diff --git a/dev-python/pycurl/pycurl-7.43.0.2.recipe b/dev-python/pycurl/pycurl-7.43.0.2.recipe new file mode 100644 index 000000000..8d53912de --- /dev/null +++ b/dev-python/pycurl/pycurl-7.43.0.2.recipe @@ -0,0 +1,133 @@ +SUMMARY="A Python interface to the cURL library" +DESCRIPTION="PycURL is a Python interface to libcurl, the multiprotocol file \ +transfer library. Similarly to the urllib Python module, PycURL can be used to \ +fetch objects identified by a URL from a Python program. Beyond simple fetches \ +however PycURL exposes most of the functionality of libcurl." +HOMEPAGE="http://pycurl.io/ + https://github.com/pycurl/pycurl" +COPYRIGHT="2001-2008 by Kjetil Jacobsen + 2001-2008 by Markus F.X.J. Oberhumer + 2013-2018 by Oleg Pudeyev" +LICENSE="GNU LGPL v2.1 + MIT" +REVISION="1" +SOURCE_URI="https://dl.bintray.com/pycurl/pycurl/pycurl-$portVersion.tar.gz" +CHECKSUM_SHA256="0f0cdfc7a92d4f2a5c44226162434e34f7d6967d3af416a6f1448649c09a25a4" + +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + pycurl$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +if [ -z "$secondaryArchSuffix" ]; then +ARCHITECTURES_doc="any" +SUMMARY_doc="A Python interface to the cURL library (documentation)" +PROVIDES_doc=" + pycurl_doc = $portVersion + " +REQUIRES_doc=" + haiku + " +fi + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcrypto$secondaryArchSuffix + devel:libcurl$secondaryArchSuffix + devel:libnghttp2$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + " + +PYTHON_PACKAGES=(python python3) +PYTHON_VERSIONS=(2.7 3.6) +# We don't have python2 for secondaryArch, +# and gcc2 doesn't support the flags passed by python3 +if [ -n "$secondaryArchSuffix" ]; then + unset PYTHON_PACKAGES[0] + unset PYTHON_VERSIONS[0] +elif [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then + unset PYTHON_PACKAGES[1] + unset PYTHON_VERSIONS[1] +fi +for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + eval "\ + PROVIDES_${pythonPackage}=\"\n\ + ${portName}_$pythonPackage = $portVersion\n\ + \"; \ + REQUIRES_$pythonPackage=\"\n\ + haiku$secondaryArchSuffix\n\ + cmd:python$pythonVersion\n\ + lib:libcrypto$secondaryArchSuffix\n\ + lib:libcurl$secondaryArchSuffix\n\ + lib:libnghttp2$secondaryArchSuffix\n\ + lib:libssl$secondaryArchSuffix\n\ + lib:libz$secondaryArchSuffix\n\ + \"\ + " + + BUILD_REQUIRES="$BUILD_REQUIRES + setuptools_$pythonPackage + " + BUILD_PREREQUIRES="$BUILD_PREREQUIRES + cmd:python$pythonVersion + " +done + +if [ -z "$secondaryArchSuffix" ]; then + REQUIRES_python+=" + lib:libpython${PYTHON_VERSIONS[0]} + " + BUILD_PREREQUIRES+=" + devel:libpython${PYTHON_VERSIONS[0]} + " +fi +if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then + REQUIRES_python3+=" + lib:libpython${PYTHON_VERSIONS[1]}m$secondaryArchSuffix + " + BUILD_PREREQUIRES+=" + devel:libpython${PYTHON_VERSIONS[1]}m$secondaryArchSuffix + " +fi + +INSTALL() +{ + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + python=python$pythonVersion + installLocation="$prefix"/lib/$python/vendor-packages/ + export PYTHONPATH="$installLocation" + rm -rf build + mkdir -p "$installLocation" + $python setup.py build install --root=/ --prefix="$prefix" + + packageEntries $pythonPackage \ + "$prefix"/lib/$python + done + + if [ -z "$secondaryArchSuffix" ]; then + mkdir -p "$docDir" + mv "$prefix"/share/doc/pycurl/* "$docDir" + rmdir "$prefix"/share/doc/pycurl + packageEntries doc \ + "$docDir" + rmdir "$prefix"/documentation/packages "$prefix"/documentation + else + rm -rf "$prefix"/share/doc/pycurl + fi + rmdir "$prefix"/share/doc "$prefix"/share +}