2009-03-20 07:44:28 +00:00
|
|
|
# Template build file for 'python'.
|
2014-08-26 10:11:33 +00:00
|
|
|
#
|
|
|
|
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python-tkinter".
|
|
|
|
#
|
2008-10-04 04:29:49 +00:00
|
|
|
pkgname=python
|
2014-07-03 06:55:17 +00:00
|
|
|
version=2.7.8
|
2014-10-07 11:52:28 +00:00
|
|
|
revision=6
|
2013-02-07 03:29:14 +00:00
|
|
|
wrksrc="Python-${version}"
|
2014-02-09 09:58:56 +00:00
|
|
|
hostmakedepends="pkg-config"
|
2014-08-17 12:28:27 +00:00
|
|
|
makedepends="
|
|
|
|
libffi-devel readline-devel>=6.3 gdbm-devel libressl-devel expat-devel
|
2014-08-26 10:11:33 +00:00
|
|
|
sqlite-devel bzip2-devel zlib-devel"
|
2014-02-09 09:58:56 +00:00
|
|
|
pycompile_dirs="usr/lib/python2.7"
|
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"
|
2014-07-03 06:55:17 +00:00
|
|
|
checksum=edde10a0cb7d14e2735e682882d5b287028d1485c456758154c19573db68075a
|
2009-02-12 22:47:19 +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() {
|
2014-11-12 07:54:29 +00:00
|
|
|
local _args
|
2014-06-02 09:07:39 +00:00
|
|
|
unset GCC CC CXX CPP LD AR AS RANLIB
|
2013-11-18 22:19:53 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
2014-06-02 09:07:39 +00:00
|
|
|
mkdir -p host-build
|
|
|
|
cd host-build
|
|
|
|
env -i PATH=$PATH ../configure
|
|
|
|
env -i PATH=$PATH make ${makejobs} python
|
|
|
|
mkdir -p ../hostpython
|
|
|
|
mv python ../hostpython
|
|
|
|
cd ..
|
|
|
|
patch -Np0 -i ${FILESDIR}/Python-2.7.6-xcompile.patch
|
2014-11-12 07:54:29 +00:00
|
|
|
_args="--build=${XBPS_MACHINE%%-musl}"
|
2013-11-18 22:19:53 +00:00
|
|
|
fi
|
2014-11-12 07:54:29 +00:00
|
|
|
./configure ${configure_args} ${_args} \
|
2014-02-09 09:58:56 +00:00
|
|
|
--with-threads --enable-ipv6 --with-signal-module \
|
|
|
|
--with-system-ffi --enable-unicode=ucs4 --with-system-expat \
|
|
|
|
--with-wctype-functions --enable-shared \
|
|
|
|
ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes \
|
|
|
|
ac_cv_have_long_long_format=yes
|
2013-11-18 22:19:53 +00:00
|
|
|
}
|
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-08-26 10:11:33 +00:00
|
|
|
ln -sf python2.7 ${DESTDIR}/usr/bin/python2
|
|
|
|
ln -sf python2.7 ${DESTDIR}/usr/bin/python
|
|
|
|
ln -sf python2.7-config ${DESTDIR}/usr/bin/python-config
|
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
|
2014-08-17 12:28:27 +00:00
|
|
|
rm -f ${DESTDIR}/usr/bin/smtpd.py
|
2014-08-26 10:11:33 +00:00
|
|
|
# Remove files that belong to python-tkinter and idle-python
|
|
|
|
rm ${DESTDIR}/usr/bin/idle
|
|
|
|
rm -r ${DESTDIR}/usr/lib/python2.7/idlelib
|
|
|
|
rm -r ${DESTDIR}/usr/lib/python2.7/lib-tk
|
2014-06-02 09:32:59 +00:00
|
|
|
# Remove test module and tests that fail to be byte-compiled.
|
2014-08-26 10:11:33 +00:00
|
|
|
rm -r ${DESTDIR}/usr/lib/python2.7/test
|
|
|
|
rm -r ${DESTDIR}/usr/lib/python2.7/lib2to3/tests
|
2014-10-07 11:52:28 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
|
|
# Remove references to cross toolchain.
|
|
|
|
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
|
|
|
|
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \
|
|
|
|
${DESTDIR}/usr/lib/python${version%.*}/config/Makefile
|
|
|
|
fi
|
2010-04-22 07:25:01 +00:00
|
|
|
}
|
2013-04-11 09:03:43 +00:00
|
|
|
|
|
|
|
python-devel_package() {
|
2014-08-17 12:28:27 +00:00
|
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
|
|
short_desc+=" - development files"
|
2013-11-13 21:51:31 +00:00
|
|
|
pkg_install() {
|
2014-07-03 06:55:17 +00:00
|
|
|
vmove usr/lib/python2.7/config/libpython2.7.a
|
2013-11-13 21:51:31 +00:00
|
|
|
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
|
|
|
}
|