90 lines
2.8 KiB
Bash
90 lines
2.8 KiB
Bash
# Template build file for 'python-tkinter'.
|
|
#
|
|
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python"; IT IS SPLITTED TO AVOID
|
|
# A CYCLIC DEPENDENCY: python -> tk -> libX11 -> libxcb -> xcb-proto -> python
|
|
#
|
|
|
|
_desc="Interpreted, interactive, object-oriented programming language"
|
|
|
|
pkgname=python-tkinter
|
|
version=2.7.14
|
|
revision=2
|
|
wrksrc="Python-${version}"
|
|
hostmakedepends="pkg-config"
|
|
makedepends="libffi-devel readline-devel gdbm-devel libressl-devel expat-devel
|
|
sqlite-devel bzip2-devel zlib-devel tk-devel"
|
|
pycompile_dirs="usr/lib/python2.7/lib-tk"
|
|
short_desc="${_desc} - GUI toolkit for Python2"
|
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
|
homepage="https://www.python.org"
|
|
license="PSF"
|
|
distfiles="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz"
|
|
checksum=71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66
|
|
|
|
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
|
|
# Enable loading sqlite extensions.
|
|
sed -i '/SQLITE_OMIT_LOAD_EXTENSION/d' setup.py
|
|
}
|
|
|
|
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 ../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} \
|
|
--enable-shared --enable-ipv6 --with-threads --enable-unicode=ucs4 \
|
|
--with-computed-gotos --with-wctype-functions --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=${wrksrc}/${pkgname}-${version}-install altinstall
|
|
|
|
# We only care for the idle and tk modules.
|
|
vmkdir usr/bin
|
|
vmkdir usr/lib/python2.7/lib-dynload
|
|
if [ -e ${wrksrc}/${pkgname}-${version}-install/usr/lib32 ]; then
|
|
_libdir=lib32
|
|
else
|
|
_libdir=lib
|
|
fi
|
|
mv ${wrksrc}/${pkgname}-${version}-install/usr/bin/idle ${DESTDIR}/usr/bin/idle2.7
|
|
mv ${wrksrc}/${pkgname}-${version}-install/usr/lib/python2.7/idlelib \
|
|
${DESTDIR}/usr/lib/python2.7/
|
|
mv ${wrksrc}/${pkgname}-${version}-install/usr/lib/python2.7/lib-tk \
|
|
${DESTDIR}/usr/lib/python2.7/
|
|
mv ${wrksrc}/${pkgname}-${version}-install/usr/${_libdir}/python2.7/lib-dynload/_tkinter.so \
|
|
${DESTDIR}/usr/lib/python2.7/lib-dynload/
|
|
ln -sf idle2.7 ${DESTDIR}/usr/bin/idle2
|
|
}
|
|
|
|
idle-python_package() {
|
|
noarch=yes
|
|
short_desc="${_desc} - IDE for Python2 using Tkinter"
|
|
pycompile_dirs="usr/lib/python2.7/idlelib"
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
pkg_install() {
|
|
vmove usr/bin/idle2*
|
|
vmove usr/lib/python2.7/idlelib
|
|
vinstall ${FILESDIR}/idle2.xpm 644 usr/share/pixmaps
|
|
vinstall ${FILESDIR}/idle2.desktop 644 usr/share/applications
|
|
}
|
|
}
|