about summary refs log tree commit diff
path: root/pkgs/by-name/ja
diff options
context:
space:
mode:
authorVladimír Čunát2024-07-20 09:29:30 +0200
committerVladimír Čunát2024-07-20 09:29:30 +0200
commit726f3ec8b586773e749987497059fa2f64e5df59 (patch)
tree4080d6502c401b67cfe9b9b1fef354f65539a15e /pkgs/by-name/ja
parentfd62707511ceeb3c35d88b6ece67f29cf0961a21 (diff)
parent7bde538b09855752d07c1c0e3abf015031d941cc (diff)
Merge #319221: jansson: adopt; modernize; add more checks
...into staging
Diffstat (limited to 'pkgs/by-name/ja')
-rw-r--r--pkgs/by-name/ja/jansson/package.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/by-name/ja/jansson/package.nix b/pkgs/by-name/ja/jansson/package.nix
new file mode 100644
index 000000000000..bb0035b97669
--- /dev/null
+++ b/pkgs/by-name/ja/jansson/package.nix
@@ -0,0 +1,52 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  nix-update-script,
+  testers,
+  validatePkgConfig,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "jansson";
+  version = "2.14";
+
+  outputs = [
+    "dev"
+    "out"
+  ];
+
+  src = fetchFromGitHub {
+    owner = "akheron";
+    repo = "jansson";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-FQgy2+g3AyRVJeniqPQj0KNeHgPdza2pmEIXqSyYry4=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    validatePkgConfig
+  ];
+
+  cmakeFlags = [
+    # networkmanager relies on libjansson.so:
+    #   https://github.com/NixOS/nixpkgs/pull/176302#issuecomment-1150239453
+    "-DJANSSON_BUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
+  ];
+
+  passthru = {
+    tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; };
+    updateScript = nix-update-script { };
+  };
+
+  meta = {
+    description = "C library for encoding, decoding and manipulating JSON data";
+    homepage = "https://github.com/akheron/jansson";
+    changelog = "https://github.com/akheron/jansson/raw/${finalAttrs.src.rev}/CHANGES";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ getchoo ];
+    platforms = lib.platforms.all;
+    pkgConfigModules = [ "jansson" ];
+  };
+})