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";
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2013-05-02 09:32:23 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2014-01-18 16:05:22 +01:00
|
|
|
name = "filegive-0.7.4";
|
2013-05-02 09:32:23 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-01-18 16:05:22 +01:00
|
|
|
url = "http://viric.name/soft/filegive/${name}.tar.gz";
|
|
|
|
sha256 = "1z3vyqfdp271qa5ah0i6jmn9gh3gb296wcm33sd2zfjqapyh12hy";
|
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
|
|
|
};
|
|
|
|
}
|