# pkgconf - Build flag helper, replacing pkg-config
# Generated from manifest.tsv by gen-ports.py. Edit the manifest, not this file,
# unless the package needs something the template cannot express - in which case
# drop a `recipe.local` beside it and it will be preserved.
name=pkgconf
version=3.0.4
release=1
desc="Build flag helper, replacing pkg-config"
url="https://github.com/pkgconf/pkgconf"
license="ISC"
depend="glibc"
makedepend="meson ninja"
source="https://distfiles.ariadne.space/pkgconf/pkgconf-3.0.4.tar.xz"
sha256="SKIP"

build() {
	cd "pkgconf-3.0.4"
	meson setup build \
		--prefix=/usr \
		--libdir=/usr/lib \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--buildtype=release \
		--wrap-mode=nodownload \
		-Db_lto=true
	ninja -C build -j"$JOBS"
}

package() {
	cd "pkgconf-3.0.4"
	DESTDIR="$pkgdir" ninja -C build install
	# pkgconf is a drop-in replacement for the original freedesktop.org
	# pkg-config, and every build tool that looks for a system pkg-config
	# looks for it by that exact name, not "pkgconf" - the pkg-config Rust
	# crate (system-deps, most *-sys crates' build.rs) does, and so does
	# any autotools ./configure with a PKG_CONFIG check. Without this,
	# `pkg-config` is not found at all even with pkgconf installed and on
	# PATH, and the error ("pkg-config command could not be found") looks
	# exactly like the tool being entirely missing. Every other
	# distribution's pkgconf package provides this same symlink.
	ln -sf pkgconf "$pkgdir/usr/bin/pkg-config"
}
