wok-current view python/receipt @ rev 25701

Fix dep for libglamoregl.so (libepoxy), and miss file for amdgpu (thanks alanyih)
author Stanislas Leduc <shann@slitaz.org>
date Fri Apr 19 12:48:51 2024 +0000 (2 months ago)
parents e53dd413c6de
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
41 # Enable SSL module
42 patch -p1 < $stuff/python_enablessl.patch
44 case "$ARCH" in
45 (arm*)
46 # First pass for build host tools
47 unset CFLAGS CXXFLAGS
48 cp -f $CONFIG_SITE .
49 CONFIG_SITE="$(pwd)/cook.site"
50 cat >> $CONFIG_SITE << EOT
51 ac_cv_have_long_long_format=yes
52 EOT
53 ./configure CC=gcc \
54 --disable-ipv6 \
55 --build=i486-slitaz-linux \
56 --host=${BUILD_SYSTEM} &&
57 make python Parser/pgen &&
58 mv python hostpython &&
59 mv Parser/pgen Parser/hostpgen || exit 1
60 make distclean
61 rm -f $CONFIG_SITE
63 # Second pass for host tools
64 . /etc/slitaz/cook.conf
65 #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
66 cp -f $CONFIG_SITE .
67 CONFIG_SITE="$(pwd)/cook.site"
68 cat >> $CONFIG_SITE << EOT
69 ac_cv_have_long_long_format=yes
70 ac_cv_buggy_getaddrinfo=no
71 ac_cv_file__dev_ptmx=yes
72 ac_cv_file__dev_ptc=no
73 EOT
75 ./configure CC=${HOST_SYSTEM}-gcc \
76 --disable-ipv6 \
77 --enable-shared \
78 --with-system-ffi \
79 ${CONFIGURE_ARGS} &&
80 make \
81 PYTHON_FOR_BUILD=${src}/hostpython \
82 HOSTPYTHON=${src}/hostpython \
83 HOSTPGEN=${src}/Parser/hostpgen \
84 CROSS_COMPILE_TARGET=yes \
85 HOSTARCH=${HOST_SYSTEM} \
86 BUILDARCH=${BUILD_SYSTEM} || exit 1
87 make DESTDIR=$DESTDIR install || exit 1
88 ;;
89 (i?86)
90 ./configure \
91 --enable-shared \
92 --build=${HOST_SYSTEM} \
93 --host=${HOST_SYSTEM} &&
94 make &&
95 make DESTDIR=$DESTDIR install
96 ;;
97 esac
98 }
100 # Rules to gen a SliTaz package suitable for Tazpkg.
101 genpkg_rules()
102 {
103 python_version=${VERSION%.*}
104 mkdir -p $fs/usr/include/${PACKAGE}$python_version
106 cook_copy_folders bin
107 cook_copy_folders lib
109 # needed for mercurial to work now
110 cp -a $install/usr/include/${PACKAGE}$python_version/pyconfig.h \
111 $fs/usr/include/${PACKAGE}$python_version
112 rm -f $fs/usr/bin/*-config
114 # Split IDLE with TK dep
115 rm -f $fs/usr/bin/idle
116 rm -rf $fs/usr/lib/python$python_version/idlelib
117 }