blob: 693e4af50a9fc23863c33fef583ddd1fa48a348a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
{
lib,
stdenv,
buildPythonPackage,
cargo,
fetchFromGitHub,
frelatage,
libiconv,
pytestCheckHook,
rustc,
rustPlatform,
}:
buildPythonPackage rec {
pname = "base2048";
version = "0.1.3";
pyproject = true;
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 ];
};
}
|