minhtml: init at 0.16.4

I generated a `Cargo.lock` file which is included in the patch phase, as upstream does not have one.
This commit is contained in:
tye-exe
2025-06-27 12:27:39 +01:00
parent 8455a2fd8f
commit 987d1657a8
2 changed files with 2106 additions and 0 deletions
+2063
View File
File diff suppressed because it is too large Load Diff
+43
View File
@@ -0,0 +1,43 @@
{
lib,
fetchFromGitHub,
rustPlatform,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "minhtml";
version = "0.16.4";
src = fetchFromGitHub {
owner = "wilsonzlin";
repo = "minify-html";
tag = "v${finalAttrs.version}";
hash = "sha256-SoCSHhgTLfztSfvzxxpZn/nQpXbKlkE4iiP0YZ0MVjY=";
};
# Upstream does not include a lock file so one has to be patched in.
cargoLock = {
lockFile = ./Cargo.lock;
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
# Ensures that only the correct package gets built, as upstream contains multiple.
cargoBuildFlags = [
"-p"
"minhtml"
];
cargoTestFlags = [
"-p"
"minhtml"
];
meta = {
description = "Minifier for HTML, JavaScript, and CSS";
mainProgram = "minhtml";
homepage = "https://github.com/wilsonzlin/minify-html";
changelog = "https://github.com/wilsonzlin/minify-html/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tye-exe ];
};
})