biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / skaware-packages / s6-rc / default.nix
blob8ccdd867688f54596ef8cbdad1f1a090c82f4b13
1 { lib, stdenv, skawarePackages, targetPackages, skalibs, execline, s6 }:
3 skawarePackages.buildPackage {
4   pname = "s6-rc";
5   version = "0.5.4.2";
6   sha256 = "AL36WW+nFhUS6XLskoKiq9j9DjHwkXe616K8PY8oOYI=";
8   manpages = skawarePackages.buildManPages {
9     pname = "s6-rc-man-pages";
10     version = "0.5.4.2.1";
11     sha256 = "Ywke3FG/xhhUd934auDB+iFRDCvy8IJs6IkirP6O/As=";
12     description = "mdoc(7) versions of the documentation for the s6-rc service manager";
13     maintainers = [ lib.maintainers.qyliss ];
14   };
16   description = "A service manager for s6-based systems";
17   platforms = lib.platforms.unix;
19   outputs = [ "bin" "lib" "dev" "doc" "out" ];
21   configureFlags = [
22     "--libdir=\${lib}/lib"
23     "--libexecdir=\${lib}/libexec"
24     "--dynlibdir=\${lib}/lib"
25     "--bindir=\${bin}/bin"
26     "--includedir=\${dev}/include"
27     "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
28     "--with-include=${skalibs.dev}/include"
29     "--with-include=${execline.dev}/include"
30     "--with-include=${s6.dev}/include"
31     "--with-lib=${skalibs.lib}/lib"
32     "--with-lib=${execline.lib}/lib"
33     "--with-lib=${s6.out}/lib"
34     "--with-dynlib=${skalibs.lib}/lib"
35     "--with-dynlib=${execline.lib}/lib"
36     "--with-dynlib=${s6.out}/lib"
37   ];
39   # s6-rc-compile generates built-in service definitions containing
40   # absolute paths to execline, s6, and s6-rc programs.  If we're
41   # running s6-rc-compile as part of a Nix derivation, and we want to
42   # cross-compile that derivation, those paths will be wrong --
43   # they'll be for execline, s6, and s6-rc on the platform we're
44   # running s6-rc-compile on, not the platform we're targeting.
45   #
46   # We can detect this special case of s6-rc being used at build time
47   # in a derivation that's being cross-compiled, because that's the
48   # only time hostPlatform != targetPlatform.  When that happens we
49   # modify s6-rc-compile to use the configuration headers for the
50   # system we're cross-compiling for.
51   postConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) ''
52     substituteInPlace src/s6-rc/s6-rc-compile.c \
53         --replace-fail '<execline/config.h>' '"${targetPackages.execline.dev}/include/execline/config.h"' \
54         --replace-fail '<s6/config.h>' '"${targetPackages.s6.dev}/include/s6/config.h"' \
55         --replace-fail '<s6-rc/config.h>' '"${targetPackages.s6-rc.dev}/include/s6-rc/config.h"'
56   '';
58   postInstall = ''
59     # remove all s6 executables from build directory
60     rm $(find -name "s6-rc-*" -type f -mindepth 1 -maxdepth 1 -executable)
61     rm s6-rc libs6rc.*
63     mv doc $doc/share/doc/s6-rc/html
64     mv examples $doc/share/doc/s6-rc/examples
65   '';