Merge pull request #215133 from IndeedNotJames/xcaddy

undefined
This commit is contained in:
Sandro 2023-02-07 18:35:31 +01:00 committed by GitHub
commit 3c2f517c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 3 deletions

View File

@ -2,7 +2,7 @@
buildGoModule rec {
pname = "xcaddy";
version = "0.3.1";
version = "0.3.2";
subPackages = [ "cmd/xcaddy" ];
@ -10,19 +10,26 @@ buildGoModule rec {
owner = "caddyserver";
repo = pname;
rev = "v${version}";
hash = "sha256-oGTtS5UlEebIqv4SM4q0YclASJNu8DNOLrGLRRAtkd8=";
hash = "sha256-M0eMI/TtUNVqE4F1ifizVb0e4ACGa+yLkG3pJLaaDNs=";
};
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; {
homepage = "https://github.com/caddyserver/xcaddy";
description = "Build Caddy with plugins";
license = licenses.asl20;
maintainers = with maintainers; [ tjni ];
maintainers = with maintainers; [ tjni indeednotjames ];
};
}

View File

@ -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 != "" {