8 # Use the same llvmPackages version as Rust
18 , ensureNewerSourcesForZipFilesHook
19 , pythonSupport ? true
20 , pythonPackages ? null
23 assert pythonSupport -> pythonPackages != null;
25 rustPlatform.buildRustPackage rec {
27 # Upstream has separate version numbering for the library and the CLI frontend.
28 # This derivation provides the CLI frontend, and thus uses its version number.
31 src = fetchFromGitLab {
32 owner = "sequoia-pgp";
34 rev = "sq/v${version}";
35 sha256 = "sha256-KhJAXpj47Tvds5SLYwnsNeIlPf9QEopoCzsvvHgCwaI=";
38 cargoSha256 = "sha256-Y7iiZVIT9Vbe4YmTfGTU8p3H3odQKms2FBnnWgvF7mI=";
42 { url = "https://gitlab.com/sequoia-pgp/sequoia/-/commit/7916f90421ecb9a75e32f0284459bcc9a3fd02b0.patch";
43 sha256 = "sha256-KBBn6XaGzIT0iVzoCYsS0N+OkZzGuWmUmIF2hl49FEI=";
53 llvmPackages_12.libclang.lib
55 ensureNewerSourcesForZipFilesHook
58 lib.optionals pythonSupport [ pythonPackages.setuptools ]
61 checkInputs = lib.optionals pythonSupport [
63 pythonPackages.pytest-runner
70 ] ++ lib.optionals pythonSupport [ pythonPackages.python pythonPackages.cffi ]
71 ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]
75 "PREFIX=${placeholder "out"}"
76 # Defaults to "ginstall" from some reason, although upstream's Makefiles check uname
84 LIBCLANG_PATH = "${llvmPackages_12.libclang.lib}/lib";
86 # Sometimes, tests fail on CI (ofborg) & hydra without this
88 # doctest for sequoia-ipc fail for some reason
89 "--skip=macros::assert_send_and_sync"
90 "--skip=macros::time_it"
93 preInstall = lib.optionalString pythonSupport ''
94 export installFlags="PYTHONPATH=$PYTHONPATH:$out/${pythonPackages.python.sitePackages}"
95 '' + lib.optionalString (!pythonSupport) ''
96 export makeFlags="PYTHON=disable"
99 # Don't use buildRustPackage phases, only use it for rust deps setup
100 configurePhase = null;
107 description = "A cool new OpenPGP implementation";
108 homepage = "https://sequoia-pgp.org/";
109 license = licenses.gpl2Plus;
110 maintainers = with maintainers; [ minijackson doronbehar ];