82 lines
2.6 KiB
Plaintext
82 lines
2.6 KiB
Plaintext
# Template file for 'python3.4'
|
|
pkgname=python3.4
|
|
version=3.4.1
|
|
revision=4
|
|
wrksrc="Python-${version}"
|
|
short_desc="Interpreted, interactive, object-oriented programming language (${version%.*} series)"
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
|
homepage="http://www.python.org"
|
|
license="PSF"
|
|
distfiles="http://www.python.org/ftp/python/${version}/Python-${version}.tar.xz"
|
|
checksum=c595a163104399041fcbe1c5c04db4c1da94f917b82ce89e8944c8edff7aedc4
|
|
|
|
pycompile_version="3.4"
|
|
pycompile_dirs="usr/lib/python3.4"
|
|
|
|
makedepends="libffi-devel readline-devel>=6.3 gdbm-devel openssl-devel
|
|
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel"
|
|
|
|
pre_configure() {
|
|
sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python3|" Lib/cgi.py
|
|
# Ensure that internal copies of zlib, expat and libffi are not used
|
|
rm -r Modules/zlib
|
|
rm -r Modules/expat
|
|
rm -r Modules/_ctypes/{darwin,libffi}*
|
|
}
|
|
|
|
do_configure() {
|
|
unset GCC CC CXX CPP LD AR AS RANLIB
|
|
if [ "$CROSS_BUILD" ]; then
|
|
mkdir -p host-build
|
|
cd host-build
|
|
env -i PATH=$PATH CFLAGS=-Os ../configure
|
|
env -i PATH=$PATH make ${makejobs} python
|
|
mkdir -p ../hostpython
|
|
mv python ../hostpython
|
|
cd ..
|
|
patch -Np0 -i ${FILESDIR}/cross.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 --without-ensurepip \
|
|
ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes \
|
|
ac_cv_have_long_long_format=yes
|
|
}
|
|
|
|
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} install maninstall
|
|
install -Dm644 LICENSE ${DESTDIR}/usr/share/licenses/${pkgname}/LICENSE
|
|
|
|
rm -f ${DESTDIR}/usr/bin/2to3{,-3.4}
|
|
|
|
ln -sf ../../libpython${version%.*}m.so \
|
|
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m/libpython${version%.*}m.so
|
|
|
|
# Remove test module and tests that fail to be byte-compiled.
|
|
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/test
|
|
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/lib2to3/tests
|
|
}
|
|
|
|
python3.4-devel_package() {
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
short_desc+=" - development files"
|
|
pkg_install() {
|
|
vmove "usr/bin/python*-config"
|
|
vmove usr/lib/pkgconfig
|
|
vmove usr/include
|
|
vmove usr/lib/python${version%.*}/config-${version%.*}m/libpython${version%.*}m.a
|
|
mkdir -p ${DESTDIR}/usr/include/python${version%.*}m
|
|
mv ${PKGDESTDIR}/usr/include/python${version%.*}m/pyconfig.h \
|
|
${DESTDIR}/usr/include/python${version%.*}m
|
|
}
|
|
}
|