mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 21:30:08 +02:00
x86_64 is used as a baseline: the "x86_64" entry, whatever status it has, is transformed into "all", and then the other entries in ARCHITECTURES either dropped or rearranged appropriately.
155 lines
4.6 KiB
Bash
155 lines
4.6 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-2018 Python Software Foundation"
|
|
REVISION="5"
|
|
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
|
|
CHECKSUM_SHA256="f8d82e7572c86ec9d55c8627aae5040124fd2203af400c383c821b980306ee6b"
|
|
SOURCE_DIR="Python-$portVersion"
|
|
PATCHES="python3-$portVersion.patchset"
|
|
if [ "$secondaryArchSuffix" = _x86 ] ; then
|
|
PATCHES+="
|
|
python3_x86-$portVersion.patchset
|
|
"
|
|
fi
|
|
|
|
ARCHITECTURES="all !x86_gcc2"
|
|
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$secondaryArchSuffix = $portVersion compat >= 3.7
|
|
cmd:2to3 = $portVersion compat >= 3.7
|
|
cmd:2to3_3.7 = $portVersion compat >= 3.7
|
|
cmd:idle = $portVersion compat >= 3.7
|
|
cmd:idle3 = $portVersion compat >= 3.7
|
|
cmd:idle3.7 = $portVersion compat >= 3.7
|
|
cmd:pydoc3 = $portVersion compat >= 3.7
|
|
cmd:pydoc3.7 = $portVersion compat >= 3.7
|
|
cmd:python3 = $portVersion compat >= 3.7
|
|
cmd:python3_config = $portVersion compat >= 3.7
|
|
cmd:python3.7 = $portVersion compat >= 3.7
|
|
cmd:python3.7_config = $portVersion compat >= 3.7
|
|
cmd:python3.7m = $portVersion compat >= 3.7
|
|
cmd:python3.7m_config = $portVersion compat >= 3.7
|
|
cmd:pyvenv = $portVersion compat >= 3.7
|
|
cmd:pyvenv_3.7 = $portVersion compat >= 3.7
|
|
devel:libpython3.7m$secondaryArchSuffix = 1.0
|
|
lib:libpython3.7m$secondaryArchSuffix = 1.0
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
cmd:file
|
|
lib:libbz2$secondaryArchSuffix
|
|
lib:libexpat$secondaryArchSuffix
|
|
lib:libffi$secondaryArchSuffix
|
|
lib:libintl$secondaryArchSuffix
|
|
lib:liblzma$secondaryArchSuffix
|
|
lib:libncurses$secondaryArchSuffix
|
|
lib:libssl$secondaryArchSuffix
|
|
lib:libedit$secondaryArchSuffix
|
|
lib:libsqlite3$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_REQUIRES="
|
|
devel:libbz2$secondaryArchSuffix
|
|
devel:libexpat$secondaryArchSuffix
|
|
devel:libffi$secondaryArchSuffix
|
|
devel:liblzma$secondaryArchSuffix
|
|
devel:libncurses$secondaryArchSuffix
|
|
devel:libssl$secondaryArchSuffix
|
|
devel:libedit$secondaryArchSuffix
|
|
devel:libsqlite3$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
cmd:aclocal
|
|
cmd:autoconf
|
|
cmd:find
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:libtoolize
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
cmd:make
|
|
"
|
|
|
|
GLOBAL_WRITABLE_FILES="
|
|
non-packaged/lib/python3.7/site-packages directory keep-old
|
|
"
|
|
|
|
BUILD()
|
|
{
|
|
export CFLAGS="-D_BSD_SOURCE"
|
|
rm -Rf Modules/expat
|
|
|
|
libtoolize --force --copy --install
|
|
aclocal
|
|
autoconf
|
|
export OPT=""
|
|
runConfigure --omit-dirs binDir,includeDir ./configure \
|
|
--enable-shared --without-ensurepip --with-system-ffi \
|
|
--with-system-expat --bindir=$commandBinDir --includedir=$developDir/headers
|
|
|
|
# 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()
|
|
{
|
|
make install
|
|
|
|
rm $libDir/libpython3.so
|
|
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
# On x86_gcc2, move lib-dynload to lib/python3.x/
|
|
mv $libDir/python3.7/lib-dynload $prefix/lib/python3.7/
|
|
fi
|
|
prepareInstalledDevelLibs libpython3.7m
|
|
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.7/vendor-packages
|
|
echo 'This directory contains packaged python modules.' \
|
|
>$prefix/lib/python3.7/vendor-packages/README
|
|
|
|
mkdir -p $prefix/non-packaged/lib/python3.7
|
|
mv $prefix/lib/python3.7/site-packages $prefix/non-packaged/lib/python3.7/
|
|
|
|
# drop testsuite altogether; move to a separate package if needed
|
|
cd $prefix/lib/python3.7
|
|
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
|
|
}
|