2021-05-14 21:57:49 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "reproxy";
|
2021-05-19 19:55:55 +01:00
|
|
|
version = "0.6.0";
|
2021-05-14 21:57:49 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umputun";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-19 19:55:55 +01:00
|
|
|
hash = "sha256-8veGMiRT59oLcMUxERI+2uRQVvbiuXTbrBi1GqoPe0M=";
|
2021-05-14 21:57:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Requires network access
|
|
|
|
substituteInPlace app/main_test.go \
|
|
|
|
--replace "Test_Main" "Skip_Main"
|
2021-05-22 20:04:35 +01:00
|
|
|
|
|
|
|
# Fails on Darwin.
|
|
|
|
# https://github.com/umputun/reproxy/issues/77
|
|
|
|
substituteInPlace app/discovery/provider/file_test.go \
|
|
|
|
--replace "TestFile_Events" "SkipFile_Events" \
|
|
|
|
--replace "TestFile_Events_BusyListener" "SkipFile_Events_BusyListener"
|
2021-05-14 21:57:49 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
buildFlagsArray = [
|
|
|
|
"-ldflags=-s -w -X main.revision=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 $GOPATH/bin/app $out/bin/reproxy
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple edge server / reverse proxy";
|
|
|
|
homepage = "https://reproxy.io/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
};
|
|
|
|
}
|