aboutsummaryrefslogtreecommitdiffstats
path: root/community/python2-tkinter
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-05-27 20:21:42 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-05-27 20:21:42 +0000
commit5b4d6eba8bd449758cfcd4b4a431df5973aff069 (patch)
tree9dc828ca837fb12c580fcb4d755ed37d7791def3 /community/python2-tkinter
parent7d0af0986a0fb1310fc0f1e372831b464f0207bc (diff)
downloadaports-5b4d6eba8bd449758cfcd4b4a431df5973aff069.tar.bz2
aports-5b4d6eba8bd449758cfcd4b4a431df5973aff069.tar.xz
community/python2-tkinter: move from main
Diffstat (limited to 'community/python2-tkinter')
-rw-r--r--community/python2-tkinter/APKBUILD103
1 files changed, 103 insertions, 0 deletions
diff --git a/community/python2-tkinter/APKBUILD b/community/python2-tkinter/APKBUILD
new file mode 100644
index 0000000000..ea047e944f
--- /dev/null
+++ b/community/python2-tkinter/APKBUILD
@@ -0,0 +1,103 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+# This package must be synchronized with python2. It is splitted to avoid
+# a cyclic dependency: python -> tk -> libx11 -> libxcb -> xcb-proto -> python
+
+pkgname=python2-tkinter
+pkgver=2.7.13
+_verbase=${pkgver%.*}
+pkgrel=1
+pkgdesc="A graphical user interface for the Python"
+url="https://wiki.python.org/moin/TkInter"
+arch="all"
+license="custom"
+subpackages="$pkgname-tests python2-idle:_idle:noarch"
+depends=""
+makedepends="expat-dev libressl-dev zlib-dev ncurses-dev bzip2-dev
+ gdbm-dev sqlite-dev libffi-dev readline-dev linux-headers paxmark
+ tk tk-dev python2"
+replaces="python2"
+replaces_priority=1
+source="http://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz"
+builddir="$srcdir/Python-$pkgver"
+
+prepare() {
+ local _pyapkbuild="$startdir"/../python2/APKBUILD
+ if [ -e "$_pyapkbuild" ]; then
+ _pver=$(. "$_pyapkbuild" ; echo $pkgver)
+ if [ "$_pver" != "$pkgver" ]; then
+ error "python version mismatch ($_pver). Set pkgver=$_pver"
+ return 1
+ fi
+ fi
+ default_prepare || return 1
+ cd "$builddir"
+
+ # Make sure we use system libs
+ rm -rf Modules/expat Modules/_ctypes/libffi* Modules/zlib || return 1
+}
+
+build() {
+ cd "$builddir"
+ export OPT="$CFLAGS"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --enable-shared \
+ --with-threads \
+ --enable-ipv6 \
+ --with-system-ffi \
+ --with-system-expat \
+ --with-system-zlib \
+ --enable-unicode=ucs4 \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ # we only care about idle, and tkinter
+ make DESTDIR="$builddir"/tmpinstall sharedinstall libinstall \
+ || return 1
+
+ mkdir -p "$pkgdir"/usr/lib/python${_verbase}/lib-dynload \
+ "$pkgdir"/usr/bin || return 1
+
+ for lib in idlelib lib-tk; do
+ mv "$builddir"/tmpinstall/usr/lib/python${_verbase}/$lib \
+ "$pkgdir"/usr/lib/python${_verbase}/ || return 1
+ done
+
+ mv "$builddir"/tmpinstall/usr/lib/python${_verbase}/lib-dynload/_tkinter.so \
+ "$pkgdir"/usr/lib/python${_verbase}/lib-dynload/ || return 1
+
+ mv "$builddir"/tmpinstall/usr/bin/idle \
+ "$pkgdir"/usr/bin/idle${_verbase} || return 1
+}
+
+_mv_files() {
+ local i
+ for i in "$@"; do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
+ done
+}
+
+tests() {
+ pkgdesc="The test modules from the main python package for tkinter"
+ replaces="python-tests python2-tests"
+ cd "$pkgdir"
+ _mv_files usr/lib/python*/*/test || return 1
+}
+
+_idle() {
+ pkgdesc="IDE for Python2 using Tkinter"
+ depends="$pkgname=$pkgver-r$pkgrel"
+ cd "$pkgdir"
+ _mv_files usr/bin
+}
+
+md5sums="53b43534153bb2a0363f08bae8b9d990 Python-2.7.13.tar.xz"
+sha256sums="35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731 Python-2.7.13.tar.xz"
+sha512sums="f37c9a28ce129d01e63c84d7db627a06402854578f62d17927334ea21ede318e04bbf66e890e3f47c85333e6b19f6e5581fb3f3e27efd24be27017d1b6529c4b Python-2.7.13.tar.xz"