wok view python/receipt @ rev 25788

xgalaga: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Sep 26 08:52:14 2024 +0000 (2 months ago)
parents 3e9a9990c985
children
line source
1 # SliTaz package receipt.
3 PACKAGE="python"
4 VERSION="2.7.18"
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 # @maintainer: Please update also: python-idle
24 current_version()
25 {
26 wget -O - https://www.python.org/ftp/python/ 2>/dev/null | \
27 sed "/=\"${VERSION%.*}/!d;s|.*\">\\(.*\\)/<.*|\\1|" | sort -Vr | sed q
28 }
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 ;;
87 (i?86)
88 ./configure \
89 --enable-shared \
90 --build=${HOST_SYSTEM} \
91 --host=${HOST_SYSTEM} &&
92 make &&
93 make DESTDIR=$DESTDIR install
94 ;;
95 esac
96 }
98 # Rules to gen a SliTaz package suitable for Tazpkg.
99 genpkg_rules()
100 {
101 python_version=${VERSION%.*}
102 mkdir -p $fs/usr/include/${PACKAGE}$python_version
104 cook_copy_folders bin
105 cook_copy_folders lib
107 # needed for mercurial to work now
108 cp -a $install/usr/include/${PACKAGE}$python_version/pyconfig.h \
109 $fs/usr/include/${PACKAGE}$python_version
110 rm -f $fs/usr/bin/*-config
112 # Split IDLE with TK dep
113 rm -f $fs/usr/bin/idle
114 rm -rf $fs/usr/lib/python$python_version/idlelib
115 }