python312Packages.icontract: relax deps (#380554)
[NixPkgs.git] / pkgs / by-name / js / jsonnet / package.nix
blob498cf26dadf296bce89cd2656572f9174edae63a
2   stdenv,
3   lib,
4   jekyll,
5   cmake,
6   fetchFromGitHub,
7   gtest,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "jsonnet";
12   version = "0.20.0";
13   outputs = [
14     "out"
15     "doc"
16   ];
18   src = fetchFromGitHub {
19     rev = "v${version}";
20     owner = "google";
21     repo = "jsonnet";
22     sha256 = "sha256-FtVJE9alEl56Uik+nCpJMV5DMVVmRCnE1xMAiWdK39Y=";
23   };
25   nativeBuildInputs = [
26     jekyll
27     cmake
28   ];
29   buildInputs = [ gtest ];
31   cmakeFlags =
32     [
33       "-DUSE_SYSTEM_GTEST=ON"
34       "-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
35     ]
36     ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
37       "-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
38     ];
40   # https://github.com/google/jsonnet/issues/778
41   patches = [
42     ./fix-cpp-unresolved-symbols.patch
43   ];
45   enableParallelBuilding = true;
47   # Upstream writes documentation in html, not in markdown/rst, so no
48   # other output formats, sorry.
49   postBuild = ''
50     jekyll build --source ../doc --destination ./html
51   '';
53   postInstall = ''
54     mkdir -p $out/share/doc/jsonnet
55     cp -r ./html $out/share/doc/jsonnet
56   '';
58   meta = {
59     description = "Purely-functional configuration language that helps you define JSON data";
60     maintainers = with lib.maintainers; [
61       benley
62       copumpkin
63     ];
64     license = lib.licenses.asl20;
65     homepage = "https://github.com/google/jsonnet";
66     platforms = lib.platforms.unix;
67   };