2013-05-03 14:04:17 -07:00
|
|
|
{ stdenv, fetchurl, fetchgit, go }:
|
2013-05-02 00:32:23 -07:00
|
|
|
|
|
|
|
assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64 || stdenv.isArm);
|
|
|
|
|
2013-05-03 14:04:17 -07:00
|
|
|
let
|
|
|
|
|
|
|
|
# Code with BSD license
|
|
|
|
srcNatPMP = fetchgit {
|
2015-08-15 03:46:41 -07:00
|
|
|
url = https://github.com/jackpal/go-nat-pmp;
|
2013-05-03 14:04:17 -07:00
|
|
|
rev = "e04deda90d56";
|
|
|
|
sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb";
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2013-05-02 00:32:23 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2014-01-18 07:05:22 -08:00
|
|
|
name = "filegive-0.7.4";
|
2013-05-02 00:32:23 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-01-18 07:05:22 -08:00
|
|
|
url = "http://viric.name/soft/filegive/${name}.tar.gz";
|
|
|
|
sha256 = "1z3vyqfdp271qa5ah0i6jmn9gh3gb296wcm33sd2zfjqapyh12hy";
|
2013-05-02 00:32:23 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ go ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
|
2013-05-03 14:04:17 -07: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 00:32:23 -07:00
|
|
|
go build -o filegive
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 05:56:10 -07:00
|
|
|
mkdir -p $out/bin
|
2013-05-02 00:32:23 -07:00
|
|
|
cp filegive $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://viric.name/cgi-bin/filegive;
|
2013-05-02 00:34:42 -07:00
|
|
|
description = "Easy p2p file sending program";
|
2014-06-18 21:19:00 -07:00
|
|
|
license = stdenv.lib.licenses.agpl3Plus;
|
2013-05-03 23:08:52 -07:00
|
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
2013-05-02 00:32:23 -07:00
|
|
|
};
|
|
|
|
}
|