97 lines
3.0 KiB
Bash
97 lines
3.0 KiB
Bash
# Template file for 'python2-tkinter'
|
|
#
|
|
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python2"; IT IS SPLITTED TO AVOID
|
|
# A CYCLIC DEPENDENCY: python2 -> tk -> libX11 -> libxcb -> xcb-proto -> python2
|
|
#
|
|
|
|
_desc="Interpreted, interactive, object-oriented programming language"
|
|
|
|
pkgname=python2-tkinter
|
|
version=2.7.18.10
|
|
revision=1
|
|
_commit=3e06fbb19d735aea134b327ad7af28f17eee5d88
|
|
pycompile_dirs="usr/lib/python2.7/lib-tk"
|
|
hostmakedepends="pkg-config"
|
|
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel expat-devel
|
|
sqlite-devel bzip2-devel zlib-devel tk-devel"
|
|
short_desc="${_desc} - GUI toolkit for Python2"
|
|
maintainer="Leah Neukirchen <leah@vuxu.org>"
|
|
license="Python-2.0"
|
|
homepage="https://www.python.org"
|
|
distfiles="https://github.com/ActiveState/cpython/archive/${_commit}.tar.gz"
|
|
checksum=023d1161f401df259f6b2eec2599659835738c097cf9c6689134eaaeb39a2fdc
|
|
|
|
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
|
|
makedepends+=" libxcrypt-devel"
|
|
fi
|
|
|
|
pre_configure() {
|
|
# Ensure that internal copies of expat and libffi are not used.
|
|
rm -r Modules/expat
|
|
rm -r Modules/_ctypes/libffi*
|
|
# Enable loading sqlite extensions.
|
|
vsed -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 XBPS_ARCH=$XBPS_ARCH ../configure
|
|
env -i PATH=$PATH XBPS_ARCH=$XBPS_ARCH 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"
|
|
|
|
mkdir -p ${wrksrc}/tmp-destdir/usr/lib
|
|
ln -s lib ${wrksrc}/tmp-destdir/usr/lib${XBPS_TARGET_WORDSIZE}
|
|
|
|
make DESTDIR=${wrksrc}/tmp-destdir altinstall
|
|
|
|
# We only care for the idle and tk modules.
|
|
vmkdir usr/bin
|
|
vmkdir usr/lib/python2.7/lib-dynload
|
|
mv ${wrksrc}/tmp-destdir/usr/bin/idle ${DESTDIR}/usr/bin/idle2.7
|
|
mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/idlelib \
|
|
${DESTDIR}/usr/lib/python2.7/
|
|
mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/lib-tk \
|
|
${DESTDIR}/usr/lib/python2.7/
|
|
mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/lib-dynload/_tkinter.so \
|
|
${DESTDIR}/usr/lib/python2.7/lib-dynload/
|
|
ln -sf idle2.7 ${DESTDIR}/usr/bin/idle2
|
|
}
|
|
|
|
idle-python_package() {
|
|
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
|
|
}
|
|
}
|
|
|
|
python-tkinter_package() {
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
short_desc+=" (transitional dummy package)"
|
|
build_style=meta
|
|
}
|