mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 15:50:07 +02:00
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.
This commit is contained in:
@@ -3,7 +3,8 @@ 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="http://lxml.de/
|
||||
HOMEPAGE="https://lxml.de/
|
||||
https://github.com/lxml/lxml
|
||||
https://pypi.python.org/pypi/lxml/"
|
||||
COPYRIGHT="2003-2010 Gustavo Niemeyer
|
||||
2003 Shuttleworth Foundation
|
||||
@@ -15,49 +16,78 @@ REVISION="1"
|
||||
SOURCE_URI="http://lxml.de/files/lxml-$portVersion.tgz"
|
||||
CHECKSUM_SHA256="e2629cdbcad82b83922a3488937632a4983ecc0fed3e5cfbf430d069382eeb9b"
|
||||
|
||||
ARCHITECTURES="x86 x86_gcc2 x86_64"
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
devel:libxml2
|
||||
devel:libxslt
|
||||
devel:libz
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libxml2$secondaryArchSuffix
|
||||
devel:libxslt$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc
|
||||
cmd:ld
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
"
|
||||
PYTHON_PACKAGES=(python python3)
|
||||
PYTHON_VERSIONS=(2.7 3.6)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\
|
||||
${portName}_$pythonPackage = $portVersion\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\
|
||||
haiku\n\
|
||||
lib:libxml2\n\
|
||||
lib:libxslt\n\
|
||||
lib:libz\n\
|
||||
cmd:python$pythonVersion\
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
setuptools_$pythonPackage"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion"
|
||||
done
|
||||
|
||||
REPLACES_python="
|
||||
python_lxml
|
||||
"
|
||||
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()
|
||||
{
|
||||
@@ -67,13 +97,18 @@ INSTALL()
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation:$PYTHONPATH
|
||||
mkdir -p $installLocation
|
||||
export PYTHONPATH=$installLocation
|
||||
mkdir -p "$installLocation"
|
||||
rm -rf build
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
--root=/ --prefix="$prefix"
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python*
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user