From 216395b5f7e14e52748a0fa843434dbaa2750421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Tue, 19 Nov 2024 14:11:50 +0100 Subject: [PATCH] jsoncpp: correct name of static library --- mingw-w64-jsoncpp/0001-static-lib-name.patch | 14 +++++++++++++ mingw-w64-jsoncpp/PKGBUILD | 22 +++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 mingw-w64-jsoncpp/0001-static-lib-name.patch diff --git a/mingw-w64-jsoncpp/0001-static-lib-name.patch b/mingw-w64-jsoncpp/0001-static-lib-name.patch new file mode 100644 index 0000000000000..7abec87dfbdc5 --- /dev/null +++ b/mingw-w64-jsoncpp/0001-static-lib-name.patch @@ -0,0 +1,14 @@ +Append suffix to static library name only for MSVC. + +diff -urN jsoncpp-1.9.6/src/lib_json/CMakeLists.txt.orig jsoncpp-1.9.6/src/lib_json/CMakeLists.txt +--- jsoncpp-1.9.6/src/lib_json/CMakeLists.txt.orig 2024-09-10 05:18:29.000000000 +0200 ++++ jsoncpp-1.9.6/src/lib_json/CMakeLists.txt 2024-11-19 14:07:18.639721600 +0100 +@@ -143,7 +143,7 @@ + + # avoid name clashes on windows as the shared import lib is also named jsoncpp.lib + if(NOT DEFINED STATIC_SUFFIX AND BUILD_SHARED_LIBS) +- if (WIN32) ++ if (MSVC) + set(STATIC_SUFFIX "_static") + else() + set(STATIC_SUFFIX "") diff --git a/mingw-w64-jsoncpp/PKGBUILD b/mingw-w64-jsoncpp/PKGBUILD index 64e19eea2e303..4c660710b923c 100644 --- a/mingw-w64-jsoncpp/PKGBUILD +++ b/mingw-w64-jsoncpp/PKGBUILD @@ -4,7 +4,7 @@ _realname=jsoncpp pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=1.9.6 -pkgrel=2 +pkgrel=3 pkgdesc="A C++ library for interacting with JSON (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -17,8 +17,24 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-ninja") -source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/open-source-parsers/jsoncpp/archive/${pkgver}.tar.gz") -sha256sums=('f93b6dd7ce796b13d02c108bc9f79812245a82e577581c4c9aabe57075c90ea2') +source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/open-source-parsers/jsoncpp/archive/${pkgver}.tar.gz" + "0001-static-lib-name.patch") +sha256sums=('f93b6dd7ce796b13d02c108bc9f79812245a82e577581c4c9aabe57075c90ea2' + '692d7ae7f102644aaf7a41f1f9eafd7b3eca45febd6bde8675afdabca85adb4f') + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + apply_patch_with_msg \ + 0001-static-lib-name.patch +} build() { declare -a extra_config