depot/third_party/nixpkgs/pkgs/development/web/minify/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

51 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, nix-update-script
, testers
, minify
}:
buildGoModule rec {
pname = "minify";
version = "2.12.9";
src = fetchFromGitHub {
owner = "tdewolff";
repo = pname;
rev = "v${version}";
hash = "sha256-+NBYn+gEsoclROnq2msNB4knviGn/XA9vNAuB0JZNek=";
};
vendorHash = "sha256-/Pw7fHVXWsovxfyzkWfb6UiRDBmiua82667N4Scl5+A=";
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";
};
}