feat(build.nix): add man page for dhall & dhall-docs on MacOS

This commit is contained in:
Profpatsch 2020-12-01 00:37:26 +01:00
parent 646a850fc1
commit 5e4e92105a
3 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ pkgs, release }: { pkgs, release }:
{ simpleName, binNames, attrName }: { simpleName, binNames, attrName, manPages ? [] }:
let let
release = import ./release.nix; release = import ./release.nix;
@ -46,6 +46,16 @@ pkgs.stdenv.mkDerivation rec {
rmdir bin rmdir bin
${pkgs.lib.optionalString (manPages != []) ''
${pkgs.lib.concatMapStringsSep "\n" (manPage: ''
# TODO: split into $man output
manPagePath="$out/share/man/man1/${manPage}"
install -D -m644 -T "share/man/man1/${manPage}" "$manPagePath"
rm "share/man/man1/${manPage}"
'') manPages}
rmdir --parent share/man/man1
''}
# a bit hacky, but sourceRoot unfortunately unpacks to the runtime build dir # a bit hacky, but sourceRoot unfortunately unpacks to the runtime build dir
rm env-vars .sandbox.sb || true rm env-vars .sandbox.sb || true

View File

@ -4,4 +4,6 @@ import ./build.nix { inherit pkgs; release = import ./release.nix; } {
simpleName = "dhall-docs-simple"; simpleName = "dhall-docs-simple";
binNames = [ "dhall-docs" ]; binNames = [ "dhall-docs" ];
attrName = "dhall-docs"; attrName = "dhall-docs";
# see https://github.com/dhall-lang/dhall-haskell/issues/2104
manPages = if pkgs.stdenv.isDarwin then [ "dhall-docs.1" ] else [];
} }

View File

@ -4,4 +4,6 @@ import ./build.nix { inherit pkgs; release = import ./release.nix; } {
simpleName = "dhall-simple"; simpleName = "dhall-simple";
binNames = [ "dhall" ]; binNames = [ "dhall" ];
attrName = "dhall"; attrName = "dhall";
# see https://github.com/dhall-lang/dhall-haskell/issues/2104
manPages = if pkgs.stdenv.isDarwin then [ "dhall.1" ] else [];
} }