skawarePackages: add manpages to their respective packages

For a while now, we’ve had these separate derivations for the skaware
manpages.

That was fine in the beginning, because it was not entirely clear
whether the manpage project would be long-lived. Given that the
collection of third-party manpages is now extensive and updated
regularly, plus it is sanctioned by skarnet, we can remove this
additional hurdle to using skaware.

The buildManPage structure is kept, instead of building them in a
separate `default.nix`, we add a field `manpages` to
`skawarePackages.buildPackage`, which adds the `"man"` output and
copies everything from the manpages output.

For backwards-compat, the manpage derivation is exposed in the
`passthru` and referenced by the `*-man-pages` attributes.

~~~

The `with skawarePackages;` scope is removed from all packages, and
used explicitly for all functions, while packages get added to the
package import header.
This commit is contained in:
Profpatsch 2024-03-04 01:34:38 +01:00
parent 70cef84833
commit 7cadc17591
21 changed files with 97 additions and 118 deletions

View file

@ -6,6 +6,8 @@
, version , version
# : string # : string
, sha256 ? lib.fakeSha256 , sha256 ? lib.fakeSha256
# : drv | null
, manpages ? null
# : string # : string
, description , description
# : list Platform # : list Platform
@ -63,7 +65,15 @@ stdenv.mkDerivation {
inherit sha256; inherit sha256;
}; };
inherit outputs; outputs =
if manpages == null
then outputs
else
assert (lib.assertMsg (!lib.elem "man" outputs) "If you pass `manpages` to `skawarePackages.buildPackage`, you cannot have a `man` output already!");
# insert as early as posible, but keep the first element
if lib.length outputs > 0
then [(lib.head outputs) "man"] ++ lib.tail outputs
else ["man"];
dontDisableStatic = true; dontDisableStatic = true;
enableParallelBuilding = true; enableParallelBuilding = true;
@ -97,6 +107,13 @@ stdenv.mkDerivation {
docFiles = commonMetaFiles; docFiles = commonMetaFiles;
}} $doc/share/doc/${pname} }} $doc/share/doc/${pname}
${if manpages == null
then ''echo "no manpages for this package"''
else ''
echo "copying manpages"
cp -vr ${manpages} $man
''}
${postInstall} ${postInstall}
''; '';
@ -104,6 +121,8 @@ stdenv.mkDerivation {
${cleanPackaging.checkForRemainingFiles} ${cleanPackaging.checkForRemainingFiles}
''; '';
passthru = passthru // (if manpages == null then {} else { inherit manpages; });
meta = { meta = {
homepage = "https://skarnet.org/software/${pname}/"; homepage = "https://skarnet.org/software/${pname}/";
inherit description platforms; inherit description platforms;
@ -112,6 +131,4 @@ stdenv.mkDerivation {
[ pmahoney Profpatsch qyliss ] ++ maintainers; [ pmahoney Profpatsch qyliss ] ++ maintainers;
}; };
inherit passthru;
} }

View file

@ -10,7 +10,6 @@ lib.makeScope pkgs.newScope (self:
# execline # execline
execline = callPackage ./execline { }; execline = callPackage ./execline { };
execline-man-pages = callPackage ./execline-man-pages { };
# servers & tools # servers & tools
mdevd = callPackage ./mdevd { }; mdevd = callPackage ./mdevd { };
@ -32,8 +31,10 @@ lib.makeScope pkgs.newScope (self:
s6-portable-utils = callPackage ./s6-portable-utils { }; s6-portable-utils = callPackage ./s6-portable-utils { };
s6-rc = callPackage ./s6-rc { }; s6-rc = callPackage ./s6-rc { };
s6-man-pages = callPackage ./s6-man-pages { }; # manpages (DEPRECATED, they are added directly to the packages now)
s6-networking-man-pages = callPackage ./s6-networking-man-pages { }; execline-man-pages = self.execline.passthru.manpages;
s6-portable-utils-man-pages = callPackage ./s6-portable-utils-man-pages { }; s6-man-pages = self.s6.passthru.manpages;
s6-rc-man-pages = callPackage ./s6-rc-man-pages { }; s6-networking-man-pages = self.s6-networking.passthru.manpages;
s6-portable-utils-man-pages = self.s6-portable-utils.passthru.manpages;
s6-rc-man-pages = self.s6-rc.passthru.manpages;
}) })

View file

@ -1,9 +0,0 @@
{ lib, buildManPages }:
buildManPages {
pname = "execline-man-pages";
version = "2.9.3.0.5";
sha256 = "0fcjrj4xp7y7n1c55k45rxr5m7zpv6cbhrkxlxymd4j603i9jh6d";
description = "Port of the documentation for the execline suite to mdoc";
maintainers = [ lib.maintainers.sternenseemann ];
}

