2021-05-15 02:46:15 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2026-02-12 12:48:09 -05:00
|
|
|
DESTDIR=${DESTDIR:-${PWD}/../vtest/}
|
|
|
|
|
TMPDIR=${TMPDIR:-$(mktemp -d)}
|
2021-05-15 02:46:15 -04:00
|
|
|
set -eux
|
|
|
|
|
|
2026-02-18 10:20:06 -05:00
|
|
|
curl -fsSL "https://code.vinyl-cache.org/vtest/VTest2/archive/main.tar.gz" -o "${TMPDIR}/VTest.tar.gz"
|
2026-02-12 12:48:09 -05:00
|
|
|
mkdir -p "${TMPDIR}/vtest"
|
|
|
|
|
tar xvf ${TMPDIR}/VTest.tar.gz -C "${TMPDIR}/vtest" --strip-components=1
|
2021-05-15 02:46:15 -04:00
|
|
|
# Special flags due to: https://github.com/vtest/VTest/issues/12
|
|
|
|
|
|
2024-05-27 05:50:31 -04:00
|
|
|
# Note: do not use "make -C ../vtest", otherwise MAKEFLAGS contains "w"
|
|
|
|
|
# and fails (see Options/Recursion in GNU Make doc, it contains the list
|
|
|
|
|
# of options without the leading '-').
|
|
|
|
|
# MFLAGS works on BSD but misses variable definitions on GNU Make.
|
|
|
|
|
# Better just avoid the -C and do the cd ourselves then.
|
|
|
|
|
|
2026-02-12 12:48:09 -05:00
|
|
|
cd "${TMPDIR}/vtest"
|
2024-05-27 05:50:31 -04:00
|
|
|
|
2024-05-27 05:59:46 -04:00
|
|
|
set +e
|
|
|
|
|
CPUS=${CPUS:-$(nproc 2>/dev/null)}
|
|
|
|
|
CPUS=${CPUS:-1}
|
|
|
|
|
set -e
|
|
|
|
|
|
2024-04-19 01:16:45 -04:00
|
|
|
#
|
|
|
|
|
# temporarily detect Apple Silicon (it's using /opt/homebrew instead of /usr/local)
|
|
|
|
|
#
|
|
|
|
|
if test -f /opt/homebrew/include/pcre2.h; then
|
2025-05-27 08:48:48 -04:00
|
|
|
make -j${CPUS} FLAGS="-O2 -s -Wall" INCS="-I. -Isrc -Ilib -I/usr/local/include -I/opt/homebrew/include -pthread"
|
2024-04-19 01:16:45 -04:00
|
|
|
else
|
2024-05-27 05:59:46 -04:00
|
|
|
make -j${CPUS} FLAGS="-O2 -s -Wall"
|
2024-04-19 01:16:45 -04:00
|
|
|
fi
|
2026-02-12 12:48:09 -05:00
|
|
|
|
|
|
|
|
mkdir -p "${DESTDIR}"
|
|
|
|
|
cp "${TMPDIR}/vtest/vtest" "${DESTDIR}"
|