wok view python3/receipt @ rev 25587
Update some web_site / wget_url
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jun 06 11:04:30 2023 +0000 (18 months ago) |
parents | 6a415673cf10 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="python3"
4 VERSION="3.8.3"
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"
14 RELATED="python3-dev python3-idle" # version must match
15 DEPENDS="openssl bzlib readline sqlite zlib ncursesw gdbm libffi"
16 BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite-dev zlib-dev \
17 expat-dev liblzma-dev ncursesw-dev tcl-dev db-dev gdbm-dev libffi-dev"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://www.python.org/downloads/ 2>/dev/null | \
23 sed '/Download Python [0-9]/!d;s|.*Python ||;s|<.*||;q'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
30 case "$ARCH" in
31 arm*)
32 # First pass for build host tools
33 unset CFLAGS CXXFLAGS
34 cp -f $CONFIG_SITE .
35 CONFIG_SITE="$(pwd)/cook.site"
36 cat >> $CONFIG_SITE << EOT
37 ac_cv_have_long_long_format=yes
38 EOT
39 ./configure CC=gcc \
40 --disable-ipv6 \
41 --build=i486-slitaz-linux \
42 --host=${BUILD_SYSTEM} &&
43 make python Parser/pgen &&
44 mv python hostpython &&
45 mv Parser/pgen Parser/hostpgen || exit 1
46 make distclean
47 rm -f $CONFIG_SITE
48 # Second pass for host tools
49 . /etc/slitaz/cook.conf
50 #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
51 cp -f $CONFIG_SITE .
52 CONFIG_SITE="$(pwd)/cook.site"
53 cat >> $CONFIG_SITE << EOT
54 ac_cv_have_long_long_format=yes
55 ac_cv_buggy_getaddrinfo=no
56 ac_cv_file__dev_ptmx=yes
57 ac_cv_file__dev_ptc=no
58 EOT
59 ./configure CC=${HOST_SYSTEM}-gcc \
60 --disable-ipv6 \
61 --enable-shared \
62 --with-system-ffi \
63 ${CONFIGURE_ARGS} &&
64 make \
65 PYTHON_FOR_BUILD=${src}/hostpython \
66 HOSTPYTHON=${src}/hostpython \
67 HOSTPGEN=${src}/Parser/hostpgen \
68 CROSS_COMPILE_TARGET=yes \
69 HOSTARCH=${HOST_SYSTEM} \
70 BUILDARCH=${BUILD_SYSTEM} || exit 1
71 make DESTDIR=$DESTDIR install || exit 1 ;;
72 i?86|x86_64)
73 CFLAGS+=" -fPIC"
74 ./configure \
75 --enable-shared \
76 --with-system-expat \
77 --with-system-ffi \
78 --without-ensurepip \
79 --build=${HOST_SYSTEM} \
80 --host=${HOST_SYSTEM} &&
81 make && make DESTDIR=$DESTDIR install ;;
82 esac
84 # chmod 755 $install/usr/lib/libpython${VERSION%.*}m.so
85 chmod 755 $install/usr/lib/libpython${VERSION%%.*}.so
86 find $install -type f -name "*.pyc" -delete
87 }
89 # Rules to gen a SliTaz package suitable for Tazpkg.
90 genpkg_rules()
91 {
92 python_version=${VERSION:0:3}
93 # mkdir -p $fs/usr/include/python${python_version}m
94 mkdir -p $fs/usr
95 mkdir $fs/usr/bin && mkdir $fs/usr/lib
96 cp -a $install/usr/bin/* $fs/usr/bin
97 cp -a $install/usr/lib/* $fs/usr/lib
98 # needed for mercurial to work now
99 # cp -a $install/usr/include/python${python_version}m/pyconfig.h \
100 # $fs/usr/include/python${python_version}m
101 rm -f $fs/usr/bin/*-config
102 # Split IDLE with TK dep
103 rm -f $fs/usr/bin/idle*
104 rm -rf $fs/usr/lib/python3.8/idlelib
105 }
107 # Post install commands for Tazpkg.
108 pre_install()
109 {
110 # Removed symlinks if python2 installed
111 if [ -d ${1}${INSTALLED}/python2 ]; then
112 rm -f /usr/bin/2to3
113 fi
114 }
116 post_remove()
117 {
118 if [ -d ${1}${INSTALLED}/python2 ]; then
119 ln -s /usr/bin/2to3-2.7 /usr/bin/2to3
120 fi
121 }