2009-03-20 08:44:28 +01:00
|
|
|
# Template build file for 'python'.
|
2008-10-04 06:29:49 +02:00
|
|
|
pkgname=python
|
2012-04-15 09:21:34 +02:00
|
|
|
version=2.7.3
|
2013-05-15 13:50:38 +02:00
|
|
|
revision=5
|
2013-02-07 04:29:14 +01:00
|
|
|
wrksrc="Python-${version}"
|
2008-09-30 02:56:49 +02:00
|
|
|
short_desc="Interpreted, interactive, object-oriented programming language"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2011-06-20 12:30:58 +02:00
|
|
|
homepage="http://www.python.org"
|
|
|
|
license="PSF"
|
2013-02-07 04:29:14 +01:00
|
|
|
distfiles="http://www.python.org/ftp/python/$version/Python-$version.tar.xz"
|
2012-04-15 09:21:34 +02:00
|
|
|
checksum=61d36be58e9e9c733c49d7b76858d5c08e2c63a84f2066b29d35d3521057c985
|
2009-02-12 23:47:19 +01:00
|
|
|
|
2011-10-05 16:42:03 +02:00
|
|
|
pycompile_dirs="usr/lib/python2.7"
|
2010-04-23 15:28:45 +02:00
|
|
|
|
2013-02-07 04:29:14 +01:00
|
|
|
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
|
2013-05-09 16:26:34 +02:00
|
|
|
expat-devel db-devel>=5.3 sqlite-devel bzip2-devel zlib-devel"
|
2011-09-19 10:10:37 +02:00
|
|
|
|
2013-02-07 04:29:14 +01:00
|
|
|
# Force posix semaphores by default; sem_open requires /dev/shm and
|
|
|
|
# it's not mounted in chroot.
|
|
|
|
_confargs="--with-threads --enable-ipv6 --with-signal-module --enable-shared
|
|
|
|
--with-system-ffi --enable-unicode=ucs4 --with-system-expat
|
|
|
|
--with-wctype-functions ac_cv_posix_semaphores_enabled=yes"
|
2010-04-22 09:25:01 +02:00
|
|
|
|
2013-04-09 01:49:27 +02:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
2013-02-07 04:29:14 +01:00
|
|
|
# cross build; have to build it in 2 stages: native and host.
|
2013-04-07 19:09:39 +02:00
|
|
|
do_configure() {
|
2013-02-07 04:29:14 +01:00
|
|
|
# Native build
|
|
|
|
env CC=gcc LD=ld AS=as RANLIB=ranlib CFLAGS= LDFLAGS= OPT="-Os" \
|
2013-04-07 19:09:39 +02:00
|
|
|
./configure && make ${makejobs} python Parser/pgen
|
2013-02-07 04:29:14 +01:00
|
|
|
mv python hostpython
|
|
|
|
mv Parser/pgen Parser/hostpgen
|
|
|
|
make distclean
|
2011-09-19 10:10:37 +02:00
|
|
|
|
2013-02-07 04:29:14 +01:00
|
|
|
# Cross build
|
|
|
|
patch -Np1 -i ${FILESDIR}/Python-2.7.3-xcompile.patch
|
|
|
|
sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
|
2013-03-24 10:21:58 +01:00
|
|
|
CFLAGS="$CFLAGS -I$XBPS_CROSS_BASE/include" \
|
|
|
|
LDFLAGS="$LDFLAGS -L$XBPS_CROSS_BASE/lib" \
|
2013-02-07 04:29:14 +01:00
|
|
|
./configure ${CONFIGURE_SHARED_ARGS} \
|
2013-04-07 19:09:39 +02:00
|
|
|
${_confargs} ac_cv_buggy_getaddrinfo=no
|
|
|
|
}
|
|
|
|
do_build() {
|
2013-02-07 04:29:14 +01:00
|
|
|
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \
|
|
|
|
BLDSHARED="${XBPS_CROSS_TRIPLET}-gcc -shared" \
|
|
|
|
CROSS_COMPILE=$XBPS_CROSS_TARGET CROSS_COMPILE_TARGET=yes \
|
|
|
|
HOSTARCH=$XBPS_CROSS_TRIPLET BUILDARCH=$XBPS_MACHINE-unknown-linux-gnu \
|
2013-04-07 19:09:39 +02:00
|
|
|
PYTHON_XCOMPILE_DEPENDENCIES_PREFIX="$XBPS_CROSS_BASE" ${makejobs}
|
2013-02-07 04:29:14 +01:00
|
|
|
}
|
|
|
|
do_install() {
|
|
|
|
# cross install
|
|
|
|
make DESTDIR=${DESTDIR} HOSTPYTHON=./hostpython \
|
|
|
|
CROSS_COMPILE=$XBPS_CROSS_TARGET \
|
|
|
|
CROSS_COMPILE_TARGET=yes install
|
|
|
|
}
|
|
|
|
else
|
|
|
|
# Native build
|
|
|
|
do_configure() {
|
|
|
|
# Enable built-in SQLite3 module to load extensions (Arch fix FS#22122)
|
|
|
|
sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
|
|
|
|
./configure ${CONFIGURE_SHARED_ARGS} ${_confargs}
|
|
|
|
}
|
|
|
|
do_build() {
|
|
|
|
make ${makejobs}
|
|
|
|
}
|
|
|
|
do_install() {
|
|
|
|
make DESTDIR=${DESTDIR} install
|
|
|
|
}
|
|
|
|
fi
|
2011-09-19 10:10:37 +02:00
|
|
|
|
2013-02-07 04:29:14 +01:00
|
|
|
post_install() {
|
2010-04-22 09:25:01 +02:00
|
|
|
chmod 755 ${DESTDIR}/usr/lib/libpython*.so*
|
2011-06-20 12:30:58 +02:00
|
|
|
install -Dm644 LICENSE ${DESTDIR}/usr/share/licenses/python/LICENSE
|
2010-04-22 09:25:01 +02:00
|
|
|
}
|
2013-04-11 11:03:43 +02:00
|
|
|
|
|
|
|
python_package() {
|
|
|
|
pkg_install() {
|
2013-05-09 16:26:34 +02:00
|
|
|
vmove all
|
2013-04-11 11:03:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
python-devel_package() {
|
|
|
|
depends="libffi-devel zlib-devel readline-devel bzip2-devel gdbm-devel
|
2013-05-09 16:26:34 +02:00
|
|
|
openssl-devel expat-devel db-devel>=5.3 ncurses-devel sqlite-devel
|
2013-04-11 11:03:43 +02:00
|
|
|
python>=${version}"
|
|
|
|
short_desc="Python development files"
|
|
|
|
pkg_install() {
|
|
|
|
vmove "usr/bin/python*-config"
|
|
|
|
vmove usr/lib/pkgconfig
|
2013-05-15 13:50:38 +02:00
|
|
|
vmove usr/include
|
|
|
|
mkdir -p ${DESTDIR}/usr/include/python2.7
|
|
|
|
mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h ${DESTDIR}/usr/include/python2.7
|
2013-04-11 11:03:43 +02:00
|
|
|
}
|
|
|
|
}
|