# Description: GTK+ based IRC client.
# URL: https://hexchat.github.io/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: gtk iso-codes python3-cffi xorg-libxdamage
# Optional: dbus-glib desktop-file-utils enchant libcanberra libnotify libproxy lua pciutils

name=hexchat
version=2.16.1
release=1
source=(https://dl.hexchat.net/hexchat/$name-$version.tar.xz)

build() {
	prt-get isinst lua && PKGMK_HEXCHAT+=' -D with-lua=lua' || PKGMK_HEXCHAT+=' -D with-lua=false'
	prt-get isinst libcanberra || PKGMK_HEXCHAT+=' -D libcanberra=disabled'
	prt-get isinst dbus-glib || PKGMK_HEXCHAT+=' -D dbus=disabled'

	prt-get isinst pciutils && PKGMK_HEXCHAT+=' -Dwith-sysinfo=true'

	meson setup build $name-$version $PKGMK_HEXCHAT \
		--prefix=/usr \
		--buildtype=plain \
		--wrap-mode nodownload \
		-D b_lto=true \
		-D b_pie=true
	meson compile -C build -j ${JOBS:-1}
	DESTDIR=$PKG meson install -C build

	rm -r $PKG/usr/share/locale
}
