Skip to content

Instantly share code, notes, and snippets.

@jonjonw
Last active August 29, 2020 17:49
Show Gist options
  • Save jonjonw/39031796ca230e240311fbb73085bd80 to your computer and use it in GitHub Desktop.
Save jonjonw/39031796ca230e240311fbb73085bd80 to your computer and use it in GitHub Desktop.
Patch for lib32-gtkglext in archlinux AUR

This a patch for https://aur.archlinux.org/packages/lib32-gtkglext/ to fix the compile error arond the use of the variable name 'index'.

To apply, clone the repo and apply git git patch before building:

git clone https://aur.archlinux.org/lib32-gtkglext.git
cd lib32-gtkglext
curl -LO https://gist.github.com/jonjonw/39031796ca230e240311fbb73085bd80/raw/lib32-gtkglext.git.diff
git apply lib32-gtkglext.git.diff
makepkg -si
diff --git a/.SRCINFO b/.SRCINFO
index 129ac65..71b9500 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = lib32-gtkglext
pkgdesc = OpenGL extensions for GTK+ (32-bit)
pkgver = 1.2.0
- pkgrel = 9
+ pkgrel = 10
url = http://gtkglext.sourceforge.net/
arch = x86_64
license = LGPL
@@ -15,8 +15,10 @@ pkgbase = lib32-gtkglext
options = !libtool
source = http://downloads.sourceforge.net/sourceforge/gtkglext/gtkglext-1.2.0.tar.bz2
source = gtk2.20.patch
+ source = gdkglshapes.patch
md5sums = ed7ba24ce06a8630c07f2d0ee5f04ab4
md5sums = e5a87ec3f2d0e616c6f32f90c3f7237f
+ md5sums = 612bae44f3cc9db93687af2b5d86a02f
pkgname = lib32-gtkglext
diff --git a/PKGBUILD b/PKGBUILD
index bf88f67..757b3f1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,12 +1,13 @@
# Contributor: Sphax <zecmerquise at gmail dot com>
# Contributor: WAAAGH.313ph4n7 <waaagh313ph4n7@gmail.com>
# Contributor: Anton Larionov <diffident dot cat at gmail dot com>
+# Contributor: Jon Wiersma (archaur at jonw dot org)
# Maintainer: josephgbr <rafael.f.f1@gmail.com>
_pkgbase=gtkglext
pkgname=lib32-$_pkgbase
pkgver=1.2.0
-pkgrel=9
+pkgrel=10
pkgdesc="OpenGL extensions for GTK+ (32-bit)"
arch=('x86_64')
url="http://gtkglext.sourceforge.net/"
@@ -15,9 +16,17 @@ depends=('lib32-gtk2' 'lib32-libxmu' 'lib32-glu' 'lib32-pangox-compat' "$_pkgbas
makedepends=('gcc-multilib' 'lib32-mesa')
options=('!libtool')
source=("http://downloads.sourceforge.net/sourceforge/gtkglext/${_pkgbase}-${pkgver}.tar.bz2"
- gtk2.20.patch)
+ gtk2.20.patch
+ gdkglshapes.patch)
md5sums=('ed7ba24ce06a8630c07f2d0ee5f04ab4'
- 'e5a87ec3f2d0e616c6f32f90c3f7237f')
+ 'e5a87ec3f2d0e616c6f32f90c3f7237f'
+ '612bae44f3cc9db93687af2b5d86a02f')
+
+prepare() {
+ cd ${_pkgbase}-${pkgver}
+ patch -Np1 -i ../gtk2.20.patch
+ patch -Np1 -i ../gdkglshapes.patch
+}
build() {
export CC="gcc -m32"
@@ -25,7 +34,6 @@ build() {
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
cd ${_pkgbase}-${pkgver}
- patch -Np1 -i ../gtk2.20.patch
autoconf --force
./configure --prefix=/usr --libdir=/usr/lib32
make
diff --git a/gdkglshapes.patch b/gdkglshapes.patch
new file mode 100644
index 0000000..302176c
--- /dev/null
+++ b/gdkglshapes.patch
@@ -0,0 +1,20 @@
+--- gtkglext-1.2.0.orig/gdk/gdkglshapes.c 2019-04-05 21:26:39.603827724 -0700
++++ gtkglext-1.2.0/gdk/gdkglshapes.c 2019-04-05 21:28:01.124446952 -0700
+@@ -544,7 +544,7 @@
+ {-Z, -X, 0}
+ };
+
+-static int index[20][3] =
++static int bindex[20][3] =
+ {
+ {0, 4, 1},
+ {0, 9, 4},
+@@ -574,7 +574,7 @@
+ int i;
+
+ for (i = 19; i >= 0; i--) {
+- drawtriangle(i, idata, index, shadeType);
++ drawtriangle(i, idata, bindex, shadeType);
+ }
+ }
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment