Description: Fix rdeps' abort with poppler >= 25.02.
 Also use correct variable bindings_CPPFLAGS throughout the makefile.
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: not-needed
Last-Update: 2025-03-25
---

--- popplerkit.orig/bindings/GNUmakefile
+++ popplerkit/bindings/GNUmakefile
@@ -42,23 +42,27 @@
 endif
 
 ifeq ($(POPPLER_0_4), YES)
-   bindings_CCFLAGS += -DPOPPLER_0_4
+   bindings_CPPFLAGS += -DPOPPLER_0_4
 endif
 
 ifeq ($(POPPLER_0_5), YES)
-   bindings_CCFLAGS += -DPOPPLER_0_5
+   bindings_CPPFLAGS += -DPOPPLER_0_5
 endif
 
 ifeq ($(POPPLER_0_6), YES)
-   bindings_CCFLAGS += -DPOPPLER_0_6
+   bindings_CPPFLAGS += -DPOPPLER_0_6
 endif
 
 ifeq ($(POPPLER_0_20), YES)
-   bindings_CCFLAGS += -DPOPPLER_0_20
+   bindings_CPPFLAGS += -DPOPPLER_0_20
 endif
 
 ifeq ($(POPPLER_0_85), YES)
-   bindings_CCFLAGS += -DPOPPLER_0_20 -DPOPPLER_0_85
+   bindings_CPPFLAGS += -DPOPPLER_0_20 -DPOPPLER_0_85
+endif
+
+ifeq ($(POPPLER_25_02), YES)
+   bindings_CPPFLAGS += -DPOPPLER_0_20 -DPOPPLER_25_02
 endif
 
 include $(GNUSTEP_MAKEFILES)/subproject.make
--- popplerkit.orig/bindings/poppler.cc
+++ popplerkit/bindings/poppler.cc
@@ -127,6 +127,8 @@
       globalParams = new GlobalParams();
 #elif POPPLER_0_85
       globalParams = std::make_unique<GlobalParams>(nullptr);
+#elif POPPLER_25_02
+      globalParams = std::make_unique<GlobalParams>("");
 #else
       globalParams = new GlobalParams(NULL);
 #endif
--- popplerkit.orig/config.sh
+++ popplerkit/config.sh
@@ -76,6 +76,11 @@
   POPPLER_VERSION="POPPLER_0_85"
 fi
 
+${PKG_CONFIG} --atleast-version=25.02 poppler
+if [ $? -eq 0 ]; then
+  POPPLER_VERSION="POPPLER_25_02"
+fi
+
 echo $POPPLER_VERSION
 
 # include freetype, just to be sure
