wok rev 25586

Add python3
author Stanislas Leduc <shann@slitaz.org>
date Sun Jun 04 12:36:08 2023 +0200 (11 months ago)
parents 0ce13f3a8b96
children d154d1f5c98a
files python3-dev/receipt python3/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/python3-dev/receipt	Sun Jun 04 12:36:08 2023 +0200
     1.3 @@ -0,0 +1,28 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKED_SIZE="164.0K"
     1.7 +UNPACKED_SIZE="1.0M"
     1.8 +PACKAGE="python3-dev"
     1.9 +VERSION="3.8.3"
    1.10 +CATEGORY="development"
    1.11 +SHORT_DESC="The Python programming language devel files."
    1.12 +MAINTAINER="shann@slitaz.org"
    1.13 +LICENSE="GPL"
    1.14 +WANTED="python3"
    1.15 +SOURCE="Python"
    1.16 +WEB_SITE="http://www.python.org/"
    1.17 +
    1.18 +DEPENDS="python3"
    1.19 +
    1.20 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.21 +genpkg_rules()
    1.22 +{
    1.23 +	mkdir -p $fs/usr/bin
    1.24 +	cp -a $install/usr/include $fs/usr
    1.25 +	cp -a $install/usr/bin/*-config $fs/usr/bin
    1.26 +	chmod 755 $fs/usr/bin/*-config
    1.27 +	# in python package now
    1.28 +	python_version=${VERSION:0:3}
    1.29 +	#rm $fs/usr/include/python${python_version}m/pyconfig.h
    1.30 +}
    1.31 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/python3/receipt	Sun Jun 04 12:36:08 2023 +0200
     2.3 @@ -0,0 +1,114 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="python3"
     2.7 +VERSION="3.8.3"
     2.8 +CATEGORY="development"
     2.9 +SHORT_DESC="The Python 3 programming language."
    2.10 +MAINTAINER="shann@slitaz.org"
    2.11 +LICENSE="GPL"
    2.12 +SOURCE="Python"
    2.13 +TARBALL="$SOURCE-$VERSION.tar.xz"
    2.14 +WEB_SITE="http://www.python.org/"
    2.15 +WGET_URL="https://www.python.org/ftp/python/$VERSION/$TARBALL"
    2.16 +
    2.17 +RELATED="python3-dev python3-idle" # version must match
    2.18 +DEPENDS="openssl bzlib readline sqlite zlib ncursesw gdbm libffi"
    2.19 +BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite-dev zlib-dev \
    2.20 +expat-dev liblzma-dev ncursesw-dev tcl-dev db-dev gdbm-dev libffi-dev"
    2.21 +
    2.22 +# Rules to configure and make the package.
    2.23 +compile_rules()
    2.24 +{
    2.25 +
    2.26 +	case "$ARCH" in
    2.27 +		arm*)
    2.28 +			# First pass for build host tools
    2.29 +			unset CFLAGS CXXFLAGS
    2.30 +			cp -f $CONFIG_SITE .
    2.31 +			CONFIG_SITE="$(pwd)/cook.site"
    2.32 +			cat >> $CONFIG_SITE << EOT
    2.33 +ac_cv_have_long_long_format=yes
    2.34 +EOT
    2.35 +			./configure CC=gcc \
    2.36 +				--disable-ipv6 \
    2.37 +				--build=i486-slitaz-linux \
    2.38 +				--host=${BUILD_SYSTEM} && 
    2.39 +			make python Parser/pgen &&
    2.40 +			mv python hostpython &&
    2.41 +			mv Parser/pgen Parser/hostpgen || exit 1
    2.42 +			make distclean
    2.43 +			rm -f $CONFIG_SITE
    2.44 +			# Second pass for host tools
    2.45 +			. /etc/slitaz/cook.conf
    2.46 +			#patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
    2.47 +			cp -f $CONFIG_SITE .
    2.48 +			CONFIG_SITE="$(pwd)/cook.site"
    2.49 +			cat >> $CONFIG_SITE << EOT
    2.50 +ac_cv_have_long_long_format=yes
    2.51 +ac_cv_buggy_getaddrinfo=no
    2.52 +ac_cv_file__dev_ptmx=yes
    2.53 +ac_cv_file__dev_ptc=no
    2.54 +EOT
    2.55 +			./configure CC=${HOST_SYSTEM}-gcc \
    2.56 +				--disable-ipv6 \
    2.57 +				--enable-shared \
    2.58 +				--with-system-ffi \
    2.59 +				${CONFIGURE_ARGS} &&
    2.60 +			make \
    2.61 +				PYTHON_FOR_BUILD=${src}/hostpython \
    2.62 +				HOSTPYTHON=${src}/hostpython \
    2.63 +				HOSTPGEN=${src}/Parser/hostpgen \
    2.64 +				CROSS_COMPILE_TARGET=yes \
    2.65 +				HOSTARCH=${HOST_SYSTEM} \
    2.66 +				BUILDARCH=${BUILD_SYSTEM} || exit 1
    2.67 +			make DESTDIR=$DESTDIR install || exit 1 ;;
    2.68 +		i?86|x86_64)
    2.69 +			CFLAGS+=" -fPIC"
    2.70 +			./configure \
    2.71 +				--enable-shared \
    2.72 +				--with-system-expat \
    2.73 +				--with-system-ffi \
    2.74 +				--without-ensurepip \
    2.75 +				--build=${HOST_SYSTEM} \
    2.76 +				--host=${HOST_SYSTEM} &&
    2.77 +				make &&	make DESTDIR=$DESTDIR install ;;
    2.78 +	esac
    2.79 +
    2.80 +#	chmod 755 $install/usr/lib/libpython${VERSION%.*}m.so
    2.81 +	chmod 755 $install/usr/lib/libpython${VERSION%%.*}.so
    2.82 +	find $install -type f -name "*.pyc" -delete
    2.83 +}
    2.84 +
    2.85 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.86 +genpkg_rules()
    2.87 +{
    2.88 +	python_version=${VERSION:0:3}
    2.89 +#	mkdir -p $fs/usr/include/python${python_version}m
    2.90 +        mkdir -p $fs/usr
    2.91 +        mkdir $fs/usr/bin && mkdir $fs/usr/lib
    2.92 +	cp -a $install/usr/bin/* $fs/usr/bin
    2.93 +	cp -a $install/usr/lib/* $fs/usr/lib
    2.94 +	# needed for mercurial to work now
    2.95 +#	cp -a $install/usr/include/python${python_version}m/pyconfig.h \
    2.96 +#		$fs/usr/include/python${python_version}m
    2.97 +	rm -f $fs/usr/bin/*-config
    2.98 +	# Split IDLE with TK dep
    2.99 +	rm -f $fs/usr/bin/idle*
   2.100 +	rm -rf $fs/usr/lib/python3.8/idlelib
   2.101 +}
   2.102 +
   2.103 +# Post install commands for Tazpkg.       
   2.104 +pre_install()  
   2.105 +{
   2.106 +        # Removed symlinks if python2 installed
   2.107 +        if [ -d ${1}${INSTALLED}/python2 ]; then                   
   2.108 +            rm -f /usr/bin/2to3
   2.109 +        fi
   2.110 +}
   2.111 +
   2.112 +post_remove()
   2.113 +{
   2.114 +        if [ -d ${1}${INSTALLED}/python2 ]; then         
   2.115 +            ln -s /usr/bin/2to3-2.7 /usr/bin/2to3
   2.116 +        fi
   2.117 +}