base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / js / jsonnet / package.nix
blob4dc7557d13798761ed5d50199e7c890635ed575d
1 { stdenv, lib, jekyll, cmake, fetchFromGitHub, gtest }:
3 stdenv.mkDerivation rec {
4   pname = "jsonnet";
5   version = "0.20.0";
6   outputs = [ "out" "doc" ];
8   src = fetchFromGitHub {
9     rev = "v${version}";
10     owner = "google";
11     repo = "jsonnet";
12     sha256 = "sha256-FtVJE9alEl56Uik+nCpJMV5DMVVmRCnE1xMAiWdK39Y=";
13   };
15   nativeBuildInputs = [ jekyll cmake ];
16   buildInputs = [ gtest ];
18   cmakeFlags = [
19     "-DUSE_SYSTEM_GTEST=ON"
20     "-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
21   ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
22     "-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
23   ];
25   # https://github.com/google/jsonnet/issues/778
26   patches = [
27     ./fix-cpp-unresolved-symbols.patch
28   ];
30   enableParallelBuilding = true;
32   # Upstream writes documentation in html, not in markdown/rst, so no
33   # other output formats, sorry.
34   postBuild = ''
35     jekyll build --source ../doc --destination ./html
36   '';
38   postInstall = ''
39     mkdir -p $out/share/doc/jsonnet
40     cp -r ./html $out/share/doc/jsonnet
41   '';
43   meta = {
44     description = "Purely-functional configuration language that helps you define JSON data";
45     maintainers = with lib.maintainers; [ benley copumpkin ];
46     license = lib.licenses.asl20;
47     homepage = "https://github.com/google/jsonnet";
48     platforms = lib.platforms.unix;
49   };