1{
2 lib,
3 buildPythonPackage,
4 setuptools,
5 fetchFromGitHub,
6 installShellFiles,
7 bats,
8 openssh,
9
10 # deps
11 cryptography,
12 bcrypt,
13 pyyaml,
14 docopt,
15 pynacl,
16}:
17
18buildPythonPackage rec {
19 pname = "crypt4gh";
20 version = "1.7";
21 pyproject = true;
22 src = fetchFromGitHub {
23 owner = "EGA-archive";
24 repo = "crypt4gh";
25 rev = "v${version}";
26 hash = "sha256-kPXD/SityWscHuRn068E6fFxUjt67cC5VEe5o8wtxwk=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 pyyaml
33 docopt
34 cryptography
35 pynacl
36 bcrypt
37 ];
38
39 pythonImportsCheck = [ "crypt4gh" ];
40
41 nativeBuildInputs = [ installShellFiles ];
42
43 postInstall = ''
44 installShellCompletion \
45 completions/crypt4gh-debug.bash \
46 completions/crypt4gh-debug.bash \
47 completions/crypt4gh.bash
48 '';
49
50 nativeCheckInputs = [
51 bats
52 openssh
53 ];
54 installCheckPhase = ''
55 PATH=$PATH:$out/bin
56 bats tests
57 '';
58
59 meta = {
60 mainProgram = "crypt4gh";
61 description = "Tool to encrypt, decrypt or re-encrypt files, according to the GA4GH encryption file format";
62 homepage = "https://github.com/EGA-archive/crypt4gh";
63 license = lib.licenses.asl20;
64 platforms = lib.platforms.all;
65 maintainers = [ lib.maintainers.richardjacton ];
66 };
67}