2019-11-19 21:51:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
failure_exit() {
|
|
|
|
echo >&2 "Could not find ${1}. Please install that before continuing."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2020-12-07 23:19:16 +00:00
|
|
|
check_python_version() {
|
2022-03-08 05:51:20 +00:00
|
|
|
if ! command -v python"$PYMAJOR"."$PYMINOR" &> /dev/null; then
|
2022-03-04 03:13:58 +00:00
|
|
|
echo >&2 "Must compile with python $PYMAJOR.$PYMINOR."
|
2020-12-07 23:19:16 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
2019-11-19 21:51:45 +00:00
|
|
|
check_python_headers() {
|
|
|
|
local python_headers_present
|
2022-03-08 05:51:20 +00:00
|
|
|
python_headers_present=$(pkg-config --libs python-"$PYMAJOR"."$PYMINOR")
|
2019-11-19 21:51:45 +00:00
|
|
|
|
|
|
|
if [ ! "${python_headers_present}" ]; then
|
2022-03-04 03:13:58 +00:00
|
|
|
failure_exit "Python $PYMAJOR.$PYMINOR headers"
|
2019-11-19 21:51:45 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
check_binary_present() {
|
|
|
|
local binary_exists
|
|
|
|
binary_exists="$(command -v "${1}")"
|
|
|
|
if [ ! "${binary_exists}" ]; then
|
|
|
|
failure_exit "${1}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-02 22:42:43 +00:00
|
|
|
check_pkgconfig() {
|
|
|
|
check_binary_present "pkg-config"
|
|
|
|
}
|
|
|
|
|
2022-04-09 20:41:10 +00:00
|
|
|
check_shasum() {
|
|
|
|
check_binary_present "shasum"
|
2021-06-04 07:36:46 +00:00
|
|
|
}
|
|
|
|
|
2022-04-28 15:27:56 +00:00
|
|
|
check_cmake() {
|
|
|
|
check_binary_present "cmake"
|
|
|
|
}
|
|
|
|
|
|
|
|
check_libtool() {
|
|
|
|
check_binary_present "libtool"
|
|
|
|
}
|
|
|
|
|
2019-11-19 21:51:45 +00:00
|
|
|
check_fortran_dependencies() {
|
|
|
|
check_binary_present "gfortran"
|
|
|
|
check_binary_present "f2c"
|
|
|
|
}
|
|
|
|
|
2020-12-07 23:19:16 +00:00
|
|
|
check_python_version
|
2020-01-02 22:42:43 +00:00
|
|
|
check_pkgconfig
|
2020-07-07 14:21:33 +00:00
|
|
|
#check_python_headers
|
2019-11-19 21:51:45 +00:00
|
|
|
check_fortran_dependencies
|
2022-04-09 20:41:10 +00:00
|
|
|
check_shasum
|