#!/bin/sh -e

export DESTDIR="$1"

# Avoid cloning gidocgen
sed '/gidocgen_dep/,/)$/d' meson.build > meson.build.tmp
mv meson.build.tmp meson.build

meson \
    --prefix=/usr \
    -Dgir=true \
    -Dgtk_doc=false \
    -Dintrospection=enabled \
    . build

ninja -C build
ninja -C build install

# Remove unneeded tests
rm -rf "$1/usr/share/installed-tests"
rm -rf "$1/usr/libexec/installed-tests"