From 2a4cb50a3ff8ba724606ddd67155061d72b2c8f3 Mon Sep 17 00:00:00 2001 From: IndeedNotJames Date: Tue, 7 Feb 2023 15:58:25 +0100 Subject: [PATCH 1/3] xcaddy: 0.3.1 -> 0.3.2 --- pkgs/servers/caddy/xcaddy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/caddy/xcaddy/default.nix b/pkgs/servers/caddy/xcaddy/default.nix index 634a6aed1402..3c462e4b6576 100644 --- a/pkgs/servers/caddy/xcaddy/default.nix +++ b/pkgs/servers/caddy/xcaddy/default.nix @@ -2,7 +2,7 @@ buildGoModule rec { pname = "xcaddy"; - version = "0.3.1"; + version = "0.3.2"; subPackages = [ "cmd/xcaddy" ]; @@ -10,7 +10,7 @@ buildGoModule rec { owner = "caddyserver"; repo = pname; rev = "v${version}"; - hash = "sha256-oGTtS5UlEebIqv4SM4q0YclASJNu8DNOLrGLRRAtkd8="; + hash = "sha256-M0eMI/TtUNVqE4F1ifizVb0e4ACGa+yLkG3pJLaaDNs="; }; patches = [ From ed903ee4efc5fcc1f77e7c24a1e03f7f75d24c35 Mon Sep 17 00:00:00 2001 From: IndeedNotJames Date: Tue, 7 Feb 2023 15:58:25 +0100 Subject: [PATCH 2/3] xcaddy: add indeednotjames as maintainer --- pkgs/servers/caddy/xcaddy/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/caddy/xcaddy/default.nix b/pkgs/servers/caddy/xcaddy/default.nix index 3c462e4b6576..96552f0e32c6 100644 --- a/pkgs/servers/caddy/xcaddy/default.nix +++ b/pkgs/servers/caddy/xcaddy/default.nix @@ -23,6 +23,6 @@ buildGoModule rec { homepage = "https://github.com/caddyserver/xcaddy"; description = "Build Caddy with plugins"; license = licenses.asl20; - maintainers = with maintainers; [ tjni ]; + maintainers = with maintainers; [ tjni indeednotjames ]; }; } From 897bc4daabad84b73d7caa8ef2d0bd845d8c701e Mon Sep 17 00:00:00 2001 From: IndeedNotJames Date: Tue, 7 Feb 2023 15:58:25 +0100 Subject: [PATCH 3/3] xcaddy: fix build info --- pkgs/servers/caddy/xcaddy/default.nix | 7 +++++++ .../caddy/xcaddy/inject_version_info.diff | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/servers/caddy/xcaddy/inject_version_info.diff diff --git a/pkgs/servers/caddy/xcaddy/default.nix b/pkgs/servers/caddy/xcaddy/default.nix index 96552f0e32c6..c20a0e325ec9 100644 --- a/pkgs/servers/caddy/xcaddy/default.nix +++ b/pkgs/servers/caddy/xcaddy/default.nix @@ -14,9 +14,16 @@ buildGoModule rec { }; patches = [ + ./inject_version_info.diff ./use_tmpdir_on_darwin.diff ]; + ldflags = [ + "-s" + "-w" + "-X github.com/caddyserver/xcaddy/cmd.customVersion=v${version}" + ]; + vendorHash = "sha256-RpbnoXyTrqGOI7DpgkO+J47P17T4QCVvM1CfS6kRO9Y="; meta = with lib; { diff --git a/pkgs/servers/caddy/xcaddy/inject_version_info.diff b/pkgs/servers/caddy/xcaddy/inject_version_info.diff new file mode 100644 index 000000000000..4d87aa687878 --- /dev/null +++ b/pkgs/servers/caddy/xcaddy/inject_version_info.diff @@ -0,0 +1,16 @@ +diff --git a/cmd/main.go b/cmd/main.go +index ede7cd8..c553140 100644 +--- a/cmd/main.go ++++ b/cmd/main.go +@@ -401,8 +401,11 @@ func splitWith(arg string) (module, version, replace string, err error) { + return + } + ++var customVersion string ++ + // xcaddyVersion returns a detailed version string, if available. + func xcaddyVersion() string { ++ return customVersion + mod := goModule() + ver := mod.Version + if mod.Sum != "" {