vala: patch to circumvent apparent pkgconf bug
authorW. Michael Petullo <mike@flyn.org>
Sun, 25 Jun 2023 20:36:28 +0000 (15:36 -0500)
committerTianling Shen <cnsztl@gmail.com>
Tue, 4 Jul 2023 08:01:58 +0000 (16:01 +0800)
There is an apparent bug in pkgconf 1.9 that broke building the OpenWrt
Vala package. This adds a patch to circumvent the bug. For the related
discussion, see:

https://github.com/openwrt/packages/issues/21359

The pkgconf bug appears similar to the one discussed here:

https://github.com/pkgconf/pkgconf/issues/268

Signed-off-by: W. Michael Petullo <mike@flyn.org>
(cherry picked from commit a7e1ba32fdf4b736a44d467b0f79b7f4665ce32d)

lang/vala/patches/001-circumvent-glib-pkgconf-bug.patch [new file with mode: 0644]

diff --git a/lang/vala/patches/001-circumvent-glib-pkgconf-bug.patch b/lang/vala/patches/001-circumvent-glib-pkgconf-bug.patch
new file mode 100644 (file)
index 0000000..fb60992
--- /dev/null
@@ -0,0 +1,73 @@
+This patch circumvents an apparent bug in pkgconf 1.9 that prevents
+building the OpenWrt Vala package. For a discussion of this, see:
+
+https://github.com/openwrt/packages/issues/21359
+
+The pkgconf bug seems similar to the one discussed here:
+
+https://github.com/pkgconf/pkgconf/issues/268
+
+--- a/configure
++++ b/configure
+@@ -13598,11 +13598,11 @@ if test -n "$GLIB_CFLAGS"; then
+  elif test -n "$PKG_CONFIG"; then
+     if test -n "$PKG_CONFIG" && \
+     { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_REQUIRED gobject-2.0 >= \$GLIB_REQUIRED\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED") 2>&5
++  ($PKG_CONFIG --exists --print-errors "gobject-2.0 >= $GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED") 2>&5
+   ac_status=$?
+   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+-  pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED" 2>/dev/null`
++  pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0 >= $GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+ else
+   pkg_failed=yes
+@@ -13615,11 +13615,11 @@ if test -n "$GLIB_LIBS"; then
+  elif test -n "$PKG_CONFIG"; then
+     if test -n "$PKG_CONFIG" && \
+     { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_REQUIRED gobject-2.0 >= \$GLIB_REQUIRED\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED") 2>&5
++  ($PKG_CONFIG --exists --print-errors "gobject-2.0 >= $GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED") 2>&5
+   ac_status=$?
+   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+-  pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED" 2>/dev/null`
++  pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gobject-2.0 >= $GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+ else
+   pkg_failed=yes
+@@ -13640,9 +13640,9 @@ else
+         _pkg_short_errors_supported=no
+ fi
+         if test $_pkg_short_errors_supported = yes; then
+-              GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED" 2>&1`
++              GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gobject-2.0 >= $GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2>&1`
+         else
+-              GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED" 2>&1`
++              GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gobject-2.0 >= $GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2>&1`
+         fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$GLIB_PKG_ERRORS" >&5
+--- a/gobject-introspection/Makefile.in
++++ b/gobject-introspection/Makefile.in
+@@ -383,8 +383,8 @@ libgidl_la_SOURCES = \
+       $(NULL)
+ libgidl_la_LIBADD = \
+-      $(GLIB_LIBS) \
+       $(GMODULE_LIBS) \
++      $(GLIB_LIBS) \
+       $(NULL)
+ BUILT_SOURCES = scannerparser.h
+@@ -400,8 +400,8 @@ gen_introspect_SOURCES = \
+       $(NULL)
+ gen_introspect_LDADD = \
+-      $(GLIB_LIBS) \
+       $(GMODULE_LIBS) \
++      $(GLIB_LIBS) \
+       libgidl.la \
+       $(NULL)