repo/extra/python/build

32 lines
750 B
Plaintext
Raw Normal View History

2019-06-25 15:24:27 +00:00
#!/bin/sh -e
./configure \
2019-06-27 09:10:08 +00:00
--prefix=/usr \
--without-ensurepip
2019-06-25 15:24:27 +00:00
make
make DESTDIR="$1" install
2019-06-25 17:08:58 +00:00
ln -s python3 "$1/usr/bin/python"
# Rebuild all python subpackages if required.
{
# Exit here if python is not installed.
command -v python3 >/dev/null || exit 0
# Figure out the system's python version.
python_sys=$(kiss l python)
python_sys=${python_sys#* }
python_sys=${python_sys#?.}
python_sys=${python_sys%.*}
# Figure out this python version.
read -r python_repo _ < "${0%/*}/version"
python_repo=${python_repo#?.}
python_repo=${python_repo%.*}
# If the two python versions differ, tell post-install to rebuild.
[ "$python_sys" = "$python_repo" ] ||
:>/tmp/python-REBUILD
}