Skip to content

Commit

Permalink
Improve system detection for brew python
Browse files Browse the repository at this point in the history
  • Loading branch information
singiamtel committed Nov 13, 2024
1 parent 10e59b2 commit dd98d84
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ env:
PYTHONPATH: "$PYTHON_ROOT/lib/python/site-packages"
prefer_system: "(?!slc5|ubuntu)"
prefer_system_check: |
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python{version_info.major}.{version_info.minor}")'
python3 -c 'import sys; import sqlite3; sys.exit(1 if sys.version_info < (3, 9) or sys.version_info > (3, 13) else 0)' && python3 -m pip --help > /dev/null && printf '#include "pyconfig.h"' | cc -c $(python3-config --includes) -xc -o /dev/null -; if [ $? -ne 0 ]; then printf "Python, the Python development packages, and pip must be installed on your system.\nUsually those packages are called python, python-devel (or python-dev) and python-pip.\n"; exit 1; fi
case $ALIBUILD_ARCHITECTURE in
osx*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python-brew{version_info.major}.{version_info.minor}")' ;;
*)
python3 -c 'from sys import version_info; print(f"alibuild_system_replace: python{version_info.major}.{version_info.minor}")'
;;
esac
python3 -c 'import sys; import sqlite3; sys.exit(1 if sys.version_info < (3, 9) or sys.version_info > (3, 13) else 0)' && python3 -m pip --help > /dev/null && printf '#include "pyconfig.h"' | cc -c $(python3-config --includes) -xc -o /dev/null -; if [ $? -ne 0 ]; then printf "Python, the Python development packages, and pip must be installed on your system.\nUsually those packages are called python, python-devel (or python-dev) and python-pip.\n"; exit 1; fi
prefer_system_replacement_specs:
"python3.9":
version: "3.9"
"python3.10":
version: "3.10"
"python3.11":
version: "3.11"
"python3.12":
version: "3.12"
"python3.13":
version: "3.13"
"python-brew3.*":
env:
PYTHON_ROOT: $(brew --prefix python3)
PYTHON_REVISION: ""
"python3.*":
env:
PYTHON_ROOT: ""
PYTHON_REVISION: ""
---
rsync -av --exclude '**/.git' $SOURCEDIR/ $BUILDDIR/
Expand Down

0 comments on commit dd98d84

Please sign in to comment.