Browse Source

Better configure checks and logs

master
Nils 2 years ago
parent
commit
bc893200cc
  1. 16
      template/configure.template

16
template/configure.template

@ -8,6 +8,7 @@ prefix=/usr/local
required_version_python=3.6
required_version_pyqt=5.0
required_soname_cbox=libcalfbox-lss.so.1
required_version_cbox=1.2.0
for arg in "$@"; do
@ -35,21 +36,29 @@ done
echo "PREFIX=$prefix"
echo "Checking Dependencies. No output is good"
echo
echo "Checking Dependencies"
function version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
ldconfig -p | grep $required_soname_cbox >/dev/null 2>&1 || { echo "$required_soname_cbox required, but it's not installed. https://git.laborejo.org/lss/libcalfbox-lss . Aborting."; exit 1; }
CBOXLSSVERSION=$(ldconfig -v 2>/dev/null | grep "libcalfbox-lss" | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+")
echo "libcalfbox-lss version is: $CBOXLSSVERSION, required >= $required_version_cbox"
if version_gt $required_version_cbox $CBOXLSSVERSION; then echo "libcalfbox-lss must be version >= $required_version_cbox but is $CBOXLSSVERSION. Aborting."; exit 1; fi
command -v python3 >/dev/null 2>&1 || { echo >&2 "Python3 >= $required_version_python is required but it's not installed. Aborting."; exit 1; }
PY3VERSION=$(python3 -c 'import platform; print(platform.python_version())')
echo "Python version is: $PY3VERSION, required >= $required_version_python"
if version_gt $required_version_python $PY3VERSION; then echo "Python3 must be version >= $required_version_python but is $PY3VERSION. Aborting."; exit 1; fi
python3 -c 'import PyQt5' >/dev/null 2>&1 || { echo >&2 "PyQt for Python3 >= $required_version_pyqt is required but it's not installed. Aborting."; exit 1; }
PYQTVERSION=$(python3 -c 'from PyQt5.QtCore import QT_VERSION_STR; print(QT_VERSION_STR)')
echo "Py-Qt version is: $PYQTVERSION, required >= $required_version_pyqt"
if version_gt $required_version_pyqt $PYQTVERSION; then echo "PyQt must be version >= $required_version_pyqt but is $PYQTVERSION. Aborting."; exit 1; fi
echo "generating makefile"
echo
echo "Generating Makefile"
printf "PREFIX=$prefix\nPROGRAM=$program\nVERSION=$version\n" >Makefile
#if $debugsym; then
@ -57,4 +66,5 @@ printf "PREFIX=$prefix\nPROGRAM=$program\nVERSION=$version\n" >Makefile
#fi
cat template/Makefile.in >>Makefile
echo 'configuration complete, type make to build.'
echo
echo 'Configuration complete. Type make to build.'

Loading…
Cancel
Save