diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/base2048/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/base2048/default.nix | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/base2048/default.nix b/nixpkgs/pkgs/development/python-modules/base2048/default.nix new file mode 100644 index 000000000000..889ef9f81f17 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/base2048/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, cargo +, fetchFromGitHub +, frelatage +, maturin +, pytestCheckHook +, pythonOlder +, rustc +, rustPlatform +}: + +buildPythonPackage rec { + pname = "base2048"; + version = "0.1.3"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ionite34"; + repo = "base2048"; + rev = "refs/tags/v${version}"; + hash = "sha256-OXlfycJB1IrW2Zq0xPDGjjwCdRTWtX/ixPGWcd+YjAg="; + }; + + cargoDeps = rustPlatform.importCargoLock { + lockFile = ./Cargo.lock; + }; + + postPatch = '' + ln -s ${./Cargo.lock} Cargo.lock + ''; + + nativeBuildInputs = [ + cargo + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + rustc + ]; + + passthru.optional-dependencies = { + fuzz = [ + frelatage + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "base2048" + ]; + + meta = with lib; { + description = "Binary encoding with base-2048 in Python with Rust"; + homepage = "https://github.com/ionite34/base2048"; + changelog = "https://github.com/ionite34/base2048/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} |