2013-05-03 23:04:17 +02:00
|
|
|
{ stdenv, fetchurl, fetchgit, go }:
|
2013-05-02 09:32:23 +02:00
|
|
|
|
|
|
|
assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64 || stdenv.isArm);
|
|
|
|
|
2013-05-03 23:04:17 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
# Code with BSD license
|
|
|
|
srcNatPMP = fetchgit {
|
|
|
|
url = "https://code.google.com/p/go-nat-pmp/";
|
|
|
|
rev = "e04deda90d56";
|
|
|
|
sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb";
|
|
|
|
};
|
|
|
|
|
2013-05-06 10:24:17 +02:00
|
|
|
version = "0.5.2";
|
2013-05-03 23:04:17 +02:00
|
|
|
|
|
|
|
in
|
2013-05-02 09:32:23 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2013-05-03 23:04:17 +02:00
|
|
|
name = "filegive-${version}";
|
2013-05-02 09:32:23 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-05-03 23:04:17 +02:00
|
|
|
url = "http://viric.name/cgi-bin/filegive/tarball/${name}.tar.gz?uuid=v${version}";
|
2013-05-02 09:32:23 +02:00
|
|
|
name = "${name}.tar.gz";
|
2013-05-06 10:24:17 +02:00
|
|
|
sha256 = "0n5ilhccdy2nsdvl871nn2isr1jdlm7yncxff7zm5qzsx8k9skkz";
|
2013-05-02 09:32:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ go ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
|
2013-05-03 23:04:17 +02:00
|
|
|
|
|
|
|
mkdir $TMPDIR/go
|
|
|
|
export GOPATH=$TMPDIR/go
|
|
|
|
|
|
|
|
GONATPMP=$GOPATH/src/code.google.com/p/go-nat-pmp
|
|
|
|
mkdir -p $GONATPMP
|
|
|
|
cp -R ${srcNatPMP}/* $GONATPMP/
|
2013-05-02 09:32:23 +02:00
|
|
|
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";
|
2013-05-04 08:08:52 +02:00
|
|
|
license = "AGPLv3+";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
2013-05-02 09:32:23 +02:00
|
|
|
};
|
|
|
|
}
|