Skip to content

Commit

Permalink
jsoncpp: correct name of static library
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Nov 19, 2024
1 parent 594c00e commit 216395b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
14 changes: 14 additions & 0 deletions mingw-w64-jsoncpp/0001-static-lib-name.patch
Original file line number Diff line number Diff line change
@@ -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 "")
22 changes: 19 additions & 3 deletions mingw-w64-jsoncpp/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down

0 comments on commit 216395b

Please sign in to comment.