-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
/
Copy pathpackage.nix
129 lines (115 loc) · 2.29 KB
/
package.nix
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
lib,
fetchpatch,
python3,
fetchFromGitHub,
gitUpdater,
makeWrapper,
e2fsprogs,
jefferson,
lz4,
lziprecover,
lzop,
p7zip,
sasquatch,
sasquatch-v4be,
simg2img,
ubi_reader,
unar,
zstd,
versionCheckHook,
}:
let
# These dependencies are only added to PATH
runtimeDeps = [
e2fsprogs
jefferson
lziprecover
lzop
p7zip
sasquatch
sasquatch-v4be
ubi_reader
simg2img
unar
zstd
lz4
];
in
python3.pkgs.buildPythonApplication rec {
pname = "unblob";
version = "25.1.8";
pyproject = true;
disabled = python3.pkgs.pythonOlder "3.9";
src = fetchFromGitHub {
owner = "onekey-sec";
repo = "unblob";
tag = version;
hash = "sha256-PGpJPAo9q52gQ3EGusYtDA2e0MG5kFClqCYPB2DvuMs=";
forceFetchGit = true;
fetchLFS = true;
};
strictDeps = true;
build-system = with python3.pkgs; [ poetry-core ];
dependencies = with python3.pkgs; [
arpy
attrs
click
cryptography
dissect-cstruct
lark
lief.py
python3.pkgs.lz4 # shadowed by pkgs.lz4
plotext
pluggy
pyfatfs
pyperscan
python-magic
rarfile
rich
structlog
treelib
unblob-native
];
nativeBuildInputs = [
makeWrapper
];
# These are runtime-only CLI dependencies, which are used through
# their CLI interface
pythonRemoveDeps = [
"jefferson"
"ubi-reader"
];
pythonImportsCheck = [ "unblob" ];
makeWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath runtimeDeps}"
];
nativeCheckInputs =
with python3.pkgs;
[
pytestCheckHook
pytest-cov
versionCheckHook
]
++ runtimeDeps;
versionCheckProgramArg = "--version";
pytestFlagsArray = [
"--no-cov"
# `disabledTests` swallows the parameters between square brackets
# https://github.com/tytso/e2fsprogs/issues/152
"-k 'not test_all_handlers[filesystem.extfs]'"
];
passthru = {
updateScript = gitUpdater { };
# helpful to easily add these to a nix-shell environment
inherit runtimeDeps;
};
meta = {
description = "Extract files from any kind of container formats";
homepage = "https://unblob.org";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
mainProgram = "unblob";
maintainers = with lib.maintainers; [ vlaci ];
};
}