2014-04-03 18:54:10 +02:00
|
|
|
{ stdenv, fetchurl, fetchgit, go }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "syncthing-${version}";
|
2014-04-30 22:48:51 +02:00
|
|
|
version = "0.8.2";
|
2014-04-03 18:54:10 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://github.com/calmh/syncthing.git";
|
|
|
|
rev = "refs/tags/v${version}";
|
2014-04-30 22:48:51 +02:00
|
|
|
sha256 = "1yhl0mk6f2cyib82jyzwz20iw1l5pxppmlgw5xn9pkmqm53wp4z4";
|
2014-04-03 18:54:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ go ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
|
|
|
|
cp -r "./auto" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./buffers" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./cid" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./discover" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./files" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./lamport" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./protocol" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./scanner" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./mc" "./dependencies/src/github.com/calmh/syncthing"
|
|
|
|
cp -r "./xdr" "./dependencies/src/github.com/calmh/syncthing"
|
2014-04-30 22:48:51 +02:00
|
|
|
cp -r "./upnp" "./dependencies/src/github.com/calmh/syncthing"
|
2014-04-03 18:54:10 +02:00
|
|
|
|
|
|
|
export GOPATH="`pwd`/Godeps/_workspace:`pwd`/dependencies"
|
|
|
|
|
|
|
|
go test -cpu=1,2,4 ./...
|
|
|
|
|
|
|
|
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 = ''
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp -r ./bin $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://syncthing.net/;
|
|
|
|
description = "Syncthing replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized";
|
|
|
|
license = with stdenv.lib.licenses; mit;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ matejc ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|