summary refs log tree commit diff
path: root/pkgs/tools/networking/cjdns/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/cjdns/default.nix')
-rw-r--r--pkgs/tools/networking/cjdns/default.nix42
1 files changed, 28 insertions, 14 deletions
diff --git a/pkgs/tools/networking/cjdns/default.nix b/pkgs/tools/networking/cjdns/default.nix
index 48e21f4507e..e602ee5f412 100644
--- a/pkgs/tools/networking/cjdns/default.nix
+++ b/pkgs/tools/networking/cjdns/default.nix
@@ -1,27 +1,41 @@
-{ stdenv, fetchgit, nodejs, which, python27 }:
+{ stdenv, fetchFromGitHub, nodejs, which, python27, utillinux }:
 
 let
-  date = "20140303";
-  rev = "f11ce1fd4795b0173ac0ef18c8a6f752aa824adb";
+  version = "16"; # see ${src}/util/version/Version.h
+  date = "20150308";
 in
 stdenv.mkDerivation {
-  name = "cjdns-${date}-${stdenv.lib.strings.substring 0 7 rev}";
+  name = "cjdns-${version}-${date}";
 
-  src = fetchgit {
-    url = "git://github.com/cjdelisle/cjdns.git";
-    inherit rev;
-    sha256 = "1bxhf9f1v0slf9mz3ll6jf45mkwvwxlf3yqxx9k23kjyr1nsc8s8";
+  src = fetchFromGitHub {
+    owner = "cjdelisle";
+    repo = "cjdns";
+    rev = "dc7eaf676cb83f13ba3e76a1bd0f2e093e6d6e1b";
+    sha256 = "1llhv9kflh4rzv9b9qq9zhrckcc6a7xs0dp147adwmaxqjj8v601";
   };
 
-  buildInputs = [ which python27 nodejs];
+  buildInputs = [ which python27 nodejs ] ++
+    # for flock
+    stdenv.lib.optional stdenv.isLinux [ utillinux ];
 
-  builder = ./builder.sh;
+  buildPhase =
+    stdenv.lib.optionalString stdenv.isArm "Seccomp_NO=1 "
+    + "bash do";
+  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 tools node_build node_modules $out/share/cjdns/
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://github.com/cjdelisle/cjdns;
     description = "Encrypted networking for regular people";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ viric emery ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ viric emery ];
+    platforms = platforms.unix;
   };
 }