98 lines
3.4 KiB
Bash
98 lines
3.4 KiB
Bash
# Template file for 'python3'
|
|
#
|
|
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python3-tkinter".
|
|
#
|
|
pkgname=python3
|
|
version=3.6.5
|
|
revision=1
|
|
wrksrc="Python-${version}"
|
|
short_desc="Interpreted, interactive, object-oriented programming language (${version%.*} series)"
|
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
|
homepage="https://www.python.org"
|
|
license="PSF-2"
|
|
distfiles="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz"
|
|
checksum=f434053ba1b5c8a5cc597e966ead3c5143012af827fd3f0697d21450bb8d87a6
|
|
|
|
pycompile_dirs="usr/lib/python${version%.*}"
|
|
hostmakedepends="pkg-config"
|
|
makedepends="libffi-devel readline-devel gdbm-devel libressl-devel expat-devel
|
|
sqlite-devel bzip2-devel zlib-devel liblzma-devel"
|
|
depends="ca-certificates"
|
|
|
|
alternatives="
|
|
python:idle:/usr/bin/idle${version%.*}
|
|
python:2to3:/usr/bin/2to3-${version%.*}
|
|
python:pydoc:/usr/bin/pydoc${version%.*}
|
|
python:python:/usr/bin/python${version%.*}
|
|
python:python.1:/usr/share/man/man1/python${version%.*}.1"
|
|
|
|
pre_configure() {
|
|
# 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() {
|
|
local _args
|
|
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
|
|
_args="--build=${XBPS_MACHINE%%-musl}"
|
|
fi
|
|
./configure ${configure_args} ${_args} \
|
|
--enable-shared --enable-ipv6 --enable-loadable-sqlite-extensions \
|
|
--with-threads --with-computed-gotos --with-dbmliborder=gdbm:ndbm \
|
|
--with-system-expat --with-system-ffi --without-ensurepip
|
|
}
|
|
do_build() {
|
|
export PATH="$PATH:$wrksrc/hostpython"
|
|
make ${makejobs}
|
|
}
|
|
do_install() {
|
|
export PATH="$PATH:$wrksrc/hostpython"
|
|
make DESTDIR=${DESTDIR} install maninstall
|
|
vlicense LICENSE
|
|
|
|
rm -f ${DESTDIR}/usr/bin/2to3
|
|
# Remove files that belong to python3-tkinter and idle-python3
|
|
rm -f ${DESTDIR}/usr/bin/idle3*
|
|
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/idlelib
|
|
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/tkinter
|
|
rm -rf ${DESTDIR}/usr/lib/python${version%.*}/turtledemo
|
|
rm -f ${DESTDIR}/usr/lib/python${version%.*}/turtle.py
|
|
# 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
|
|
# Remove references to the install(1) wrapper.
|
|
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
|
|
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_m_*.py \
|
|
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m*/Makefile
|
|
if [ "$CROSS_BUILD" ]; then
|
|
# Remove references to cross toolchain.
|
|
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
|
|
${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_m_*.py \
|
|
${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m*/Makefile
|
|
fi
|
|
}
|
|
|
|
python3-devel_package() {
|
|
short_desc+=" - development files"
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
pkg_install() {
|
|
vmove usr/bin/python*-config
|
|
vmove usr/lib/pkgconfig
|
|
vmove usr/include
|
|
mv ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m*/libpython${version%.*}m.a \
|
|
${PKGDESTDIR}/usr/lib
|
|
mkdir -p ${DESTDIR}/usr/include/python${version%.*}m
|
|
mv ${PKGDESTDIR}/usr/include/python${version%.*}m/pyconfig.h \
|
|
${DESTDIR}/usr/include/python${version%.*}m
|
|
}
|
|
}
|