From 1e7999e6e63a68e82e023f60219b375daeea40ed Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sun, 16 Oct 2016 17:04:44 +0200 Subject: [PATCH] python3: update to 3.5.2 --- common/shlibs | 2 + srcpkgs/idle-python3 | 1 + srcpkgs/python3-devel | 1 + srcpkgs/python3-tkinter | 1 + srcpkgs/python3/files/cross.patch | 84 +++++++++++++++++ srcpkgs/python3/files/idle3.desktop | 9 ++ srcpkgs/python3/files/idle3.xpm | 124 ++++++++++++++++++++++++ srcpkgs/python3/template | 140 ++++++++++++++++++++++++++-- srcpkgs/python3/update | 3 + 9 files changed, 358 insertions(+), 7 deletions(-) create mode 120000 srcpkgs/idle-python3 create mode 120000 srcpkgs/python3-devel create mode 120000 srcpkgs/python3-tkinter create mode 100644 srcpkgs/python3/files/cross.patch create mode 100644 srcpkgs/python3/files/idle3.desktop create mode 100644 srcpkgs/python3/files/idle3.xpm create mode 100644 srcpkgs/python3/update diff --git a/common/shlibs b/common/shlibs index de5fa945207..4cdbb54736d 100644 --- a/common/shlibs +++ b/common/shlibs @@ -1687,6 +1687,8 @@ libdar.so.5000 libdar-2.4.14_1 libpython3.so python3.4-3.4.1_1 libpython3.4m.so.1.0 python3.4-3.4.1_1 libpython3.5m.so.1.0 python3.5-3.5.1_1 +libpython3.so python3-3.5.2_1 +libpython3.5m.so.1.0 python3-3.5.2_1 libbrscandec2.so.1 brother-brscan3-0.2.11_2 libpyglib-2.0-python.so.0 python-gobject2-2.28.6_11 libxmlrpc_server_abyss.so.3 xmlrpc-c-1.25.28_1 diff --git a/srcpkgs/idle-python3 b/srcpkgs/idle-python3 new file mode 120000 index 00000000000..b8a0adbbb97 --- /dev/null +++ b/srcpkgs/idle-python3 @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/srcpkgs/python3-devel b/srcpkgs/python3-devel new file mode 120000 index 00000000000..b8a0adbbb97 --- /dev/null +++ b/srcpkgs/python3-devel @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/srcpkgs/python3-tkinter b/srcpkgs/python3-tkinter new file mode 120000 index 00000000000..b8a0adbbb97 --- /dev/null +++ b/srcpkgs/python3-tkinter @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/srcpkgs/python3/files/cross.patch b/srcpkgs/python3/files/cross.patch new file mode 100644 index 00000000000..479ee898f9b --- /dev/null +++ b/srcpkgs/python3/files/cross.patch @@ -0,0 +1,84 @@ +--- setup.py.orig 2014-05-19 07:19:40.000000000 +0200 ++++ setup.py 2014-06-18 09:50:55.950072020 +0200 +@@ -17,7 +17,7 @@ from distutils.command.install_lib impor + from distutils.command.build_scripts import build_scripts + from distutils.spawn import find_executable + +-cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ ++cross_compiling = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('PYTHONXCPREFIX' in os.environ) + + def get_platform(): + # cross build +@@ -486,7 +486,7 @@ class PyBuildExt(build_ext): + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.base_prefix) != '/usr' \ ++ if os.path.normpath(sys.base_prefix) != '/usr' and not cross_compiling \ + and not sysconfig.get_config_var('PYTHONFRAMEWORK'): + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when +@@ -549,6 +549,11 @@ class PyBuildExt(build_ext): + if host_platform == 'darwin': + math_libs = [] + ++ # Insert libraries and headers from XBPS_CROSS_BASE ++ if 'XBPS_CROSS_BASE' in os.environ: ++ lib_dirs += [os.environ['XBPS_CROSS_BASE'] + '/usr/lib'] ++ inc_dirs += [os.environ['XBPS_CROSS_BASE'] + '/usr/include'] ++ + # XXX Omitted modules: gl, pure, dl, SGI-specific modules + + # +@@ -1852,8 +1857,13 @@ class PyBuildExt(build_ext): + + # Pass empty CFLAGS because we'll just append the resulting + # CFLAGS to Python's; -g or -O2 is to be avoided. +- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ +- % (ffi_builddir, ffi_srcdir, " ".join(config_args)) ++ if cross_compiling: ++ cmd = "cd %s && env CFLAGS='' '%s/configure' --host=%s --build=%s %s" \ ++ % (ffi_builddir, ffi_srcdir, os.environ.get('HOSTARCH'), ++ os.environ.get('BUILDARCH'), " ".join(config_args)) ++ else: ++ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ ++ % (ffi_builddir, ffi_srcdir, " ".join(config_args)) + + res = os.system(cmd) + if res or not os.path.exists(ffi_configfile): +--- Makefile.pre.in.orig 2015-09-13 13:41:23.000000000 +0200 ++++ Makefile.pre.in 2015-09-14 17:56:11.792632577 +0200 +@@ -1011,8 +1013,6 @@ + upgrade) ensurepip="--upgrade" ;; \ + install|*) ensurepip="" ;; \ + esac; \ +- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \ +- $$ensurepip --root=$(DESTDIR)/ ; \ + fi + + altinstall: commoninstall +@@ -1021,8 +1021,6 @@ + upgrade) ensurepip="--altinstall --upgrade" ;; \ + install|*) ensurepip="--altinstall" ;; \ + esac; \ +- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \ +- $$ensurepip --root=$(DESTDIR)/ ; \ + fi + + commoninstall: @FRAMEWORKALTINSTALLFIRST@ \ +@@ -1400,11 +1398,12 @@ + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods ++ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + --prefix=$(prefix) \ +- --install-scripts=$(BINDIR) \ +- --install-platlib=$(DESTSHARED) \ +- --root=$(DESTDIR)/ ++ --install-scripts=$(DESTDIR)$(BINDIR) \ ++ --install-platlib=$(DESTDIR)$(DESTSHARED) \ ++ --root=/ + -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py + -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__ + diff --git a/srcpkgs/python3/files/idle3.desktop b/srcpkgs/python3/files/idle3.desktop new file mode 100644 index 00000000000..8f9d005737e --- /dev/null +++ b/srcpkgs/python3/files/idle3.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=IDLE (using Python3) +Comment=IDE for Python (using Python3) +Exec=idle3 +Icon=idle3 +Terminal=false +Type=Application +Categories=Development; +StartupNotify=true diff --git a/srcpkgs/python3/files/idle3.xpm b/srcpkgs/python3/files/idle3.xpm new file mode 100644 index 00000000000..964cbefdeb3 --- /dev/null +++ b/srcpkgs/python3/files/idle3.xpm @@ -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 %.%.%.%.%.%.", +"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%." +}; diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template index 992f9849df2..4f2349418ba 100644 --- a/srcpkgs/python3/template +++ b/srcpkgs/python3/template @@ -1,11 +1,137 @@ # Template file for 'python3' pkgname=python3 -version=3.4 +version=3.5.2 revision=1 -noarch=yes -build_style=meta -homepage="http://www.voidlinux.eu/" -short_desc="Python 3.x meta-pkg" +wrksrc="Python-${version}" +short_desc="Interpreted, interactive, object-oriented programming language (${version%.*} series)" maintainer="Juan RP " -license="Public domain" -depends="python3.4" +homepage="https://www.python.org" +license="PSF" +distfiles="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz" +checksum=0010f56100b9b74259ebcd5d4b295a32324b58b517403a10d1a2aa7cb22bca40 + +#replaces="python3.4>=0" +pycompile_dirs="usr/lib/python3.5" +makedepends="libffi-devel readline-devel gdbm-devel libressl-devel expat-devel + sqlite-devel bzip2-devel zlib-devel liblzma-devel tcl-devel tk-devel libX11-devel" +depends="ca-certificates" + +alternatives=" + python:idle:/usr/bin/idle3.5 + python:2to3:/usr/bin/2to3-3.5 + python:pydoc:/usr/bin/pydoc3.5 + python:python:/usr/bin/python3.5 + python:python.1:/usr/share/man/man1/python3.5.1 + python3:idle3:/usr/bin/idle3.5 + python3:2to3:/usr/bin/2to3-3.5 + python3:pydoc3:/usr/bin/pydoc3.5 + python3:python3:/usr/bin/python3.5 + python3:pyvenv3:/usr/bin/pyvenv-3.5 + python3:python3-config:/usr/bin/python3.5-config + python3:libpython3.so:/usr/lib/libpython3.5m.so + python3:python3.pc:/usr/lib/pkgconfig/python-3.5.pc + python3:python3.1:/usr/share/man/man1/python3.5.1" + +pre_configure() { + # Ensure that internal copies of zlib, expat and libffi are not used + rm -r Modules/zlib + rm -r Modules/expat + rm -r Modules/_ctypes/{darwin,libffi}* +} +do_configure() { + local _args + unset GCC CC CXX CPP LD AR AS RANLIB + if [ "$CROSS_BUILD" ]; then + mkdir -p host-build + cd host-build + env -i PATH=$PATH CFLAGS=-Os ../configure + env -i PATH=$PATH make ${makejobs} python + mkdir -p ../hostpython + mv python ../hostpython + cd .. + patch -Np0 -i ${FILESDIR}/cross.patch + _args="--build=${XBPS_MACHINE%%-musl}" + fi + ./configure ${configure_args} ${_args} \ + --enable-shared --enable-ipv6 --with-threads --enable-unicode=ucs4 \ + --with-computed-gotos --with-system-expat --with-system-ffi \ + --without-ensurepip +} +do_build() { + export PATH="$PATH:$wrksrc/hostpython" + make ${makejobs} +} +do_install() { + export PATH="$PATH:$wrksrc/hostpython" + make DESTDIR=${DESTDIR} install maninstall + vlicense LICENSE + + rm -f ${DESTDIR}/usr/bin/2to3 + rm -f ${DESTDIR}/usr/bin/pyvenv + rm -f ${DESTDIR}/usr/bin/{idle,pydoc,python}3 + rm -f ${DESTDIR}/usr/share/man/man1/python3.1 + rm -f ${DESTDIR}/usr/bin/python3-config + rm -f ${DESTDIR}/usr/lib/libpython3.so + rm -f ${DESTDIR}/usr/lib/pkgconfig/python3.pc + + ln -sf ../../libpython${version%.*}m.so \ + ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m/libpython${version%.*}m.so + + # Remove test module and tests that fail to be byte-compiled. + rm -rf ${DESTDIR}/usr/lib/python${version%.*}/test + rm -rf ${DESTDIR}/usr/lib/python${version%.*}/lib2to3/tests + # Remove references to hardening -specs. + sed -e 's|\(-specs=.*hardened-ld\)||g' -e 's|\(-specs=.*hardened-cc1\)||g' -i \ + ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \ + ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m/Makefile \ + ${DESTDIR}/usr/bin/python${version%.*}*-config + # Remove references to the install(1) wrapper. + sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \ + ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \ + ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m/Makefile + if [ "$CROSS_BUILD" ]; then + # Remove references to cross toolchain. + sed -i "s/$XBPS_CROSS_TRIPLET-//g" \ + ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata.py \ + ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}m/Makefile + fi +} + +python3-devel_package() { + #replaces="python3.4-devel>=0" + depends="${sourcepkg}-${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/bin/python*-config + vmove usr/lib/pkgconfig + vmove usr/include + vmove usr/lib/python${version%.*}/config-${version%.*}m/libpython${version%.*}m.a + mkdir -p ${DESTDIR}/usr/include/python${version%.*}m + mv ${PKGDESTDIR}/usr/include/python${version%.*}m/pyconfig.h \ + ${DESTDIR}/usr/include/python${version%.*}m + } +} +python3-tkinter_package() { + #replaces="python3.4-tkinter>=0" + pycompile_dirs="usr/lib/python3.5" + depends="${sourcepkg}-${version}_${revision}" + short_desc+=" - GUI toolkit for Python3" + pkg_install() { + vmove usr/lib/python${version%.*}/tkinter + vmove usr/lib/python${version%.*}/turtle.py + vmove usr/lib/python${version%.*}/turtledemo + vmove usr/lib/python${version%.*}/lib-dynload/_tkinter.cpython-*m-*.so + } +} +idle-python3_package() { + #replaces="idle-python3.4>=0" + pycompile_dirs="usr/lib/python3.5/idlelib" + depends="${sourcepkg}-${version}_${revision} python3-tkinter" + short_desc+=" - IDE for Python3 using Tkinter" + pkg_install() { + vmove usr/bin/idle${version%.*} + vmove usr/lib/python${version%.*}/idlelib + vinstall ${FILESDIR}/idle3.xpm 644 usr/share/pixmaps + vinstall ${FILESDIR}/idle3.desktop 644 usr/share/applications + } +} diff --git a/srcpkgs/python3/update b/srcpkgs/python3/update new file mode 100644 index 00000000000..fa24a2701dd --- /dev/null +++ b/srcpkgs/python3/update @@ -0,0 +1,3 @@ +pkgname=Python +site="${homepage}/downloads/source/" +ignore="*rc* *b* *a*"