Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
71 lines
1.5 KiB
Nix
71 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
|
|
# Build runit-init as a static binary
|
|
static ? false,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "runit";
|
|
version = "2.2.0";
|
|
|
|
src = fetchurl {
|
|
url = "http://smarden.org/runit/${pname}-${version}.tar.gz";
|
|
sha256 = "sha256-le9NKGi5eMcXn+R5AeXFeOEc8nPSkr1iCL06fMsCkpA=";
|
|
};
|
|
|
|
patches = [
|
|
./fix-ar-ranlib.patch
|
|
];
|
|
|
|
outputs = [
|
|
"out"
|
|
"man"
|
|
];
|
|
|
|
sourceRoot = "admin/${pname}-${version}";
|
|
|
|
doCheck = true;
|
|
|
|
buildInputs = lib.optionals static [
|
|
stdenv.cc.libc
|
|
stdenv.cc.libc.static
|
|
];
|
|
|
|
postPatch = ''
|
|
sed -i "s,\(#define RUNIT\) .*,\1 \"$out/bin/runit\"," src/runit.h
|
|
# usernamespace sandbox of nix seems to conflict with runit's assumptions
|
|
# about unix users. Therefor skip the check
|
|
sed -i '/.\/chkshsgr/d' src/Makefile
|
|
''
|
|
+ lib.optionalString (!static) ''
|
|
sed -i 's,-static,,g' src/Makefile
|
|
'';
|
|
|
|
preBuild = ''
|
|
cd src
|
|
|
|
# Both of these are originally hard-coded to gcc
|
|
echo ${stdenv.cc.targetPrefix}cc > conf-cc
|
|
echo ${stdenv.cc.targetPrefix}cc ${lib.optionalString stdenv.hostPlatform.isDarwin "-Xlinker -x "}> conf-ld
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp -t $out/bin $(< ../package/commands)
|
|
|
|
mkdir -p $man/share/man
|
|
cp -r ../man $man/share/man/man8
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "UNIX init scheme with service supervision";
|
|
license = licenses.bsd3;
|
|
homepage = "http://smarden.org/runit";
|
|
maintainers = with maintainers; [ joachifm ];
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
};
|
|
}
|