Files
packages/net/gnunet/patches/0005-meson-detect-libcurl-gnutls.patch
T
Daniel Golle 9667c7473d gnunet: update to 0.27.0
Changes since 0.25.1:

0.27.0:
 * util: Removed GNUNET_CRYPTO_symmetric_derive_iv API
 * util: Deprecate GNUNET_CRYPTO_symmetric_* APIs
 * util: Revise GNUNET_CRYPTO_hkdf_* APIs for safe variadic
   arguments. Fixes #10898

0.26.x:
 * util: Revise crypto API to prevent misuse of key material
 * util: Add various TIME related helper APIs
 * pils: Ship missing header
 * pq: fix NULL reporting in arrays
 * pq: fix consistency check errors
 * util: fix UTF-8 uppercase/lowercase conversion API insanity

0.25.2:
 * build: Various build system and detection logic improvements
 * reintroduce some flat file storages

Drop patches that have been merged upstream:
 - 0001-meson-convert-SQLite-version-detection-to-compile-time
 - 0002-meson-convert-cURL-version-detection-to-compile-time
 - 0003-meson-convert-libsodium-version-detection-to-compile
 - 0004-meson-convert-cURL-SSL-library-detection-to-compile
 - 0007-namecache-install-sql-files
 - 0008-namecache-build-flat-namecache-plugin

Refresh 0005-meson-detect-libcurl-gnutls.patch for the upstream
switch from cc.compiles to cc.run for the cURL SSL backend check.

Link: https://git.gnunet.org/gnunet.git/tree/NEWS?h=v0.27.0
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-05-15 13:44:24 +01:00

106 lines
3.2 KiB
Diff

From a4a4f5e02ac1cc396bbd1fb8e0c0c460a833512e Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Fri, 10 Oct 2025 01:15:11 +0100
Subject: [PATCH 5/8] meson: detect libcurl-gnutls
Instead of only checking if cURL is built against gnuTLS, also test of
there is a dedicated libcurl-gnutls library and favor using it.
---
meson.build | 67 +++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 52 insertions(+), 15 deletions(-)
--- a/meson.build
+++ b/meson.build
@@ -194,10 +194,17 @@ if not sqlite_dep.found()
error('Sqlite version >= 3.35.0 requried')
endif
endif
-curl_dep = dependency('libcurl', version: '>=7.85.0', required: false)
-if not curl_dep.found()
- curl_dep = cc.find_library('curl', required: true)
- curl_version_check = '''#include <curl/curl.h>
+
+curl_gnutls_dep = dependency(
+ 'libcurl-gnutls',
+ version: '>=7.85.0',
+ required: false,
+)
+if not curl_gnutls_dep.found()
+ curl_gnutls_dep = cc.find_library('curl-gnutls', required: false)
+endif
+
+curl_version_check = '''#include <curl/curl.h>
int main(int argc, char **argv) {
#if LIBCURL_VERSION_NUM < 0x075500
#error "cURL version >= 7.85.0 required"
@@ -205,12 +212,34 @@ if not curl_dep.found()
return 0;
}
'''
- if not cc.compiles(
- curl_version_check,
- name: 'cURL version check',
- dependencies: curl_dep,
- )
- error('cURL version >=7.85.0 required')
+
+# If libcurl-gnutls found, use it and we know it has gnutls support
+curl_is_gnutls = false
+if curl_gnutls_dep.found()
+ curl_dep = curl_gnutls_dep
+ curl_is_gnutls = true
+ # Check version for libcurl-gnutls if it was found via find_library
+ if curl_gnutls_dep.type_name() != 'pkgconfig'
+ if not cc.compiles(
+ curl_version_check,
+ name: 'cURL-gnutls version check',
+ dependencies: curl_dep,
+ )
+ error('libcurl-gnutls version >=7.85.0 required')
+ endif
+ endif
+else
+ # Fall back to regular libcurl
+ curl_dep = dependency('libcurl', version: '>=7.85.0', required: false)
+ if not curl_dep.found()
+ curl_dep = cc.find_library('curl', required: true)
+ if not cc.compiles(
+ curl_version_check,
+ name: 'cURL version check',
+ dependencies: curl_dep,
+ )
+ error('cURL version >=7.85.0 required')
+ endif
endif
endif
zlib_dep = dependency('zlib', required: false)
@@ -489,13 +518,22 @@ curl_ssl_check = '''#include <curl/curl.
}
'''
-result = cc.run(
- curl_ssl_check,
- name: 'cURL gnutls check',
- dependencies: curl_dep,
-)
+# Check if we found libcurl-gnutls (has gnutls support by definition)
+curl_gnutls_available = false
+if curl_is_gnutls
+ curl_gnutls_available = true
+else
+ # Fall back to runtime check for regular libcurl with gnutls support
+ result = cc.run(
+ curl_ssl_check,
+ name: 'cURL gnutls check',
+ dependencies: curl_dep,
+ )
+ curl_gnutls_available = result.returncode() == 0
+endif
+
private_config.set('curl_gnutls', 0)
-if result.returncode() == 0
+if curl_gnutls_available
private_config.set('curl_gnutls', 1)
endif