2014-09-15 15:37:17 +01:00
|
|
|
{ stdenv, lib, go, go-bindata, fetchgit, fetchbzr, fetchhg, fetchFromGitHub }:
|
2013-10-27 13:26:13 +00:00
|
|
|
|
2014-09-15 15:37:17 +01:00
|
|
|
let deps = import ./deps.nix {
|
|
|
|
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
|
|
|
};
|
2013-10-27 21:56:59 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2013-10-27 13:26:13 +00:00
|
|
|
name = "ngrok-${version}";
|
2014-09-15 15:37:17 +01:00
|
|
|
version = "1.7";
|
2013-10-27 13:26:13 +00:00
|
|
|
|
2014-09-15 15:37:17 +01:00
|
|
|
buildInputs = [ go go-bindata ];
|
2013-10-27 13:26:13 +00:00
|
|
|
|
2014-09-15 15:37:17 +01:00
|
|
|
unpackPhase = ''
|
|
|
|
export GOPATH=$(pwd)
|
|
|
|
cp -LR ${deps}/src src
|
|
|
|
chmod u+w -R src
|
|
|
|
sourceRoot=src/github.com/inconshreveable/ngrok
|
|
|
|
'';
|
2013-10-27 13:26:13 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
2014-09-15 15:37:17 +01:00
|
|
|
export HOME=$(pwd)
|
|
|
|
export GOPATH=$(pwd):$GOPATH
|
2013-10-27 21:56:59 +00:00
|
|
|
|
|
|
|
# don't download dependencies as we already have them
|
2014-09-15 15:37:17 +01:00
|
|
|
sed -i '/jteeuwen\/go-bindata/d' Makefile
|
|
|
|
sed -i '/export GOPATH/d' Makefile
|
|
|
|
sed -i 's|bin/go-bindata|go-bindata|' Makefile
|
2013-10-27 13:26:13 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-09-16 09:19:43 +01:00
|
|
|
make release-client release-server
|
2013-10-27 13:26:13 +00:00
|
|
|
mkdir -p $out/bin
|
2014-09-16 09:19:43 +01:00
|
|
|
cp bin/ngrok{d,} $out/bin
|
2013-10-27 13:26:13 +00:00
|
|
|
'';
|
|
|
|
|
2014-09-15 15:37:17 +01:00
|
|
|
meta = with lib; {
|
2013-10-27 13:26:13 +00:00
|
|
|
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 15:37:17 +01:00
|
|
|
maintainers = with maintainers; [ iElectric cstrahan ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2013-10-27 13:26:13 +00:00
|
|
|
};
|
|
|
|
}
|