### this file is sourced not run
PKGVER=3.24.36
PKGBUILD=1
PKGARCH=i686

# source: BLFS 11.3
TARBALL=gtk+-$PKGVER.tar.xz
MD5SUM=fd4571a112ffaa2fbbb9d25de8f5b6c0
SRC_URL=https://download.gnome.org/sources/gtk+/3.24/$TARBALL
BUNDLE=

SLACKREQ='at-spi2-core32 gdk-pixbuf32 libepoxy32 pango32 cups32 libxkbcommon32'
SLACKDESC="gtk3_32: gtk3_32 $PKGVER (GTK GUI Toolkit)
gtk3_32:  
gtk3_32: The GTK+ 3 package contains libraries used for creating graphical user 
gtk3_32: interfaces for applications. This is version 3 of GTK+.  
gtk3_32: 
gtk3_32: This contains 32-bit version of the library.
gtk3_32: 
gtk3_32: 
gtk3_32: 
gtk3_32: 
gtk3_32:
"

### default pkg_download
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/gtk+* &&
	patch -Np1 -i ../pkg/0001-fix-tooltip-issue-with-various-de-panels.patch &&
	patch -Np1 -i ../pkg/disable-introspection.patch && # the config command does not work
	true
}
### package - collect the libs only
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share etc
	mkdir -p usr/bin &&
	cp -v tmp/*-32 usr/bin &&
	if [ -d tmp/gir-1.0 ]; then
		mkdir usr/share/gir-1.0-32 &&	
		mv -v tmp/gir-1.0/* usr/share/gir-1.0-32
	fi
}

### build
pkg_build() {
	export CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS"
	MESONFLAGS="$MESONFLAGS     \
		-Dman=false             \
		-Dbroadway_backend=true \
		-Dtests=false           \
		-Dinstalled_tests=false \
		-Dexamples=false        \
		-Dgtk_doc=false         \
		-Ddemos=false           \
		-Dwayland_backend=false \
		-Dintrospection=false   \
	"
	pkg_build_meson &&
	pkg_build_slackdesc &&
	rm -f /usr/share/glib-2.0/schemas/gschemas.compiled &&

	# gtk2 compat
	mv /usr/bin/gtk{,3}-update-icon-cache &&
	#mv /usr/share/man/man1/gtk{,3}-update-icon-cache.1 &&
		
	# multilib
	mv -v /usr/bin/gtk-query-immodules-3.0 /tmp/gtk-query-immodules-3.0-32 &&
	if [ -d /usr/share/gir-1.0 ]; then
		mv -v /usr/share/gir-1.0 /tmp
	fi
}


