Blame 0001-rpm-use-meson-s-syntax-to-specify-sourcedir-and-buil.patch

Igor Gnatenko da6a24
From dd2843cf8752d26575b15cd1ba73c43bd3501494 Mon Sep 17 00:00:00 2001
Igor Gnatenko b44b0b
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko b44b0b
Date: Tue, 13 Dec 2016 11:59:52 +0100
Igor Gnatenko b44b0b
Subject: [PATCH 1/2] rpm: use meson's syntax to specify sourcedir and builddir
Igor Gnatenko b44b0b
Igor Gnatenko b44b0b
When user uses %meson -Denable_cool_feature=true current macro fails
Igor Gnatenko b44b0b
because RPM adds flag after popd:
Igor Gnatenko b44b0b
...
Igor Gnatenko b44b0b
pushd x86_64-redhat-linux-gnu
Igor Gnatenko b44b0b
  /usr/bin/meson ... $OLDPWD/.
Igor Gnatenko b44b0b
popd -Denable_cool_feature
Igor Gnatenko b44b0b
Igor Gnatenko b44b0b
Since meson can accept $srcdir and $builddir arugments we don't have
Igor Gnatenko b44b0b
this problem with pushd/popd. It also simplifies things a bit.
Igor Gnatenko b44b0b
Igor Gnatenko b44b0b
Reported-by: Richard Hughes <richard@hughsie.com>
Igor Gnatenko b44b0b
References: https://bugzilla.redhat.com/show_bug.cgi?id=1401062
Igor Gnatenko b44b0b
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko da6a24
(cherry picked from commit dcd3c217121fbb09be8acecd2d866219e85ad9bd)
Igor Gnatenko b44b0b
---
Igor Gnatenko da6a24
 data/macros.meson | 28 +++++++++++++---------------
Igor Gnatenko da6a24
 1 file changed, 13 insertions(+), 15 deletions(-)
Igor Gnatenko b44b0b
Igor Gnatenko b44b0b
diff --git a/data/macros.meson b/data/macros.meson
Igor Gnatenko da6a24
index 4b91c70d..1512a6bf 100644
Igor Gnatenko b44b0b
--- a/data/macros.meson
Igor Gnatenko b44b0b
+++ b/data/macros.meson
Igor Gnatenko da6a24
@@ -8,21 +8,19 @@
Igor Gnatenko b44b0b
     export FFLAGS="%{optflags} -I%{_fmoddir}"  \
Igor Gnatenko b44b0b
     export FCFLAGS="%{optflags} -I%{_fmoddir}" \
Igor Gnatenko b44b0b
     export LDFLAGS="%{?__global_ldflags}"      \
Igor Gnatenko b44b0b
-    mkdir -p %{__builddir}                     \
Igor Gnatenko b44b0b
-    pushd %{__builddir}                        \
Igor Gnatenko da6a24
-        %{__meson}                         \\\
Igor Gnatenko da6a24
-            --buildtype=plain              \\\
Igor Gnatenko da6a24
-            --prefix=%{_prefix}            \\\
Igor Gnatenko da6a24
-            --libdir=%{_libdir}            \\\
Igor Gnatenko da6a24
-            --libexecdir=%{_libexecdir}    \\\
Igor Gnatenko da6a24
-            --bindir=%{_bindir}            \\\
Igor Gnatenko da6a24
-            --includedir=%{_includedir}    \\\
Igor Gnatenko da6a24
-            --datadir=%{_datadir}          \\\
Igor Gnatenko da6a24
-            --mandir=%{_mandir}            \\\
Igor Gnatenko da6a24
-            --localedir=%{_datadir}/locale \\\
Igor Gnatenko da6a24
-            --sysconfdir=%{_sysconfdir}    \\\
Igor Gnatenko b44b0b
-            $OLDPWD/%{__sourcedir}             \
Igor Gnatenko b44b0b
-    popd
Igor Gnatenko b44b0b
+    %{__meson}                            \\\
Igor Gnatenko b44b0b
+        --buildtype=plain                 \\\
Igor Gnatenko b44b0b
+        --prefix=%{_prefix}               \\\
Igor Gnatenko b44b0b
+        --libdir=%{_libdir}               \\\
Igor Gnatenko b44b0b
+        --libexecdir=%{_libexecdir}       \\\
Igor Gnatenko b44b0b
+        --bindir=%{_bindir}               \\\
Igor Gnatenko b44b0b
+        --includedir=%{_includedir}       \\\
Igor Gnatenko b44b0b
+        --datadir=%{_datadir}             \\\
Igor Gnatenko b44b0b
+        --mandir=%{_mandir}               \\\
Igor Gnatenko b44b0b
+        --localedir=%{_datadir}/locale    \\\
Igor Gnatenko b44b0b
+        --sysconfdir=%{_sysconfdir}       \\\
Igor Gnatenko b44b0b
+        %{__sourcedir} %{__builddir}      \\\
Igor Gnatenko b44b0b
+        %{nil}
Igor Gnatenko b44b0b
 
Igor Gnatenko b44b0b
 %meson_build \
Igor Gnatenko b44b0b
     %ninja_build -C %{__builddir}
Igor Gnatenko b44b0b
-- 
Igor Gnatenko b44b0b
2.11.0
Igor Gnatenko b44b0b