From 1551f86b4d72d151f5cd411fdbfed23b3da2906e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 16 Mar 2025 18:11:15 +0100 Subject: [PATCH] gnutls: fix the static build * p11-kit does not support static builds, so avoid depending on it for the static lib only * make sure p11-kit is also not in Requires.private by using the static .pc file * Fix libintl import lib being referenced by path in the .pc file by passing --without-libintl-prefix This fixes static linking against libgnutls. Fixes #23287 --- mingw-w64-gnutls/PKGBUILD | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mingw-w64-gnutls/PKGBUILD b/mingw-w64-gnutls/PKGBUILD index aba28bf4cd..0459a70e50 100644 --- a/mingw-w64-gnutls/PKGBUILD +++ b/mingw-w64-gnutls/PKGBUILD @@ -4,7 +4,7 @@ _realname=gnutls pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=3.8.9 -pkgrel=1 +pkgrel=2 pkgdesc="A library which provides a secure layer over a reliable transport layer (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -92,8 +92,10 @@ build() { --disable-rpath \ --disable-gtk-doc \ --with-libiconv-prefix=${MINGW_PREFIX} \ + --without-libintl-prefix \ --disable-libdane \ --disable-tests \ + --without-p11-kit \ "${extra_config[@]}" \ gl_cv_double_slash_root=yes @@ -114,6 +116,7 @@ build() { --disable-rpath \ --disable-gtk-doc \ --with-libiconv-prefix=${MINGW_PREFIX} \ + --without-libintl-prefix \ --disable-libdane \ --disable-tests \ "${extra_config[@]}" \ @@ -137,6 +140,10 @@ package() { cd "${srcdir}/build-${MSYSTEM}-shared" make DESTDIR="${pkgdir}" install + # Since we use --without-p11-kit for the static build + # use the static .pc which doesn't have p11-kit in Requires.private + cp "${srcdir}/build-${MSYSTEM}-static/lib/gnutls.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/gnutls.pc" + find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm local PREFIX_DEPS=$(cygpath -am ${MINGW_PREFIX}) find "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig -name *.pc -exec sed -i -e"s|${PREFIX_DEPS}|${MINGW_PREFIX}|g" {} \;