From 3b901be6bb004531491d71093127cf562c2e335d Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 5 Jul 2021 13:09:30 -0400 Subject: [PATCH] jsonnet: add output with html documentation (#128990) Co-authored-by: Dmitry Bogatov Co-authored-by: Sandro --- pkgs/development/compilers/jsonnet/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/jsonnet/default.nix b/pkgs/development/compilers/jsonnet/default.nix index be03f53a76e..e85404c58b5 100644 --- a/pkgs/development/compilers/jsonnet/default.nix +++ b/pkgs/development/compilers/jsonnet/default.nix @@ -1,8 +1,9 @@ -{ stdenv, lib, fetchFromGitHub }: +{ stdenv, lib, jekyll, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "jsonnet"; version = "0.17.0"; + outputs = ["out" "doc"]; src = fetchFromGitHub { rev = "v${version}"; @@ -11,6 +12,8 @@ stdenv.mkDerivation rec { sha256 = "1ddz14699v5lqx3dh0mb7hfffr6fk5zhmzn3z8yxkqqvriqnciim"; }; + nativeBuildInputs = [ jekyll ]; + enableParallelBuilding = true; makeFlags = [ @@ -19,12 +22,19 @@ stdenv.mkDerivation rec { "libjsonnet.so" ]; + # Upstream writes documentation in html, not in markdown/rst, so no + # other output formats, sorry. + preBuild = '' + jekyll build --source ./doc --destination ./html + ''; + installPhase = '' - mkdir -p $out/bin $out/lib $out/include + mkdir -p $out/bin $out/lib $out/include $out/share/doc/jsonnet cp jsonnet $out/bin/ cp jsonnetfmt $out/bin/ cp libjsonnet*.so $out/lib/ cp -a include/*.h $out/include/ + cp -r ./html $out/share/doc/jsonnet ''; meta = {