# Contributor: Vince Mele <vmele@inoc.com>
maintainer="fossdd <fossdd@pwned.life>"
pkgname=ding-libs
pkgver=0.6.2
pkgrel=5
pkgdesc="'D is not GLib' utility libraries"
url="https://pagure.io/SSSD/ding-libs/"
arch="all"
license="GPL-3.0-or-later AND LGPL-3.0-or-later"
# TODO: add check-dev to checkdepends
checkdepends="check-dev diffutils" # need option -b to cmp
makedepends="
	gettext-dev
	icu-dev
	libintl
	"
subpackages="$pkgname-dev"
source="https://github.com/SSSD/ding-libs/releases/download/$pkgver/ding-libs-$pkgver.tar.gz
	musl-fixes.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare

	update_config_sub # update config sub for loongarch64
	update_config_guess # update config guess for loongarch64
}

build() {
	cd "$builddir"
	export LDFLAGS="$LDFLAGS -lintl"
	./configure --prefix=/usr --disable-static
	make all
}

check() {
	cd "$builddir"
	make -j1 check
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir/" install

	rm -rf $pkgdir/usr/share
}

sha512sums="
566172e0addb0ee6e0ebd12874d3b72f2fa6bcb1ecc628c0c529984193290fae554efc40f52d2cec675bffab32a36183e47ec629db25e83ed2995f1049c64703  ding-libs-0.6.2.tar.gz
22cdec129b19fbc7caf1c56004cd2d00197719bc1dc9835a5d74228affe947b93061ad57612a36b75032891e8e5d4d6970bbc9c6b0057659541686c76770221e  musl-fixes.patch
"
