NAME="gtk3"
DESC="Libraries used for creating graphical user interfaces for applications"
VERSION="3.24.41"

FILES=(
  "https://download.gnome.org/sources/gtk+/${VERSION%.*}/gtk+-${VERSION}.tar.xz"
  "update-icon-cache.sh"
)
HASHES=(
  "2321e8158feac093b6ed82aac66dbbfd"
  "565f1889ebca2136e5f10a670571499da25178085682da542b722004811da6d8"
)

DEPENDS=(
  "at-spi2-core" "gdk-pixbuf" "libepoxy"
  "glib" "pango" "gsettings-desktop-schemas"
  "wayland"
)
BUILD=("meson" "wayland-protocols")

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

  mkdir build
  cd    build

  meson setup --prefix=/usr         \
            --buildtype=release     \
            -Dman=true              \
            -Dbroadway_backend=true \
            ..                     
  ninja
  DESTDIR="${ROOTDIR}" ninja install
  install -m755 "${ROOTDIR}/update-icon-cache.sh" "${ROOTDIR}/usr/bin/update-icon-cache"

  cd ../.. && rm -rf "gtk+-${VERSION}"
}

INSTALL(){
  gtk-query-immodules-3.0 --update-cache
  glib-compile-schemas /usr/share/glib-2.0/schemas
  exit 0
}