View file

@ -1,29 +1,30 @@
{ fetchFromGitHub, skawarePackages }: { lib, fetchFromGitHub, skawarePackages, skalibs }:
with skawarePackages;
let let
version = "2.9.4.0"; version = "2.9.4.0";
in skawarePackages.buildPackage {
inherit version;
pname = "execline";
# ATTN: also check whether there is a new manpages version
sha256 = "mrVdVhU536dv9Kl5BvqZX8SiiOPeUiXLGp2PqenrxJs=";
# Maintainer of manpages uses following versioning scheme: for every # Maintainer of manpages uses following versioning scheme: for every
# upstream $version he tags manpages release as ${version}.1, and, # upstream $version he tags manpages release as ${version}.1, and,
# in case of extra fixes to manpages, new tags in form ${version}.2, # in case of extra fixes to manpages, new tags in form ${version}.2,
# ${version}.3 and so on are created. # ${version}.3 and so on are created.
manpages = fetchFromGitHub { manpages = skawarePackages.buildManPages {
owner = "flexibeast"; pname = "execline-man-pages";
repo = "execline-man-pages"; version = "2.9.3.0.5";
rev = "v2.9.1.0.1"; sha256 = "0fcjrj4xp7y7n1c55k45rxr5m7zpv6cbhrkxlxymd4j603i9jh6d";
sha256 = "nZzzQFMUPmIgPS3aAIgcORr/TSpaLf8UtzBUFD7blt8="; description = "Port of the documentation for the execline suite to mdoc";
maintainers = [ lib.maintainers.sternenseemann ];
}; };
in buildPackage {
inherit version;
pname = "execline";
sha256 = "mrVdVhU536dv9Kl5BvqZX8SiiOPeUiXLGp2PqenrxJs=";
description = "A small scripting language, to be used in place of a shell in non-interactive scripts"; description = "A small scripting language, to be used in place of a shell in non-interactive scripts";
outputs = [ "bin" "man" "lib" "dev" "doc" "out" ]; outputs = [ "bin" "lib" "dev" "doc" "out" ];
# TODO: nsss support # TODO: nsss support
configureFlags = [ configureFlags = [
@ -62,7 +63,5 @@ in buildPackage {
-o "$bin/bin/execlineb" \ -o "$bin/bin/execlineb" \
${./execlineb-wrapper.c} \ ${./execlineb-wrapper.c} \
-lskarnet -lskarnet
mkdir -p $man/share/
cp -vr ${manpages}/man* $man/share
''; '';
} }

View file

@ -1,8 +1,6 @@
{ lib, skawarePackages }: { lib, skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "mdevd"; pname = "mdevd";
version = "0.1.6.3"; version = "0.1.6.3";
sha256 = "9uzw73zUjQTvx1rLLa2WfYULyIFb2wCY8cnvBDOU1DA="; sha256 = "9uzw73zUjQTvx1rLLa2WfYULyIFb2wCY8cnvBDOU1DA=";

View file

@ -1,8 +1,6 @@
{ skawarePackages }: { skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "nsss"; pname = "nsss";
version = "0.2.0.4"; version = "0.2.0.4";
sha256 = "ObUE+FvY9rUj0zTlz6YsAqOV2zWZG3XyBt8Ku9Z2Gq0="; sha256 = "ObUE+FvY9rUj0zTlz6YsAqOV2zWZG3XyBt8Ku9Z2Gq0=";

View file

@ -1,8 +1,6 @@
{ skawarePackages }: { skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "s6-dns"; pname = "s6-dns";
version = "2.3.7.1"; version = "2.3.7.1";
sha256 = "zwJYV07H1itlTgwq14r0x9Z6xMnLN/eBSA9ZflSzD20="; sha256 = "zwJYV07H1itlTgwq14r0x9Z6xMnLN/eBSA9ZflSzD20=";

View file

@ -1,8 +1,6 @@
{ lib, skawarePackages }: { lib, skawarePackages, skalibs, execline, s6 }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "s6-linux-init"; pname = "s6-linux-init";
version = "1.1.2.0"; version = "1.1.2.0";
sha256 = "sha256-Ea4I0KZiELXla2uu4Pa5sbafvtsF/aEoWxFaMcpGx38="; sha256 = "sha256-Ea4I0KZiELXla2uu4Pa5sbafvtsF/aEoWxFaMcpGx38=";

View file

@ -1,8 +1,6 @@
{ lib, skawarePackages }: { lib, skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "s6-linux-utils"; pname = "s6-linux-utils";
version = "2.6.2.0"; version = "2.6.2.0";
sha256 = "j5RGM8qH09I+DwPJw4PRUC1QjJusFtOMP79yOl6rK7c="; sha256 = "j5RGM8qH09I+DwPJw4PRUC1QjJusFtOMP79yOl6rK7c=";

View file

@ -1,9 +0,0 @@
{ lib, buildManPages }:
buildManPages {
pname = "s6-man-pages";
version = "2.12.0.2.1";
sha256 = "sha256-fFU+cRwXb4SwHsI/r0ghuzCf6hEK/muPPp2XMvD8VtQ=";
description = "Port of the documentation for the s6 supervision suite to mdoc";
maintainers = [ lib.maintainers.sternenseemann ];
}

View file

@ -1,9 +0,0 @@
{ lib, buildManPages }:
buildManPages {
pname = "s6-networking-man-pages";
version = "2.5.1.3.3";
sha256 = "02ba5jyfpbib402mfl42pbbdxyjy2vhpiz1b2qdg4ax58yr4jzqk";
description = "Port of the documentation for the s6-networking suite to mdoc";
maintainers = [ lib.maintainers.sternenseemann ];
}

View file

@ -1,11 +1,10 @@
{ lib, skawarePackages { lib, skawarePackages, skalibs, execline, s6, s6-dns
# Whether to build the TLS/SSL tools and what library to use # Whether to build the TLS/SSL tools and what library to use
# acceptable values: "bearssl", "libressl", false # acceptable values: "bearssl", "libressl", false
, sslSupport ? "bearssl" , libressl, bearssl , sslSupport ? "bearssl" , libressl, bearssl
}: }:
with skawarePackages;
let let
sslSupportEnabled = sslSupport != false; sslSupportEnabled = sslSupport != false;
sslLibs = { sslLibs = {
@ -17,11 +16,19 @@ in
assert sslSupportEnabled -> sslLibs ? ${sslSupport}; assert sslSupportEnabled -> sslLibs ? ${sslSupport};
buildPackage { skawarePackages.buildPackage {
pname = "s6-networking"; pname = "s6-networking";
version = "2.7.0.2"; version = "2.7.0.2";
sha256 = "wzxvGyvhb4miGvlGz9BiQqEvmBhMiYt1XdskM4ZxzrE="; sha256 = "wzxvGyvhb4miGvlGz9BiQqEvmBhMiYt1XdskM4ZxzrE=";
manpages = skawarePackages.buildManPages {
pname = "s6-networking-man-pages";
version = "2.5.1.3.3";
sha256 = "02ba5jyfpbib402mfl42pbbdxyjy2vhpiz1b2qdg4ax58yr4jzqk";
description = "Port of the documentation for the s6-networking suite to mdoc";
maintainers = [ lib.maintainers.sternenseemann ];
};
description = "A suite of small networking utilities for Unix systems"; description = "A suite of small networking utilities for Unix systems";
outputs = [ "bin" "lib" "dev" "doc" "out" ]; outputs = [ "bin" "lib" "dev" "doc" "out" ];

View file

@ -1,9 +0,0 @@
{ lib, buildManPages }:
buildManPages {
pname = "s6-portable-utils-man-pages";
version = "2.3.0.2.2";
sha256 = "0zbxr6jqrx53z1gzfr31nm78wjfmyjvjx7216l527nxl9zn8nnv1";
description = "Port of the documentation for the s6-portable-utils suite to mdoc";
maintainers = [ lib.maintainers.somasis ];
}

View file

@ -1,12 +1,18 @@
{ skawarePackages }: { lib, skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "s6-portable-utils"; pname = "s6-portable-utils";
version = "2.3.0.3"; version = "2.3.0.3";
sha256 = "PkSSBV0WDCX7kBU/DvwnfX1Sv5gbvj6i6d/lHEk1Yf8="; sha256 = "PkSSBV0WDCX7kBU/DvwnfX1Sv5gbvj6i6d/lHEk1Yf8=";
manpages = skawarePackages.buildManPages {
pname = "s6-portable-utils-man-pages";
version = "2.3.0.2.2";
sha256 = "0zbxr6jqrx53z1gzfr31nm78wjfmyjvjx7216l527nxl9zn8nnv1";
description = "Port of the documentation for the s6-portable-utils suite to mdoc";
maintainers = [ lib.maintainers.somasis ];
};
description = "A set of tiny general Unix utilities optimized for simplicity and small size"; description = "A set of tiny general Unix utilities optimized for simplicity and small size";
outputs = [ "bin" "dev" "doc" "out" ]; outputs = [ "bin" "dev" "doc" "out" ];

View file

@ -1,9 +0,0 @@
{ lib, buildManPages }:
buildManPages {
pname = "s6-rc-man-pages";
version = "0.5.4.2.1";
sha256 = "Ywke3FG/xhhUd934auDB+iFRDCvy8IJs6IkirP6O/As=";
description = "mdoc(7) versions of the documentation for the s6-rc service manager";
maintainers = [ lib.maintainers.qyliss ];
}

View file

@ -1,12 +1,18 @@
{ lib, stdenv, skawarePackages, targetPackages }: { lib, stdenv, skawarePackages, targetPackages, skalibs, execline, s6 }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "s6-rc"; pname = "s6-rc";
version = "0.5.4.2"; version = "0.5.4.2";
sha256 = "AL36WW+nFhUS6XLskoKiq9j9DjHwkXe616K8PY8oOYI="; sha256 = "AL36WW+nFhUS6XLskoKiq9j9DjHwkXe616K8PY8oOYI=";
manpages = skawarePackages.buildManPages {
pname = "s6-rc-man-pages";
version = "0.5.4.2.1";
sha256 = "Ywke3FG/xhhUd934auDB+iFRDCvy8IJs6IkirP6O/As=";
description = "mdoc(7) versions of the documentation for the s6-rc service manager";
maintainers = [ lib.maintainers.qyliss ];
};
description = "A service manager for s6-based systems"; description = "A service manager for s6-based systems";
platforms = lib.platforms.unix; platforms = lib.platforms.unix;

View file

@ -1,12 +1,18 @@
{ skawarePackages }: { lib, skawarePackages, skalibs, execline }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "s6"; pname = "s6";
version = "2.12.0.3"; version = "2.12.0.3";
sha256 = "gA0xIm9sJc3T7AtlJA+AtWzl7BNzQdCo0VTndjjlgQM="; sha256 = "gA0xIm9sJc3T7AtlJA+AtWzl7BNzQdCo0VTndjjlgQM=";
manpages = skawarePackages.buildManPages {
pname = "s6-man-pages";
version = "2.12.0.2.1";
sha256 = "sha256-fFU+cRwXb4SwHsI/r0ghuzCf6hEK/muPPp2XMvD8VtQ=";
description = "Port of the documentation for the s6 supervision suite to mdoc";
maintainers = [ lib.maintainers.sternenseemann ];
};
description = "skarnet.org's small & secure supervision software suite"; description = "skarnet.org's small & secure supervision software suite";
# NOTE lib: cannot split lib from bin at the moment, # NOTE lib: cannot split lib from bin at the moment,

View file

@ -1,6 +1,4 @@
{ stdenv, lib, runCommandCC, skawarePackages }: { stdenv, lib, runCommandCC, skawarePackages, skalibs }:
with skawarePackages;
let let
# From https://skarnet.org/software/misc/sdnotify-wrapper.c, # From https://skarnet.org/software/misc/sdnotify-wrapper.c,

View file

@ -4,9 +4,7 @@
, pkgs , pkgs
}: }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "skalibs"; pname = "skalibs";
version = "2.14.1.1"; version = "2.14.1.1";
sha256 = "trebgW9LoLaAFnaw7UF5tZyMeAnu/+JttnLkBGNr78M="; sha256 = "trebgW9LoLaAFnaw7UF5tZyMeAnu/+JttnLkBGNr78M=";

View file

@ -1,8 +1,6 @@
{ skawarePackages }: { skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "tipidee"; pname = "tipidee";
version = "0.0.3.0"; version = "0.0.3.0";
sha256 = "0dk6k86UKgJ2ioX5H2Xoga9S+SwMy9NFrK2KEKoNxCA="; sha256 = "0dk6k86UKgJ2ioX5H2Xoga9S+SwMy9NFrK2KEKoNxCA=";

View file

@ -1,8 +1,6 @@
{ skawarePackages }: { skawarePackages, skalibs }:
with skawarePackages; skawarePackages.buildPackage {
buildPackage {
pname = "utmps"; pname = "utmps";
version = "0.1.2.2"; version = "0.1.2.2";
sha256 = "sha256-9/+jcUxllzu5X7zxUBwG/AR42TpRzqGzc+xoEcJCX1I="; sha256 = "sha256-9/+jcUxllzu5X7zxUBwG/AR42TpRzqGzc+xoEcJCX1I=";