Add recipe for lxml

And patch, because they happily hardcode -lm in there...
This commit is contained in:
François Revol
2014-07-29 15:27:14 +02:00
parent 2a454805c7
commit adf1aca0cf
2 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
From 72985b29a3f51785c7fb070080861c815e6d3edd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 29 Jul 2014 01:50:29 +0200
Subject: [PATCH] Fix Haiku build (no libm)
GRMBL !$*^= hardcoding
---
setupinfo.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/setupinfo.py b/setupinfo.py
index 4a1d150..4a5746d 100644
--- a/setupinfo.py
+++ b/setupinfo.py
@@ -186,9 +186,11 @@ def libraries():
libs = ['%s_a' % lib for lib in libs]
libs.extend(['zlib', 'WS2_32'])
elif OPTION_STATIC:
- libs = ['z', 'm']
+ libs = ['z']
else:
- libs = ['xslt', 'exslt', 'xml2', 'z', 'm']
+ libs = ['xslt', 'exslt', 'xml2', 'z']
+ if sys.platform[0:5] not in ('haiku','win32'):
+ libs.append('m')
return libs
def library_dirs(static_library_dirs):
--
1.8.3.4

View File

@@ -0,0 +1,72 @@
SUMMARY="A Pythonic binding for the libxml2 and libxslt libraries"
DESCRIPTION="
The lxml XML toolkit is a Pythonic binding for the C libraries \
libxml2 and libxslt. It is unique in that it combines the speed \
and XML feature completeness of these libraries with the simplicity \
of a native Python API, mostly compatible but superior to the \
well-known ElementTree API. The latest release works with all \
CPython versions from 2.4 to 3.3. See the introduction for more \
information about background and goals of the lxml project.
"
HOMEPAGE="
http://lxml.de/
http://pypi.python.org/pypi/lxml/
"
SRC_URI="http://lxml.de/files/lxml-3.3.5.tgz"
CHECKSUM_SHA256="6ad6949dc7eea744a30fba77a968dd5910f545220e58bcc813b9df5c793e318a"
#FIXME: check exact license
#gentoo says: LICENSE="BSD ElementTree GPL-2 PSF-2"
LICENSE="GNU GPL v2"
COPYRIGHT="2003-2010 Gustavo Niemeyer"
REVISION="1"
ARCHITECTURES="x86 x86_gcc2 x86_64"
SOURCE_DIR="lxml-$portVersion"
PATCHES="python_lxml-3.3.5.patchset"
PROVIDES="
python_lxml = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libxml2$secondaryArchSuffix
lib:libxslt$secondaryArchSuffix
lib:libz$secondaryArchSuffix
cmd:python
python_setuptools
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
devel:libxml2$secondaryArchSuffix
devel:libxslt$secondaryArchSuffix
devel:libz$secondaryArchSuffix
python_setuptools
"
BUILD_PREREQUIRES="
cmd:python
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
"
BUILD()
{
$portPackageLinksDir/cmd~python/bin/python setup.py build
}
INSTALL()
{
# GENERIC: all python_setuptools-based installs need this
export PATH="$portPackageLinksDir/cmd~python/bin:$PATH"
pythonVersion=$(python --version 2>&1 | sed 's/Python //' | head -c3)
installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
python setup.py install \
--single-version-externally-managed \
--root=/ --prefix=$prefix
}