about summary refs log tree commit diff
path: root/pkgs/tools/networking/filegive/default.nix
blob: 7e3c228af1260a7d094577c66e7767c34c0e347e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ stdenv, fetchurl, go }:

assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64 || stdenv.isArm);

stdenv.mkDerivation rec {
  name = "filegive-0.3";

  src = fetchurl {
    url = "http://viric.name/cgi-bin/filegive/tarball/filegive-0.3.tar.gz?uuid=v0.3";
    name = "${name}.tar.gz";
    sha256 = "1xiz47q6f579nb36p973bb3wjszn515v0sjh76pif1cihijdsb5y";
  };

  buildInputs = [ go ];

  buildPhase = ''
    ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
    go build -o filegive
  '';

  installPhase = ''
    ensureDir $out/bin
    cp filegive $out/bin
  '';

  meta = {
    homepage = http://viric.name/cgi-bin/filegive;
    description = "Easy p2p file sending program";
    license = "BSD";
  };
}