Pantheon updates 2024-12-13 (#364951)
[NixPkgs.git] / pkgs / development / skaware-packages / s6-networking / default.nix
bloba30c7f8c0c458cb0400335ca16dfdb82de487025
2   lib,
3   skawarePackages,
4   skalibs,
5   execline,
6   s6,
7   s6-dns,
9   # Whether to build the TLS/SSL tools and what library to use
10   # acceptable values: "bearssl", "libressl", false
11   sslSupport ? "bearssl",
12   libressl,
13   bearssl,
16 let
17   sslSupportEnabled = sslSupport != false;
18   sslLibs = {
19     libressl = libressl;
20     bearssl = bearssl;
21   };
24 assert sslSupportEnabled -> sslLibs ? ${sslSupport};
26 skawarePackages.buildPackage {
27   pname = "s6-networking";
28   version = "2.7.0.3";
29   sha256 = "20EcVDcaF+19RUPdhs+VMM4l/PYkvvg64rV5Ug5ecL8=";
31   manpages = skawarePackages.buildManPages {
32     pname = "s6-networking-man-pages";
33     version = "2.7.0.3.1";
34     sha256 = "9u2C1TF9vma+7Qo+00uZ6eOCn/9eMgKALgHDVgMcrfg=";
35     description = "Port of the documentation for the s6-networking suite to mdoc";
36     maintainers = [ lib.maintainers.sternenseemann ];
37   };
39   description = "Suite of small networking utilities for Unix systems";
41   outputs = [
42     "bin"
43     "lib"
44     "dev"
45     "doc"
46     "out"
47   ];
49   # TODO: nsss support
50   configureFlags =
51     [
52       "--libdir=\${lib}/lib"
53       "--libexecdir=\${lib}/libexec"
54       "--dynlibdir=\${lib}/lib"
55       "--bindir=\${bin}/bin"
56       "--includedir=\${dev}/include"
57       "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
58       "--with-include=${skalibs.dev}/include"
59       "--with-include=${execline.dev}/include"
60       "--with-include=${s6.dev}/include"
61       "--with-include=${s6-dns.dev}/include"
62       "--with-lib=${skalibs.lib}/lib"
63       "--with-lib=${execline.lib}/lib"
64       "--with-lib=${s6.out}/lib"
65       "--with-lib=${s6-dns.lib}/lib"
66       "--with-dynlib=${skalibs.lib}/lib"
67       "--with-dynlib=${execline.lib}/lib"
68       "--with-dynlib=${s6.out}/lib"
69       "--with-dynlib=${s6-dns.lib}/lib"
70     ]
71     ++ (lib.optionals sslSupportEnabled [
72       "--enable-ssl=${sslSupport}"
73       "--with-include=${lib.getDev sslLibs.${sslSupport}}/include"
74       "--with-lib=${lib.getLib sslLibs.${sslSupport}}/lib"
75       "--with-dynlib=${lib.getLib sslLibs.${sslSupport}}/lib"
76     ]);
78   postInstall = ''
79     # remove all s6 executables from build directory
80     rm $(find -name "s6-*" -type f -mindepth 1 -maxdepth 1 -executable)
81     rm libs6net.* libstls.* libs6tls.* libsbearssl.*
83     mv doc $doc/share/doc/s6-networking/html
84   '';