From 7fdcebbac395637cf3e2a79e0ecd4c514dd4b131 Mon Sep 17 00:00:00 2001
From: Dimitry Ishenko <dimitry.ishenko@gmail.com>
Date: Wed, 13 May 2026 15:26:11 -0400
Subject: [PATCH 1/4] Patch glew.pc.in

Upstream patch: https://github.com/nigels-com/glew/pull/477
---
 ...w.pc.in-make-includedir-configurable.patch | 49 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 debian/patches/0004-glew.pc.in-make-includedir-configurable.patch

diff --git a/debian/patches/0004-glew.pc.in-make-includedir-configurable.patch b/debian/patches/0004-glew.pc.in-make-includedir-configurable.patch
new file mode 100644
index 0000000..b174313
--- /dev/null
+++ b/debian/patches/0004-glew.pc.in-make-includedir-configurable.patch
@@ -0,0 +1,49 @@
+From 6b1f8298ee8c21eb0e72705aaca3420913511812 Mon Sep 17 00:00:00 2001
+From: Dimitry Ishenko <dimitry.ishenko@gmail.com>
+Date: Wed, 13 May 2026 15:17:27 -0400
+Subject: [PATCH] glew.pc.in: make includedir configurable
+
+---
+ Makefile   | 5 +++--
+ glew.pc.in | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 0ff4e2c..4b4a701 100644
+--- a/Makefile
++++ b/Makefile
+@@ -44,7 +44,8 @@ GLEW_PREFIX ?= /usr/local
+ GLEW_DEST ?= /usr/local
+ BINDIR    ?= $(GLEW_DEST)/bin
+ LIBDIR    ?= $(GLEW_DEST)/lib
+-INCDIR    ?= $(GLEW_DEST)/include/GL
++INCLUDEDIR ?= $(GLEW_DEST)/include
++INCDIR    ?= $(INCLUDEDIR)/GL
+ PKGDIR    ?= $(GLEW_DEST)/lib/pkgconfig
+ 
+ ifneq ($(GLEW_NO_GLU), -DGLEW_NO_GLU)
+@@ -146,7 +147,7 @@ glew.pc: glew.pc.in
+ 		-e "s|@prefix@|$(GLEW_PREFIX)|g" \
+ 		-e "s|@libdir@|$(LIBDIR)|g" \
+ 		-e "s|@exec_prefix@|$(BINDIR)|g" \
+-		-e "s|@includedir@|$(INCDIR)|g" \
++		-e "s|@includedir@|$(INCLUDEDIR)|g" \
+ 		-e "s|@version@|$(GLEW_VERSION)|g" \
+ 		-e "s|@cflags@||g" \
+ 		-e "s|@libname@|$(NAME)|g" \
+diff --git a/glew.pc.in b/glew.pc.in
+index a892540..27d8614 100644
+--- a/glew.pc.in
++++ b/glew.pc.in
+@@ -1,7 +1,7 @@
+ prefix=@prefix@
+ exec_prefix=${prefix}
+ libdir=@libdir@
+-includedir=${prefix}/include
++includedir=@includedir@
+ 
+ Name: glew
+ Description: The OpenGL Extension Wrangler library
+-- 
+2.53.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 56d592b..d37140f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-Fix_FTBFS_on_kFreeBSD.patch
 # 0002-Fix_pkgconfig_path.patch
 # 0003-Fix_glex-moved-header.patch
+0004-glew.pc.in-make-includedir-configurable.patch
-- 
2.53.0

