diff options
| author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-05-16 00:03:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-16 00:03:08 +0000 |
| commit | 8af15d94de56ad7ea86df14d22ebfc116616ac17 (patch) | |
| tree | 1532da6030ea81a73a21ea57d86ee53d03209b0b /pkgs/development/python-modules/css-inline/default.nix | |
| parent | 54fba9982e9f012520da359274345f8d29bf1df2 (diff) | |
| parent | bedde01a4ea9b751139008db5495e2b44f25f185 (diff) | |
Merge staging-next into staging
Diffstat (limited to 'pkgs/development/python-modules/css-inline/default.nix')
| -rw-r--r-- | pkgs/development/python-modules/css-inline/default.nix | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/css-inline/default.nix b/pkgs/development/python-modules/css-inline/default.nix new file mode 100644 index 000000000000..96535eb94d95 --- /dev/null +++ b/pkgs/development/python-modules/css-inline/default.nix @@ -0,0 +1,71 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub + +# build-system +, rustPlatform + +# native darwin dependencies +, libiconv +, Security + +# tests +, pytestCheckHook +, hypothesis +}: + +buildPythonPackage rec { + pname = "css-inline"; + version = "0.8.7"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "Stranger6667"; + repo = "css-inline"; + rev = "python-v${version}"; + hash = "sha256-VtWvzEqozbRo9OIcObdaRRqDq9Tcp0KxXOPZWO5qTeE="; + }; + + postPatch = '' + cd bindings/python + ln -s ${./Cargo.lock} Cargo.lock + ''; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + postPatch = '' + cd bindings/python + ln -s ${./Cargo.lock} Cargo.lock + ''; + name = "${pname}-${version}"; + hash = "sha256-S8ebg5sMK7zoG84eAeXIWqDYuRVW9Mx9GJUAaKD9mxw="; + }; + + nativeBuildInputs = [ + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + ]; + + buildInputs = lib.optionals stdenv.isDarwin [ + libiconv + Security + ]; + + pythonImportsCheck = [ + "css_inline" + ]; + + nativeCheckInputs = [ + hypothesis + pytestCheckHook + ]; + + meta = with lib; { + description = "Inline CSS into style attributes"; + homepage = "https://github.com/Stranger6667/css-inline"; + changelog = "https://github.com/Stranger6667/css-inline/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} |
