depot/third_party/nixpkgs/pkgs/build-support/skaware/build-skaware-man-pages.nix
Default email b6f2ab0a42 Project import generated by Copybara.
GitOrigin-RevId: 253aecf69ed7595aaefabde779aa6449195bebb7
2021-08-18 15:19:15 +02:00

51 lines
841 B
Nix

{ lib, stdenv, fetchFromGitHub }:
{
# : string
pname
# : string
, version
# : string
, sha256
# : list (int | string)
, sections
# : string
, description
# : list Maintainer
, maintainers
# : license
, license ? lib.licenses.isc
# : string
, owner ? "flexibeast"
# : string
, rev ? "v${version}"
}:
let
manDir = "${placeholder "out"}/share/man";
src = fetchFromGitHub {
inherit owner rev sha256;
repo = pname;
};
in
stdenv.mkDerivation {
inherit pname version src;
makeFlags = [
"MANPATH=${manDir}"
];
dontBuild = true;
preInstall = lib.concatMapStringsSep "\n"
(section: "mkdir -p \"${manDir}/man${builtins.toString section}\"")
sections;
meta = with lib; {
inherit description license maintainers;
inherit (src.meta) homepage;
platforms = platforms.all;
};
}