Files
nixpkgs/pkgs/development/python-modules/base2048/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

60 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
cargo,
fetchFromGitHub,
frelatage,
libiconv,
pytestCheckHook,
pythonOlder,
rustc,
rustPlatform,
}:
buildPythonPackage rec {
pname = "base2048";
version = "0.1.3";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "ionite34";
repo = "base2048";
tag = "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
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
optional-dependencies = {
fuzz = [ frelatage ];
};
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "base2048" ];
meta = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};
}