# Maintainer: Natanael Copa # This package must be synchronized with python2. It is splitted to avoid # a cyclic dependency: python -> tk -> libx11 -> libxcb -> xcb-proto -> python global pkgname := 'python2-tkinter' global pkgver := '2.7.14' global _verbase := $(pkgver%.*) global pkgrel := '0' global pkgdesc := '"A graphical user interface for the Python'" global url := '"https://wiki.python.org/moin/TkInter'" global arch := '"all'" global license := '"custom'" global subpackages := ""$pkgname-tests python2-idle:_idle:noarch"" global depends := ''"" global 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'" global replaces := '"python2'" global replaces_priority := '1' global source := ""http://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz"" global builddir := ""$srcdir/Python-$pkgver"" proc prepare { var _pyapkbuild = ""$startdir"/../main/python2/APKBUILD" if test -e $_pyapkbuild { global _pver := $[source "$_pyapkbuild" ; echo $pkgver] if test $_pver != $pkgver { error "python version mismatch ($_pver). Set pkgver=$_pver" return 1 } } default_prepare cd $builddir # Make sure we use system libs rm -rf Modules/expat Modules/_ctypes/libffi* Modules/zlib } proc 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 make } proc 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 for lib in [idlelib lib-tk] { mv "$builddir"/tmpinstall/usr/lib/python$(_verbase)/$lib \ "$pkgdir"/usr/lib/python$(_verbase)/ } mv "$builddir"/tmpinstall/usr/lib/python$(_verbase)/lib-dynload/_tkinter.so \ "$pkgdir"/usr/lib/python$(_verbase)/lib-dynload/ mv "$builddir"/tmpinstall/usr/bin/idle \ "$pkgdir"/usr/bin/idle$(_verbase) } proc _mv_files { var i = '' for i in [@Argv] { mkdir -p "$subpkgdir"/$(i%/*) mv "$pkgdir"/$i "$subpkgdir"/$i } } proc tests { global pkgdesc := '"The test modules from the main python package for tkinter'" global replaces := '"python-tests python2-tests'" cd $pkgdir _mv_files usr/lib/python*/*/test } proc _idle { global pkgdesc := '"IDE for Python2 using Tkinter'" global depends := ""$pkgname=$pkgver-r$pkgrel"" cd $pkgdir _mv_files usr/bin } global sha512sums := '"78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 Python-2.7.14.tar.xz'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(python2-tkinter)} spids:[11])] spids: [11] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(2.7.14)} spids:[14])] spids: [14] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_verbase) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(".*")}) spids: [18 22] ) } spids: [17] ) ] spids: [17] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[24])] spids: [24] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("A graphical user interface for the Python"))} spids: [27] ) ] spids: [27] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("https://wiki.python.org/moin/TkInter"))} spids: [32] ) ] spids: [32] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[37])] spids: [37] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (custom))} spids:[42])] spids: [42] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") ("-tests python2-idle:_idle:noarch"))} spids: [47] ) ] spids: [47] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ )} spids:[53])] spids: [53] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: { (DQ ("expat-dev libressl-dev zlib-dev ncurses-dev bzip2-dev\n") ("\tgdbm-dev sqlite-dev libffi-dev readline-dev linux-headers paxmark\n") ("\ttk tk-dev python2") ) } spids: [57] ) ] spids: [57] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:replaces) op:Equal rhs:{(DQ (python2))} spids:[64])] spids: [64] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:replaces_priority) op:Equal rhs:{(1)} spids:[69])] spids: [69] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://www.python.org/ftp/python/") ($ VSub_Name "$pkgver") (/Python-) ($ VSub_Name "$pkgver") (.tar.xz) ) } spids: [72] ) ] spids: [72] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/Python-) ($ VSub_Name "$pkgver"))} spids: [81] ) ] spids: [81] ) (FuncDef name: prepare body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:_pyapkbuild) op: Equal rhs: {(DQ ($ VSub_Name "$startdir")) (/../main/python2/APKBUILD)} spids: [98] ) ] spids: [96] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {(DQ ($ VSub_Name "$_pyapkbuild"))} {(Lit_Other "]")}) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_pver) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(.)} {(DQ ($ VSub_Name "$_pyapkbuild"))}) terminator: ) (C {(echo)} {($ VSub_Name "$pkgver")}) ] ) left_token: spids: [122 134] ) } spids: [121] ) ] spids: [121] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$_pver"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$pkgver"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(error)} { (DQ ("python version mismatch (") ($ VSub_Name "$_pver") ("). Set pkgver=") ($ VSub_Name "$_pver") ) } ) (ControlFlow token: arg_word: {(1)} ) ] spids: [-1 155] ) ] spids: [-1 173] ) ] spids: [-1 118] ) ] spids: [-1 176] ) (C {(default_prepare)}) (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(rm)} {(-rf)} {(Modules/expat)} {(Modules/_ctypes/libffi) (Lit_Other "*")} {(Modules/zlib)} ) ] spids: [93] ) spids: [89 92] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(export)} {(Lit_VarLike "OPT=") (DQ ($ VSub_Name "$CFLAGS"))}) (C {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--prefix) (Lit_Other "=") (/usr)} {(--enable-shared)} {(--with-threads)} {(--enable-ipv6)} {(--with-system-ffi)} {(--with-system-expat)} {(--with-system-zlib)} {(--enable-unicode) (Lit_Other "=") (ucs4)} ) (C {(make)}) ] spids: [212] ) spids: [208 211] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$builddir")) (/tmpinstall)} {(sharedinstall)} {(libinstall)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/python) (${ VSub_Name _verbase) (/lib-dynload)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin)} ) (ForEach iter_name: lib iter_words: [{(idlelib)} {(lib-tk)}] do_arg_iter: False body: (DoGroup children: [ (C {(mv)} {(DQ ($ VSub_Name "$builddir")) (/tmpinstall/usr/lib/python) (${ VSub_Name _verbase) (/) ($ VSub_Name "$lib") } {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/python) (${ VSub_Name _verbase) (/)} ) ] spids: [359 386] ) spids: [353 357] ) (C {(mv)} {(DQ ($ VSub_Name "$builddir")) (/tmpinstall/usr/lib/python) (${ VSub_Name _verbase) (/lib-dynload/_tkinter.so) } {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/python) (${ VSub_Name _verbase) (/lib-dynload/)} ) (C {(mv)} {(DQ ($ VSub_Name "$builddir")) (/tmpinstall/usr/bin/idle)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin/idle) (${ VSub_Name _verbase)} ) ] spids: [290] ) spids: [286 289] ) (FuncDef name: _mv_files body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:i) op:Equal spids:[443])] spids: [441] ) (ForEach iter_name: i iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/) (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ("*")}) spids: [468 473] ) } ) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/) ($ VSub_Name "$i")} {(DQ ($ VSub_Name "$subpkgdir")) (/) ($ VSub_Name "$i")} ) ] spids: [457 491] ) spids: [451 455] ) ] spids: [438] ) spids: [434 437] ) (FuncDef name: tests body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("The test modules from the main python package for tkinter"))} spids: [503] ) ] spids: [503] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:replaces) op: Equal rhs: {(DQ ("python-tests python2-tests"))} spids: [509] ) ] spids: [509] ) (C {(cd)} {(DQ ($ VSub_Name "$pkgdir"))}) (C {(_mv_files)} {(usr/lib/python) (Lit_Other "*") (/) (Lit_Other "*") (/test)}) ] spids: [500] ) spids: [496 499] ) (FuncDef name: _idle body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("IDE for Python2 using Tkinter"))} spids: [540] ) ] spids: [540] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") ("=") ($ VSub_Name "$pkgver") (-r) ($ VSub_Name "$pkgrel") ) } spids: [546] ) ] spids: [546] ) (C {(cd)} {(DQ ($ VSub_Name "$pkgdir"))}) (C {(_mv_files)} {(usr/bin)}) ] spids: [537] ) spids: [533 536] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 Python-2.7.14.tar.xz" ) ) } spids: [570] ) ] spids: [570] ) ] )