wok view python/receipt @ rev 24476
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 18 09:29:30 2022 +0000 (2022-02-18) |
parents | 0e3b43ca38e6 |
children | 401ca84be53a |
line source
1 # SliTaz package receipt.
3 PACKAGE="python"
4 VERSION="2.7.17"
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/"
11 SOURCE="Python"
12 TARBALL="$SOURCE-$VERSION.tar.xz"
13 WGET_URL="https://www.python.org/ftp/python/$VERSION/$TARBALL"
15 RELATED="python-dev python-idle" # versions must match
16 DEPENDS="bzlib gdbm libffi ncursesw openssl readline sqlite zlib"
17 BUILD_DEPENDS="bzip2-dev db-dev gdbm-dev libffi-dev ncursesw-dev
18 openssl-dev readline-dev sqlite-dev tcl-dev tk-dev zlib-dev"
20 HOST_ARCH="i486 arm"
22 current_version()
23 {
24 wget -O - https://www.python.org/ftp/python/ 2>/dev/null | \
25 sed "/=\"${VERSION%.*}/!d;s|.*\">\\(.*\\)/<.*|\\1|" | sort -Vr | sed q
26 }
28 # @maintainer: Please update also: python-idle
30 # Rules to configure and make the package.
31 compile_rules()
32 {
33 # Temporary workaround for FS#22322
34 # See http://bugs.python.org/issue10835 for upstream report
35 sed -i "/progname =/s/python/python${_pybasever}/" \
36 Python/pythonrun.c
38 # Enable built-in SQLite3 module to load extensions (fix FS#22122)
39 sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" \
40 setup.py
42 case "$ARCH" in
43 arm*)
44 # First pass for build host tools
45 unset CFLAGS CXXFLAGS
46 cp -f $CONFIG_SITE .
47 CONFIG_SITE="$(pwd)/cook.site"
48 cat >> $CONFIG_SITE << EOT
49 ac_cv_have_long_long_format=yes
50 EOT
51 ./configure CC=gcc \
52 --disable-ipv6 \
53 --build=i486-slitaz-linux \
54 --host=${BUILD_SYSTEM} &&
55 make python Parser/pgen &&
56 mv python hostpython &&
57 mv Parser/pgen Parser/hostpgen || exit 1
58 make distclean
59 rm -f $CONFIG_SITE
61 # Second pass for host tools
62 . /etc/slitaz/cook.conf
63 #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
64 cp -f $CONFIG_SITE .
65 CONFIG_SITE="$(pwd)/cook.site"
66 cat >> $CONFIG_SITE << EOT
67 ac_cv_have_long_long_format=yes
68 ac_cv_buggy_getaddrinfo=no
69 ac_cv_file__dev_ptmx=yes
70 ac_cv_file__dev_ptc=no
71 EOT
73 ./configure CC=${HOST_SYSTEM}-gcc \
74 --disable-ipv6 \
75 --enable-shared \
76 --with-system-ffi \
77 ${CONFIGURE_ARGS} &&
78 make \
79 PYTHON_FOR_BUILD=${src}/hostpython \
80 HOSTPYTHON=${src}/hostpython \
81 HOSTPGEN=${src}/Parser/hostpgen \
82 CROSS_COMPILE_TARGET=yes \
83 HOSTARCH=${HOST_SYSTEM} \
84 BUILDARCH=${BUILD_SYSTEM} || exit 1
85 make DESTDIR=$DESTDIR install || exit 1 ;;
86 i?86)
87 ./configure \
88 --enable-shared \
89 --build=${HOST_SYSTEM} \
90 --host=${HOST_SYSTEM} &&
91 make &&
92 make DESTDIR=$DESTDIR install ;;
93 esac
94 }
96 # Rules to gen a SliTaz package suitable for Tazpkg.
97 genpkg_rules()
98 {
99 python_version=${VERSION:0:3}
100 mkdir -p $fs/usr/include/${PACKAGE}$python_version
102 cp -a $install/usr/bin $fs/usr
103 cp -a $install/usr/lib $fs/usr
105 # needed for mercurial to work now
106 cp -a $install/usr/include/${PACKAGE}$python_version/pyconfig.h \
107 $fs/usr/include/${PACKAGE}$python_version
108 rm -f $fs/usr/bin/*-config
110 # Split IDLE with TK dep
111 rm -f $fs/usr/bin/idle
112 rm -rf $fs/usr/lib/python2.7/idlelib
113 }