2009-03-20 07:44:28 +00:00
|
|
|
# Template build file for 'python'.
|
2008-10-04 04:29:49 +00:00
|
|
|
pkgname=python
|
2013-11-18 22:19:53 +00:00
|
|
|
version=2.7.6
|
2014-01-08 19:50:37 +00:00
|
|
|
revision=4
|
2013-02-07 03:29:14 +00:00
|
|
|
wrksrc="Python-${version}"
|
2008-09-30 00:56:49 +00:00
|
|
|
short_desc="Interpreted, interactive, object-oriented programming language"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2011-06-20 10:30:58 +00:00
|
|
|
homepage="http://www.python.org"
|
|
|
|
license="PSF"
|
2013-02-07 03:29:14 +00:00
|
|
|
distfiles="http://www.python.org/ftp/python/$version/Python-$version.tar.xz"
|
2013-11-18 22:19:53 +00:00
|
|
|
checksum=1fd68e81f8bf7386ff239b7faee9ba387129d2cf34eab13350bd8503a0bff6a1
|
2009-02-12 22:47:19 +00:00
|
|
|
|
2013-05-22 15:22:58 +00:00
|
|
|
hostmakedepends="pkg-config"
|
2013-02-07 03:29:14 +00:00
|
|
|
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
|
2013-11-18 22:19:53 +00:00
|
|
|
expat-devel sqlite-devel bzip2-devel zlib-devel"
|
2014-01-01 15:10:11 +00:00
|
|
|
pycompile_dirs="usr/lib/python2.7"
|
2011-09-19 08:10:37 +00:00
|
|
|
|
2013-11-18 22:19:53 +00:00
|
|
|
configure_args="
|
|
|
|
--with-threads --enable-ipv6 --with-signal-module --enable-shared
|
2013-02-07 03:29:14 +00:00
|
|
|
--with-system-ffi --enable-unicode=ucs4 --with-system-expat
|
2013-11-18 22:19:53 +00:00
|
|
|
--with-wctype-functions ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
|
|
|
|
ac_cv_have_long_long_format=yes"
|
2010-04-22 07:25:01 +00:00
|
|
|
|
2013-11-18 22:19:53 +00:00
|
|
|
pre_configure() {
|
|
|
|
# Ensure that internal copies of expat, libffi and zlib are not used.
|
|
|
|
rm -r Modules/expat
|
|
|
|
rm -r Modules/_ctypes/libffi*
|
|
|
|
rm -r Modules/zlib
|
|
|
|
}
|
|
|
|
|
|
|
|
do_configure() {
|
2013-12-03 01:00:56 +00:00
|
|
|
unset CC LD AR AS RANLIB
|
2013-11-18 22:19:53 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
2013-12-03 01:00:56 +00:00
|
|
|
CFLAGS=-Os LDFLAGS= ./configure
|
2013-11-18 22:19:53 +00:00
|
|
|
make python
|
|
|
|
mkdir hostpython
|
2013-02-07 03:29:14 +00:00
|
|
|
mv python hostpython
|
|
|
|
make distclean
|
2013-11-18 22:19:53 +00:00
|
|
|
patch -Np0 -i ${FILESDIR}/Python-${version}-xcompile.patch
|
|
|
|
fi
|
|
|
|
./configure --build=${XBPS_MACHINE}-unknown-linux-gnu ${configure_args}
|
|
|
|
}
|
2011-09-19 08:10:37 +00:00
|
|
|
|
2013-11-18 22:19:53 +00:00
|
|
|
do_build() {
|
|
|
|
# Avoid invoking pgen for cross-compiles.
|
|
|
|
touch Include/graminit.h Python/graminit.c
|
|
|
|
export PATH="$PATH:$wrksrc/hostpython"
|
|
|
|
make ${makejobs}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
export PATH="$PATH:$wrksrc/hostpython"
|
|
|
|
make DESTDIR=${DESTDIR} altinstall
|
2014-01-01 15:10:11 +00:00
|
|
|
ln -sf /usr/bin/python2.7 ${DESTDIR}/usr/bin/python2
|
|
|
|
ln -sf /usr/bin/python2.7 ${DESTDIR}/usr/bin/python
|
2013-11-18 22:19:53 +00:00
|
|
|
}
|
2011-09-19 08:10:37 +00:00
|
|
|
|
2013-02-07 03:29:14 +00:00
|
|
|
post_install() {
|
2010-04-22 07:25:01 +00:00
|
|
|
chmod 755 ${DESTDIR}/usr/lib/libpython*.so*
|
2011-06-20 10:30:58 +00:00
|
|
|
install -Dm644 LICENSE ${DESTDIR}/usr/share/licenses/python/LICENSE
|
2013-05-22 15:22:58 +00:00
|
|
|
# Remove test module.
|
|
|
|
rm -rf ${DESTDIR}/usr/lib/python2.7/test
|
2010-04-22 07:25:01 +00:00
|
|
|
}
|
2013-04-11 09:03:43 +00:00
|
|
|
|
|
|
|
python-devel_package() {
|
2013-11-18 22:19:53 +00:00
|
|
|
depends="python>=${version}_${revision}"
|
|
|
|
short_desc+=" - development files"
|
2013-11-13 21:51:31 +00:00
|
|
|
pkg_install() {
|
|
|
|
vmove "usr/bin/python*-config"
|
|
|
|
vmove usr/lib/pkgconfig
|
2013-05-15 11:50:38 +00:00
|
|
|
vmove usr/include
|
|
|
|
mkdir -p ${DESTDIR}/usr/include/python2.7
|
2013-11-18 22:19:53 +00:00
|
|
|
mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h \
|
|
|
|
${DESTDIR}/usr/include/python2.7
|
2013-11-13 21:51:31 +00:00
|
|
|
}
|
2013-04-11 09:03:43 +00:00
|
|
|
}
|