Unverified Commit a0e23ac4 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

helix: build offline documentation (#458103)

parents 7b5d40ed a4b47853
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  fetchzip,
  lib,
  rustPlatform,
  mdbook,
  git,
  installShellFiles,
  versionCheckHook,
@@ -11,6 +12,10 @@
rustPlatform.buildRustPackage (final: {
  pname = "helix";
  version = "25.07.1";
  outputs = [
    "out"
    "doc"
  ];

  # This release tarball includes source code for the tree-sitter grammars,
  # which is not ordinarily part of the repository.
@@ -25,20 +30,26 @@ rustPlatform.buildRustPackage (final: {
  nativeBuildInputs = [
    git
    installShellFiles
    mdbook
  ];

  env.HELIX_DEFAULT_RUNTIME = "${placeholder "out"}/lib/runtime";

  postBuild = ''
    mdbook build book -d ../book-html
  '';

  postInstall = ''
    # not needed at runtime
    rm -r runtime/grammars/sources

    mkdir -p $out/lib
    mkdir -p $out/lib $doc/share/doc
    cp -r runtime $out/lib
    installShellCompletion contrib/completion/hx.{bash,fish,zsh}
    mkdir -p $out/share/{applications,icons/hicolor/256x256/apps}
    cp contrib/Helix.desktop $out/share/applications
    cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
    cp -r book-html $doc/share/doc/$name
  '';

  nativeInstallCheckInputs = [