From f3d978be6511622b4500a42a18307f10c4db1ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sat, 25 Oct 2014 15:51:47 +0200 Subject: [PATCH] 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) --- pkgs/tools/networking/cjdns/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/cjdns/default.nix b/pkgs/tools/networking/cjdns/default.nix index 4403018a391..c32bc224bdd 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;