skawarePackages.buildManPages: derivation wrapper for skaware man page ports
GitHub user flexibeast has been porting the html documentation from skarnet.org to mdoc, making them available as man pages. While the documentation is non authorative, it is certainly useful and is also linked from skarnet.org. buildManPages implements the common mkDerivation machinery common to all ported man page packages / repositories.
This commit is contained in:
parent
f21e16592e
commit
b4c9d6eb31
51
pkgs/build-support/skaware/build-skaware-man-pages.nix
Normal file
51
pkgs/build-support/skaware/build-skaware-man-pages.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ 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;
|
||||
};
|
||||
}
|
|
@ -18597,6 +18597,7 @@ with pkgs;
|
|||
buildPackage = callPackage ../build-support/skaware/build-skaware-package.nix {
|
||||
inherit cleanPackaging;
|
||||
};
|
||||
buildManPages = callPackage ../build-support/skaware/build-skaware-man-pages.nix { };
|
||||
|
||||
skalibs = callPackage ../development/libraries/skalibs { };
|
||||
execline = callPackage ../tools/misc/execline { };
|
||||
|
|
Loading…
Reference in a new issue