| 1 |
#! /bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
# Record certain build tool versions for use as a cache key. |
| 5 |
autotools_ver= |
| 6 |
|
| 7 |
# Log the identities and versions of the build tools. |
| 8 |
for tool in \ |
| 9 |
"${CC-cc}" \ |
| 10 |
"${NM-nm}" \ |
| 11 |
"${AUTOCONF-autoconf}" \ |
| 12 |
"${AUTOMAKE-automake}" \ |
| 13 |
"${LIBTOOLIZE-libtoolize}" \ |
| 14 |
"${PKG_CONFIG-pkg-config}" \ |
| 15 |
"${PERL-perl}" \ |
| 16 |
"${CPANM-cpanm}" \ |
| 17 |
"${PERLCRITIC-perlcritic}" \ |
| 18 |
"${PERLTIDY-perltidy}" \ |
| 19 |
"${PYTHON-python3}" \ |
| 20 |
"${GCOV-gcov}" \ |
| 21 |
"${LCOV-lcov}" \ |
| 22 |
"${LLVM_COV-llvm-cov}" \ |
| 23 |
"${VALGRIND-valgrind}" |
| 24 |
do |
| 25 |
# $tool might include mandatory command-line arguments. |
| 26 |
# Interpret it the same way Make would. |
| 27 |
set fnord $tool; shift # word-split $tool and load it into "$@" |
| 28 |
|
| 29 |
echo ::group::"$1" |
| 30 |
if command -V "$1"; then |
| 31 |
echo + "$@" --version |
| 32 |
"$@" --version |
| 33 |
fi |
| 34 |
echo ::endgroup:: |
| 35 |
|
| 36 |
case "$1" in |
| 37 |
(*autoconf*) |
| 38 |
autotools_ver="${autotools_ver}ac$("$@" --version 2>&1 | |
| 39 |
sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' |
| 40 |
)" |
| 41 |
;; |
| 42 |
|
| 43 |
(*automake*) |
| 44 |
autotools_ver="${autotools_ver}am$("$@" --version | |
| 45 |
sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' |
| 46 |
)" |
| 47 |
;; |
| 48 |
|
| 49 |
(*libtoolize*) |
| 50 |
autotools_ver="${autotools_ver}lt$("$@" --version | |
| 51 |
sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' |
| 52 |
)" |
| 53 |
;; |
| 54 |
|
| 55 |
(*pkg-config*) |
| 56 |
autotools_ver="${autotools_ver}pk$("$@" --version | |
| 57 |
sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' |
| 58 |
)" |
| 59 |
;; |
| 60 |
|
| 61 |
(*python*) |
| 62 |
echo ::group::passlib |
| 63 |
"$@" -c ' |
| 64 |
try: |
| 65 |
import passlib |
| 66 |
import os.path |
| 67 |
print("passlib is " + os.path.dirname(passlib.__file__)) |
| 68 |
print("passlib: version " + passlib.__version__) |
| 69 |
except ModuleNotFoundError: |
| 70 |
print("passlib is not installed") |
| 71 |
' |
| 72 |
echo ::endgroup:: |
| 73 |
;; |
| 74 |
esac |
| 75 |
done |
| 76 |
|
| 77 |
set fnord; shift # clear $@ |
| 78 |
echo "autotools-ver=$autotools_ver" >> $GITHUB_OUTPUT |
| 79 |
exit 0 |