wok-next view python/receipt @ rev 20978

Small improvements
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Sep 27 01:34:11 2018 +0300 (2018-09-27)
parents 019246ad2f42
children f48456621a9d
line source
1 # SliTaz package receipt v2.
3 PACKAGE="python"
4 VERSION="2.7.15"
5 CATEGORY="development"
6 SHORT_DESC="The Python programming language"
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="PSL"
9 WEB_SITE="https://www.python.org/"
10 LFS="http://www.linuxfromscratch.org/blfs/view/stable/general/python2.html"
11 REPOLOGY="python2"
13 TARBALL="$PACKAGE-$VERSION.tar.xz"
14 WGET_URL="https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz"
16 BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite3-dev zlib-dev \
17 ncurses-dev tcl-dev tk-dev db-dev gdbm-dev libffi-dev expat-dev"
18 SPLIT="python-dev python-idle python-tcltk python"
19 COOKOPTS="!menus !zip"
21 compile_rules() {
22 # Temporary workaround for FS#22322
23 # See http://bugs.python.org/issue10835 for upstream report
24 sed -i.orig "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c
26 # Enable built-in SQLite3 module to load extensions (fix FS#22122)
27 sed -i.orig "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
29 case "$ARCH" in
30 arm*)
31 # First pass for build host tools
32 unset CFLAGS CXXFLAGS
33 cp -f $CONFIG_SITE .
34 CONFIG_SITE="$(pwd)/cook.site"
35 cat >> $CONFIG_SITE <<EOT
36 ac_cv_have_long_long_format=yes
37 EOT
38 ./configure CC=gcc \
39 --disable-ipv6 \
40 --build=i486-slitaz-linux \
41 --host=${BUILD_SYSTEM} &&
42 make python Parser/pgen &&
43 mv python hostpython &&
44 mv Parser/pgen Parser/hostpgen || exit 1
45 make distclean
46 rm -f $CONFIG_SITE
47 # Second pass for host tools
48 . /etc/slitaz/cook.conf
49 cp -f $CONFIG_SITE .
50 CONFIG_SITE="$(pwd)/cook.site"
51 cat >> $CONFIG_SITE <<EOT
52 ac_cv_have_long_long_format=yes
53 ac_cv_buggy_getaddrinfo=no
54 ac_cv_file__dev_ptmx=yes
55 ac_cv_file__dev_ptc=no
56 EOT
57 ./configure CC=${HOST_SYSTEM}-gcc \
58 --disable-ipv6 \
59 --enable-shared \
60 --with-system-ffi \
61 ${CONFIGURE_ARGS} &&
62 make \
63 PYTHON_FOR_BUILD=${src}/hostpython \
64 HOSTPYTHON=${src}/hostpython \
65 HOSTPGEN=${src}/Parser/hostpgen \
66 CROSS_COMPILE_TARGET=yes \
67 HOSTARCH=${HOST_SYSTEM} \
68 BUILDARCH=${BUILD_SYSTEM} || exit 1
69 make DESTDIR=$DESTDIR install || exit 1
70 ;;
71 i?86|x86_64)
72 ./configure \
73 --prefix=/usr \
74 --enable-shared \
75 --with-system-expat \
76 --with-system-ffi \
77 --without-ensurepip \
78 --enable-unicode=ucs4 \
79 $CONFIGURE_ARGS &&
80 make &&
81 make DESTDIR=$DESTDIR install &&
82 chmod -v 755 $install/usr/lib/libpython2.7.so.1.0
83 ;;
84 esac
86 find $install -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete
87 }
89 genpkg_rules() {
90 case $PACKAGE in
91 *-dev)
92 copy @dev test/ distutils/command/*.exe ensurepip/
93 find $fs -type f -name pyconfig.h -delete # move to python package
94 ;;
95 *-idle)
96 copy idle idlelib/ python-idle.desktop
97 CAT="development|GUI IDE using TK Toolkit"
98 DEPENDS="python-tcltk tcl tk"
99 ;;
100 *-tcltk)
101 copy _tkinter.so lib-tk/ @rm
102 CAT="development|Tcl/Tk files"
103 DEPENDS="python tcl tk xorg-libX11"
104 ;;
105 python)
106 # Now pyconfig.h is required for Mercurial.
107 copy @std @rm pyconfig.h
108 DEPENDS="python-setuptools python-pip \
109 bzlib expat gdbm libffi libsqlite3 ncurses \
110 ncurses-libpanel openssl readline zlib"
111 ;;
112 esac
113 }