wok-current view python3/receipt @ rev 25786

Bump gvfs to fix issue with open files on android device, patch udev to fix mtp issue on pcmanfm
author Stanislas Leduc <shann@slitaz.org>
date Tue Jul 29 18:05:13 2025 +0000 (2 months ago)
parents 5926178cd6fa
children
line source
1 # SliTaz package receipt.
3 PACKAGE="python3"
4 VERSION="3.9.22"
5 CATEGORY="development"
6 SHORT_DESC="The Python 3 programming language."
7 MAINTAINER="shann@slitaz.org"
8 LICENSE="GPL"
9 SOURCE="Python"
10 TARBALL="$SOURCE-$VERSION.tar.xz"
11 WEB_SITE="https://www.python.org/"
12 WGET_URL="https://www.python.org/ftp/python/$VERSION/$TARBALL"
13 HOST_ARCH="i486 x86_64"
15 RELATED="python3-dev python3-idle" # version must match
16 DEPENDS="openssl bzlib readline sqlite zlib ncursesw gdbm libffi"
17 BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite-dev zlib-dev \
18 expat-dev liblzma-dev ncursesw-dev tcl-dev db-dev gdbm-dev libffi-dev"
20 # What is the latest version available today?
21 current_version()
22 {
23 wget -O - https://www.python.org/downloads/ 2>/dev/null | \
24 sed '/Download Python [0-9]/!d;s|.*Python ||;s|<.*||;q'
25 }
27 # Rules to configure and make the package.
28 compile_rules()
29 {
31 case "$ARCH" in
32 arm*)
33 # First pass for build host tools
34 unset CFLAGS CXXFLAGS
35 cp -f $CONFIG_SITE .
36 CONFIG_SITE="$(pwd)/cook.site"
37 cat >> $CONFIG_SITE << EOT
38 ac_cv_have_long_long_format=yes
39 EOT
40 ./configure CC=gcc \
41 --disable-ipv6 \
42 --build=i486-slitaz-linux \
43 --host=${BUILD_SYSTEM} &&
44 make python Parser/pgen &&
45 mv python hostpython &&
46 mv Parser/pgen Parser/hostpgen || exit 1
47 make distclean
48 rm -f $CONFIG_SITE
49 # Second pass for host tools
50 . /etc/slitaz/cook.conf
51 #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
52 cp -f $CONFIG_SITE .
53 CONFIG_SITE="$(pwd)/cook.site"
54 cat >> $CONFIG_SITE << EOT
55 ac_cv_have_long_long_format=yes
56 ac_cv_buggy_getaddrinfo=no
57 ac_cv_file__dev_ptmx=yes
58 ac_cv_file__dev_ptc=no
59 EOT
60 ./configure CC=${HOST_SYSTEM}-gcc \
61 --disable-ipv6 \
62 --enable-shared \
63 --with-system-ffi \
64 ${CONFIGURE_ARGS} &&
65 make \
66 PYTHON_FOR_BUILD=${src}/hostpython \
67 HOSTPYTHON=${src}/hostpython \
68 HOSTPGEN=${src}/Parser/hostpgen \
69 CROSS_COMPILE_TARGET=yes \
70 HOSTARCH=${HOST_SYSTEM} \
71 BUILDARCH=${BUILD_SYSTEM} || exit 1
72 make DESTDIR=$DESTDIR install || exit 1 ;;
73 i?86|x86_64)
74 CFLAGS="$CFLAGS -fPIC"
75 ./configure \
76 --enable-shared \
77 --with-system-expat \
78 --with-system-ffi \
79 --without-ensurepip \
80 --build=${HOST_SYSTEM} \
81 --host=${HOST_SYSTEM} &&
82 make && make DESTDIR=$DESTDIR install ;;
83 esac
85 # chmod 755 $install/usr/lib/libpython${VERSION%.*}m.so
86 chmod 755 $install/usr/lib/libpython${VERSION%%.*}.so
87 find $install -type f -name "*.pyc" -delete
88 }
90 # Rules to gen a SliTaz package suitable for Tazpkg.
91 genpkg_rules()
92 {
93 python_version=${VERSION:0:3}
94 # mkdir -p $fs/usr/include/python${python_version}m
95 mkdir -p $fs/usr
96 mkdir $fs/usr/bin && mkdir $fs/usr/lib
97 cp -a $install/usr/bin/* $fs/usr/bin
98 cp -a $install/usr/lib/* $fs/usr/lib
100 # Ensure we don't have pyc file
101 find $fs/usr/lib -name "*.pyc" -delete
103 # needed for mercurial to work now
104 # cp -a $install/usr/include/python${python_version}m/pyconfig.h \
105 # $fs/usr/include/python${python_version}m
106 rm -f $fs/usr/bin/*-config
107 # Split IDLE with TK dep
108 rm -f $fs/usr/bin/idle*
109 rm -rf $fs/usr/lib/python3.9/idlelib
110 }
112 # Post install commands for Tazpkg.
113 pre_install()
114 {
115 # Removed symlinks if python2 installed
116 if [ -d ${1}${INSTALLED}/python2 ]; then
117 rm -f /usr/bin/2to3
118 fi
119 }
121 post_remove()
122 {
123 if [ -d ${1}${INSTALLED}/python2 ]; then
124 ln -s /usr/bin/2to3-2.7 /usr/bin/2to3
125 fi
126 }