]> git.pld-linux.org Git - packages/jsoncpp.git/commitdiff
- added cmake-prefer-shared patch: let namespaced target (JsonCpp::JsonCpp) point... master auto/th/jsoncpp-1.9.5-3
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 10 May 2023 15:54:22 +0000 (17:54 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Wed, 10 May 2023 15:54:22 +0000 (17:54 +0200)
- fixed description
- release 3

jsoncpp-cmake-prefer-shared.patch [new file with mode: 0644]
jsoncpp.spec

diff --git a/jsoncpp-cmake-prefer-shared.patch b/jsoncpp-cmake-prefer-shared.patch
new file mode 100644 (file)
index 0000000..bc9fce5
--- /dev/null
@@ -0,0 +1,16 @@
+--- jsoncpp-1.9.5/jsoncpp-namespaced-targets.cmake.orig        2021-11-03 18:53:28.000000000 +0100
++++ jsoncpp-1.9.5/jsoncpp-namespaced-targets.cmake     2023-05-10 16:21:39.573256446 +0200
+@@ -1,7 +1,7 @@
+-if (TARGET jsoncpp_static)
+-    add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
+-    set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
+-elseif (TARGET jsoncpp_lib)
++if (TARGET jsoncpp_lib)
+     add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
+     set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
+-endif ()
+\ No newline at end of file
++elseif (TARGET jsoncpp_static)
++    add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
++    set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
++endif ()
index fe7fe107cdf6e7631aaef702339d16690e5392e7..270020ec95c24c1bfd3600af1b39ed1727c43c11 100644 (file)
@@ -1,18 +1,20 @@
 #
 # Conditional build:
-%bcond_without apidocs # doxygen apidocs build
-%bcond_without tests   # tests during build
+%bcond_without apidocs         # doxygen apidocs build
+%bcond_without static_libs     # static library
+%bcond_without tests           # tests during build
 
 Summary:       API for manipulating JSON
 Summary(pl.UTF-8):     API do operacji na strukturach JSON
 Name:          jsoncpp
 Version:       1.9.5
-Release:       2
+Release:       3
 License:       MIT or Public Domain
 Group:         Libraries
 #Source0Download: https://github.com/open-source-parsers/jsoncpp/releases
 Source0:       https://github.com/open-source-parsers/jsoncpp/archive/%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: d6c8c609f2162eff373db62b90a051c7
+Patch0:                %{name}-cmake-prefer-shared.patch
 URL:           https://github.com/open-source-parsers/jsoncpp/
 BuildRequires: cmake >= 3.8.0
 BuildRequires: libstdc++-devel >= 6:4.8.1
@@ -29,7 +31,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 JSONCPP provides a simple API to manipulate JSON values, and handle
 serialization and unserialization to strings.
 
-%description
+%description -l pl.UTF-8
 JSONCPP udostępnia proste API do operacji na wartościach JSON oraz
 obsługi serializacji oraz deserializacji z łańcuchów znaków.
 
@@ -71,11 +73,14 @@ Dokumentacja API biblioteki JSONCPP.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 install -d build
 cd build
 %cmake .. \
+       -DBUILD_OBJECT_LIBS=OFF \
+       %{!?with_static_libs:-DBUILD_STATIC_LIBS=OFF} \
        -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir}/%{name} \
        -DJSONCPP_WITH_CMAKE_PACKAGE=ON \
        %{!?with_tests:-DJSONCPP_WITH_TESTS=OFF} \
@@ -115,9 +120,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_pkgconfigdir}/jsoncpp.pc
 %{_libdir}/cmake/jsoncpp
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libjsoncpp.a
+%endif
 
 %if %{with apidocs}
 %files apidocs
This page took 0.802263 seconds and 4 git commands to generate.