2022-08-02 14:03:17 +03:00
|
|
|
|
distributable:
|
|
|
|
|
url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}.tar.xz
|
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
|
|
versions:
|
|
|
|
|
github: python/cpython/tags
|
|
|
|
|
|
|
|
|
|
dependencies:
|
2022-08-05 04:19:01 +03:00
|
|
|
|
# recommended but none are actually required
|
2022-08-03 21:27:08 +03:00
|
|
|
|
zlib.net: 1
|
2022-08-05 04:19:01 +03:00
|
|
|
|
sourceware.org/bzip2: 1
|
|
|
|
|
openssl.org: ^1.1
|
|
|
|
|
sourceware.org/libffi: 3
|
|
|
|
|
libexpat.github.io: 2
|
|
|
|
|
bytereef.org/mpdecimal: 2
|
|
|
|
|
tukaani.org/xz: 5
|
|
|
|
|
sqlite.org: 3
|
|
|
|
|
gnu.org/readline: 8
|
|
|
|
|
invisible-island.net/ncurses: 6
|
2022-08-02 14:03:17 +03:00
|
|
|
|
|
2022-08-05 23:22:53 +03:00
|
|
|
|
#TODO pip should be python.org/pip and installed by default (as a recommended dependent) with python
|
|
|
|
|
#RATIONALE it is independently versioned
|
|
|
|
|
|
2022-08-02 14:03:17 +03:00
|
|
|
|
build:
|
|
|
|
|
dependencies:
|
|
|
|
|
tea.xyz/gx/cc: c99
|
|
|
|
|
tea.xyz/gx/make: '*'
|
2022-08-05 04:19:01 +03:00
|
|
|
|
freedesktop.org/pkg-config: ^0.29
|
|
|
|
|
|
|
|
|
|
#TODO use the diff
|
2022-08-02 14:03:17 +03:00
|
|
|
|
script: |
|
2022-08-03 21:27:08 +03:00
|
|
|
|
sed -i.bak -e 's|system_lib_dirs = .*|system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")|' ./setup.py
|
|
|
|
|
sed -i.bak -e 's|system_include_dirs = .*|system_include_dirs = os.getenv("CPATH").split(":")|' ./setup.py
|
|
|
|
|
|
2022-08-02 14:03:17 +03:00
|
|
|
|
./configure $ARGS
|
|
|
|
|
make --jobs {{ hw.concurrency }}
|
|
|
|
|
make install
|
2022-08-05 23:22:53 +03:00
|
|
|
|
|
2022-08-02 14:03:17 +03:00
|
|
|
|
cd {{ prefix }}/bin
|
2022-08-05 23:22:53 +03:00
|
|
|
|
ln -sf python{{ version.marketing }} python
|
|
|
|
|
ln -sf python{{ version.marketing }}-config python-config
|
|
|
|
|
ln -sf pip{{ version.marketing }} pip
|
2022-08-02 14:03:17 +03:00
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
SHARE: /opt/python.org/share
|
|
|
|
|
ARGS:
|
|
|
|
|
- --prefix="{{ prefix }}"
|
|
|
|
|
# it’s 202x
|
|
|
|
|
- --enable-ipv6
|
|
|
|
|
# prevent auto updates -> we control that
|
2022-08-05 23:22:53 +03:00
|
|
|
|
# - --without-ensurepip
|
2022-08-02 14:03:17 +03:00
|
|
|
|
- --disable-loadable-sqlite-extensions
|
|
|
|
|
# use our libraries not the bundled ones
|
|
|
|
|
- --with-system-expat
|
|
|
|
|
- --with-system-ffi
|
|
|
|
|
- --with-system-libmpdec
|
|
|
|
|
# these two make our binary not portable
|
|
|
|
|
#- --enable-optimizations
|
|
|
|
|
#- --with-lto
|
|
|
|
|
# on macOS we probably will actually want to --enable-framework
|
|
|
|
|
- --enable-shared
|
|
|
|
|
# put data that doesn’t vary between pythons in a consistent place
|
|
|
|
|
- --datarootdir="$SHARE"
|
|
|
|
|
- --datadir="$SHARE"
|
2022-08-10 21:58:22 +03:00
|
|
|
|
|
|
|
|
|
#FIXME get rid of these v*
|
|
|
|
|
OPENSSL_INCLUDES: /opt/openssl.org/v*/include
|
|
|
|
|
OPENSSL_LDFLAGS: -L/opt/openssl.org/v*/lib'
|
|
|
|
|
|
|
|
|
|
#FIXME we should get the include path from the ncurses `.pc` files
|
|
|
|
|
CPATH: /opt/invisible-island.net/ncurses/v*/include/ncursesw:$CPATH
|
|
|
|
|
|
|
|
|
|
# required for `setup.py` which is used to detect the libs for python’s modules
|
2022-08-05 04:19:01 +03:00
|
|
|
|
diff: |
|
|
|
|
|
diff --git a/setup.py b/setup.py
|
|
|
|
|
index 85a2b26..4f2f742 100644
|
|
|
|
|
--- a/setup.py
|
|
|
|
|
+++ b/setup.py
|
|
|
|
|
@@ -847,8 +847,8 @@ class PyBuildExt(build_ext):
|
|
|
|
|
add_dir_to_list(self.compiler.include_dirs,
|
|
|
|
|
sysconfig.get_config_var("INCLUDEDIR"))
|
|
|
|
|
|
|
|
|
|
- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
|
|
|
|
|
- system_include_dirs = ['/usr/include']
|
|
|
|
|
+ system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")
|
|
|
|
|
+ system_include_dirs = os.getenv("CPATH").split(":")
|
|
|
|
|
# lib_dirs and inc_dirs are used to search for files;
|
|
|
|
|
# if a file is found in one of those directories, it can
|
|
|
|
|
# be assumed that no additional -I,-L directives are needed.
|
2022-08-02 14:03:17 +03:00
|
|
|
|
|
|
|
|
|
test:
|
2022-08-03 21:27:08 +03:00
|
|
|
|
#TODO test all modules eg zlib module
|
2022-08-05 23:22:53 +03:00
|
|
|
|
script: |
|
2022-08-02 14:03:17 +03:00
|
|
|
|
python --version
|
2022-08-05 23:22:53 +03:00
|
|
|
|
pip --version
|