wok-next annotate python/receipt @ rev 20972
Improve Python packages: update, also provide Python3 packages where available
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Sep 22 16:05:26 2018 +0300 (2018-09-22) |
parents | 9b3461bf373c |
children | 3457c3087924 |
rev | line source |
---|---|
al@19763 | 1 # SliTaz package receipt v2. |
pankso@18 | 2 |
pankso@18 | 3 PACKAGE="python" |
al@20885 | 4 VERSION="2.7.15" |
pankso@204 | 5 CATEGORY="development" |
al@19763 | 6 SHORT_DESC="The Python programming language" |
pankso@18 | 7 MAINTAINER="pankso@slitaz.org" |
pascal@15378 | 8 LICENSE="PSL" |
al@19763 | 9 WEB_SITE="https://www.python.org/" |
al@20443 | 10 LFS="http://www.linuxfromscratch.org/blfs/view/stable/general/python2.html" |
al@20884 | 11 REPOLOGY="python2" |
pankso@18 | 12 |
al@19763 | 13 TARBALL="$PACKAGE-$VERSION.tar.xz" |
al@19763 | 14 WGET_URL="https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz" |
al@19582 | 15 |
pascal@20098 | 16 BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite3-dev zlib-dev \ |
al@19763 | 17 ncurses-dev tcl-dev tk-dev db-dev gdbm-dev libffi-dev expat-dev" |
al@19763 | 18 SPLIT="python-idle python-tcltk python python-dev" |
al@20443 | 19 COOKOPTS="!menus !zip" |
pankso@16026 | 20 |
al@20443 | 21 compile_rules() { |
slaxemulator@10975 | 22 # Temporary workaround for FS#22322 |
slaxemulator@10975 | 23 # See http://bugs.python.org/issue10835 for upstream report |
al@20885 | 24 sed -i.orig "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c |
al@18077 | 25 |
slaxemulator@10975 | 26 # Enable built-in SQLite3 module to load extensions (fix FS#22122) |
al@20885 | 27 sed -i.orig "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py |
al@20885 | 28 |
al@20885 | 29 # If setuptools installed on the host, they will not be installed to the |
al@20885 | 30 # $DESTDIR. Probably bug. Dirty hack using chroot to resolve it: |
al@20885 | 31 rm /usr/bin/easy_install* /usr/bin/pip* |
al@20885 | 32 rm -r /usr/lib/python2.7/site-packages/easy_install.py \ |
al@20885 | 33 /usr/lib/python2.7/site-packages/pip* \ |
al@20885 | 34 /usr/lib/python2.7/site-packages/pkg_resources \ |
al@20885 | 35 /usr/lib/python2.7/site-packages/setuptools* |
al@18077 | 36 |
pankso@16026 | 37 case "$ARCH" in |
pankso@16026 | 38 arm*) |
pankso@16290 | 39 # First pass for build host tools |
pankso@16290 | 40 unset CFLAGS CXXFLAGS |
pankso@16290 | 41 cp -f $CONFIG_SITE . |
pankso@16062 | 42 CONFIG_SITE="$(pwd)/cook.site" |
al@20443 | 43 cat >> $CONFIG_SITE <<EOT |
pankso@16290 | 44 ac_cv_have_long_long_format=yes |
pankso@16290 | 45 EOT |
pankso@16290 | 46 ./configure CC=gcc \ |
pankso@16290 | 47 --disable-ipv6 \ |
pankso@16290 | 48 --build=i486-slitaz-linux \ |
al@19582 | 49 --host=${BUILD_SYSTEM} && |
pankso@16290 | 50 make python Parser/pgen && |
pankso@16290 | 51 mv python hostpython && |
pankso@16290 | 52 mv Parser/pgen Parser/hostpgen || exit 1 |
pankso@16290 | 53 make distclean |
pankso@16290 | 54 rm -f $CONFIG_SITE |
pankso@16290 | 55 # Second pass for host tools |
pankso@16290 | 56 . /etc/slitaz/cook.conf |
pankso@16290 | 57 cp -f $CONFIG_SITE . |
pankso@16290 | 58 CONFIG_SITE="$(pwd)/cook.site" |
al@20443 | 59 cat >> $CONFIG_SITE <<EOT |
pankso@16290 | 60 ac_cv_have_long_long_format=yes |
pankso@16290 | 61 ac_cv_buggy_getaddrinfo=no |
pankso@16290 | 62 ac_cv_file__dev_ptmx=yes |
pankso@16290 | 63 ac_cv_file__dev_ptc=no |
pankso@16290 | 64 EOT |
pankso@16290 | 65 ./configure CC=${HOST_SYSTEM}-gcc \ |
pankso@16026 | 66 --disable-ipv6 \ |
pankso@16026 | 67 --enable-shared \ |
pankso@16290 | 68 --with-system-ffi \ |
pankso@16290 | 69 ${CONFIGURE_ARGS} && |
pankso@16290 | 70 make \ |
pankso@16290 | 71 PYTHON_FOR_BUILD=${src}/hostpython \ |
pankso@16290 | 72 HOSTPYTHON=${src}/hostpython \ |
pankso@16290 | 73 HOSTPGEN=${src}/Parser/hostpgen \ |
pankso@16290 | 74 CROSS_COMPILE_TARGET=yes \ |
pankso@16290 | 75 HOSTARCH=${HOST_SYSTEM} \ |
pankso@16290 | 76 BUILDARCH=${BUILD_SYSTEM} || exit 1 |
al@19582 | 77 make DESTDIR=$DESTDIR install || exit 1 |
al@19582 | 78 ;; |
al@20443 | 79 i?86|x86_64) |
pankso@16026 | 80 ./configure \ |
al@19763 | 81 --prefix=/usr \ |
pankso@16026 | 82 --enable-shared \ |
al@19763 | 83 --with-system-expat \ |
al@19763 | 84 --with-system-ffi \ |
al@19763 | 85 --with-ensurepip=yes \ |
al@19763 | 86 --enable-unicode=ucs4 \ |
al@19763 | 87 --build=$HOST_SYSTEM \ |
al@19763 | 88 --host=$HOST_SYSTEM && |
al@20885 | 89 make && |
al@20885 | 90 make DESTDIR=$DESTDIR install && |
al@19763 | 91 chmod -v 755 $install/usr/lib/libpython2.7.so.1.0 |
al@19582 | 92 ;; |
pankso@16290 | 93 esac |
al@20972 | 94 |
al@20972 | 95 # Upgrade pip unless it will throw noisy warnings on every pip-based package |
al@20972 | 96 pip install --upgrade --root=$install pip |
pankso@18 | 97 } |
pankso@18 | 98 |
al@20443 | 99 genpkg_rules() { |
al@19763 | 100 case $PACKAGE in |
al@19763 | 101 *-idle) |
al@19763 | 102 copy idle idlelib/ python-idle.desktop |
al@19763 | 103 CAT="development|GUI IDE using TK Toolkit" |
al@19763 | 104 DEPENDS="python-tcltk tcl tk" |
al@19763 | 105 ;; |
al@19763 | 106 *-tcltk) |
al@19763 | 107 copy _tkinter.so lib-tk/ |
al@19763 | 108 CAT="development|Tcl/Tk files" |
al@19763 | 109 DEPENDS="python tcl tk xorg-libX11" |
al@19763 | 110 ;; |
al@19763 | 111 python) |
al@20443 | 112 # Now pyconfig.h is required for Mercurial. |
al@20443 | 113 copy @std pyconfig.h @rm |
al@20443 | 114 DEPENDS="bzlib expat gdbm libffi libsqlite3 ncurses \ |
al@20443 | 115 ncurses-libpanel openssl readline zlib" |
al@19763 | 116 ;; |
al@19763 | 117 *-dev) |
al@20443 | 118 copy @dev @rm |
al@19763 | 119 ;; |
al@19763 | 120 esac |
pankso@18 | 121 } |