2021-05-31 22:54:33 +02:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
|
2021-05-14 22:57:49 +02:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "reproxy";
|
2021-07-10 19:27:11 +02:00
|
|
|
version = "0.9.0";
|
2021-05-14 22:57:49 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umputun";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-07-10 19:27:11 +02:00
|
|
|
hash = "sha256-z10KfDwIwitiR6ei1xV9//zhH7DLTow1giEYyjh8FIg=";
|
2021-05-14 22:57:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Requires network access
|
|
|
|
substituteInPlace app/main_test.go \
|
|
|
|
--replace "Test_Main" "Skip_Main"
|
2021-06-09 12:33:00 +02:00
|
|
|
substituteInPlace app/proxy/proxy_test.go \
|
|
|
|
--replace "TestHttp_matchHandler" "SkipHttp_matchHandler"
|
2021-05-31 22:54:33 +02:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2021-05-22 21:04:35 +02: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 22:57:49 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X main.revision=${version}"
|
2021-05-14 22:57:49 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|