#!/bin/sh
#
# Copyright 2023-2026 Sasa Ostrouska <saxa@droplinegnome.org>
# Available under the terms of the GNU GPL.
#

NAME="libnma_gtk4"
VERSION="1.10.6"
REVISION="2"

PKG_SOURCEURL='${DLG_GNOMEMIRROR}/libnma/${VER_MAJ}.${VER_MIN}/libnma-${VERSION}.tar.xz'

. $DLG_ROOT/etc/config
. $DLG_ROOT/lib/dl-base

cflags
cxxflags
prepare
analyzesource

# We have to remove configure script to be able to use meson instead of 
# autotools, this is an ugly hack. I will probably fix this better in dl-build
# so we can force certain build system with the use of a variable. Maybe...
spewdo "cd ${PKG_SRCROOT}; rm Makefile.am"

configure -Dbuildtype=release \
	-Dlibnma_gtk4=true
make
makeinstall
tidydocumentation
analyzebinaries

# We have to remove stuff which would overwrite the Slackware default libnma.
spewdo "cd $PKG_STAGEROOT; rm -rf usr/lib64/libnma.* ; rm -rf usr/lib64/pkgconfig/libnma.pc"
spewdo "rm -rf usr/lib64/girepository-1.0/NMA-1.0.typelib"
spewdo "rm -rf usr/share/gir-1.0/NMA-1.0.gir; rm -rf usr/share/vala/vapi/libnma.*"
spewdo "rm -rf usr/share/{gtk-doc,locale,glib-2.0}"
spewdo "rm -rf usr/include"

finalizepackage
packagize
cleanup
