12 rustPlatform.buildRustPackage rec {
13 pname = "rpm-sequoia";
16 src = fetchFromGitHub {
17 owner = "rpm-software-management";
20 hash = "sha256-AZCsboUv4muKOw5El2Hw5O1cvAgD3JhBppacrQCJT2k=";
23 cargoHash = "sha256-0yO1+OAkXje/ir8i8URVhIcW8gwXleYx+XL1U4bjtXk=";
31 rustPlatform.bindgenHook
34 propagatedBuildInputs = [ nettle ];
36 # Tests will parse the symbols, on darwin we have two issues:
37 # - library name is hardcoded to librpm_sequoia.so
38 # - The output of the objdump differs and the parsing logic needs to be adapted
39 doCheck = !stdenv.hostPlatform.isDarwin;
46 # Ensure the generated .pc file gets the correct prefix
47 env.PREFIX = placeholder "out";
49 # Install extra files, the same as this is done on fedora:
50 # https://src.fedoraproject.org/rpms/rust-rpm-sequoia/blob/f41/f/rust-rpm-sequoia.spec#_81
52 # Install the generated pc file for consumption by the dependents
54 install -Dm644 target/release/rpm-sequoia.pc -t $dev/lib/pkgconfig
57 # Dependents will rely on the versioned symlinks
58 lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
60 find target/release/ \
62 -type l -name 'librpm_sequoia.*' \
63 -exec cp --no-dereference {} $out/lib/ \;
65 + lib.optionalString stdenv.hostPlatform.isDarwin ''
67 ln -s librpm_sequoia.dylib $out/lib/librpm_sequoia.${version}.dylib
70 passthru.updateScript = nix-update-script { };
73 description = "An OpenPGP backend for rpm using Sequoia PGP";
74 homepage = "https://sequoia-pgp.org/";
75 license = lib.licenses.gpl2Plus;
76 maintainers = with lib.maintainers; [ baloo ];