nixpkgs/pkgs/applications/networking/syncthing/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2015-01-06 09:24:48 +01:00
{ stdenv, fetchgit, go }:
stdenv.mkDerivation rec {
name = "syncthing-${version}";
2015-01-21 21:31:04 +01:00
version = "0.10.21";
src = fetchgit {
2015-01-06 09:24:48 +01:00
url = "git://github.com/syncthing/syncthing.git";
rev = "refs/tags/v${version}";
2015-01-21 21:31:04 +01:00
sha256 = "60cd8607cf7d2837252680f6c2879aba1f35a2c74a47c2f2ea874d6eed2adaa5";
};
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"
export GOPATH="`pwd`/Godeps/_workspace:`pwd`/dependencies"
2015-01-06 09:24:48 +01:00
go run build.go test
mkdir ./bin
go build -o ./bin/syncthing -ldflags "-w -X main.Version v${version}" ./cmd/syncthing
'';
installPhase = ''
mkdir -p $out/bin
cp -r ./bin $out
'';
meta = {
homepage = http://syncthing.net/;
description = "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;
};
}