1 { stdenv, lib, jekyll, cmake, fetchFromGitHub, gtest }:
3 stdenv.mkDerivation rec {
6 outputs = [ "out" "doc" ];
8 src = fetchFromGitHub {
12 sha256 = "sha256-FtVJE9alEl56Uik+nCpJMV5DMVVmRCnE1xMAiWdK39Y=";
15 nativeBuildInputs = [ jekyll cmake ];
16 buildInputs = [ gtest ];
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"}"
25 # https://github.com/google/jsonnet/issues/778
27 ./fix-cpp-unresolved-symbols.patch
30 enableParallelBuilding = true;
32 # Upstream writes documentation in html, not in markdown/rst, so no
33 # other output formats, sorry.
35 jekyll build --source ../doc --destination ./html
39 mkdir -p $out/share/doc/jsonnet
40 cp -r ./html $out/share/doc/jsonnet
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;