diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/web/minify/default.nix | 39 | ||||
-rw-r--r-- | pkgs/development/web/minify/update-go-version-mod.patch | 12 |
2 files changed, 45 insertions, 6 deletions
diff --git a/pkgs/development/web/minify/default.nix b/pkgs/development/web/minify/default.nix index 13589bb0f621f..85c1083c6a6df 100644 --- a/pkgs/development/web/minify/default.nix +++ b/pkgs/development/web/minify/default.nix @@ -1,24 +1,51 @@ -{ buildGoModule, fetchFromGitHub, lib }: +{ lib +, buildGoModule +, fetchFromGitHub +, installShellFiles +, nix-update-script +, testers +, minify +}: buildGoModule rec { pname = "minify"; - version = "2.11.1"; + version = "2.12.7"; src = fetchFromGitHub { owner = "tdewolff"; repo = pname; rev = "v${version}"; - sha256 = "sha256-qna2u+Y4eRGLNvRKDbL/VQud1pn8b1wWzbKQM1p0Yws="; + hash = "sha256-V3lFM58ciU9RrIp5s+ZMaCUAfRJxbTuQxusXhLCiGmI="; }; - vendorSha256 = "sha256-stj3fOaPM70kF6vTX/DEs4qFq/O0Vq0TFw0J/3L5NmA="; + patches = [ ./update-go-version-mod.patch ]; + + vendorHash = "sha256-v3ZPaeE1YW9BRXHxGsmN8tHv3ApOY+NivfePctOmYlM="; + + nativeBuildInputs = [ installShellFiles ]; ldflags = [ "-s" "-w" "-X main.Version=${version}" ]; + subPackages = [ "cmd/minify" ]; + + passthru = { + updateScript = nix-update-script { }; + tests.version = testers.testVersion { + inherit version; + package = minify; + command = "minify --version"; + }; + }; + + postInstall = '' + installShellCompletion --cmd minify --bash cmd/minify/bash_completion + ''; + meta = with lib; { - description = "Minifiers for web formats"; - license = licenses.mit; + description = "Go minifiers for web formats"; homepage = "https://go.tacodewolff.nl/minify"; downloadPage = "https://github.com/tdewolff/minify"; + changelog = "https://github.com/tdewolff/minify/releases/tag/v${version}"; + license = licenses.mit; }; } diff --git a/pkgs/development/web/minify/update-go-version-mod.patch b/pkgs/development/web/minify/update-go-version-mod.patch new file mode 100644 index 0000000000000..5f8178cdf980e --- /dev/null +++ b/pkgs/development/web/minify/update-go-version-mod.patch @@ -0,0 +1,12 @@ +diff --git a/go.mod b/go.mod +index cebe363..f9ae9c8 100644 +--- a/go.mod ++++ b/go.mod +@@ -1,6 +1,6 @@ + module github.com/tdewolff/minify/v2 + +-go 1.13 ++go 1.18 + + require ( + github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect |