@@ -1,33 +1,35 @@
1−{ stdenv, fetchurl, fetchgit, go }:
1+{ stdenv, fetchgit, go }:
22
33stdenv.mkDerivation rec {
44 name = "syncthing-${version}";
5− version = "0.8.15";
5+ version = "0.10.17";
66
77 src = fetchgit {
8− url = "git://github.com/calmh/syncthing.git";
8+ url = "git://github.com/syncthing/syncthing.git";
99 rev = "refs/tags/v${version}";
10− sha256 = "0xv8kaji60zqxws72srh5hdi9fyvaipdcsawp6gcyahhr3cz0ddq";
10+ sha256 = "1hv0va7234rgyahn8xvpyj1bsbmn7ifsyqm7b3ghhybinclghp1w";
1111 };
1212
1313 buildInputs = [ go ];
1414
15− buildPhase = ''
16− mkdir -p "./dependencies/src/github.com/calmh/syncthing"
15+ patches = [
16+ # Remove when Go 1.4 is available in Nix, or when this pull request is released:
17+ # https://github.com/syncthing/syncthing/pull/1183
18+ ./fix-go-1.4-range.patch
19+ ];
1720
18− for a in auto buffers cid discover files lamport protocol scanner \
19− logger beacon config xdr upnp model osutil versioner; do
20− cp -r "./$a" "./dependencies/src/github.com/calmh/syncthing"
21− done
21+ buildPhase = ''
22+ mkdir -p "./dependencies/src/github.com/syncthing/syncthing"
23+ cp -r internal "./dependencies/src/github.com/syncthing/syncthing"
2224
2325 export GOPATH="`pwd`/Godeps/_workspace:`pwd`/dependencies"
2426
25− go test -cpu=1,2,4 ./...
27+ # Tests can't be run in parallel because TestPredictableRandom relies on global state
28+ go run build.go test
2629
2730 mkdir ./bin
2831
2932 go build -o ./bin/syncthing -ldflags "-w -X main.Version v${version}" ./cmd/syncthing
30− go build -o ./bin/stcli -ldflags "-w -X main.Version v${version}" ./cmd/stcli
3133 '';
3234
3335 installPhase = ''