filegive: use buildGoPackage

+20 -33
+8 -33
pkgs/tools/networking/filegive/default.nix
··· 1 - { stdenv, fetchurl, fetchgit, go }: 2 - 3 - let 4 5 - # Code with BSD license 6 - srcNatPMP = fetchgit { 7 - url = https://github.com/jackpal/go-nat-pmp; 8 - rev = "e04deda90d56"; 9 - sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb"; 10 - }; 11 - 12 - in 13 - stdenv.mkDerivation rec { 14 name = "filegive-0.7.4"; 15 16 src = fetchurl { ··· 18 sha256 = "1z3vyqfdp271qa5ah0i6jmn9gh3gb296wcm33sd2zfjqapyh12hy"; 19 }; 20 21 - buildInputs = [ go ]; 22 23 - buildPhase = '' 24 - ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "export GOARM=5"} 25 26 - mkdir $TMPDIR/go 27 - export GOPATH=$TMPDIR/go 28 - 29 - GONATPMP=$GOPATH/src/code.google.com/p/go-nat-pmp 30 - mkdir -p $GONATPMP 31 - cp -R ${srcNatPMP}/* $GONATPMP/ 32 - go build -o filegive 33 - ''; 34 - 35 - installPhase = '' 36 - mkdir -p $out/bin 37 - cp filegive $out/bin 38 - ''; 39 - 40 - meta = { 41 homepage = http://viric.name/cgi-bin/filegive; 42 description = "Easy p2p file sending program"; 43 - license = stdenv.lib.licenses.agpl3Plus; 44 - maintainers = with stdenv.lib.maintainers; [viric]; 45 - platforms = with stdenv.lib.platforms; linux; 46 }; 47 }
··· 1 + { buildGoPackage, stdenv, fetchurl }: 2 3 + buildGoPackage rec { 4 name = "filegive-0.7.4"; 5 6 src = fetchurl { ··· 8 sha256 = "1z3vyqfdp271qa5ah0i6jmn9gh3gb296wcm33sd2zfjqapyh12hy"; 9 }; 10 11 + goDeps = ./deps.nix; 12 13 + goPackagePath = "viric.name/soft/filegive"; 14 15 + meta = with stdenv.lib; { 16 homepage = http://viric.name/cgi-bin/filegive; 17 description = "Easy p2p file sending program"; 18 + license = licenses.agpl3Plus; 19 + maintainers = [ maintainers.viric ]; 20 + platforms = platforms.linux; 21 }; 22 }
+12
pkgs/tools/networking/filegive/deps.nix
···
··· 1 + # This file was generated by https://github.com/kamilchm/go2nix v1.3.0 2 + [ 3 + { 4 + goPackagePath = "code.google.com/p/go-nat-pmp"; 5 + fetch = { 6 + type = "git"; 7 + url = "https://github.com/jackpal/go-nat-pmp"; 8 + rev = "e04deda90d5683d6e375732740814a89eea7bafd"; 9 + sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb"; 10 + }; 11 + } 12 + ]