depot/third_party/nixpkgs/pkgs/tools/admin/daemontools/default.nix
Default email b450903751 Project import generated by Copybara.
GitOrigin-RevId: 74a1793c659d09d7cf738005308b1f86c90cb59b
2022-09-09 16:08:57 +02:00

62 lines
1.7 KiB
Nix

{ fetchurl, bash, glibc, lib, stdenv, installShellFiles }:
let
man-pages = fetchurl {
url = "https://salsa.debian.org/debian/daemontools/-/archive/debian/1%250.76-8/daemontools-debian-1%250.76-8.tar.gz?path=debian/daemontools-man";
sha256 = "sha256-om5r1ddUx1uObp9LR+SwCLLtm+rRuLoq28OLbhWhdzU=";
};
in
stdenv.mkDerivation rec {
pname = "daemontools";
version = "0.76";
src = fetchurl {
url = "https://cr.yp.to/daemontools/daemontools-${version}.tar.gz";
sha256 = "07scvw88faxkscxi91031pjkpccql6wspk4yrlnsbrrb5c0kamd5";
};
patches = [ ./fix-nix-usernamespace-build.patch ];
outputs = [ "out" "man" ];
nativeBuildInputs = [ installShellFiles ];
configurePhase = ''
cd daemontools-${version}
sed -ie '1 s_$_ -include ${glibc.dev}/include/errno.h_' src/conf-cc
substituteInPlace src/Makefile \
--replace '/bin/sh' '${bash}/bin/bash -oxtrace'
sed -ie "s_^PATH=.*_PATH=$src/daemontools-${version}/compile:''${PATH}_" src/rts.tests
cat ${glibc.dev}/include/errno.h
'';
buildPhase = ''
package/compile
'';
installPhase = ''
for cmd in $(cat package/commands); do
install -Dm755 "command/$cmd" "$out/bin/$cmd"
done
tar -xz --strip-components=2 -f ${man-pages}
installManPage daemontools-man/*.8
install -v -Dm644 daemontools-man/README $man/share/doc/daemontools/README.man
'';
# Keep README.man in the man output (see _multioutDocs())
outputDoc = "man";
meta = {
license = lib.licenses.publicDomain;
homepage = "https://cr.yp.to/daemontools.html";
description = "A collection of tools for managing UNIX services";
maintainers = with lib.maintainers; [ kevincox ];
platforms = lib.platforms.unix;
};
}