2014-06-17 07:49:49 +00:00
|
|
|
# Template file for 'python3.4'
|
|
|
|
pkgname=python3.4
|
2014-10-08 22:25:02 +00:00
|
|
|
version=3.4.2
|
2015-01-03 16:04:03 +00:00
|
|
|
revision=2
|
2014-06-17 07:49:49 +00:00
|
|
|
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"
|
2014-10-08 22:25:02 +00:00
|
|
|
checksum=1c6d9682d145c056537e477bbfa060ce727f9edd38df1827e0f970dcf04b2def
|
2014-06-17 07:49:49 +00:00
|
|
|
|
2014-06-18 09:33:49 +00:00
|
|
|
pycompile_version="3.4"
|
|
|
|
pycompile_dirs="usr/lib/python3.4"
|
|
|
|
|
2014-08-17 12:34:34 +00:00
|
|
|
makedepends="
|
2015-01-03 16:04:03 +00:00
|
|
|
libffi-devel readline-devel>=6.3 gdbm-devel libressl-devel>=2.1.2 expat-devel
|
2014-08-17 12:34:34 +00:00
|
|
|
sqlite-devel bzip2-devel zlib-devel liblzma-devel tcl-devel tk-devel libX11-devel"
|
2014-06-17 07:49:49 +00:00
|
|
|
|
|
|
|
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() {
|
2014-11-12 07:55:27 +00:00
|
|
|
local _args
|
2014-06-18 08:11:30 +00:00
|
|
|
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
|
2014-11-12 07:55:27 +00:00
|
|
|
_args="--build=${XBPS_MACHINE%%-musl}"
|
2014-06-18 08:11:30 +00:00
|
|
|
fi
|
2014-11-12 07:55:27 +00:00
|
|
|
./configure ${configure_args} ${_args} \
|
2014-06-18 08:11:30 +00:00
|
|
|
--with-threads --enable-ipv6 --with-signal-module \
|
2014-08-17 12:34:34 +00:00
|
|
|
--with-system-ffi --with-system-expat \
|
|
|
|
--enable-shared --without-ensurepip \
|
2014-06-18 08:11:30 +00:00
|
|
|
ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes \
|
|
|
|
ac_cv_have_long_long_format=yes
|
2014-06-17 07:49:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
2014-06-18 08:11:30 +00:00
|
|
|
# Avoid invoking pgen for cross-compiles.
|
|
|
|
touch Include/graminit.h Python/graminit.c
|
|
|
|
export PATH="$PATH:$wrksrc/hostpython"
|
2014-06-17 07:49:49 +00:00
|
|
|
make ${makejobs}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2014-06-18 08:11:30 +00:00
|
|
|
export PATH="$PATH:$wrksrc/hostpython"
|
2014-06-17 07:49:49 +00:00
|
|
|
make DESTDIR=${DESTDIR} install maninstall
|
2014-09-05 14:39:50 +00:00
|
|
|
vlicense LICENSE
|
2014-06-17 07:49:49 +00:00
|
|
|
|
|
|
|
rm -f ${DESTDIR}/usr/bin/2to3{,-3.4}
|
|
|
|
|
2014-06-18 08:11:30 +00:00
|
|
|
ln -sf ../../libpython${version%.*}m.so \
|
|
|
|
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m/libpython${version%.*}m.so
|
2014-06-18 09:49:37 +00:00
|
|
|
|
|
|
|
# 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
|
2014-09-05 14:39:50 +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-3.4m/Makefile
|
|
|
|
fi
|
2014-06-17 07:49:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2014-06-18 08:11:30 +00:00
|
|
|
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
|
2014-06-17 07:49:49 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-17 12:34:34 +00:00
|
|
|
|
|
|
|
python3.4-tkinter_package() {
|
|
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
|
|
short_desc+=" - GUI toolkit for Python${version%.*}"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/lib/python${version%.*}/tkinter
|
|
|
|
vmove usr/lib/python${version%.*}/turtle.py
|
|
|
|
vmove usr/lib/python${version%.*}/turtledemo
|
|
|
|
vmove usr/lib/python${version%.*}/lib-dynload/_tkinter.cpython-34m.so
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
idle-python3.4_package() {
|
|
|
|
depends="${sourcepkg}>=${version}_${revision} python3.4-tkinter"
|
|
|
|
short_desc+=" - IDE for Python${version%.*} using Tkinter"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/bin/idle3*
|
|
|
|
vmove usr/lib/python${version%.*}/idlelib
|
|
|
|
vinstall ${FILESDIR}/idle3.xpm 644 usr/share/pixmaps
|
|
|
|
vinstall ${FILESDIR}/idle3.desktop 644 usr/share/applications
|
|
|
|
}
|
|
|
|
}
|