From 7058dccca5b62d2d2dc8c260bef220fd1364c856 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:57:52 +0200 Subject: [PATCH] simplehttp2server: migrate to buildGoModule Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- pkgs/servers/simplehttp2server/default.nix | 36 +++++++++++++--------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/pkgs/servers/simplehttp2server/default.nix b/pkgs/servers/simplehttp2server/default.nix index b14056f5adca..3ec200a1d201 100644 --- a/pkgs/servers/simplehttp2server/default.nix +++ b/pkgs/servers/simplehttp2server/default.nix @@ -1,26 +1,32 @@ -{ lib, buildGoPackage, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, fetchpatch }: -buildGoPackage rec { +buildGoModule rec { pname = "simplehttp2server"; version = "3.1.3"; - goPackagePath = "github.com/GoogleChromeLabs/simplehttp2server"; - src = fetchFromGitHub { - owner = "GoogleChromeLabs"; - repo = "simplehttp2server"; - rev = version; - sha256 = "113mcfvy1m91wask5039mhr0187nlw325ac32785yl4bb4igi8aw"; + owner = "GoogleChromeLabs"; + repo = "simplehttp2server"; + rev = version; + sha256 = "113mcfvy1m91wask5039mhr0187nlw325ac32785yl4bb4igi8aw"; }; - goDeps = ./deps.nix; + patches = [ + # Migrate to Go modules + (fetchpatch { + url = "https://github.com/GoogleChromeLabs/simplehttp2server/commit/7090b4af33846c48b336335f6a19514b7c1d4392.patch"; + hash = "sha256-xGBPNdAmOAUkr7j2VDfTi3Bm13y/b3nuqDLf1jiGct4="; + }) + ]; + + vendorHash = "sha256-PcDy+46Pz6xOxxwkSjojsbKZyR1yHdbWAJT+HFAEKkA="; + proxyVendor = true; meta = with lib; { - homepage = "https://github.com/GoogleChromeLabs/simplehttp2server"; - description = "HTTP/2 server for development purposes"; - license = licenses.asl20; - maintainers = with maintainers; [ yrashk ]; - mainProgram = "simplehttp2server"; + homepage = "https://github.com/GoogleChromeLabs/simplehttp2server"; + description = "HTTP/2 server for development purposes"; + license = licenses.asl20; + maintainers = with maintainers; [ yrashk ]; + mainProgram = "simplehttp2server"; }; - }