mirror of
https://github.com/ivabus/pantry
synced 2024-11-30 04:05:06 +03:00
fix(python3.7)
This commit is contained in:
parent
2de4c6558e
commit
43662c24d6
1 changed files with 23 additions and 9 deletions
|
@ -50,6 +50,17 @@ build:
|
||||||
sed -i.bak -e 's|system_lib_dirs = .*|system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")|' ./setup.py
|
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
|
sed -i.bak -e 's|system_include_dirs = .*|system_include_dirs = os.getenv("CPATH").split(":")|' ./setup.py
|
||||||
|
|
||||||
|
if semverator satisfies '<3.8' {{ version }}; then
|
||||||
|
# older versions use a different config dir
|
||||||
|
confdir=$(echo $confdir | sed -e 's/\(config-{{ version.marketing }}\)/\1m/')
|
||||||
|
|
||||||
|
# 3.7 and older use `python3.7m` for include dir
|
||||||
|
SUFFIX=m
|
||||||
|
|
||||||
|
# 3.7 aborts on linux+aarch64 with this
|
||||||
|
ARGS=${ARGS/--with-ensurepip/--without-ensurepip}
|
||||||
|
fi
|
||||||
|
|
||||||
./configure $ARGS
|
./configure $ARGS
|
||||||
make --jobs {{ hw.concurrency }}
|
make --jobs {{ hw.concurrency }}
|
||||||
make install
|
make install
|
||||||
|
@ -67,18 +78,17 @@ build:
|
||||||
# we provide the binaries in a separate package
|
# we provide the binaries in a separate package
|
||||||
# but we don’t use --without-ensurepip because stuff expects python to
|
# but we don’t use --without-ensurepip because stuff expects python to
|
||||||
# come bundled with setuptools
|
# come bundled with setuptools
|
||||||
rm pip*
|
find . -mindepth 1 -maxdepth 1 -type f -name 'pip*' -exec rm {} \;
|
||||||
|
|
||||||
# older versions use a different config dir
|
|
||||||
if semverator satisfies '<3.8' {{ version }}; then
|
|
||||||
confdir=$(echo $confdir | sed -e 's/\(config-{{ version.marketing }}\)/\1m/')
|
|
||||||
# 3.7 and older use `python3.7m` for include dir
|
|
||||||
SUFFIX=m
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make relocatable
|
# make relocatable
|
||||||
cd {{prefix}}
|
cd {{prefix}}
|
||||||
for binfile in $shebangs $confdir/python-config.py; do
|
for binfile in $shebangs $confdir/python-config.py; do
|
||||||
|
if ! test -f $binfile; then
|
||||||
|
binfile=${binfile/{{version.marketing}}/{{version.marketing}}$SUFFIX}
|
||||||
|
fi
|
||||||
|
if ! test -f $binfile; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
binfile=$(readlink -f $binfile)
|
binfile=$(readlink -f $binfile)
|
||||||
sed -i.bak -e 's|#!{{ prefix }}/bin/|#!/usr/bin/env |g' $binfile
|
sed -i.bak -e 's|#!{{ prefix }}/bin/|#!/usr/bin/env |g' $binfile
|
||||||
rm $binfile.bak
|
rm $binfile.bak
|
||||||
|
@ -138,13 +148,17 @@ build:
|
||||||
test:
|
test:
|
||||||
dependencies:
|
dependencies:
|
||||||
tea.xyz/gx/cc: c99
|
tea.xyz/gx/cc: c99
|
||||||
|
crates.io/semverator: '*'
|
||||||
script: |
|
script: |
|
||||||
# Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions
|
# Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions
|
||||||
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
|
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
|
||||||
python -c "import sqlite3"
|
python -c "import sqlite3"
|
||||||
|
|
||||||
# check to see if we can create a venv
|
# check to see if we can create a venv
|
||||||
python -m venv myvenv
|
# we can't ensurepip on 3.7 so, this won't work
|
||||||
|
if semverator satisfies '^3.8' {{ version }}; then
|
||||||
|
python -m venv myvenv
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if some other modules import. Then the linked libs are working.
|
# Check if some other modules import. Then the linked libs are working.
|
||||||
python -c "import _ctypes"
|
python -c "import _ctypes"
|
||||||
|
|
Loading…
Reference in a new issue