Include fix for meson 0.64
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 23 Nov 2022 11:48:18 +0000 (11:48 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 23 Nov 2022 11:48:18 +0000 (11:48 +0000)
https://gitlab.com/libblkio/libblkio/-/merge_requests/149

libblkio/149.patch [new file with mode: 0644]
libblkio/libblkio.spec

diff --git a/libblkio/149.patch b/libblkio/149.patch
new file mode 100644 (file)
index 0000000..b93651b
--- /dev/null
@@ -0,0 +1,37 @@
+From c2195221fcec63ee8b6350379fab03b82210e9e3 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Tue, 22 Nov 2022 14:03:17 -0500
+Subject: [PATCH] cargo-build.sh: support optimization=plain
+
+meson 0.64.0 added optimization=plain. It means that no optimization
+flags are explicitly passed to the compiler. This is useful in
+situations where the environment wants to control compiler flags (e.g.
+nix, rpm, etc), typically via CFLAGS, CXXFLAGS, etc.
+
+Make sure to handle optimization=plain so that cargo-build.sh doesn't
+exit early.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ src/cargo-build.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/cargo-build.sh b/src/cargo-build.sh
+index 2ad5463..9879d44 100755
+--- a/src/cargo-build.sh
++++ b/src/cargo-build.sh
+@@ -16,6 +16,11 @@ case "${meson_debug}" in
+ esac
+ case "${meson_optimization}" in
++    plain)
++        # A release build without explicit optimization flags
++        profile=release
++        args+=( --release )
++        ;;
+     0)
+         profile=debug
+         rustflags+=( -C opt-level=0 )
+-- 
+GitLab
+
index 68c0704..2280f23 100644 (file)
@@ -5,11 +5,15 @@ Version:       1.1.1
 
 Summary:       Block device I/O library
 Name:          libblkio
-Release:       6%{?dist}
+Release:       7%{?dist}
 URL:           %{forgeurl}
 Source0:       %{forgesource}
 License:       Apache-2.0 OR MIT
 
+# Fix for meson 0.64
+# (https://gitlab.com/libblkio/libblkio/-/merge_requests/149)
+Patch:         149.patch
+
 # Basic build requirements.
 BuildRequires: gcc, gcc-c++
 BuildRequires: make
@@ -85,5 +89,5 @@ sed -e 's/--locked/--offline/' -i src/cargo-build.sh
 
 
 %changelog
-* Tue Nov 22 2022 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-6
+* Wed Nov 23 2022 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-7
 - Initial package