pycurl-7.43.0.3.recipe revision cd1c7197
1SUMMARY="A Python interface to the cURL library"
2DESCRIPTION="PycURL is a Python interface to libcurl, the multiprotocol file \
3transfer library. Similarly to the urllib Python module, PycURL can be used to \
4fetch objects identified by a URL from a Python program. Beyond simple fetches \
5however PycURL exposes most of the functionality of libcurl."
6HOMEPAGE="http://pycurl.io/
7	https://github.com/pycurl/pycurl"
8COPYRIGHT="2001-2008 Kjetil Jacobsen
9	2001-2008 Markus F.X.J. Oberhumer
10	2013-2018 Oleg Pudeyev"
11LICENSE="GNU LGPL v2.1
12	MIT"
13REVISION="1"
14SOURCE_URI="https://github.com/pycurl/pycurl/archive/REL_${portVersion//./_}.tar.gz"
15CHECKSUM_SHA256="553047902a738cc2e6b1cd42783a9d0992e47086773be30027a71e1293493c39"
16SOURCE_DIR="pycurl-REL_${portVersion//./_}"
17
18ARCHITECTURES="x86_gcc2 x86 x86_64"
19SECONDARY_ARCHITECTURES="x86"
20
21PROVIDES="
22	pycurl$secondaryArchSuffix = $portVersion
23	"
24REQUIRES="
25	haiku$secondaryArchSuffix
26	"
27
28if [ -z "$secondaryArchSuffix" ]; then
29ARCHITECTURES_doc="any"
30SUMMARY_doc="A Python interface to the cURL library (documentation)"
31PROVIDES_doc="
32	pycurl_doc = $portVersion
33	"
34REQUIRES_doc="
35	haiku
36	"
37fi
38
39BUILD_REQUIRES="
40	haiku${secondaryArchSuffix}_devel
41	devel:libcrypto$secondaryArchSuffix
42	devel:libcurl$secondaryArchSuffix
43	devel:libnghttp2$secondaryArchSuffix
44	devel:libssl$secondaryArchSuffix
45	devel:libz$secondaryArchSuffix
46	"
47BUILD_PREREQUIRES="
48	cmd:gcc$secondaryArchSuffix
49	cmd:make
50	"
51
52PYTHON_PACKAGES=()
53PYTHON_VERSIONS=()
54PYTHON_LIBSUFFIXES=()
55# We don't have python2 for secondaryArch,
56if [ -z "$secondaryArchSuffix" ]; then
57	PYTHON_PACKAGES+=(python)
58	PYTHON_VERSIONS+=(2.7)
59	PYTHON_LIBSUFFIXES+=("")
60fi
61# gcc2 does not support the flags passed by python3
62if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
63	PYTHON_PACKAGES+=(python36 python3)
64	PYTHON_VERSIONS+=(3.6 3.7)
65	PYTHON_LIBSUFFIXES+=(m m)
66fi
67for i in "${!PYTHON_PACKAGES[@]}"; do
68	pythonPackage=${PYTHON_PACKAGES[i]}
69	pythonVersion=${PYTHON_VERSIONS[$i]}
70	pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
71
72	eval "PROVIDES_${pythonPackage}=\"
73		${portName}_$pythonPackage = $portVersion
74		\""
75	eval "REQUIRES_$pythonPackage=\"
76		haiku$secondaryArchSuffix
77		lib:libcrypto$secondaryArchSuffix
78		lib:libcurl$secondaryArchSuffix
79		lib:libnghttp2$secondaryArchSuffix
80		lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix
81		lib:libssl$secondaryArchSuffix
82		lib:libz$secondaryArchSuffix
83		\""
84BUILD_REQUIRES="$BUILD_REQUIRES
85	setuptools_$pythonPackage"
86BUILD_PREREQUIRES="$BUILD_PREREQUIRES
87	cmd:python$pythonVersion"
88done
89
90INSTALL()
91{
92	for i in "${!PYTHON_PACKAGES[@]}"; do
93		pythonPackage=${PYTHON_PACKAGES[i]}
94		pythonVersion=${PYTHON_VERSIONS[$i]}
95
96		python=python$pythonVersion
97		installLocation="$prefix"/lib/$python/vendor-packages/
98		export PYTHONPATH="$installLocation"
99		rm -rf build
100		make
101		mkdir -p "$installLocation"
102		$python setup.py build install --root=/ --prefix="$prefix"
103
104		packageEntries $pythonPackage \
105			"$prefix"/lib/$python
106	done
107
108	if [ -z "$secondaryArchSuffix" ]; then
109		mkdir -p "$docDir"
110		mv "$prefix"/share/doc/pycurl/* "$docDir"
111		rmdir "$prefix"/share/doc/pycurl
112		packageEntries doc \
113			"$docDir"
114		rmdir "$prefix"/documentation/packages "$prefix"/documentation
115	else
116		rm -rf "$prefix"/share/doc/pycurl
117	fi
118	rmdir "$prefix"/share/doc "$prefix"/share
119}
120