2015-01-06 09:24:48 +01:00
|
|
|
{ stdenv, fetchgit, go }:
|
2014-04-03 18:54:10 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "syncthing-${version}";
|
2015-01-21 21:31:04 +01:00
|
|
|
version = "0.10.21";
|
2014-04-03 18:54:10 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
2015-01-06 09:24:48 +01:00
|
|
|
url = "git://github.com/syncthing/syncthing.git";
|
2014-04-03 18:54:10 +02:00
|
|
|
rev = "refs/tags/v${version}";
|
2015-01-21 21:31:04 +01:00
|
|
|
sha256 = "60cd8607cf7d2837252680f6c2879aba1f35a2c74a47c2f2ea874d6eed2adaa5";
|
2014-04-03 18:54:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ go ];
|
|
|
|
|
2015-01-06 09:24:48 +01:00
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p "./dependencies/src/github.com/syncthing/syncthing"
|
|
|
|
cp -r internal "./dependencies/src/github.com/syncthing/syncthing"
|
2014-04-03 18:54:10 +02:00
|
|
|
|
|
|
|
export GOPATH="`pwd`/Godeps/_workspace:`pwd`/dependencies"
|
|
|
|
|
2015-01-06 09:24:48 +01:00
|
|
|
go run build.go test
|
2014-04-03 18:54:10 +02:00
|
|
|
|
|
|
|
mkdir ./bin
|
|
|
|
|
|
|
|
go build -o ./bin/syncthing -ldflags "-w -X main.Version v${version}" ./cmd/syncthing
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 14:56:10 +02:00
|
|
|
mkdir -p $out/bin
|
2014-04-03 18:54:10 +02:00
|
|
|
cp -r ./bin $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://syncthing.net/;
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized";
|
2014-04-03 18:54:10 +02:00
|
|
|
license = with stdenv.lib.licenses; mit;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ matejc ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|