nixpkgs/pkgs/tools/misc/ngrok/default.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2014-09-15 16:37:17 +02:00
{ stdenv, lib, go, go-bindata, fetchgit, fetchbzr, fetchhg, fetchFromGitHub }:
2014-09-15 16:37:17 +02:00
let deps = import ./deps.nix {
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
};
in stdenv.mkDerivation rec {
name = "ngrok-${version}";
2014-09-15 16:37:17 +02:00
version = "1.7";
2014-09-15 16:37:17 +02:00
buildInputs = [ go go-bindata ];
2014-09-15 16:37:17 +02:00
unpackPhase = ''
export GOPATH=$(pwd)
cp -LR ${deps}/src src
chmod u+w -R src
sourceRoot=src/github.com/inconshreveable/ngrok
'';
preBuild = ''
2014-09-15 16:37:17 +02:00
export HOME=$(pwd)
export GOPATH=$(pwd):$GOPATH
# don't download dependencies as we already have them
2014-09-15 16:37:17 +02:00
sed -i '/jteeuwen\/go-bindata/d' Makefile
sed -i '/export GOPATH/d' Makefile
sed -i 's|bin/go-bindata|go-bindata|' Makefile
'';
installPhase = ''
2014-09-16 10:19:43 +02:00
make release-client release-server
mkdir -p $out/bin
2014-09-16 10:19:43 +02:00
cp bin/ngrok{d,} $out/bin
'';
2014-09-15 16:37:17 +02:00
meta = with lib; {
description = "Reverse proxy that creates a secure tunnel between from a public endpoint to a locally running web service";
homepage = https://ngrok.com/;
license = licenses.asl20;
2014-09-15 16:37:17 +02:00
maintainers = with maintainers; [ iElectric cstrahan ];
platforms = with platforms; linux ++ darwin;
};
}