From f101816bbfb25fc93f7b47c32f65fba0fc2aae5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Reyrol?= Date: Mon, 17 Jul 2023 12:04:13 +0200 Subject: [PATCH] minify: 2.11.1 -> 2.12.7 --- pkgs/development/web/minify/default.nix | 39 ++++++++++++++++--- .../web/minify/update-go-version-mod.patch | 12 ++++++ 2 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/web/minify/update-go-version-mod.patch diff --git a/pkgs/development/web/minify/default.nix b/pkgs/development/web/minify/default.nix index 13589bb0f621..85c1083c6a6d 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 000000000000..5f8178cdf980 --- /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