wok view python3/receipt @ rev 25586

Add python3
author Stanislas Leduc <shann@slitaz.org>
date Sun Jun 04 12:36:08 2023 +0200 (11 months ago)
parents
children d154d1f5c98a
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="http://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 # Rules to configure and make the package.
20 compile_rules()
21 {
23 case "$ARCH" in
24 arm*)
25 # First pass for build host tools
26 unset CFLAGS CXXFLAGS
27 cp -f $CONFIG_SITE .
28 CONFIG_SITE="$(pwd)/cook.site"
29 cat >> $CONFIG_SITE << EOT
30 ac_cv_have_long_long_format=yes
31 EOT
32 ./configure CC=gcc \
33 --disable-ipv6 \
34 --build=i486-slitaz-linux \
35 --host=${BUILD_SYSTEM} &&
36 make python Parser/pgen &&
37 mv python hostpython &&
38 mv Parser/pgen Parser/hostpgen || exit 1
39 make distclean
40 rm -f $CONFIG_SITE
41 # Second pass for host tools
42 . /etc/slitaz/cook.conf
43 #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
44 cp -f $CONFIG_SITE .
45 CONFIG_SITE="$(pwd)/cook.site"
46 cat >> $CONFIG_SITE << EOT
47 ac_cv_have_long_long_format=yes
48 ac_cv_buggy_getaddrinfo=no
49 ac_cv_file__dev_ptmx=yes
50 ac_cv_file__dev_ptc=no
51 EOT
52 ./configure CC=${HOST_SYSTEM}-gcc \
53 --disable-ipv6 \
54 --enable-shared \
55 --with-system-ffi \
56 ${CONFIGURE_ARGS} &&
57 make \
58 PYTHON_FOR_BUILD=${src}/hostpython \
59 HOSTPYTHON=${src}/hostpython \
60 HOSTPGEN=${src}/Parser/hostpgen \
61 CROSS_COMPILE_TARGET=yes \
62 HOSTARCH=${HOST_SYSTEM} \
63 BUILDARCH=${BUILD_SYSTEM} || exit 1
64 make DESTDIR=$DESTDIR install || exit 1 ;;
65 i?86|x86_64)
66 CFLAGS+=" -fPIC"
67 ./configure \
68 --enable-shared \
69 --with-system-expat \
70 --with-system-ffi \
71 --without-ensurepip \
72 --build=${HOST_SYSTEM} \
73 --host=${HOST_SYSTEM} &&
74 make && make DESTDIR=$DESTDIR install ;;
75 esac
77 # chmod 755 $install/usr/lib/libpython${VERSION%.*}m.so
78 chmod 755 $install/usr/lib/libpython${VERSION%%.*}.so
79 find $install -type f -name "*.pyc" -delete
80 }
82 # Rules to gen a SliTaz package suitable for Tazpkg.
83 genpkg_rules()
84 {
85 python_version=${VERSION:0:3}
86 # mkdir -p $fs/usr/include/python${python_version}m
87 mkdir -p $fs/usr
88 mkdir $fs/usr/bin && mkdir $fs/usr/lib
89 cp -a $install/usr/bin/* $fs/usr/bin
90 cp -a $install/usr/lib/* $fs/usr/lib
91 # needed for mercurial to work now
92 # cp -a $install/usr/include/python${python_version}m/pyconfig.h \
93 # $fs/usr/include/python${python_version}m
94 rm -f $fs/usr/bin/*-config
95 # Split IDLE with TK dep
96 rm -f $fs/usr/bin/idle*
97 rm -rf $fs/usr/lib/python3.8/idlelib
98 }
100 # Post install commands for Tazpkg.
101 pre_install()
102 {
103 # Removed symlinks if python2 installed
104 if [ -d ${1}${INSTALLED}/python2 ]; then
105 rm -f /usr/bin/2to3
106 fi
107 }
109 post_remove()
110 {
111 if [ -d ${1}${INSTALLED}/python2 ]; then
112 ln -s /usr/bin/2to3-2.7 /usr/bin/2to3
113 fi
114 }