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

# source: post BLFS 11 2021-12-22
TARBALL=gtk+-$PKGVER.tar.xz
MD5SUM=1c4821835d6ffe7cf5b35c320f89569b
SRC_URL=https://download.gnome.org/sources/gtk+/3.24/$TARBALL
BUNDLE=

SLACKREQ='at-spi2-atk
atk2 >= 2.32
gdk-pixbuf libepoxy pango cups libxkbcommon libjson-glib librest libwayland'
SLACKDESC="gtk3: gtk3 $PKGVER (GTK GUI Toolkit)
gtk3:  
gtk3: The GTK+ 3 package contains libraries used for creating graphical user 
gtk3: interfaces for applications. 
gtk3: 
gtk3: This is version 3 of the library. It is not compatible with GTK2, but
gtk3: it can be installed side-by-side with it.
gtk3: 
gtk3: This package includes support for the wayland backend.
gtk3: 
gtk3:
"
SLACKINSTALL='glib-compile-schemas ./usr/share/glib-2.0/schemas'
SLACKUNINSTALL='glib-compile-schemas ./usr/share/glib-2.0/schemas'

### default pkg_download
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/gtk+* &&
	patch -Np1 -i ../pkg/ftfbs.patch &&
	patch -Np1 -i ../pkg/0001-fix-tooltip-issue-with-various-de-panels.patch &&
	sed -i '/sort-directories-first/{n;s/false/true/;}' gtk/org.gtk.Settings.FileChooser.gschema.xml &&
	true
}

### default pkg_package
### build
pkg_build() {
	export CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS"
	CONFFLAGS="$CONFFLAGS \
		--enable-broadway-backend --enable-x11-backend \
		--enable-wayland-backend \
		--enable-introspection \
		--disable-schemas-compile \
		--with-x"
	pkg_build_autoconf && pkg_build_slackdesc &&
	
	# 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{,-64} &&
	ln -sfv multiarch_wrapper /usr/bin/gtk-query-immodules-3.0 &&
	mv -v /usr/share/gir-1.0/* /usr/share/gir-1.0-64 &&
	rm -r /usr/share/gir-1.0/ &&
	
<< "INFO-ONLY"

Configuration Information

GTK+ 3 themes change the way a GTK+ 3 application looks. 
An icon theme can be used to change the icons that appear on the application's toolbar. 
If you have installed a GTK+ 3 theme (eg gnome-themes-standard-3.18.0), 
an icon theme (such as oxygen-icons-15.04.3) and/or a font 
(such as DejaVu fonts), you can set your prefences in ~/.config/gtk-3.0/settings.ini 
or the default system wide configuration file (as the root user), in /etc/gtk-3.0/settings.ini

mkdir -p /etc/gtk-3.0
> /etc/gtk-3.0/settings.ini cat << "EOF"
[Settings]
gtk-theme-name = Adwaita
gtk-icon-theme-name = oxygen
gtk-font-name = DejaVu Sans 12
gtk-cursor-theme-size = 18
gtk-toolbar-style = GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias = 1
gtk-xft-hinting = 1
gtk-xft-hintstyle = hintslight
gtk-xft-rgba = rgb
gtk-cursor-theme-name = Adwaita
EOF

There are many settings keys, some with default values. 
You can find them at Settings: GTK+ 3 Reference Manual https://developer.gnome.org/gtk3/stable/GtkSettings.html
There are many more themes available at https://www.gnome-look.org/browse/ and other places.

 As part of GTK+-3.0's redesign, the scroll bar buttons are no longer visible on the scrollbar in many applications. If this functionality is desired, modify the gtk.css file and restore them using the following command:

cat > ~/.config/gtk-3.0/gtk.css << "EOF"
*  {
   -GtkScrollbar-has-backward-stepper: 1;
   -GtkScrollbar-has-forward-stepper: 1;
}
EOF

INFO-ONLY
}

