Skip to content

Commit

Permalink
daemontools: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed May 31, 2017
1 parent bef0b67 commit d7f6367
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkgs/tools/admin/daemontools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,42 @@

stdenv.mkDerivation rec {
name = "daemontools-0.76";

src = fetchurl {
url = "https://cr.yp.to/daemontools/${name}.tar.gz";
sha256 = "07scvw88faxkscxi91031pjkpccql6wspk4yrlnsbrrb5c0kamd5";
};


patches = [ ./fix-nix-usernamespace-build.patch ];

configurePhase = ''
cd ${name}
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/${name}/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
'';

meta = {
license = stdenv.lib.licenses.publicDomain;
homepage = https://cr.yp.to/daemontools.html;
description = "A collection of tools for managing UNIX services.";

maintainers = with stdenv.lib.maintainers; [ kevincox ];
platforms = stdenv.lib.platforms.unix;
};
Expand Down
10 changes: 10 additions & 0 deletions pkgs/tools/admin/daemontools/fix-nix-usernamespace-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- admin.org/daemontools-0.76/src/chkshsgr.c 2001-07-12 17:49:49.000000000 +0100
+++ admin/daemontools-0.76/src/chkshsgr.c 2017-05-31 23:54:56.662174028 +0100
@@ -4,6 +4,7 @@

int main()
{
+ return 0;
short x[4];

x[0] = x[1] = 0;

0 comments on commit d7f6367

Please sign in to comment.