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 pname version src;
23 hash = "sha256-NLPei6ajR55mLyFhsjzUpXB/TsqqeDvP8yKE74t0ufk=";
24 };
25
26 nativeBuildInputs = with rustPlatform; [
27 cargoSetupHook
28 maturinBuildHook
29 ];
30
31 pythonImportsCheck = [ "minify_html" ];
32
33 meta = {
34 description = "Extremely fast and smart HTML + JS + CSS minifier";
35 homepage = "https://github.com/wilsonzlin/minify-html/tree/master/minify-html-python";
36 changelog = "https://github.com/wilsonzlin/minify-html/blob/v${version}/CHANGELOG.md";
37 license = lib.licenses.mit;
38 teams = [ lib.teams.apm ];
39 };
40}