diff options
author | Dmitry Bogatov <serenity@kaction.cc> | 2023-05-03 00:16:59 -0400 |
---|---|---|
committer | Dmitry Bogatov <serenity@kaction.cc> | 2023-05-03 00:16:59 -0400 |
commit | 816aa8db8158b246b94d9476794d9d8b91a400bd (patch) | |
tree | ab3cb17e80a90dba389ed2ed4bc18fa732e67bd7 | |
parent | 3306b06ef061b79be803992ded374195d9f3d573 (diff) | |
download | nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.tar nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.tar.gz nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.tar.bz2 nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.tar.lz nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.tar.xz nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.tar.zst nixpkgs-816aa8db8158b246b94d9476794d9d8b91a400bd.zip |
just: build offline documentation
-rw-r--r-- | pkgs/development/tools/just/default.nix | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/development/tools/just/default.nix b/pkgs/development/tools/just/default.nix index fd97cc2634f..ec21765e3a3 100644 --- a/pkgs/development/tools/just/default.nix +++ b/pkgs/development/tools/just/default.nix @@ -6,11 +6,13 @@ , bash , installShellFiles , libiconv +, mdbook }: rustPlatform.buildRustPackage rec { pname = "just"; version = "1.13.0"; + outputs = [ "out" "man" "doc" ]; src = fetchFromGitHub { owner = "casey"; @@ -21,7 +23,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-91C/5m2avsW7GKQDg/Ez9fzzFhe8ih1De1RbV/MBJbM="; - nativeBuildInputs = [ installShellFiles ]; + nativeBuildInputs = [ installShellFiles mdbook ]; buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; preCheck = '' @@ -42,6 +44,15 @@ rustPlatform.buildRustPackage rec { cp $TMPDIR/string.rs tests/string.rs ''; + postBuild = '' + cargo run --package generate-book + + # No linkcheck in sandbox + echo 'optional = true' >> book/en/book.toml + mdbook build book/en + find . + ''; + checkFlags = [ "--skip=edit" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched "--skip=run_shebang" # test case very rarely fails with "Text file busy" @@ -49,6 +60,8 @@ rustPlatform.buildRustPackage rec { ]; postInstall = '' + mkdir -p $doc/share/doc/$name + mv ./book/en/build/html $doc/share/doc/$name installManPage man/just.1 installShellCompletion --cmd just \ |