python: enable tk support

That addresses the following issues:
- Add tkinter ("Tk interface") support. Tkinter is the standard Python
  binding to the Tk GUI toolkit.
- Fix broken IDLE (the Python IDE) built with Tkinter.

Add two new subpkgs: python-tkinter and idle-python.
This commit is contained in:
Alessio Sergi 2014-08-17 14:28:27 +02:00
parent b2e0be415f
commit dd465c41b3
5 changed files with 162 additions and 4 deletions

1
srcpkgs/idle-python Symbolic link
View file

@ -0,0 +1 @@
python

1
srcpkgs/python-tkinter Symbolic link
View file

@ -0,0 +1 @@
python

View file

@ -0,0 +1,9 @@
[Desktop Entry]
Name=IDLE
Comment=IDE for Python2
Exec=idle
Icon=idle
Terminal=false
Type=Application
Categories=Development;
StartupNotify=true

View file

@ -0,0 +1,124 @@
/* XPM */
static char *python[] = {
/* columns rows colors chars-per-pixel */
"16 16 102 2 ",
" c #EBBB18",
". c #EBBE21",
"X c #F3C11A",
"o c #FAC719",
"O c #FDCB1B",
"+ c #FFCC1C",
"@ c #EBC22A",
"# c #FFCF23",
"$ c #FFCF24",
"% c #FFD025",
"& c #FFD026",
"* c #FFD32D",
"= c #FDD22F",
"- c #FFD32E",
"; c #FFD32F",
": c #EBC534",
"> c #E8C73D",
", c #FFD330",
"< c #FFD430",
"1 c #FDD536",
"2 c #FFD637",
"3 c #FAD339",
"4 c #FFD738",
"5 c #FFD739",
"6 c #FFD73A",
"7 c #F9D53E",
"8 c #FFD83A",
"9 c #ECCE45",
"0 c #FDD941",
"q c #FFDA41",
"w c #FFDA42",
"e c #FFDB42",
"r c #FFDB43",
"t c #FFDB44",
"y c #FDDD4A",
"u c #FFDE4B",
"i c #FFDF4D",
"p c #FDDE4E",
"a c #FFDF4E",
"s c #FFE255",
"d c #FFE357",
"f c #FFE358",
"g c #FFE661",
"h c #FFE761",
"j c #FFE762",
"k c #F2E16E",
"l c #F5E36F",
"z c #FDE96A",
"x c #FFEB6C",
"c c #326087",
"v c #366690",
"b c #366791",
"n c #356892",
"m c #366993",
"M c #366994",
"N c #376896",
"B c #376A96",
"V c #396C96",
"C c #386C97",
"Z c #396D99",
"A c #3A6F9B",
"S c #3A709C",
"D c #3B709C",
"F c #3B709D",
"G c #3C719E",
"H c #3D73A0",
"J c #3D73A2",
"K c #3D74A1",
"L c #3E74A2",
"P c #3E75A3",
"I c #3F76A5",
"U c #4078A6",
"Y c #4078A7",
"T c #4179A8",
"R c #427BAA",
"E c #437CAB",
"W c #437DAD",
"Q c #437DAE",
"! c #447DAD",
"~ c #447EAD",
"^ c #457FAF",
"/ c #4680B0",
"( c #4680B1",
") c #4681B2",
"_ c #4781B2",
"` c #4883B4",
"' c #4884B5",
"] c #4885B6",
"[ c #4985B7",
"{ c #4A87B9",
"} c #4A86BA",
"| c #4B88BB",
" . c #4C89BC",
".. c #4C8ABC",
"X. c #4D8BBE",
"o. c #4C8ABF",
"O. c #4E8DC0",
"+. c #4F8DC1",
"@. c #508FC3",
"#. c #5291C6",
"$. c gray100",
"%. c None",
/* pixels */
"%.%.%.%.+.} ( W I G N %.%.%.%.%.",
"%.%.%.%...$.( R L S B %.%.%.%.%.",
"%.%.%.%.] ( R L D B m %.%.%.%.%.",
"%.%.o.] W L V v V B B %.%.%.%.%.",
"#.+. .` ^ U G A m B B %.s u 7 %.",
"@.o._ ^ R G A m m m c %.u q 1 %.",
"o.] _ R L G B B n c %.9 q 1 * %.",
"] _ E U m %.%.%.%.%.%.q 5 * # %.",
"( E U n %.k z j s a t 5 * $ O %.",
"W R K %.l x j f a t 5 * $ + X %.",
"%.K D %.x j f a q 8 * $ + + %.%.",
"%.%.%.%.j f a > : @ . %.%.%.",
"%.%.%.%.f a t 5 , % + %.%.%.%.%.",
"%.%.%.%.a t 5 < % $.O %.%.%.%.%.",
"%.%.%.%.%.3 , % + o %.%.%.%.%.%.",
"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%."
};

