depot/third_party/nixpkgs/pkgs/development/web/minify/default.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

51 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, nix-update-script
, testers
, minify
}:
buildGoModule rec {
pname = "minify";
version = "2.20.16";
src = fetchFromGitHub {
owner = "tdewolff";
repo = pname;
rev = "v${version}";
hash = "sha256-0RiSNRoRmN7X2udwgGaArXgIRTaxaGH4fo3usiCJNbA=";
};
vendorHash = "sha256-8OEF2sAJZuGX4z/OsXCAkRR82JO3rYCEJQbidIjGOJ8=";
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 = "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;
maintainers = with maintainers; [ gaelreyrol ];
mainProgram = "minify";
};
}