smlinux/base/python3/python3.SMBuild

54 lines
1.5 KiB
Text
Executable file

app=python3
version=3.9.14
build=1sml
homepage="https://www.python.org/"
download="https://www.python.org/ftp/python/$version/Python-$version.tar.xz"
desc="object-oriented interpreted programming language"
requires="libffi expat file openssl sqlite"
noautoconfsite=1
build() {
mkandenterbuilddir
rm -rf "Python-$version"
tar xf $srcdir/Python-$version.tar.?z*
cd "Python-$version"
fixbuilddirpermissions
applypatch $srcdir/musl-find_library.patch
sed -i "s|^#.* /usr/local/bin/python|#!/bin/python3|" Lib/cgi.py
find . -name "*.py" -exec \
sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/bin/env python3|" {} +
LDFLAGS="-lncursesw -lterminfo" \
./configure \
--prefix="/" \
--libdir="/lib" \
--with-system-expat \
--with-system-ffi \
--without-cxx-main \
--without-ensurepip \
--enable-shared
make $MAKEFLAGS
make install DESTDIR=$pkg
cp LICENSE $pkgdocs/
for test in sqlite3/test email/test ctypes/test test\
unittest/test tkinter/test \
bsddb/test json/tests lib2to3/tests\
distutils/tests tests ; do
rm -rf "$pkg"/lib/python3.9/"$test"
done
( cd $pkg/bin ; ln -s python3 python )
mkfinalpkg
}
sha512sums="
691a7814cf6c7bee96d8dbb7c5c85cb11f2e999101e20491b99435cdec07c3bbd5ce43ad3d9c64f695383b79197884caa1965c4346e4525e23b09c686271e4ab Python-3.9.14.tar.xz
9abb510f769fee9c212be728f71802cdd3346b65f052dcc820686feee53a51ad106e4f34e439c5d9dd5da7a00559b07ad0fee4815ebd16fbfb170ba228fc37f5 musl-find_library.patch
"