#!/bin/bash

set -eu
set -o pipefail

# shellcheck disable=SC2154

export PATH=/usr/local/c"$which_python"/bin:$PATH
#echo 'pkg-config is at:'
#which pkg-config

#echo 'modversion of glib-2.0 from path-searched pkg-config is:'
#pkg-config --modversion glib-2.0
#echo

#echo "modversion of glib-2.0 from /usr/local/c$which_python/bin/pkg-config is:"
#/usr/local/c"$which_python"/bin/pkg-config --modversion glib-2.0
#echo

export CFLAGS="-I/usr/local/c$which_python/include"
export LDFLAGS="-L/usr/local/c$which_python/lib -Wl,-rpath -Wl,/usr/local/c$which_python/lib"

# Added Sat Jul 19 16:34:08 PDT 2014 for Mint 17
export ATK_CFLAGS="$CFLAGS"
export ATK_LIBS="$LDFLAGS"

# We patch configure.ac for fribidi, so we need to redo autoconf
# Patching configure.ac was having problems though, so I wound up hacking configure
# ./autogen.sh

# ./autogen.sh fails, but autoconf seems to run...  And I want to try adding fribidi in configure.ac
# autoconf

# ./configure --prefix=/usr/local/c"$which_python" --enable-introspection
# make

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

echo 'fred 1'
command -v g-ir-scanner

meson setup --prefix /usr/local/c"$which_python" _build
cd _build
ninja