From d9ad15582bde622191eb0ab11a013e45ff004d4f Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Mon, 25 Oct 2021 10:15:23 -0700 Subject: [PATCH] Downgrade libbpf-sys to 0.4.0-2 on Fedora 35 and earlier --- libbpf-cargo-downgrade-libbpf-sys.patch | 12 ++++++++++++ rust-libbpf-cargo.spec | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 libbpf-cargo-downgrade-libbpf-sys.patch diff --git a/libbpf-cargo-downgrade-libbpf-sys.patch b/libbpf-cargo-downgrade-libbpf-sys.patch new file mode 100644 index 0000000..4a70fc4 --- /dev/null +++ b/libbpf-cargo-downgrade-libbpf-sys.patch @@ -0,0 +1,12 @@ +diff -Naur a/Cargo.toml b/Cargo.toml +--- a/Cargo.toml 2021-10-25 10:12:51.321033877 -0700 ++++ b/Cargo.toml 2021-10-25 10:14:01.983431692 -0700 +@@ -35,7 +35,7 @@ + version = "0.12" + + [dependencies.libbpf-sys] +-version = "0.5.0-1" ++version = "0.4.0-2" + + [dependencies.memmap2] + version = "0.3" diff --git a/rust-libbpf-cargo.spec b/rust-libbpf-cargo.spec index 5dfa654..0c354eb 100644 --- a/rust-libbpf-cargo.spec +++ b/rust-libbpf-cargo.spec @@ -14,6 +14,9 @@ URL: https://crates.io/crates/libbpf-cargo Source: %{crates_source} # Turn on the novendor feature by default Patch0: libbpf-cargo-fix-metadata.diff +# Downgrade libbpf-sys to 0.4.0-2; this patch is meant for Fedora 35 and lower +# where libbpf is still at 0.4.0 +Patch1: libbpf-cargo-downgrade-libbpf-sys.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -84,7 +87,11 @@ which use "novendor" feature of "%{crate}" crate. %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%setup -q -n %{crate}-%{version_no_tilde} +%patch0 -p1 +%if 0%{?fedora} < 36 +%patch1 -p1 +%endif %cargo_prep %generate_buildrequires