2021-08-18 20:15:47 +03:00
|
|
|
{ lib, stdenv, skawarePackages, targetPackages }:
|
2015-09-25 04:15:36 +03:00
|
|
|
|
2018-09-03 00:31:26 +03:00
|
|
|
with skawarePackages;
|
2015-09-25 04:15:36 +03:00
|
|
|
|
2018-09-03 00:31:26 +03:00
|
|
|
buildPackage {
|
|
|
|
pname = "s6-rc";
|
2023-04-02 23:59:16 +03:00
|
|
|
version = "0.5.4.1";
|
|
|
|
sha256 = "1yaMq3xUIzBc+VmKM9T82rijFZUrPsgPechbjLdhWPY=";
|
2015-09-25 04:15:36 +03:00
|
|
|
|
2018-09-03 00:31:26 +03:00
|
|
|
description = "A service manager for s6-based systems";
|
2021-08-18 20:33:31 +03:00
|
|
|
platforms = lib.platforms.unix;
|
2015-09-25 04:15:36 +03:00
|
|
|
|
2018-07-22 18:03:19 +03:00
|
|
|
outputs = [ "bin" "lib" "dev" "doc" "out" ];
|
|
|
|
|
2015-09-25 04:15:36 +03:00
|
|
|
configureFlags = [
|
2018-07-22 18:03:19 +03:00
|
|
|
"--libdir=\${lib}/lib"
|
|
|
|
"--libexecdir=\${lib}/libexec"
|
|
|
|
"--dynlibdir=\${lib}/lib"
|
|
|
|
"--bindir=\${bin}/bin"
|
|
|
|
"--includedir=\${dev}/include"
|
|
|
|
"--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
|
|
|
|
"--with-include=${skalibs.dev}/include"
|
|
|
|
"--with-include=${execline.dev}/include"
|
|
|
|
"--with-include=${s6.dev}/include"
|
|
|
|
"--with-lib=${skalibs.lib}/lib"
|
|
|
|
"--with-lib=${execline.lib}/lib"
|
|
|
|
"--with-lib=${s6.out}/lib"
|
|
|
|
"--with-dynlib=${skalibs.lib}/lib"
|
|
|
|
"--with-dynlib=${execline.lib}/lib"
|
|
|
|
"--with-dynlib=${s6.out}/lib"
|
2018-09-03 00:31:26 +03:00
|
|
|
];
|
2015-09-25 04:15:36 +03:00
|
|
|
|
2021-08-18 20:15:47 +03:00
|
|
|
# s6-rc-compile generates built-in service definitions containing
|
|
|
|
# absolute paths to execline, s6, and s6-rc programs. If we're
|
|
|
|
# running s6-rc-compile as part of a Nix derivation, and we want to
|
|
|
|
# cross-compile that derivation, those paths will be wrong --
|
|
|
|
# they'll be for execline, s6, and s6-rc on the platform we're
|
|
|
|
# running s6-rc-compile on, not the platform we're targeting.
|
|
|
|
#
|
|
|
|
# We can detect this special case of s6-rc being used at build time
|
|
|
|
# in a derivation that's being cross-compiled, because that's the
|
|
|
|
# only time hostPlatform != targetPlatform. When that happens we
|
|
|
|
# modify s6-rc-compile to use the configuration headers for the
|
|
|
|
# system we're cross-compiling for.
|
|
|
|
postConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) ''
|
|
|
|
substituteInPlace src/s6-rc/s6-rc-compile.c \
|
|
|
|
--replace '<execline/config.h>' '"${targetPackages.execline.dev}/include/execline/config.h"' \
|
|
|
|
--replace '<s6/config.h>' '"${targetPackages.s6.dev}/include/s6/config.h"' \
|
|
|
|
--replace '<s6-rc/config.h>' '"${targetPackages.s6-rc.dev}/include/s6-rc/config.h"'
|
|
|
|
'';
|
|
|
|
|
2018-07-22 18:03:19 +03:00
|
|
|
postInstall = ''
|
2018-09-03 00:31:26 +03:00
|
|
|
# remove all s6 executables from build directory
|
|
|
|
rm $(find -name "s6-rc-*" -type f -mindepth 1 -maxdepth 1 -executable)
|
|
|
|
rm s6-rc libs6rc.*
|
|
|
|
|
2018-07-22 18:03:19 +03:00
|
|
|
mv doc $doc/share/doc/s6-rc/html
|
|
|
|
mv examples $doc/share/doc/s6-rc/examples
|
|
|
|
'';
|
|
|
|
|
2015-09-25 04:15:36 +03:00
|
|
|
}
|