# lxterminal - The LXDE terminal emulator
# 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=lxterminal
version=0.4.0
release=1
desc="The LXDE terminal emulator"
url="https://lxde.org/"
license="GPL-2.0-or-later"
depend="glibc gtk3 vte3"
makedepend=""
source="https://downloads.sourceforge.net/lxde/lxterminal-0.4.0.tar.xz"
sha256="SKIP"

build() {
	# LXDE's GTK code predates clang treating an incompatible pointer
	# assignment as an error rather than a warning. The assignments are the
	# usual GTK widget-to-subclass ones and upstream has not moved.
	export CFLAGS="$CFLAGS -fcommon -Wno-incompatible-pointer-types -Wno-int-conversion"
	cd "lxterminal-0.4.0"
	# Not every configure script accepts the same options - sqlite rejects
	# --disable-nls outright, for instance - so only pass the ones this one
	# actually advertises. Guessing wrong fails the whole build.
	_opts="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib"
	_help=$(./configure --help 2>/dev/null)
	case "$_help" in *--disable-static*)  _opts="$_opts --disable-static" ;; esac
	case "$_help" in *--disable-nls*)     _opts="$_opts --disable-nls" ;; esac
	# LXDE still defaults to GTK2, which ScrapLinux does not have and is not
	# going to package. Every one of these builds against GTK3 when asked.
	case "$_help" in *--with-gtk*) _opts="$_opts --with-gtk=3" ;; esac
	case "$_help" in *--enable-gtk3*) _opts="$_opts --enable-gtk3" ;; esac
	# shellcheck disable=SC2086
	./configure $_opts
	make -j"$JOBS"
}

package() {
	cd "lxterminal-0.4.0"
	make DESTDIR="$pkgdir" install
}
