Files
haikuports/dev-lang/python/python3.8-3.8.18.recipe
OscarL c58157dc95 python3.8: update to version 3.8.18 (#9280)
* python3.8: update to version 3.8.18

* python3.8: recipe improvements "backported" from newer versions.
2023-08-25 09:54:04 +03:00

165 lines
4.8 KiB
Bash

SUMMARY="An interpreted, interactive, object-oriented programming language"
DESCRIPTION="Python is a programming language that lets you work more quickly \
and integrate your systems more effectively. You can learn to use Python and \
see almost immediate gains in productivity and lower maintenance costs.
Python runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java \
and .NET virtual machines.
Python is free to use, even for commercial products, because of its \
OSI-approved open source license."
HOMEPAGE="https://www.python.org"
LICENSE="Python"
COPYRIGHT="1990-2023 Python Software Foundation"
REVISION="1"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
CHECKSUM_SHA256="3ffb71cd349a326ba7b2fadc7e7df86ba577dd9c4917e52a8401adbda7405e3f"
SOURCE_DIR="Python-$portVersion"
PATCHES="python3.8-$portVersion.patchset"
if [ "$secondaryArchSuffix" = _x86 ] ; then
PATCHES+="
python3.8_x86-$portVersion.patchset
"
fi
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
python3.8$secondaryArchSuffix = $portVersion compat >= 3.8
cmd:2to3_3.8 = $portVersion compat >= 3.8
cmd:idle3.8 = $portVersion compat >= 3.8
cmd:pydoc3.8 = $portVersion compat >= 3.8
cmd:python3.8 = $portVersion compat >= 3.8
cmd:python3.8_config = $portVersion compat >= 3.8
cmd:pyvenv_3.8 = $portVersion compat >= 3.8
devel:libpython3.8$secondaryArchSuffix = 1.0
lib:libpython3.8$secondaryArchSuffix = 1.0
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:file
lib:libbz2$secondaryArchSuffix
lib:libedit$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libffi$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:liblzma$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
REPLACES="
python38$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libbz2$secondaryArchSuffix
devel:libedit$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
devel:libffi$secondaryArchSuffix
devel:liblzma$secondaryArchSuffix
devel:libncurses$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libtclstub8.6$secondaryArchSuffix
devel:libtk8.6$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
autoconf_archive
cmd:aclocal
cmd:autoconf
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
GLOBAL_WRITABLE_FILES="
non-packaged/lib/python3.8/site-packages directory keep-old
"
BUILD()
{
rm -Rf Modules/expat
autoreconf -fi
# From ./configure:
# "compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
# for debug/optimization stuff. BASECFLAGS is for flags that are required
# just to get things to compile and link."
export BASECFLAGS="-D_BSD_SOURCE"
# Not exporting OPT ends up with "-g -fwrapv -O3 -Wall" being used,
# and using OPT="" means the build ends up being "-O0".
export OPT="-fwrapv -O3 -Wall"
runConfigure --omit-dirs binDir,includeDir ./configure \
--bindir=$commandBinDir \
--includedir=$developDir/headers \
--enable-optimizations \
--enable-shared \
--with-ensurepip=no \
--with-system-expat \
--with-system-ffi
# prevent make from rebuilding stuff that requires python
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
rm -f python
make $jobArgs
}
INSTALL()
{
# altinstall avoids clobbering $prefix/bin/{2to3,idle3,pydoc3,python3,python3-config}
make altinstall
rm $libDir/libpython3.so
if [ "$targetArchitecture" = x86_gcc2 ]; then
# On x86_gcc2, move lib-dynload to lib/python3.x/
mv $libDir/python3.8/lib-dynload $prefix/lib/python3.8/
fi
prepareInstalledDevelLibs libpython3.8
fixPkgconfig
if [ "$targetArchitecture" = x86_gcc2 ]; then
# fix pkgconfig to match configure flags
sed -i -e 's,headers/x86,headers,' $developLibDir/pkgconfig/python*.pc
fi
mkdir -p $prefix/lib/python3.8/vendor-packages
echo 'This directory contains packaged python modules.' \
>$prefix/lib/python3.8/vendor-packages/README
mkdir -p $prefix/non-packaged/lib/python3.8
mv $prefix/lib/python3.8/site-packages $prefix/non-packaged/lib/python3.8/
# drop testsuite altogether; move to a separate package if needed
cd $prefix/lib/python3.8
rm -rf ctypes/test distutils/tests idlelib/idle_test lib2to3/tests \
sqlite3/test test tkinter/test unittest/test
}
TEST()
{
cd Lib/test
rm -f test_asynchat.py # this one stalls, so skip it for now
rm -f test_multiprocessing.py # this one stalls, so skip it for now
cd ../..
make $jobArgs test
}