#!/bin/bash

set -eu
set -o pipefail

# ./autogen.sh --prefix=/usr/local/c"$which_python"
# #./configure --prefix=/usr/local/c"$which_python"
# make

PKG_CONFIG_PATH="$(set -eu; build_pkg_config_path)"
export PKG_CONFIG_PATH

# configure the build
# If we do not disable benchmarking, we get 
# Downloading google-benchmark source from https://github.com/google/benchmark/archive/v1.5.2.zip
# HTTP Error 500: Internal Server Error
# A fallback URL could be specified using source_fallback_url key in the wrap file
#
# perf/meson.build:1:0: ERROR: could not get https://github.com/google/benchmark/archive/v1.5.2.zip is the internet available?
meson _build --prefix /usr/local/c"$which_python" -Dbenchmark="disabled"

# build GLib
ninja -C _build