### this file is sourced not run
PKGBUILD=1
PKGARCH=x86_64

# source: step
# hash=271c49a976b3451736f6999a4e9fa5c61ed91152
# PKGVER=0.58.3.3 # 3rd commit after 0.58.3 on 2020.06.04
# MD5SUM=fcdf2d6f81170e73d6aecb85c75d7560
# hash7=${hash#???????}; hash7=${hash%$hash7}
# TARBALL=libvte2_91-$PKGVER.tar.gz
# SRC_URL=https://github.com/GNOME/vte/archive/$hash.tar.gz
#SRC_URL="https://github.com/GNOME/vte/archive/refs/tags/$PKGVER.tar.gz"

PKGVER=0.59.0
MD5SUM=7cf62796a0253fae16aeca418d676de3

TARBALL="vte-$PKGVER.tar.bz2"
SRC_URL="https://gitlab.gnome.org/GNOME/vte/-/archive/$PKGVER/$TARBALL"
BUNDLE=

SLACKREQ='libvdpau gtk3 glib libpcre2 libgnutls' # gobject-introspection
SLACKDESC="libvte2_91: libvte2_91 $PKGVER (Terminal emulator widget for GTK3)
libvte2_91:
libvte2_91: VTE provides a virtual terminal widget for GTK3 applications.
libvte2_91:
libvte2_91: https://gitlab.gnome.org/GNOME/vte
libvte2_91:
libvte2_91:
libvte2_91:
libvte2_91:
libvte2_91:
libvte2_91:
"

### default pkg_download
### default pkg_prepare
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/vte-* &&
	# uncomment patch for vte >= 0.62
	true # patch -Np1 -i $CHROOT_DIR/tmp/pkg/Allow-background-color-and-color-on-VteTerminal-widgets-t.patch
}
### build
pkg_build() {
	### for gcc 7.3 and python 3.6

	# chroot's locale is unset, which results in python codec woes when
	# meson runs a CUSTOM_COMMAND involving python file I/O
	export LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"

	# or add -Db_asneeded to MESONFLAGS
	export LDFLAGS="$LDFLAGS -Wl,--as-needed"

	# https://github.com/mesonbuild/meson/blob/master/docs/markdown/Build-options.md
	# https://github.com/mesonbuild/meson/blob/master/docs/markdown/Builtin-options.md
	MESONFLAGS="$MESONFLAGS -D_systemd=false" # project option
	MESONFLAGS="$MESONFLAGS -Dvapi=false"     # project option no vala

	#MESONFLAGS="$MESONFLAGS -Dc_std=gnu11 -Dcpp_std=gnu++17"

	# backport of python 3.7+ built-in dataclasses for vte >= 0.62
	#pip3 install /tmp/pkg/dataclasses-0.8.tar.gz &&

	pkg_build_meson _build &&
	pkg_build_slackdesc &&

	# multilib
	mv -v /usr/share/gir-1.0/* /usr/share/gir-1.0-64 &&
	rm -r /usr/share/gir-1.0/
}

# vim:ft=sh:

