From a35196a5e4c0d9d61cfb8935f75c0abe3c690078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 26 Jan 2023 01:10:13 +0000 Subject: [PATCH] Build python 3.11 statically. --- sysa/SHA256SUMS.pkgs | 2 +- sysc/python-3.11.1/files/Setup.local | 179 +++++++++++++++++++++++++++ sysc/python-3.11.1/python-3.11.1.sh | 9 +- 3 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 sysc/python-3.11.1/files/Setup.local diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs index 5f1d714..c0378d5 100644 --- a/sysa/SHA256SUMS.pkgs +++ b/sysa/SHA256SUMS.pkgs @@ -101,7 +101,7 @@ faa100ea90445983531e90e5e570ad4f559aca4165cfee6caa0ab9036a065bfb python-3.1.5_1 f297082aeecba9e539c4ea22ac0d10e9b73950d54f4f5d394e7227ea960a577c python-3.3.7_0.tar.bz2 d9c26b6764735a21dc9cea68044e3f5f386ac70712a735ff8f497169e16e713f python-3.4.10_0.tar.bz2 68c701e8a33413843b19aba94da4c3f45618f86787ea9ccac608092b3bb0cb32 python-3.8.16_0.tar.bz2 -bcc0ba8f0dfec71daf523b65e1d8d587f2446b43ed0b7bb355df877b988d68ba python-3.11.1_0.tar.bz2 +e4baae4350c5ccc54717e77c10a3a2ee9cc6c626bd4d3751c0b5cacf0a9cace0 python-3.11.1_0.tar.bz2 8a0248fbf8fe1764580698415cc3628585d4dd054ddf63040f400e18cbaef7a4 sed-4.0.9_0.tar.bz2 177553732a080e25ba5778525743543e9da012122f4ad0d314a425ca87a3c2bd sed-4.8_0.tar.bz2 f3be04bb46c9ac80180defa46c274214ab00b5b4dd9c8a3a6de162e43ef0fa20 tar-1.34_0.tar.bz2 diff --git a/sysc/python-3.11.1/files/Setup.local b/sysc/python-3.11.1/files/Setup.local new file mode 100644 index 0000000..0349ee3 --- /dev/null +++ b/sysc/python-3.11.1/files/Setup.local @@ -0,0 +1,179 @@ +# SPDX-FileCopyrightText: 2023 Andrius Štikonas +# SPDX-License-Identifier: PSF-2.0 + +# Based on Modules/Setup file + +*static* + +# Modules that should always be present (POSIX and Windows): + +_asyncio _asynciomodule.c +_bisect _bisectmodule.c +_contextvars _contextvarsmodule.c +_csv _csv.c +_datetime _datetimemodule.c +_decimal _decimal/_decimal.c +_heapq _heapqmodule.c +_json _json.c +_lsprof _lsprof.c rotatingtree.c +_multiprocessing -I$(srcdir)/Modules/_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c +_opcode _opcode.c +_pickle _pickle.c +_queue _queuemodule.c +_random _randommodule.c +_socket socketmodule.c +_statistics _statisticsmodule.c +_struct _struct.c +_typing _typingmodule.c +_zoneinfo _zoneinfo.c +array arraymodule.c +audioop audioop.c +binascii binascii.c +cmath cmathmodule.c +math mathmodule.c +mmap mmapmodule.c +select selectmodule.c + +# XML +_elementtree _elementtree.c +pyexpat pyexpat.c + +# hashing builtins +_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c +_md5 md5module.c +_sha1 sha1module.c +_sha256 sha256module.c +_sha512 sha512module.c +_sha3 _sha3/sha3module.c + +# text encodings and unicode +_codecs_cn cjkcodecs/_codecs_cn.c +_codecs_hk cjkcodecs/_codecs_hk.c +_codecs_iso2022 cjkcodecs/_codecs_iso2022.c +_codecs_jp cjkcodecs/_codecs_jp.c +_codecs_kr cjkcodecs/_codecs_kr.c +_codecs_tw cjkcodecs/_codecs_tw.c +_multibytecodec cjkcodecs/multibytecodec.c +unicodedata unicodedata.c + +# Modules with some UNIX dependencies + +_posixsubprocess _posixsubprocess.c +_posixshmem -I$(srcdir)/Modules/_multiprocessing _multiprocessing/posixshmem.c -lrt +fcntl fcntlmodule.c +grp grpmodule.c +ossaudiodev ossaudiodev.c +resource resource.c +spwd spwdmodule.c +syslog syslogmodule.c +termios termios.c + +# Modules with UNIX dependencies that require external libraries + +#_crypt _cryptmodule.c -lcrypt +#nis nismodule.c -I/usr/include/tirpc -lnsl -ltirpc + +# Modules that require external libraries. + +#_bz2 _bz2module.c -lbz2 +#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -ldl -lffi -DHAVE_FFI_PREP_CIF_VAR -DHAVE_FFI_PREP_CLOSURE_LOC -DHAVE_FFI_CLOSURE_ALLOC +# The _dbm module supports NDBM, GDBM with compat module, and Berkeley DB. +#_dbm _dbmmodule.c -lgdbm_compat -DUSE_GDBM_COMPAT +#_gdbm _gdbmmodule.c -lgdbm +_lzma _lzmamodule.c -llzma +#_uuid _uuidmodule.c -luuid +zlib zlibmodule.c -lz + +# The readline module also supports libeditline (-leditline). +# Some systems may require -ltermcap or -ltermlib. +#readline readline.c -lreadline -ltermcap + +# OpenSSL bindings +#_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS) +#_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) -lcrypto + +# To statically link OpenSSL: +_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \ + -l:libssl.a -Wl,--exclude-libs,libssl.a \ + -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a +_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \ + -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a + +# The _tkinter module. +# +# The command for _tkinter is long and site specific. Please +# uncomment and/or edit those parts as indicated. If you don't have a +# specific extension (e.g. Tix or BLT), leave the corresponding line +# commented out. (Leave the trailing backslashes in! If you +# experience strange errors, you may want to join all uncommented +# lines and remove the backslashes -- the backslash interpretation is +# done by the shell's "read" command and it may not be implemented on +# every system. + +# *** Always uncomment this (leave the leading underscore in!): +#_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT $(TCLTK_INCLUDES) $(TCLTK_LIBS) \ +# *** Uncomment and edit to reflect where your Tcl/Tk libraries are: +# -L/usr/local/lib \ +# *** Uncomment and edit to reflect where your Tcl/Tk headers are: +# -I/usr/local/include \ +# *** Uncomment and edit to reflect where your X11 header files are: +# -I/usr/X11R6/include \ +# *** Or uncomment this for Solaris: +# -I/usr/openwin/include \ +# *** Uncomment and edit for Tix extension only: +# -DWITH_TIX -ltix8.1.8.2 \ +# *** Uncomment and edit for BLT extension only: +# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ +# *** Uncomment and edit for PIL (TkImaging) extension only: +# (See http://www.pythonware.com/products/pil/ for more info) +# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ +# *** Uncomment and edit for TOGL extension only: +# -DWITH_TOGL togl.c \ +# *** Uncomment and edit to reflect where your X11 libraries are: +# -L/usr/X11R6/lib \ +# *** Or uncomment this for Solaris: +# -L/usr/openwin/lib \ +# *** Uncomment these for TOGL extension only: +# -lGL -lGLU -lXext -lXmu \ +# *** Uncomment for AIX: +# -lld \ +# *** Always uncomment this; X11 libraries to link with: +# -lX11 + +# Some system have -lcurses +#_curses -lncurses -lncursesw -ltermcap _cursesmodule.c +#_curses_panel -lpanel -lncurses _curses_panel.c + +# macOS specific module, needs SystemConfiguration and CoreFoundation framework +# _scproxy _scproxy.c + +# Examples + +#xx xxmodule.c +#xxlimited xxlimited.c +#xxlimited_35 xxlimited_35.c +xxsubtype xxsubtype.c # Required for the test suite to pass! + +# Testing + +#_xxsubinterpreters _xxsubinterpretersmodule.c +#_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c +#_testbuffer _testbuffer.c +#_testinternalcapi _testinternalcapi.c + +# Some testing modules MUST be built as shared libraries. + +#*shared* +#_ctypes_test _ctypes/_ctypes_test.c +#_testcapi _testcapimodule.c +#_testimportmultiple _testimportmultiple.c +#_testmultiphase _testmultiphase.c + +# --- +# Uncommenting the following line tells makesetup that all following modules +# are not built (see above for more detail). +# +#*disabled* +# +# _sqlite3 _tkinter _curses pyexpat +# _codecs_jp _codecs_kr _codecs_tw unicodedata diff --git a/sysc/python-3.11.1/python-3.11.1.sh b/sysc/python-3.11.1/python-3.11.1.sh index 649b83c..f3ec2ec 100755 --- a/sysc/python-3.11.1/python-3.11.1.sh +++ b/sysc/python-3.11.1/python-3.11.1.sh @@ -12,6 +12,8 @@ src_prepare() { # Regenerate ssl_data for ssl module rm Modules/_ssl_data_300.h Modules/_ssl_data.h python Tools/ssl/make_ssl_data.py ../openssl-1.1.1l Modules/_ssl_data_111.h + sed -i 's#$(srcdir)/Modules/_ssl_data.h ##' Makefile.pre.in + sed -i 's#$(srcdir)/Modules/_ssl_data_300.h ##' Makefile.pre.in # Regenerate encodings grep generated -r . -l | grep encodings | xargs rm @@ -48,15 +50,18 @@ src_prepare() { } src_configure() { + mv Setup.local Modules MACHDEP=linux ac_sys_system=Linux \ CPPFLAGS="-U__DATE__ -U__TIME__" \ - LDFLAGS="-L/usr/lib/musl" \ + PKG_CONFIG_PATH="${PREFIX}/lib/musl/pkgconfig/" \ + LDFLAGS="-static" \ ./configure \ --build=i386-unknown-linux-musl \ --host=i386-unknown-linux-musl \ --prefix="${PREFIX}" \ --libdir="${PREFIX}/lib/musl" \ - --with-system-ffi + --with-system-ffi \ + --disable-shared } src_compile() {