View file

@ -1,10 +1,12 @@
# Template build file for 'python'. # Template build file for 'python'.
pkgname=python pkgname=python
version=2.7.8 version=2.7.8
revision=3 revision=4
wrksrc="Python-${version}" wrksrc="Python-${version}"
hostmakedepends="pkg-config" hostmakedepends="pkg-config"
makedepends="libffi-devel readline-devel>=6.3 gdbm-devel libressl-devel expat-devel sqlite-devel bzip2-devel zlib-devel" makedepends="
libffi-devel readline-devel>=6.3 gdbm-devel libressl-devel expat-devel
sqlite-devel bzip2-devel zlib-devel tcl-devel tk-devel libX11-devel"
pycompile_dirs="usr/lib/python2.7" pycompile_dirs="usr/lib/python2.7"
short_desc="Interpreted, interactive, object-oriented programming language" short_desc="Interpreted, interactive, object-oriented programming language"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
@ -58,14 +60,15 @@ do_install() {
post_install() { post_install() {
chmod 755 ${DESTDIR}/usr/lib/libpython*.so* chmod 755 ${DESTDIR}/usr/lib/libpython*.so*
install -Dm644 LICENSE ${DESTDIR}/usr/share/licenses/python/LICENSE install -Dm644 LICENSE ${DESTDIR}/usr/share/licenses/python/LICENSE
rm -f ${DESTDIR}/usr/bin/smtpd.py
# Remove test module and tests that fail to be byte-compiled. # Remove test module and tests that fail to be byte-compiled.
rm -rf ${DESTDIR}/usr/lib/python2.7/test rm -rf ${DESTDIR}/usr/lib/python2.7/test
rm -rf ${DESTDIR}/usr/lib/python2.7/lib2to3/tests rm -rf ${DESTDIR}/usr/lib/python2.7/lib2to3/tests
} }
python-devel_package() { python-devel_package() {
depends="python>=${version}_${revision}" depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files" short_desc+=" - development files"
pkg_install() { pkg_install() {
vmove usr/lib/python2.7/config/libpython2.7.a vmove usr/lib/python2.7/config/libpython2.7.a
vmove "usr/bin/python*-config" vmove "usr/bin/python*-config"
@ -76,3 +79,23 @@ python-devel_package() {
${DESTDIR}/usr/include/python2.7 ${DESTDIR}/usr/include/python2.7
} }
} }
python-tkinter_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - GUI toolkit for Python2"
pkg_install() {
vmove usr/lib/python2.7/lib-tk
vmove usr/lib/python2.7/lib-dynload/_tkinter.so
}
}
idle-python_package() {
depends="${sourcepkg}>=${version}_${revision} python-tkinter"
short_desc+=" - IDE for Python2 using Tkinter"
pkg_install() {
vmove usr/bin/idle
vmove usr/lib/python2.7/idlelib
vinstall ${FILESDIR}/idle.xpm 644 usr/share/pixmaps
vinstall ${FILESDIR}/idle.desktop 644 usr/share/applications
}
}