From 1360d4cc5133bf700044e6d343169d289143a183 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 4 Mar 2023 22:24:16 -0500 Subject: [PATCH] zig: build offline documentation --- pkgs/development/compilers/zig/0.10.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/compilers/zig/0.10.nix b/pkgs/development/compilers/zig/0.10.nix index 966be329befc..860baf1d6045 100644 --- a/pkgs/development/compilers/zig/0.10.nix +++ b/pkgs/development/compilers/zig/0.10.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation rec { pname = "zig"; version = "0.10.1"; + outputs = [ "out" "doc" ]; src = fetchFromGitHub { owner = "ziglang"; @@ -52,7 +53,17 @@ stdenv.mkDerivation rec { "-DZIG_TARGET_MCPU=baseline" ]; + postBuild = '' + ./zig2 build-exe ../doc/docgen.zig + ./docgen ./zig2 ../doc/langref.html.in ./langref.html + ''; + doCheck = true; + + postInstall = '' + install -Dm644 -t $doc/share/doc/$pname-$version/html ./langref.html + ''; + installCheckPhase = '' $out/bin/zig test --cache-dir "$TMPDIR" -I $src/test $src/test/behavior.zig '';