Files
haikuports/dev-python/lxml/lxml-4.2.1.recipe
fbrosson 04129b2dc2 lxml: add x86 2nd arch to make lxml_x86_python3 build on x86_gcc2h.
lxml_python3 did not build on x86_gcc2h because lxml depends on
external libs. Adding support for x86 secondary arch is required
to be able to provide to the python3 subpackage the x86 2nd arch
builds of these libs.

Also make lxml_x86_python3 provide lxml_python3 to allow any-arch
python3 subpackages to depend on lxml_python3.
2018-10-27 02:41:53 +00:00

115 lines
2.8 KiB
Bash

SUMMARY="A Pythonic binding for the libxml2 and libxslt libraries"
DESCRIPTION="The lxml XML toolkit is unique in that it combines the speed \
and XML feature completeness of the libxml2 and libxslt libraries with the \
simplicity of a native Python API, mostly compatible but superior to the \
well-known ElementTree API."
HOMEPAGE="https://lxml.de/
https://github.com/lxml/lxml
https://pypi.python.org/pypi/lxml/"
COPYRIGHT="2003-2010 Gustavo Niemeyer
2003 Shuttleworth Foundation
2004 Infrae"
LICENSE="BSD (3-clause)
GNU GPL v2
PSF-2"
REVISION="1"
SOURCE_URI="http://lxml.de/files/lxml-$portVersion.tgz"
CHECKSUM_SHA256="e2629cdbcad82b83922a3488937632a4983ecc0fed3e5cfbf430d069382eeb9b"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libxml2$secondaryArchSuffix
devel:libxslt$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
"
PYTHON_PACKAGES=()
PYTHON_VERSIONS=()
PYTHON_LIBSUFFIXES=()
# We don't have python2 for secondaryArch
if [ -z "$secondaryArchSuffix" ]; then
PYTHON_PACKAGES+=(python)
PYTHON_VERSIONS+=(2.7)
PYTHON_LIBSUFFIXES+=("")
BUILD_REQUIRES+="
setuptools_python
"
BUILD_PREREQUIRES+="
cmd:python2
"
REPLACES_python="
python_lxml
"
fi
# gcc2 does not support the flags passed by python3
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
PYTHON_PACKAGES+=(python3)
PYTHON_VERSIONS+=(3.6)
PYTHON_LIBSUFFIXES+=(m)
BUILD_REQUIRES+="
setuptools_python3
"
BUILD_PREREQUIRES+="
cmd:python3
"
fi
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libxslt$secondaryArchSuffix
lib:libz$secondaryArchSuffix
\""
done
if [ "$targetArchitecture" = x86_gcc2 -a -n "$secondaryArchSuffix" ]; then
PROVIDES_python3+="
lxml_python3 = $portVersion
"
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
mkdir -p "$installLocation"
rm -rf build
$python setup.py build install \
--root=/ --prefix="$prefix"
packageEntries $pythonPackage \
"$prefix"/lib/$python
done
if [ -z "$secondaryArchSuffix" ]; then
install -m 755 -d "$docDir"
install -m 644 -t "$docDir" CHANGES.txt CREDITS.txt README.rst
fi
}