# Maintainer: Jesus E. pkgname=gtk2 pkgver=2.24.33 _debver=$pkgver _debrel=2 pkgrel=4 pkgdesc="GObject-based multi-platform GUI toolkit (legacy version)" arch=(i686 x86_64) url="https://www.gtk.org/" depends=(atk pango libxcursor libxinerama libxrandr libxi libxcomposite libxdamage shared-mime-info cairo libcups gtk-update-icon-cache librsvg-legacy desktop-file-utils arc-icon-theme xcursor-premium) makedepends=(gobject-introspection quilt) optdepends=('gnome-themes-extra: Default widget theme' 'tauthon: gtk-builder-convert') license=(LGPL-2) install=gtk2.install source=("https://download.gnome.org/sources/gtk+/${pkgver:0:4}/gtk+-$pkgver.tar.xz" "https://deb.debian.org/debian/pool/main/g/gtk+2.0/gtk+2.0_$_debver-$_debrel.debian.tar.xz" gtkrc gtk-query-immodules-2.0.hook xid-collision-debug.patch remove-gtk-doc-support.patch CVE-2024-6655.patch) sha512sums=('71b588797c81f727dfac8dcb1be193f7436f717d30ecf18eae2d3aeb0f445b3be4743400acac16435490db8f564f01032065d3f42d27871317f80c98aef929d5' '2ddd60764df23d2f53f541835e7b6d11ee4d23ec4e8256ecbd217c19ad2b8e0eeacb2b35f4c56c71df3aba4f98412e90bc79e122dbb9c5d77f51ed017dc0bd23' '398760cf027a337f04d623c91b870752b9a5b41c6038069e04a84fd30aae610e084fe675c60faba62092b96f8149a7606947f9413347eac7b75c0b54ebfb1e2a' 'be7a807046f27e5796f6069dfd2c88f9b7508e3b9e209d97c1575e0d809b279aacacd0e1247f1f7643fa47eede2d987bf433cd17cea0524526ad31982ae8d90d' '89e3223c86731a76b12d39245f1ec4cf8b4860ab1d11d74a10e5deb0db302f20b4bb5d9034da1d8aeb96369dbdeddcdd2f28943270dc501476c694562b960159' '771355046c218726356d7b8823fba4a0f69620936f40d67f18b44378d4f099deb62c2236806176446cb8784327dc555d86518d8bf3eddc6c203d586b0ca165dd' 'b8c8c27e5ef5d8f41527196ef122f37a9e398bc122f1c36c97bfcc09b816c8f4ddacc9d69b75e598d24a27fb8daf0934d6ca977bc889ba6829f9bcc0580f4fe6') prepare() { cd gtk+-$pkgver if [[ ${pkgver%.*} = ${_debver%.*} ]]; then # Debian patches export QUILT_PATCHES=debian/patches export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index' export QUILT_DIFF_ARGS='--no-timestamps' mv "$srcdir"/debian . quilt push -av fi patch -Np1 -i $srcdir/xid-collision-debug.patch patch -Np1 -i $srcdir/remove-gtk-doc-support.patch patch -Np1 -i $srcdir/CVE-2024-6655.patch sed -i '1s/python$/tauthon/' gtk/gtk-builder-convert autoreconf -fvi } build() { cd gtk+-$pkgver ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-xinput=yes \ --enable-man # https://bugzilla.gnome.org/show_bug.cgi?id=655517 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make } package() { cd gtk+-$pkgver make DESTDIR="$pkgdir" install install -Dm644 ../gtkrc "$pkgdir/usr/share/gtk-2.0/gtkrc" install -Dm644 ../gtk-query-immodules-2.0.hook "$pkgdir/usr/share/libalpm/hooks/gtk-query-immodules-2.0.hook" install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING" rm "$pkgdir/usr/bin/gtk-update-icon-cache" }