b4n left a comment (geany/geany-plugins#1476)

> Out of curiosity - is it something you noticed by yourself or did someone 
> else report this issue? Isn't there some compile-time glib macro we could use 
> to always report issues like this? I've made this mistake several times 
> already and I suspect it's not the last time.

Actually yes, probably something like 
`-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56` (and optionally 
`-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56` not to get annoying 
deprecations for API we can't yet replace)

> Would it be hard to do using the build system? If it's not a big problem, I'd 
> prefer that to modifying jsonrpc-glib. But if the result is something too 
> complicated, I can e.g. save this diff to a patch file and apply it when 
> updating to a newer version of jsonrpc-glib (which I think is pretty stable 
> and not evolving too much so it might not be necessary to do normally).

Not tested, but it should be trivial.  Probably something like this:
```diff
diff --git a/build/lsp.m4 b/build/lsp.m4
index 2aaa6da3..af1dc6f6 100644
--- a/build/lsp.m4
+++ b/build/lsp.m4
@@ -2,6 +2,7 @@ AC_DEFUN([GP_CHECK_LSP],
 [
     GP_ARG_DISABLE([LSP], [auto])
 
+    GLIB_VERSION=2.68
     JSON_GLIB_PACKAGE_NAME=json-glib-1.0
     JSON_GLIB_VERSION=1.10
     JSONRPC_GLIB_PACKAGE_NAME=jsonrpc-glib-1.0
@@ -12,6 +13,8 @@ AC_DEFUN([GP_CHECK_LSP],
             [Force using system json-glib and jsonrpc-glib libraries for the 
LSP plugin. [[default=no]]]),,
         enable_system_jsonrpc=no)
 
+    GP_CHECK_PLUGIN_DEPS([LSP], [LSP], [glib-2.0 >= ${GLIB_VERSION}])
+
     PKG_CHECK_MODULES([SYSTEM_JSONRPC],
         [${JSON_GLIB_PACKAGE_NAME} >= ${JSON_GLIB_VERSION}
          ${JSONRPC_GLIB_PACKAGE_NAME} >= ${JSONRPC_GLIB_VERSION}],
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1476#issuecomment-3053002276
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/pull/1476/[email protected]>

Reply via email to