Skip to content

Commit 7353dfc

Browse files
authored
rpm-sequoia: init at 1.7.0 (#354645)
2 parents a59994b + a2d3ae0 commit 7353dfc

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
objdump may be prefixed on cross-compilation, read the path from $OBJDUMP instead
2+
3+
diff --git a/tests/symbols.rs b/tests/symbols.rs
4+
index 9375619..5f161fc 100644
5+
--- a/tests/symbols.rs
6+
+++ b/tests/symbols.rs
7+
@@ -27,7 +27,10 @@ fn symbols() -> anyhow::Result<()> {
8+
}
9+
};
10+
11+
- let cmd = Command::new("objdump")
12+
+ let cmd = Command::new("bash")
13+
+ .arg("-c")
14+
+ .arg(r#"exec "$OBJDUMP" "$@""#)
15+
+ .arg("--")
16+
.arg("-T")
17+
.arg(lib)
18+
.unwrap();
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
stdenv,
3+
fetchFromGitHub,
4+
lib,
5+
nettle,
6+
nix-update-script,
7+
rustPlatform,
8+
pkg-config,
9+
runCommand,
10+
}:
11+
12+
rustPlatform.buildRustPackage rec {
13+
pname = "rpm-sequoia";
14+
version = "1.7.0";
15+
16+
src = fetchFromGitHub {
17+
owner = "rpm-software-management";
18+
repo = "rpm-sequoia";
19+
rev = "v${version}";
20+
hash = "sha256-AZCsboUv4muKOw5El2Hw5O1cvAgD3JhBppacrQCJT2k=";
21+
};
22+
23+
cargoHash = "sha256-0yO1+OAkXje/ir8i8URVhIcW8gwXleYx+XL1U4bjtXk=";
24+
25+
patches = [
26+
./objdump.patch
27+
];
28+
29+
nativeBuildInputs = [
30+
pkg-config
31+
rustPlatform.bindgenHook
32+
];
33+
34+
propagatedBuildInputs = [ nettle ];
35+
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;
40+
41+
outputs = [
42+
"out"
43+
"dev"
44+
];
45+
46+
# Ensure the generated .pc file gets the correct prefix
47+
env.PREFIX = placeholder "out";
48+
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
51+
preInstall =
52+
# Install the generated pc file for consumption by the dependents
53+
''
54+
install -Dm644 target/release/rpm-sequoia.pc -t $dev/lib/pkgconfig
55+
''
56+
+
57+
# Dependents will rely on the versioned symlinks
58+
''
59+
install -d $out/lib
60+
find target/release/ \
61+
-maxdepth 1 \
62+
-type l -name 'librpm_sequoia.*' \
63+
-exec cp --no-dereference {} $out/lib/ \;
64+
'';
65+
66+
passthru.updateScript = nix-update-script { };
67+
68+
meta = {
69+
description = "An OpenPGP backend for rpm using Sequoia PGP";
70+
homepage = "https://sequoia-pgp.org/";
71+
license = lib.licenses.gpl2Plus;
72+
maintainers = with lib.maintainers; [ baloo ];
73+
};
74+
}

0 commit comments

Comments
 (0)