diff --git a/0001-yajl-2.1.0-pkgconfig-location.patch b/0001-yajl-2.1.0-pkgconfig-location.patch index 757a9ccee1fe24f0a401d17026973528c9b0a6e9..40e29a9b36fabf96137de7f0c8b85106854d232d 100644 --- a/0001-yajl-2.1.0-pkgconfig-location.patch +++ b/0001-yajl-2.1.0-pkgconfig-location.patch @@ -1,16 +1,17 @@ diff -rup yajl-2.1.0.orig/src/CMakeLists.txt yajl-2.1.0.new/src/CMakeLists.txt ---- yajl-2.1.0.orig/src/CMakeLists.txt 2014-03-19 04:58:29.000000000 +0000 -+++ yajl-2.1.0.new/src/CMakeLists.txt 2014-04-28 11:19:28.431492533 +0100 -@@ -30,7 +30,7 @@ ADD_DEFINITIONS(-DYAJL_BUILD) +--- yajl-2.1.0.orig/src/CMakeLists.txt 2014-03-19 04:58:29.000000000 +0000 ++++ yajl-2.1.0.new/src/CMakeLists.txt 2014-04-28 11:19:28.431492533 +0100 +@@ -30,7 +30,8 @@ # set up some paths SET (libDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib) SET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/include/yajl) -SET (shareDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/share/pkgconfig) +SET (pkgconfigDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib/pkgconfig) ++INCLUDE(GNUInstallDirs) # set the output path for libraries SET(LIBRARY_OUTPUT_PATH ${libDir}) -@@ -61,7 +61,7 @@ FILE(MAKE_DIRECTORY ${incDir}) +@@ -61,7 +61,7 @@ # generate build-time source SET(dollar $) CONFIGURE_FILE(api/yajl_version.h.cmake ${incDir}/yajl_version.h) @@ -19,9 +20,28 @@ diff -rup yajl-2.1.0.orig/src/CMakeLists.txt yajl-2.1.0.new/src/CMakeLists.txt # copy public headers to output directory FOREACH (header ${PUB_HDRS}) -@@ -84,4 +84,4 @@ INSTALL(TARGETS yajl - INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX}) +@@ -78,10 +78,10 @@ + # at build time you may specify the cmake variable LIB_SUFFIX to handle + # 64-bit systems which use 'lib64' + INSTALL(TARGETS yajl +- RUNTIME DESTINATION lib${LIB_SUFFIX} +- LIBRARY DESTINATION lib${LIB_SUFFIX} +- ARCHIVE DESTINATION lib${LIB_SUFFIX}) +-INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++INSTALL(TARGETS yajl_s ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl) INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl) -INSTALL(FILES ${shareDir}/yajl.pc DESTINATION share/pkgconfig) -+INSTALL(FILES ${pkgconfigDir}/yajl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) ++INSTALL(FILES ${pkgconfigDir}/yajl.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +--- yajl-2.1.0/src/yajl.pc.cmake.orig 2025-08-23 16:05:14.289318200 +0800 ++++ yajl-2.1.0/src/yajl.pc.cmake 2025-08-23 16:05:37.443984300 +0800 +@@ -1,5 +1,5 @@ + prefix=${CMAKE_INSTALL_PREFIX} +-libdir=${dollar}{prefix}/lib${LIB_SUFFIX} ++libdir=${dollar}{prefix}/${CMAKE_INSTALL_LIBDIR} + includedir=${dollar}{prefix}/include/yajl + + Name: Yet Another JSON Library diff --git a/0002-yajl-2.1.0-pkgconfig-includedir.patch b/0002-yajl-2.1.0-pkgconfig-includedir.patch index ba134f01f47e5cac9005a8e07eb798d300706ee6..33eeb6d957a0b425d3c8a222c5a014f41eb760b7 100644 --- a/0002-yajl-2.1.0-pkgconfig-includedir.patch +++ b/0002-yajl-2.1.0-pkgconfig-includedir.patch @@ -3,7 +3,7 @@ diff -rup yajl-2.1.0.orig/src/yajl.pc.cmake yajl-2.1.0.new/src/yajl.pc.cmake +++ yajl-2.1.0.new/src/yajl.pc.cmake 2014-04-28 11:12:23.505791003 +0100 @@ -1,6 +1,6 @@ prefix=${CMAKE_INSTALL_PREFIX} - libdir=${dollar}{prefix}/lib${LIB_SUFFIX} + libdir=${dollar}{prefix}/${CMAKE_INSTALL_LIBDIR} -includedir=${dollar}{prefix}/include/yajl +includedir=${dollar}{prefix}/include diff --git a/yajl-allow-build-with-CMake-4.0.0.patch b/yajl-allow-build-with-CMake-4.0.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..17e768cb37fba19cabd8d58f690e9ba5b89e8198 --- /dev/null +++ b/yajl-allow-build-with-CMake-4.0.0.patch @@ -0,0 +1,66 @@ +From 6fe59ca50dfd65bdb3d1c87a27245b2dd1a072f9 Mon Sep 17 00:00:00 2001 +From: Rudi Heitbaum +Date: Fri, 28 Mar 2025 09:31:40 +0000 +Subject: [PATCH] Allow build with CMake 4.0.0 + +fixes deprecated cmake option and uses cmake 2.8.0 TARGET_FILE +update cmake supported minimum versions to 2.8.0...3.10 + +ref: +- https://cmake.org/cmake/help/latest/policy/CMP0026.html + +CMake Error at .../CMakeLists.txt: (GET_TARGET_PROPERTY): + The LOCATION property may not be read from target "json_...". Use the + target name directly with add_custom_command, or use the generator + expression $, as appropriate. + +Signed-off-by: Rudi Heitbaum +--- + CMakeLists.txt | 2 +- + reformatter/CMakeLists.txt | 4 +--- + verify/CMakeLists.txt | 4 +--- + 3 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 471eee13..deba3a40 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ + # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.6) ++CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0...3.10) + + PROJECT(YetAnotherJSONParser C) + +diff --git a/reformatter/CMakeLists.txt b/reformatter/CMakeLists.txt +index 52a9bee8..267d02e2 100644 +--- a/reformatter/CMakeLists.txt ++++ b/reformatter/CMakeLists.txt +@@ -35,9 +35,7 @@ IF (NOT WIN32) + ENDIF (NOT WIN32) + + # copy the binary into the output directory +-GET_TARGET_PROPERTY(binPath json_reformat LOCATION) +- + ADD_CUSTOM_COMMAND(TARGET json_reformat POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir}) ++ COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${binDir}) + + INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin) +diff --git a/verify/CMakeLists.txt b/verify/CMakeLists.txt +index 967fca16..2f390082 100644 +--- a/verify/CMakeLists.txt ++++ b/verify/CMakeLists.txt +@@ -29,9 +29,7 @@ + TARGET_LINK_LIBRARIES(json_verify yajl) + + # copy in the binary +-GET_TARGET_PROPERTY(binPath json_verify LOCATION) +- + ADD_CUSTOM_COMMAND(TARGET json_verify POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir}) ++ COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${binDir}) + + INSTALL(TARGETS json_verify RUNTIME DESTINATION bin) diff --git a/yajl.spec b/yajl.spec index 2b4a93a9ee7759f69c599686f61bb5c1ca9a33a8..a0e4cc83df2a208d8b4626d6b372aa69d08e87fe 100644 --- a/yajl.spec +++ b/yajl.spec @@ -3,7 +3,7 @@ Name: yajl Version: 2.1.0 -Release: 24 +Release: 25 Summary: Yet Another JSON Library License: ISC URL: https://github.com/lloyd/yajl @@ -18,7 +18,8 @@ Patch6: 0006-fix-memory-leak-of-ctx-root.patch Patch7: 0007-add-cmake-option-for-test-and-binary.patch Patch8: backport-CVE-2022-24795.patch Patch9: yajl-assert-error-when-memory-allocation-failed.patch -Patch10: backport-Fix-for-CVE-2017-16516.patch +Patch10: backport-Fix-for-CVE-2017-16516.patch +Patch11: yajl-allow-build-with-CMake-4.0.0.patch BuildRequires: gcc BuildRequires: cmake >= 3.4 @@ -65,6 +66,9 @@ cd test %{_libdir}/pkgconfig/yajl.pc %changelog +* Sat Aug 23 2025 Funda Wang - 2.1.0-25 +- fix build with cmake 4 + * Fri Jan 24 2025 fuanan - 2.1.0-24 - revert to the original test case