about summary refs log tree commit diff
path: root/pkgs/tools/networking/cjdns
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@viric.name>2014-10-25 15:51:47 +0200
committerLluís Batlle i Rossell <viric@viric.name>2014-10-25 15:52:54 +0200
commitf3d978be6511622b4500a42a18307f10c4db1ff0 (patch)
tree31608cc5318eafff4cd25577d6c6e18a80cc68ac /pkgs/tools/networking/cjdns
parentfd5f455a73cc504887e9b3297c366ae05955585d (diff)
downloadnixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.tar
nixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.tar.gz
nixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.tar.bz2
nixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.tar.lz
nixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.tar.xz
nixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.tar.zst
nixlib-f3d978be6511622b4500a42a18307f10c4db1ff0.zip
cjdns: installing contrib scripts
I made the nodejs and python scripts have the proper shebang. A lot more
of them could be updated to reference store paths (calls to "python",
etc.)

(cherry picked from commit 2fb382afb6319065f20af22d86774df190beb0d5)
Diffstat (limited to 'pkgs/tools/networking/cjdns')
-rw-r--r--pkgs/tools/networking/cjdns/default.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/tools/networking/cjdns/default.nix b/pkgs/tools/networking/cjdns/default.nix
index 4403018a3912..c32bc224bdde 100644
--- a/pkgs/tools/networking/cjdns/default.nix
+++ b/pkgs/tools/networking/cjdns/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, nodejs, which, python27 }:
+{ stdenv, fetchFromGitHub, nodejs, which, python27, utillinux }:
 
 let
   date = "20141023";
@@ -14,10 +14,20 @@ stdenv.mkDerivation {
     sha256 = "11z8dk7byxh9pfv7mhfvnk465qln1g7z8c8f822623d59lwjpbs1";
   };
 
-  buildInputs = [ which python27 nodejs];
+  buildInputs = [ which python27 nodejs ] ++
+    # for flock
+    stdenv.lib.optional stdenv.isLinux [ utillinux ];
 
   buildPhase = "bash do";
-  installPhase = "installBin cjdroute makekeys privatetopublic publictoip6";
+  installPhase = ''
+    installBin cjdroute makekeys privatetopublic publictoip6
+    sed -i 's,/usr/bin/env node,'$(type -P node), \
+      $(find contrib -name "*.js")
+    sed -i 's,/usr/bin/env python,'$(type -P python), \
+      $(find contrib -type f)
+    mkdir -p $out/share/cjdns
+    cp -R contrib node_build node_modules $out/share/cjdns/
+  '';
 
   meta = with stdenv.lib; {
     homepage = https://github.com/cjdelisle/cjdns;