NAME="gtk4"
DESC="Libraries used for creating graphical user interfaces for applications"
VERSION="4.12.0"
FILES=("https://download.gnome.org/sources/gtk/4.12/gtk-$VERSION.tar.xz")
HASHES=("69372ddb998c125c3a04c44b8c68b339")
DEPENDS=(
  "at-spi2-core" "gdk-pixbuf" "libepoxy" 
  "pango" "gsettings-desktop-schemas"
)

PACKAGE() {
  tar xf gtk-$VERSION.tar.xz
  cd gtk-$VERSION

  sed -e '/glib-object.h/a #include <gdk/gdk.h>'        \
    -e '/ gtk_printer_option/i GDK_AVAILABLE_IN_ALL'  \
    -e '/\*gtk_printer_option/i GDK_AVAILABLE_IN_ALL' \
    -i.orig gtk/print/gtkprinteroptionprivate.h

  mkdir build
  cd    build

  meson setup --prefix=/usr         \
            --buildtype=release     \
            -Dbroadway-backend=true \
            -Dintrospection=enabled \
            ..
  ninja && DESTDIR="$ROOTDIR" ninja install

  cd ../.. && rm -r gtk-$VERSION
}
