mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ stdenv, fetchgit, go }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "syncthing-${version}";
|
|
version = "0.10.20";
|
|
|
|
src = fetchgit {
|
|
url = "git://github.com/syncthing/syncthing.git";
|
|
rev = "refs/tags/v${version}";
|
|
sha256 = "2d61a5b1ca45e4ad0805413e8965a6f3d61256cccb7a6a08cc146bf7433f5d80";
|
|
};
|
|
|
|
buildInputs = [ go ];
|
|
|
|
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 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;
|
|
};
|
|
}
|