# HG changeset patch # User Hans-G?nter Theisgen # Date 1573836450 -3600 # Node ID f987b2a37476e3228eb9a1c0779be993be1b934d # Parent e549186a3cd353415010670bb3db4cbb985a996a copied python and python3 recipes from wok-next diff -r e549186a3cd3 -r f987b2a37476 python/.icon.png Binary file python/.icon.png has changed diff -r e549186a3cd3 -r f987b2a37476 python/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/receipt Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,71 @@ +# SliTaz package receipt v2. + +PACKAGE="python" +VERSION="2.7.15" +CATEGORY="development" +SHORT_DESC="The Python programming language" +MAINTAINER="devel@slitaz.org" +LICENSE="PSL" +WEB_SITE="https://www.python.org/" +LFS="http://www.linuxfromscratch.org/blfs/view/svn/general/python2.html" +REPOLOGY="python2" + +TARBALL="$PACKAGE-$VERSION.tar.xz" +WGET_URL="https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz" +TARBALL_SHA1="f99348a095ec4a6411c84c0d15343d11920c9724" + +BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite3-dev zlib-dev \ +ncurses-dev tcl-dev tk-dev db-dev gdbm-dev libffi-dev expat-dev" +SPLIT="$PACKAGE-dev $PACKAGE-idle $PACKAGE-tcltk $PACKAGE" + +COOKOPTS="!menus !zip" + +compile_rules() { + # Temporary workaround for FS#22322 + # See http://bugs.python.org/issue10835 for upstream report + sed -i.orig "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c + + # Enable built-in SQLite3 module to load extensions (fix FS#22122) + sed -i.orig "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py + + ./configure \ + --prefix=/usr \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + --enable-unicode=ucs4 \ + $CONFIGURE_ARGS && + make && + make DESTDIR=$install install && + chmod -v 755 $install/usr/lib/libpython2.7.so.1.0 + + find $install -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete +} + +genpkg_rules() { + case $PACKAGE in + *-dev) + copy @dev test/ distutils/command/*.exe ensurepip/ + find $fs -type f -name pyconfig.h -delete # move to python package + DEPENDS="python" # skip python-idle and python-tcltk + ;; + *-idle) + copy idle idlelib/ python-idle.desktop + CAT="development|GUI IDE using TK Toolkit" + DEPENDS="python-tcltk tcl tk" + ;; + *-tcltk) + copy _tkinter.so lib-tk/ @rm + CAT="development|Tcl/Tk files" + DEPENDS="python tcl tk libx11" + ;; + python) + # Now pyconfig.h is required for Mercurial. + copy @std @rm pyconfig.h + DEPENDS="python-setuptools python-pip \ + libbzip2 expat libgdbm libffi libsqlite3 ncurses \ + ncurses-libpanel openssl readline zlib" + ;; + esac +} diff -r e549186a3cd3 -r f987b2a37476 python/stuff/applications/python-idle.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/stuff/applications/python-idle.desktop Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +Name=Python IDLE +Exec=idle +Icon=python +Categories=Development; diff -r e549186a3cd3 -r f987b2a37476 python/stuff/applications/python.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/stuff/applications/python.desktop Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Python interpreter +Name[fr]=Interpreteur Python +Name[pt]=Interpretador Python +Name[pt_BR]=Interpretador Python +Name[ru]=Интерпретатор Python +Terminal=false +Exec=terminal -e python +Icon=python +Type=Application +Categories=Development; diff -r e549186a3cd3 -r f987b2a37476 python/stuff/patches/13a39142c047.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/stuff/patches/13a39142c047.diff Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,72 @@ +Error in the end of the `make install`: + +``` +Traceback (most recent call last): + File "${src}/Lib/runpy.py", line 163, in _run_module_as_main + mod_name, _Error) + File "${src}/Lib/runpy.py", line 111, in _get_module_details + __import__(mod_name) # Do not catch exceptions initializing package + File "${src}/Lib/ensurepip/__init__.py", line 9, in + import tempfile + File "${src}/Lib/tempfile.py", line 35, in + from random import Random as _Random + File "${src}/Lib/random.py", line 885, in + _inst = Random() + File "${src}/Lib/random.py", line 97, in __init__ + self.seed(x) + File "${src}/Lib/random.py", line 113, in seed + a = long(_hexlify(_urandom(2500)), 16) +OSError: [Errno 38] Function not implemented +make: *** [Makefile:927: install] Error 1 +``` + +While the normal installing process is following: + +``` +Collecting setuptools +Collecting pip +Installing collected packages: setuptools, pip +Successfully installed pip-9.0.1 setuptools-28.8.0 +``` + +Discussion found here: http://bugs.python.org/issue29188 +Patch found in the discussion above: +https://hg.python.org/cpython/rev/13a39142c047 + +Chunk #1 is removed from the original patch because it rejected. + + +# HG changeset patch +# User Victor Stinner +# Date 1483956641 -3600 +# Node ID 13a39142c0473ecb64fcd4b12a915025df6e4310 +# Parent cb4f73be9486d47f1dc4285998d1532d8857c59e +Don't use getentropy() on Linux + +Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but +read from /dev/urandom to get random bytes, for example in os.urandom(). On +Linux, getentropy() is implemented which getrandom() is blocking mode, whereas +os.urandom() should not block. + +diff --git a/Python/random.c b/Python/random.c +--- a/Python/random.c ++++ b/Python/random.c +@@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_ + } + + /* Issue #25003: Don't use getentropy() on Solaris (available since +- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */ +-#elif defined(HAVE_GETENTROPY) && !defined(sun) ++ Solaris 11.3), it is blocking whereas os.urandom() should not block. ++ ++ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24 ++ implements it with the getrandom() syscall which can fail with ENOSYS, ++ and this error is not supported in py_getentropy() and getrandom() is called ++ with flags=0 which blocks until system urandom is initialized, which is not ++ the desired behaviour to seed the Python hash secret nor for os.urandom(): ++ see the PEP 524 which was only implemented in Python 3.6. */ ++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux) + #define PY_GETENTROPY 1 + + /* Fill buffer with size pseudo-random bytes generated by getentropy(). + diff -r e549186a3cd3 -r f987b2a37476 python/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/stuff/patches/series Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,1 @@ +#13a39142c047.diff diff -r e549186a3cd3 -r f987b2a37476 python/stuff/python.png Binary file python/stuff/python.png has changed diff -r e549186a3cd3 -r f987b2a37476 python3/.icon.png --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python3/.icon.png Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,1 @@ +../python/.icon.png \ No newline at end of file diff -r e549186a3cd3 -r f987b2a37476 python3/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python3/receipt Fri Nov 15 17:47:30 2019 +0100 @@ -0,0 +1,59 @@ +# SliTaz package receipt v2. + +PACKAGE="python3" +VERSION="3.7.2" +CATEGORY="development" +SHORT_DESC="The Python 3 programming language" +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="GPL" +WEB_SITE="https://www.python.org/download/releases/" +LFS="http://www.linuxfromscratch.org/lfs/view/development/chapter06/Python.html" + +TARBALL="Python-$VERSION.tar.xz" +WGET_URL="https://www.python.org/ftp/python/$VERSION/$TARBALL" +TARBALL_SHA1="c3dc6928516bcb934cf4740461044c79c7c35494" + +BUILD_DEPENDS="readline-dev gdbm-dev openssl-dev sqlite3-dev zlib-dev tk-dev \ +ncurses-dev xz-dev bzip2-dev expat-dev libffi-dev" +SPLIT="$PACKAGE-idle $PACKAGE-tcltk $PACKAGE-ensurepip $PACKAGE $PACKAGE-dev" + +COPY_idle="idle3 idle${VERSION%.*} idlelib/" +COPY_tcltk="_tkinter.*.so tkinter/" +COPY_ensurepip="ensurepip/" +COPY_std="@std @rm pyconfig.h" + +CAT_idle="development|GUI IDE using TK Toolkit" +CAT_tcltk="development|Tcl/Tk files" +CAT_ensurepip="development|ensurepip" + +DEPENDS_idle="$PACKAGE" +DEPENDS_tcltk="$PACKAGE tcl tk" +DEPENDS_ensurepip="$PACKAGE" +DEPENDS_std="expat libbzip2 libffi libgdbm liblzma libsqlite3 ncurses \ +ncurses-libpanel openssl readline util-linux-uuid zlib python3-setuptools \ +python3-pip" +DEPENDS_dev="$PACKAGE" + +TAGS_std="LFS" +COOKOPTS="!zip" + +compile_rules() { + mkdir -p $install/usr/lib/pkgconfig + + ./configure \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + $CONFIGURE_ARGS && + make && + make DESTDIR=$install install || return 1 + + chmod 755 $install/usr/lib/libpython${VERSION%.*}m.so + chmod 755 $install/usr/lib/libpython${VERSION%%.*}.so + + find $install -type f -name '*.pyc' -delete +} + +PROVIDE_std="py3k" +PROVIDE_dev="py3k-dev"