build-from-source: select python interpretor in build script

On rhel-8, python2 is available and in the path, but it doesn't
actually work because required modules are missing.
This commit is contained in:
Thomas Haller 2018-11-16 13:48:39 +01:00
parent 582c45cd15
commit 5c51bfea86

View file

@ -56,6 +56,7 @@ $SUDO yum install \
polkit-devel \
ppp-devel \
pygobject3-base \
python3 \
readline-devel \
rpm-build \
strace \
@ -70,6 +71,12 @@ $SUDO yum install \
# for the tests, let's pre-load some modules:
$SUDO modprobe ip_gre
# in particular on rhel-8, the pygobject module does not exist for
# python2. Hence, we prefer python3 over python2.
PYTHON=$(which python3) || \
PYTHON=$(which python2) || \
PYTHON=$(which python)
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
@ -96,6 +103,7 @@ if [[ "$DO_TEST_BUILD" == yes ]]; then
NOCONFIGURE=yes ./autogen.sh
./configure \
PYTHON="${PYTHON}" \
--enable-maintainer-mode \
--enable-more-warnings=error \
--prefix=/opt/test \
@ -143,6 +151,7 @@ if [[ "$DO_TEST_PACKAGE" == yes || "$DO_INSTALL" == yes ]]; then
A=("${A[@]}" --without sanitizer)
fi
NM_BUILD_SNAPSHOT="${BUILD_SNAPSHOT}" \
PYTHON="${PYTHON}" \
./contrib/fedora/rpm/build_clean.sh -c "${A[@]}"
fi