1{
2 buildPythonPackage,
3 fetchPypi,
4 lib,
5 rustPlatform,
6}:
7
8buildPythonPackage rec {
9 pname = "minify-html";
10 version = "0.16.4";
11
12 pyproject = true;
13
14 # Fetching from Pypi, because there is no Cargo.lock in the GitHub repo.
15 src = fetchPypi {
16 inherit version;
17 pname = "minify_html";
18 hash = "sha256-3UjI/5ZhoQNHYkAqdBGzFohnqXP4/Hiwn2foGCC2TSI=";
19 };
20
21 cargoDeps = rustPlatform.fetchCargoVendor {
22 inherit src;
23 name = "${pname}-${version}";
24 hash = "sha256-NLPei6ajR55mLyFhsjzUpXB/TsqqeDvP8yKE74t0ufk=";
25 };
26
27 nativeBuildInputs = with rustPlatform; [
28 cargoSetupHook
29 maturinBuildHook
30 ];
31
32 pythonImportsCheck = [ "minify_html" ];
33
34 meta = {
35 description = "Extremely fast and smart HTML + JS + CSS minifier";
36 homepage = "https://github.com/wilsonzlin/minify-html/tree/master/minify-html-python";
37 changelog = "https://github.com/wilsonzlin/minify-html/blob/v${version}/CHANGELOG.md";
38 license = lib.licenses.mit;
39 teams = [ lib.teams.apm ];
40 };
41}