By default, glew sets the libdir in the pkg-config file to the LIBDIR
that it is installed to. We don't want that here, so this commit patches
the pkg-config file to always use the system's libdir (/usr/lib).
Signed-off-by: Sebastian <sebastian@sebsite.pw>
---
community/glew/APKBUILD | 11 +++++++----
community/glew/glew.patch | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 4 deletions(-)
create mode 100644 community/glew/glew.patch
diff --git a/community/glew/APKBUILD b/community/glew/APKBUILD
index 4b3fb46f..8d4ee3ff 100644
--- a/community/glew/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=glew
pkgver=2.2.0
-pkgrel=0
+pkgrel=1
pkgdesc="A cross-platform C/C++ extension loading library"
url="http://glew.sourceforge.net"
arch="all"
@@ -11,12 +11,12 @@ options="!check" # No test suite.
depends_dev="libxmu-dev libxi-dev mesa-dev glu-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dev"
-source="https://downloads.sourceforge.net/glew/glew-$pkgver.tgz"
+source="https://downloads.sourceforge.net/glew/glew-$pkgver.tgz
+ glew.patch"
replaces="mesa-dev"
prepare() {
default_prepare
- sed -i 's|lib64|lib|' config/Makefile.linux
}
build() {
@@ -27,4 +27,7 @@ package() {
make GLEW_DEST="$pkgdir/usr" install
}
-sha512sums="57453646635609d54f62fb32a080b82b601fd471fcfd26e109f479b3fef6dfbc24b83f4ba62916d07d62cd06d1409ad7aa19bc1cd7cf3639c103c815b8be31d1 glew-2.2.0.tgz"
+sha512sums="
+57453646635609d54f62fb32a080b82b601fd471fcfd26e109f479b3fef6dfbc24b83f4ba62916d07d62cd06d1409ad7aa19bc1cd7cf3639c103c815b8be31d1 glew-2.2.0.tgz
+8fc5bee31d59f47d6097a77a36325fe5b64b320b786974218f770c0f4046ade59342ad8c48cc5af4306772321c57eefbfbcee54e37389a466f9de37c3ed1ec67 glew.patch
+"
diff --git a/community/glew/glew.patch b/community/glew/glew.patch
new file mode 100644
index 00000000..4bc21e00
--- /dev/null
@@ -0,0 +1,34 @@
+Fixes pkg-config file to have correct system libdir.
+
+diff -aur glew-2.2.0/Makefile glew-2.2.0-alpine/Makefile
+--- glew-2.2.0/Makefile 2020-03-15 11:53:59.000000000 +0000
++++ glew-2.2.0-alpine/Makefile 2022-01-28 02:42:23.773580331 +0000
+@@ -144,7 +144,7 @@
+ glew.pc: glew.pc.in
+ sed \
+ -e "s|@prefix@|$(GLEW_PREFIX)|g" \
+- -e "s|@libdir@|$(LIBDIR)|g" \
++ -e "s|@libdir@|/usr/lib|g" \
+ -e "s|@exec_prefix@|$(BINDIR)|g" \
+ -e "s|@includedir@|$(INCDIR)|g" \
+ -e "s|@version@|$(GLEW_VERSION)|g" \
+
+diff -aur glew-2.2.0/config/Makefile.linux glew-2.2.0-alpine/config/Makefile.linux
+--- glew-2.2.0/config/Makefile.linux 2020-03-15 11:53:59.000000000 +0000
++++ glew-2.2.0-alpine/config/Makefile.linux 2022-01-28 02:43:26.813582486 +0000
+@@ -12,13 +12,8 @@
+ ifeq (e2k,${M_ARCH})
+ ARCH64 = true
+ endif
+-ifeq (${ARCH64},true)
+- LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64
+- LIBDIR = $(GLEW_DEST)/lib64
+-else
+- LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib
+- LIBDIR = $(GLEW_DEST)/lib
+-endif
++LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib
++LIBDIR = $(GLEW_DEST)/usr/lib
+ LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
--
2.34.1
This patch puts files in wrong locations:
```
--- filelist-glew-old
+++ filelist-glew
@@ -1,5 +1,7 @@
.PKGINFO
usr/
-usr/lib/
-usr/lib/libGLEW.so.2.2
-usr/lib/libGLEW.so.2.2.0
+usr/usr/
+usr/usr/lib/
+usr/usr/lib/libGLEW.so
+usr/usr/lib/libGLEW.so.2.2
+usr/usr/lib/libGLEW.so.2.2.0
>>> Size difference for glew-dev: 2472 KiB -> 2488 KiB
--- filelist-glew-dev-old
+++ filelist-glew-dev
@@ -6,7 +6,8 @@
usr/include/GL/glxew.h
usr/include/GL/wglew.h
usr/lib/
-usr/lib/libGLEW.a
-usr/lib/libGLEW.so
usr/lib/pkgconfig/
usr/lib/pkgconfig/glew.pc
+usr/usr/
+usr/usr/lib/
+usr/usr/lib/libGLEW.a
```
--
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/30087#note_210149