Merge pull request #65724 from doronbehar/improve-sequoia

Improve sequoia package expression

authored by worldofpeace and committed by GitHub a5b77b8c 6490f9c7

+99 -33
-32
pkgs/tools/security/sequoia-tool/default.nix
··· 1 - { stdenv, fetchFromGitLab, rustPlatform, darwin 2 - , pkgconfig, capnproto, clang, libclang, nettle, openssl, sqlite }: 3 - 4 - rustPlatform.buildRustPackage rec { 5 - pname = "sequoia-tool"; 6 - version = "0.9.0"; 7 - 8 - src = fetchFromGitLab { 9 - owner = "sequoia-pgp"; 10 - repo = "sequoia"; 11 - rev = "v${version}"; 12 - sha256 = "13dzwdzz33dy2lgnznsv8wqnw2501f2ggrkfwpqy5x6d1kgms8rj"; 13 - }; 14 - 15 - nativeBuildInputs = [ pkgconfig clang libclang ]; 16 - buildInputs = [ capnproto nettle openssl sqlite ] 17 - ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; 18 - 19 - LIBCLANG_PATH = libclang + "/lib"; 20 - 21 - cargoBuildFlags = [ "--package=sequoia-tool" ]; 22 - 23 - cargoSha256 = "1zcnkpzcar3a2fk2rn3i3nb70b59ds9fpfa44f15r3aaxajsdhdi"; 24 - 25 - meta = with stdenv.lib; { 26 - description = "A command-line frontend for Sequoia, an implementation of OpenPGP"; 27 - homepage = https://sequoia-pgp.org/; 28 - license = licenses.gpl3; 29 - maintainers = with maintainers; [ minijackson ]; 30 - platforms = platforms.all; 31 - }; 32 - }
+91
pkgs/tools/security/sequoia/default.nix
··· 1 + { stdenv, fetchFromGitLab, lib, darwin 2 + , git, nettle, llvmPackages, cargo, rustc 3 + , rustPlatform, pkgconfig, glib 4 + , openssl, sqlite, capnproto 5 + , ensureNewerSourcesForZipFilesHook, pythonSupport ? true, pythonPackages ? null 6 + }: 7 + 8 + assert pythonSupport -> pythonPackages != null; 9 + 10 + rustPlatform.buildRustPackage rec { 11 + pname = "sequoia"; 12 + version = "0.9.0"; 13 + 14 + src = fetchFromGitLab { 15 + owner = "sequoia-pgp"; 16 + repo = pname; 17 + rev = "v${version}"; 18 + sha256 = "13dzwdzz33dy2lgnznsv8wqnw2501f2ggrkfwpqy5x6d1kgms8rj"; 19 + }; 20 + 21 + cargoSha256 = "1zcnkpzcar3a2fk2rn3i3nb70b59ds9fpfa44f15r3aaxajsdhdi"; 22 + 23 + nativeBuildInputs = [ 24 + pkgconfig 25 + cargo 26 + rustc 27 + git 28 + llvmPackages.libclang 29 + llvmPackages.clang 30 + ensureNewerSourcesForZipFilesHook 31 + ] ++ 32 + lib.optionals pythonSupport [ pythonPackages.setuptools ] 33 + ; 34 + 35 + checkInputs = lib.optionals pythonSupport [ 36 + pythonPackages.pytest 37 + pythonPackages.pytestrunner 38 + ]; 39 + 40 + buildInputs = [ 41 + openssl 42 + sqlite 43 + nettle 44 + capnproto 45 + ] 46 + ++ lib.optionals pythonSupport [ pythonPackages.python pythonPackages.cffi ] 47 + ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ] 48 + ; 49 + 50 + makeFlags = [ 51 + "PREFIX=${placeholder ''out''}" 52 + ]; 53 + 54 + buildFlags = [ 55 + "build-release" 56 + ]; 57 + 58 + LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; 59 + 60 + postPatch = '' 61 + # otherwise, the check fails because we delete the `.git` in the unpack phase 62 + substituteInPlace openpgp-ffi/Makefile \ 63 + --replace 'git grep' 'grep -R' 64 + # Without this, the check fails 65 + substituteInPlace openpgp-ffi/examples/Makefile \ 66 + --replace '-O0 -g -Wall -Werror' '-g' 67 + substituteInPlace ffi/examples/Makefile \ 68 + --replace '-O0 -g -Wall -Werror' '-g' 69 + ''; 70 + 71 + preInstall = lib.optionalString pythonSupport '' 72 + export installFlags="PYTHONPATH=$PYTHONPATH:$out/${pythonPackages.python.sitePackages}" 73 + '' + lib.optionalString (!pythonSupport) '' 74 + export installFlags="PYTHON=disable" 75 + ''; 76 + 77 + # Don't use buildRustPackage phases, only use it for rust deps setup 78 + configurePhase = null; 79 + buildPhase = null; 80 + doCheck = true; 81 + checkPhase = null; 82 + installPhase = null; 83 + 84 + meta = with stdenv.lib; { 85 + description = "A cool new OpenPGP implementation"; 86 + homepage = "https://sequoia-pgp.org/"; 87 + license = licenses.gpl3; 88 + maintainers = with maintainers; [ minijackson doronbehar ]; 89 + platforms = platforms.all; 90 + }; 91 + }
+3 -1
pkgs/top-level/all-packages.nix
··· 5953 5953 5954 5954 seqdiag = with python3Packages; toPythonApplication seqdiag; 5955 5955 5956 - sequoia-tool = callPackage ../tools/security/sequoia-tool { inherit (llvmPackages) libclang; }; 5956 + sequoia = callPackage ../tools/security/sequoia { 5957 + pythonPackages = python3Packages; 5958 + }; 5957 5959 5958 5960 sewer = callPackage ../tools/admin/sewer { }; 5959 5961
+5
pkgs/top-level/python-packages.nix
··· 4705 4705 4706 4706 seqdiag = callPackage ../development/python-modules/seqdiag { }; 4707 4707 4708 + sequoia = disabledIf (isPyPy || !isPy3k) (toPythonModule (pkgs.sequoia.override { 4709 + pythonPackages = self; 4710 + pythonSupport = true; 4711 + })); 4712 + 4708 4713 safe = callPackage ../development/python-modules/safe { }; 4709 4714 4710 4715 sampledata = callPackage ../development/python-modules/sampledata { };