|
| 1 | +# Maintainer: Felix Yan <felixonmars@archlinux.org> |
| 2 | +# Contributor: Ionut Biru <ibiru@archlinux.org |
| 3 | +# Contributor: Pierre Schmitz <pierre@archlinux.de> |
| 4 | +# Contributor: Mikko Seppälä <t-r-a-y@mbnet.fi> |
| 5 | + |
| 6 | +pkgname=lib32-gtk2 |
| 7 | +pkgver=2.24.33 |
| 8 | +pkgrel=5 |
| 9 | +pkgdesc="GObject-based multi-platform GUI toolkit (legacy, 32-bit)" |
| 10 | +url="https://www.gtk.org/" |
| 11 | +arch=(x86_64) |
| 12 | +license=(LGPL-2.1-or-later) |
| 13 | +depends=( |
| 14 | + gtk2 |
| 15 | + lib32-atk |
| 16 | + lib32-cairo |
| 17 | + lib32-gdk-pixbuf2 |
| 18 | + lib32-glib2 |
| 19 | + lib32-glibc |
| 20 | + lib32-libcups |
| 21 | + lib32-librsvg |
| 22 | + lib32-libx11 |
| 23 | + lib32-libxcomposite |
| 24 | + lib32-libxcursor |
| 25 | + lib32-libxdamage |
| 26 | + lib32-libxext |
| 27 | + lib32-libxfixes |
| 28 | + lib32-libxi |
| 29 | + lib32-libxinerama |
| 30 | + lib32-libxrandr |
| 31 | + lib32-libxrender |
| 32 | + lib32-pango |
| 33 | +) |
| 34 | +makedepends=( |
| 35 | + git |
| 36 | + glib2-devel |
| 37 | + gobject-introspection |
| 38 | + gtk-doc |
| 39 | +) |
| 40 | +source=( |
| 41 | + "git+https://gitlab.gnome.org/GNOME/gtk.git#tag=$pkgver" |
| 42 | + gtk-query-immodules-2.0-32.hook |
| 43 | + 0001-Lower-severity-of-XID-collision-warnings.patch |
| 44 | + 0002-Stop-looking-for-modules-in-cwd.patch |
| 45 | +) |
| 46 | +b2sums=('1b18d1cfef55466209cf93be45af15dc058a8b74d13ab590cfc7f0b09b0584adc62d4330aaed65185c0142cc8c326e4274c8e75e0af94bec5be3cfcca105c1e6' |
| 47 | + 'e9a1c4037c9e1fd03e0c139059165a85b6258b0535bd8150d5b1bdab71f056240bd0448f2f1d6930aa1b1b73299707e79ce83c6f28dcbeb7664412c136bb5401' |
| 48 | + '45ecc976d9eb9d990fc204230aa052a6d1b2bdfdc94788be37d576ab262a1da49855eb46ecd4bfce4efde6e2f817a1660c6d1fa756be3b372f7f8d13b0ef0fd0' |
| 49 | + '06ca1c6f0e8f6a7c7a3cc08ce3d358af978d28fc4aa8d9e981883e3ad5adf7d821bcb27bc8b93bf65171a92396ac8f7ad62c90db501a492cca7c30b6081e957f') |
| 50 | + |
| 51 | +prepare() { |
| 52 | + cd gtk |
| 53 | + git apply -3 ../0001-Lower-severity-of-XID-collision-warnings.patch |
| 54 | + |
| 55 | + # CVE-2024-6655: https://www.openwall.com/lists/oss-security/2024/09/09/1 |
| 56 | + # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7361 |
| 57 | + git apply -3 ../0002-Stop-looking-for-modules-in-cwd.patch |
| 58 | + |
| 59 | + sed -i '/AM_INIT_AUTOMAKE/s/]/ foreign]/' configure.ac |
| 60 | + autoreconf -fvi |
| 61 | +} |
| 62 | + |
| 63 | +build() { |
| 64 | + local configure_options=( |
| 65 | + --prefix=/usr |
| 66 | + --libdir=/usr/lib32 |
| 67 | + --sysconfdir=/etc |
| 68 | + --localstatedir=/var |
| 69 | + --with-xinput=yes |
| 70 | + --disable-gtk-doc |
| 71 | + ) |
| 72 | + |
| 73 | + export CC="gcc -m32" |
| 74 | + export CXX="g++ -m32" |
| 75 | + export PKG_CONFIG=i686-pc-linux-gnu-pkg-config |
| 76 | + CFLAGS+=" -Wno-error=implicit-int -Wno-error=incompatible-pointer-types" |
| 77 | + |
| 78 | + cd gtk |
| 79 | + ./configure "${configure_options[@]}" |
| 80 | + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool |
| 81 | + make |
| 82 | +} |
| 83 | + |
| 84 | +package() { |
| 85 | + optdepends=( |
| 86 | + 'adwaita-fonts: Default font' |
| 87 | + 'adwaita-icon-theme: Default icon theme' |
| 88 | + 'gnome-themes-extra-gtk2: Default widget theme' |
| 89 | + ) |
| 90 | + provides=( |
| 91 | + libgailutil.so |
| 92 | + libgdk-x11-2.0.so |
| 93 | + libgtk-x11-2.0.so |
| 94 | + ) |
| 95 | + install=lib32-gtk2.install |
| 96 | + |
| 97 | + make -C gtk DESTDIR="$pkgdir" install |
| 98 | + rm -r "$pkgdir"/{etc,usr/{include,share}} |
| 99 | + find "$pkgdir/usr/bin" -type f -not -name gtk-query-immodules-2.0 -delete |
| 100 | + mv "$pkgdir"/usr/bin/gtk-query-immodules-2.0{,-32} |
| 101 | + |
| 102 | + install -Dm644 gtk-query-immodules-2.0-32.hook -t "$pkgdir/usr/share/libalpm/hooks" |
| 103 | +} |
| 104 | + |
| 105 | +# vim:set sw=2 sts=-1 et: |
0 commit comments