2023-07-15 17:15:38 +00:00
|
|
|
{ stdenv, lib, jekyll, cmake, fetchFromGitHub, gtest }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "jsonnet";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.20.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
outputs = [ "out" "doc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "google";
|
|
|
|
repo = "jsonnet";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-FtVJE9alEl56Uik+nCpJMV5DMVVmRCnE1xMAiWdK39Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [ jekyll cmake ];
|
|
|
|
buildInputs = [ gtest ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_SYSTEM_GTEST=ON"
|
|
|
|
"-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
|
2023-08-04 22:07:22 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2023-07-15 17:15:38 +00:00
|
|
|
"-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# https://github.com/google/jsonnet/issues/778
|
|
|
|
patches = [
|
|
|
|
./fix-cpp-unresolved-symbols.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
# Upstream writes documentation in html, not in markdown/rst, so no
|
|
|
|
# other output formats, sorry.
|
2023-07-15 17:15:38 +00:00
|
|
|
postBuild = ''
|
|
|
|
jekyll build --source ../doc --destination ./html
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/doc/jsonnet
|
2021-07-14 22:03:04 +00:00
|
|
|
cp -r ./html $out/share/doc/jsonnet
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Purely-functional configuration language that helps you define JSON data";
|
|
|
|
maintainers = with lib.maintainers; [ benley copumpkin ];
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
homepage = "https://github.com/google/jsonnet";
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|