Check installed libmaxminddb version with pkg-config #4
+6
-4
@@ -124,9 +124,11 @@ build_brotli() {
|
||||
run cmake --build "$src/out" --config Release --target brotlienc -j "$JOBS"
|
||||
}
|
||||
|
||||
install_maxmind() { # system-wide, only the first time a given version is fetched
|
||||
local dir=libmaxminddb-$V_MAXM
|
||||
if [ -d "$dir" ]; then step "$dir (cached, assumed installed)"; return 0; fi
|
||||
install_maxmind() { # system-wide, skipped when pkg-config already reports $V_MAXM
|
||||
local dir=libmaxminddb-$V_MAXM have
|
||||
have=$(pkg-config --modversion libmaxminddb 2>/dev/null || true)
|
||||
if [ "$have" = "$V_MAXM" ]; then step "libmaxminddb $have already installed"; return 0; fi
|
||||
log "pkg-config reports libmaxminddb '${have:-none}', want $V_MAXM"
|
||||
fetch "https://github.com/maxmind/libmaxminddb/releases/download/$V_MAXM/$dir.tar.gz" "$dir"
|
||||
step "Installing $dir system-wide (sudo)"
|
||||
cd "$dir"
|
||||
@@ -148,7 +150,7 @@ trap 'on_error $LINENO' ERR
|
||||
cd "$BUILDROOT"
|
||||
|
||||
missing=()
|
||||
for t in curl tar unzip git cmake make cc; do command -v "$t" >/dev/null || missing+=("$t"); done
|
||||
for t in curl tar unzip git cmake make cc pkg-config; do command -v "$t" >/dev/null || missing+=("$t"); done
|
||||
if [ ${#missing[@]} -gt 0 ]; then echo "Missing required tools: ${missing[*]}" >&2; exit 1; fi
|
||||
|
||||
step "freenginx $V_NGINX in $BUILDROOT (log: $LOG)"
|
||||
|
||||
Reference in new issue
Block a user