diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-10-20 22:09:03 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-10-20 22:09:03 +0000 |
commit | 50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch) | |
tree | f2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/development/libraries/yajl | |
parent | 4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff) | |
parent | cfc75eec4603c06503ae750f88cf397e00796ea8 (diff) | |
download | nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2 nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip |
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts: nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/yajl')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/yajl/cmake-shared-static-fix.patch | 89 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/yajl/default.nix | 27 |
2 files changed, 109 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/libraries/yajl/cmake-shared-static-fix.patch b/nixpkgs/pkgs/development/libraries/yajl/cmake-shared-static-fix.patch new file mode 100644 index 000000000000..05c8f19dacbc --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/yajl/cmake-shared-static-fix.patch @@ -0,0 +1,89 @@ +From 768be8b9f98e30a8bd2d51576be9dfcf2cb838ea Mon Sep 17 00:00:00 2001 +From: Kiskae <Kiskae@users.noreply.github.com> +Date: Tue, 26 Sep 2023 20:53:00 +0200 +Subject: [PATCH] simplify compilation of static/shared with cmake + +Signed-off-by: Kiskae <Kiskae@users.noreply.github.com> +--- + CMakeLists.txt | 2 ++ + example/CMakeLists.txt | 2 +- + perf/CMakeLists.txt | 2 +- + src/CMakeLists.txt | 7 ++----- + test/parsing/CMakeLists.txt | 2 +- + 5 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 471eee13..9af25203 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,6 +16,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + + PROJECT(YetAnotherJSONParser C) + ++option(BUILD_SHARED_LIBS "Build using shared libraries" ON) ++ + SET (YAJL_MAJOR 2) + SET (YAJL_MINOR 1) + SET (YAJL_MICRO 1) +diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt +index 0a7f6220..62ddf14c 100644 +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -20,4 +20,4 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib) + + ADD_EXECUTABLE(parse_config ${SRCS}) + +-TARGET_LINK_LIBRARIES(parse_config yajl_s) ++TARGET_LINK_LIBRARIES(parse_config yajl) +diff --git a/perf/CMakeLists.txt b/perf/CMakeLists.txt +index b438d7a1..924a2681 100644 +--- a/perf/CMakeLists.txt ++++ b/perf/CMakeLists.txt +@@ -20,4 +20,4 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib) + + ADD_EXECUTABLE(perftest ${SRCS}) + +-TARGET_LINK_LIBRARIES(perftest yajl_s) ++TARGET_LINK_LIBRARIES(perftest yajl) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 789ddf99..78875032 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -35,9 +35,7 @@ SET (pkgconfigDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib/pkgconfig + # set the output path for libraries + SET(LIBRARY_OUTPUT_PATH ${libDir}) + +-ADD_LIBRARY(yajl_s STATIC ${SRCS} ${HDRS} ${PUB_HDRS}) +- +-ADD_LIBRARY(yajl SHARED ${SRCS} ${HDRS} ${PUB_HDRS}) ++ADD_LIBRARY(yajl ${SRCS} ${HDRS} ${PUB_HDRS}) + + #### setup shared library version number + SET_TARGET_PROPERTIES(yajl PROPERTIES +@@ -69,7 +67,7 @@ FOREACH (header ${PUB_HDRS}) + + EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different ${header} ${incDir}) + +- ADD_CUSTOM_COMMAND(TARGET yajl_s POST_BUILD ++ ADD_CUSTOM_COMMAND(TARGET yajl POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${incDir}) + ENDFOREACH (header ${PUB_HDRS}) + +@@ -81,7 +79,6 @@ 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}) + INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl) + INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl) + INSTALL(FILES ${pkgconfigDir}/yajl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) +diff --git a/test/parsing/CMakeLists.txt b/test/parsing/CMakeLists.txt +index c22a3887..f445920d 100644 +--- a/test/parsing/CMakeLists.txt ++++ b/test/parsing/CMakeLists.txt +@@ -20,4 +20,4 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../../${YAJL_DIST_NAME}/lib) + + ADD_EXECUTABLE(yajl_test ${SRCS}) + +-TARGET_LINK_LIBRARIES(yajl_test yajl_s) ++TARGET_LINK_LIBRARIES(yajl_test yajl) diff --git a/nixpkgs/pkgs/development/libraries/yajl/default.nix b/nixpkgs/pkgs/development/libraries/yajl/default.nix index 022284b0b130..dad884c24842 100644 --- a/nixpkgs/pkgs/development/libraries/yajl/default.nix +++ b/nixpkgs/pkgs/development/libraries/yajl/default.nix @@ -1,18 +1,30 @@ -{ lib, stdenv, fetchFromGitHub, cmake }: +{ lib, stdenv, fetchFromGitHub, cmake, which, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "yajl"; - version = "2.1.0"; + version = "unstable-2022-04-20"; src = fetchFromGitHub { - owner = "lloyd"; + owner = "containers"; repo = "yajl"; - rev = "refs/tags/${version}"; - sha256 = "00yj06drb6izcxfxfqlhimlrb089kka0w0x8k27pyzyiq7qzcvml"; + rev = "49923ccb2143e36850bcdeb781e2bcdf5ce22f15"; + hash = "sha256-9bMPA5FpyBp8fvG/kkT/MnhYtdqg3QzOnmDFXKwJVW0="; }; + patches = [ + # https://github.com/containers/yajl/pull/1 + ./cmake-shared-static-fix.patch + ]; + nativeBuildInputs = [ cmake ]; + doCheck = true; + nativeCheckInputs = [ which ]; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + meta = { description = "Yet Another JSON Library"; longDescription = '' @@ -21,7 +33,8 @@ stdenv.mkDerivation rec { ''; homepage = "http://lloyd.github.com/yajl/"; license = lib.licenses.isc; + pkgConfigModules = [ "yajl" ]; platforms = with lib.platforms; linux ++ darwin; maintainers = with lib.maintainers; [ maggesi ]; }; -} +}) |