summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorBrendan Long <self@brendanlong.com>2015-01-06 02:24:48 -0600
committerBrendan Long <self@brendanlong.com>2015-01-06 02:24:48 -0600
commit9d23d09bc90222926364eecc4d5c5b02aa85ffc3 (patch)
treea8d96b749d1c452fffeaf589c7d06cb6fa2d5e13 /pkgs/applications
parente9d868de631597a82b28927fb89ba7c2dfa52def (diff)
downloadnixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.tar
nixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.tar.gz
nixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.tar.bz2
nixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.tar.lz
nixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.tar.xz
nixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.tar.zst
nixlib-9d23d09bc90222926364eecc4d5c5b02aa85ffc3.zip
syncthing: Update to 0.10.17
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/syncthing/default.nix26
-rw-r--r--pkgs/applications/networking/syncthing/fix-go-1.4-range.patch14
2 files changed, 28 insertions, 12 deletions
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix
index 64bf287b44f0..09facfab3d51 100644
--- a/pkgs/applications/networking/syncthing/default.nix
+++ b/pkgs/applications/networking/syncthing/default.nix
@@ -1,33 +1,35 @@
-{ stdenv, fetchurl, fetchgit, go }:
+{ stdenv, fetchgit, go }:
 
 stdenv.mkDerivation rec {
   name = "syncthing-${version}";
-  version = "0.8.15";
+  version = "0.10.17";
 
   src = fetchgit {
-    url = "git://github.com/calmh/syncthing.git";
+    url = "git://github.com/syncthing/syncthing.git";
     rev = "refs/tags/v${version}";
-    sha256 = "0xv8kaji60zqxws72srh5hdi9fyvaipdcsawp6gcyahhr3cz0ddq";
+    sha256 = "1hv0va7234rgyahn8xvpyj1bsbmn7ifsyqm7b3ghhybinclghp1w";
   };
 
   buildInputs = [ go ];
 
-  buildPhase = ''
-    mkdir -p "./dependencies/src/github.com/calmh/syncthing"
+  patches = [
+    # Remove when Go 1.4 is available in Nix, or when this pull request is released:
+    # https://github.com/syncthing/syncthing/pull/1183
+    ./fix-go-1.4-range.patch
+  ];
 
-    for a in auto buffers cid discover files lamport protocol scanner \
-            logger beacon config xdr upnp model osutil versioner; do
-        cp -r "./$a" "./dependencies/src/github.com/calmh/syncthing"
-    done
+  buildPhase = ''
+    mkdir -p "./dependencies/src/github.com/syncthing/syncthing"
+    cp -r internal "./dependencies/src/github.com/syncthing/syncthing"
 
     export GOPATH="`pwd`/Godeps/_workspace:`pwd`/dependencies"
 
-    go test -cpu=1,2,4 ./...
+    # Tests can't be run in parallel because TestPredictableRandom relies on global state
+    go run build.go test
 
     mkdir ./bin
 
     go build -o ./bin/syncthing -ldflags "-w -X main.Version v${version}" ./cmd/syncthing
-    go build -o ./bin/stcli -ldflags "-w -X main.Version v${version}" ./cmd/stcli
   '';
 
   installPhase = ''
diff --git a/pkgs/applications/networking/syncthing/fix-go-1.4-range.patch b/pkgs/applications/networking/syncthing/fix-go-1.4-range.patch
new file mode 100644
index 000000000000..8aacc68bd988
--- /dev/null
+++ b/pkgs/applications/networking/syncthing/fix-go-1.4-range.patch
@@ -0,0 +1,14 @@
+diff --git a/internal/model/queue_test.go b/internal/model/queue_test.go
+index 3745664..96aaf38 100644
+--- a/internal/model/queue_test.go
++++ b/internal/model/queue_test.go
+@@ -191,7 +191,7 @@ func BenchmarkJobQueuePushPopDone10k(b *testing.B) {
+ 		for _, f := range files {
+ 			q.Push(f.Name)
+ 		}
+-		for range files {
++		for _ = range files {
+ 			n, _ := q.Pop()
+ 			q.Done(n)
+ 		}
+--