nixpkgs/pkgs/tools/networking/filegive/default.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, fetchgit, go }:
assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64 || stdenv.isArm);
let
# Code with BSD license
srcNatPMP = fetchgit {
url = "https://code.google.com/p/go-nat-pmp/";
rev = "e04deda90d56";
sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb";
};
2013-10-07 09:31:50 +02:00
version = "0.7.1";
in
stdenv.mkDerivation rec {
name = "filegive-${version}";
src = fetchurl {
2013-10-01 09:19:46 +02:00
url = "http://viric.name/cgi-bin/filegive/tarball/${name}.tar.gz?uuid=v${version}";
name = "${name}.tar.gz";
2013-10-07 09:31:50 +02:00
sha256 = "14yyif6q89ihn28kliszaf19vywjg9f7192q1ak8823da1svbq8a";
};
buildInputs = [ go ];
buildPhase = ''
${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
mkdir $TMPDIR/go
export GOPATH=$TMPDIR/go
GONATPMP=$GOPATH/src/code.google.com/p/go-nat-pmp
mkdir -p $GONATPMP
cp -R ${srcNatPMP}/* $GONATPMP/
go build -o filegive
'';
installPhase = ''
ensureDir $out/bin
cp filegive $out/bin
'';
meta = {
homepage = http://viric.name/cgi-bin/filegive;
2013-05-02 09:34:42 +02:00
description = "Easy p2p file sending program";
license = "AGPLv3+";
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
};
}