diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-10-26 12:28:45 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-10-26 12:42:33 +0000 |
commit | ec356aebd5adedb9de23cbb54ff42a783fb835e7 (patch) | |
tree | 3d5d9547461536638cad6966d89d7a5546111c54 /main/python2-tkinter/APKBUILD | |
parent | dddfa696dcbef80b8169cb1079eef23cbbd25491 (diff) | |
download | aports-ec356aebd5adedb9de23cbb54ff42a783fb835e7.tar.bz2 aports-ec356aebd5adedb9de23cbb54ff42a783fb835e7.tar.xz |
main/python2: fix cyclic dependency for tkinter
Add a separate apkbuild for tkinter to avoid the cyclic buildtime
dependency:
python -> tk -> libX11 -> libxcb -> xcb-proto -> python
Diffstat (limited to 'main/python2-tkinter/APKBUILD')
-rw-r--r-- | main/python2-tkinter/APKBUILD | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/main/python2-tkinter/APKBUILD b/main/python2-tkinter/APKBUILD new file mode 100644 index 0000000000..b642cc3b69 --- /dev/null +++ b/main/python2-tkinter/APKBUILD @@ -0,0 +1,102 @@ +# 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.12 +_verbase=${pkgver%.*} +pkgrel=0 +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" +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" +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" + arch=noarch + depends="$pkgname=$pkgver-r$pkgrel" + cd "$pkgdir" + _mv_files usr/bin +} + +md5sums="57dffcee9cee8bb2ab5f82af1d8e9a69 Python-2.7.12.tar.xz" +sha256sums="d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978 Python-2.7.12.tar.xz" +sha512sums="6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f Python-2.7.12.tar.xz" |