# HG changeset patch # User Stanislas Leduc # Date 1685874968 -7200 # Node ID 6a415673cf107a48db6463552ce3d2552e349f84 # Parent 0ce13f3a8b967660a9b4fa6166562324b299690a Add python3 diff -r 0ce13f3a8b96 -r 6a415673cf10 python3-dev/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python3-dev/receipt Sun Jun 04 12:36:08 2023 +0200 @@ -0,0 +1,28 @@ +# SliTaz package receipt. + +PACKED_SIZE="164.0K" +UNPACKED_SIZE="1.0M" +PACKAGE="python3-dev" +VERSION="3.8.3" +CATEGORY="development" +SHORT_DESC="The Python programming language devel files." +MAINTAINER="shann@slitaz.org" +LICENSE="GPL" +WANTED="python3" +SOURCE="Python" +WEB_SITE="http://www.python.org/" + +DEPENDS="python3" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + cp -a $install/usr/include $fs/usr + cp -a $install/usr/bin/*-config $fs/usr/bin + chmod 755 $fs/usr/bin/*-config + # in python package now + python_version=${VERSION:0:3} + #rm $fs/usr/include/python${python_version}m/pyconfig.h +} + diff -r 0ce13f3a8b96 -r 6a415673cf10 python3/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python3/receipt Sun Jun 04 12:36:08 2023 +0200 @@ -0,0 +1,114 @@ +# SliTaz package receipt. + +PACKAGE="python3" +VERSION="3.8.3" +CATEGORY="development" +SHORT_DESC="The Python 3 programming language." +MAINTAINER="shann@slitaz.org" +LICENSE="GPL" +SOURCE="Python" +TARBALL="$SOURCE-$VERSION.tar.xz" +WEB_SITE="http://www.python.org/" +WGET_URL="https://www.python.org/ftp/python/$VERSION/$TARBALL" + +RELATED="python3-dev python3-idle" # version must match +DEPENDS="openssl bzlib readline sqlite zlib ncursesw gdbm libffi" +BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite-dev zlib-dev \ +expat-dev liblzma-dev ncursesw-dev tcl-dev db-dev gdbm-dev libffi-dev" + +# Rules to configure and make the package. +compile_rules() +{ + + case "$ARCH" in + arm*) + # First pass for build host tools + unset CFLAGS CXXFLAGS + cp -f $CONFIG_SITE . + CONFIG_SITE="$(pwd)/cook.site" + cat >> $CONFIG_SITE << EOT +ac_cv_have_long_long_format=yes +EOT + ./configure CC=gcc \ + --disable-ipv6 \ + --build=i486-slitaz-linux \ + --host=${BUILD_SYSTEM} && + make python Parser/pgen && + mv python hostpython && + mv Parser/pgen Parser/hostpgen || exit 1 + make distclean + rm -f $CONFIG_SITE + # Second pass for host tools + . /etc/slitaz/cook.conf + #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1 + cp -f $CONFIG_SITE . + CONFIG_SITE="$(pwd)/cook.site" + cat >> $CONFIG_SITE << EOT +ac_cv_have_long_long_format=yes +ac_cv_buggy_getaddrinfo=no +ac_cv_file__dev_ptmx=yes +ac_cv_file__dev_ptc=no +EOT + ./configure CC=${HOST_SYSTEM}-gcc \ + --disable-ipv6 \ + --enable-shared \ + --with-system-ffi \ + ${CONFIGURE_ARGS} && + make \ + PYTHON_FOR_BUILD=${src}/hostpython \ + HOSTPYTHON=${src}/hostpython \ + HOSTPGEN=${src}/Parser/hostpgen \ + CROSS_COMPILE_TARGET=yes \ + HOSTARCH=${HOST_SYSTEM} \ + BUILDARCH=${BUILD_SYSTEM} || exit 1 + make DESTDIR=$DESTDIR install || exit 1 ;; + i?86|x86_64) + CFLAGS+=" -fPIC" + ./configure \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + --build=${HOST_SYSTEM} \ + --host=${HOST_SYSTEM} && + make && make DESTDIR=$DESTDIR install ;; + esac + +# chmod 755 $install/usr/lib/libpython${VERSION%.*}m.so + chmod 755 $install/usr/lib/libpython${VERSION%%.*}.so + find $install -type f -name "*.pyc" -delete +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + python_version=${VERSION:0:3} +# mkdir -p $fs/usr/include/python${python_version}m + mkdir -p $fs/usr + mkdir $fs/usr/bin && mkdir $fs/usr/lib + cp -a $install/usr/bin/* $fs/usr/bin + cp -a $install/usr/lib/* $fs/usr/lib + # needed for mercurial to work now +# cp -a $install/usr/include/python${python_version}m/pyconfig.h \ +# $fs/usr/include/python${python_version}m + rm -f $fs/usr/bin/*-config + # Split IDLE with TK dep + rm -f $fs/usr/bin/idle* + rm -rf $fs/usr/lib/python3.8/idlelib +} + +# Post install commands for Tazpkg. +pre_install() +{ + # Removed symlinks if python2 installed + if [ -d ${1}${INSTALLED}/python2 ]; then + rm -f /usr/bin/2to3 + fi +} + +post_remove() +{ + if [ -d ${1}${INSTALLED}/python2 ]; then + ln -s /usr/bin/2to3-2.7 /usr/bin/2to3 + fi +}