void-packages/srcpkgs/python/template

77 lines
2.4 KiB
Plaintext
Raw Normal View History

# Template build file for 'python'.
pkgname=python
2013-11-18 23:19:53 +01:00
version=2.7.6
revision=8
2013-02-07 04:29:14 +01:00
wrksrc="Python-${version}"
hostmakedepends="pkg-config"
makedepends="libffi-devel readline-devel>=6.3 gdbm-devel openssl-devel expat-devel sqlite-devel bzip2-devel zlib-devel"
pycompile_dirs="usr/lib/python2.7"
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"
2013-11-18 23:19:53 +01:00
checksum=1fd68e81f8bf7386ff239b7faee9ba387129d2cf34eab13350bd8503a0bff6a1
2013-11-18 23:19:53 +01: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
# Fix readline module to build with readline>=6.3.
sed -e 's,(CPPFunction \*),,g;s,(Function \*),,g' -i Modules/readline.c
2013-11-18 23:19:53 +01:00
}
do_configure() {
unset CC CXX LD AR AS RANLIB
2013-11-18 23:19:53 +01:00
if [ "$CROSS_BUILD" ]; then
CFLAGS=-Os CXXFLAGS= LDFLAGS= ./configure
make ${makejobs} python
2013-11-18 23:19:53 +01:00
mkdir hostpython
2013-02-07 04:29:14 +01:00
mv python hostpython
make distclean
2013-11-18 23:19:53 +01:00
patch -Np0 -i ${FILESDIR}/Python-${version}-xcompile.patch
fi
./configure ${configure_args} --build=${XBPS_MACHINE}-unknown-linux-gnu \
--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 23:19:53 +01:00
}
2013-11-18 23:19:53 +01: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
ln -sf /usr/bin/python2.7 ${DESTDIR}/usr/bin/python2
ln -sf /usr/bin/python2.7 ${DESTDIR}/usr/bin/python
ln -sf /usr/bin/python2.7-config ${DESTDIR}/usr/bin/python-config
2013-11-18 23:19:53 +01:00
}
2013-02-07 04:29:14 +01:00
post_install() {
chmod 755 ${DESTDIR}/usr/lib/libpython*.so*
2011-06-20 12:30:58 +02:00
install -Dm644 LICENSE ${DESTDIR}/usr/share/licenses/python/LICENSE
# Remove test module.
rm -rf ${DESTDIR}/usr/lib/python2.7/test
}
python-devel_package() {
2013-11-18 23:19:53 +01:00
depends="python>=${version}_${revision}"
short_desc+=" - 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
2013-11-18 23:19:53 +01:00
mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h \
${DESTDIR}/usr/include/python2.7
}
}