Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchFromGitLab
4, pkg-config
5, rustPlatform
6, cargo
7, rustc
8, bzip2
9, nettle
10, openssl
11, pcsclite
12, stdenv
13, darwin
14}:
15
16buildPythonPackage rec {
17 pname = "pysequoia";
18 version = "0.1.14";
19 format = "pyproject";
20
21 src = fetchFromGitLab {
22 owner = "sequoia-pgp";
23 repo = "pysequoia";
24 rev = "v${version}";
25 hash = "sha256-63kUUxZTG33cB/IiD4AiDpLOI6Uew/fETgqhaGc7zp0=";
26 };
27
28 cargoDeps = rustPlatform.fetchCargoTarball {
29 inherit src;
30 name = "${pname}-${version}";
31 hash = "sha256-S/j3bGgU46nvVQFs35ih05teVEIJrFN4Ryq4B7rLFDE=";
32 };
33
34 nativeBuildInputs = [
35 pkg-config
36 rustPlatform.bindgenHook
37 rustPlatform.cargoSetupHook
38 rustPlatform.maturinBuildHook
39 cargo
40 rustc
41 ];
42
43 buildInputs = [
44 bzip2
45 nettle
46 openssl
47 pcsclite
48 ] ++ lib.optionals stdenv.isDarwin [
49 darwin.apple_sdk.frameworks.CoreFoundation
50 darwin.apple_sdk.frameworks.Security
51 ];
52
53 pythonImportsCheck = [ "pysequoia" ];
54
55 meta = with lib; {
56 description = "This library provides OpenPGP facilities in Python through the Sequoia PGP library";
57 homepage = "https://sequoia-pgp.gitlab.io/pysequoia";
58 license = licenses.asl20;
59 maintainers = with maintainers; [ doronbehar ];
60 };
61}