Blob Blame History Raw
From dcd3c217121fbb09be8acecd2d866219e85ad9bd Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Tue, 13 Dec 2016 11:59:52 +0100
Subject: [PATCH 1/2] rpm: use meson's syntax to specify sourcedir and builddir

When user uses %meson -Denable_cool_feature=true current macro fails
because RPM adds flag after popd:
...
pushd x86_64-redhat-linux-gnu
  /usr/bin/meson ... $OLDPWD/.
popd -Denable_cool_feature

Since meson can accept $srcdir and $builddir arugments we don't have
this problem with pushd/popd. It also simplifies things a bit.

Reported-by: Richard Hughes <richard@hughsie.com>
References: https://bugzilla.redhat.com/show_bug.cgi?id=1401062
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
 data/macros.meson | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/data/macros.meson b/data/macros.meson
index 97d8a23f..5250c348 100644
--- a/data/macros.meson
+++ b/data/macros.meson
@@ -8,22 +8,20 @@
     export FFLAGS="%{optflags} -I%{_fmoddir}"  \
     export FCFLAGS="%{optflags} -I%{_fmoddir}" \
     export LDFLAGS="%{?__global_ldflags}"      \
-    mkdir -p %{__builddir}                     \
-    pushd %{__builddir}                        \
-        %{__meson}                            \\\
-            --buildtype=plain                 \\\
-            --prefix=%{_prefix}               \\\
-            --libdir=%{_libdir}               \\\
-            --libexecdir=%{_libexecdir}       \\\
-            --bindir=%{_bindir}               \\\
-            --includedir=%{_includedir}       \\\
-            --datadir=%{_datadir}             \\\
-            --mandir=%{_mandir}               \\\
-            --localedir=%{_datadir}/locale    \\\
-            --sysconfdir=%{_sysconfdir}       \\\
-            --localstatedir=%{_localstatedir} \\\
-            $OLDPWD/%{__sourcedir}             \
-    popd
+    %{__meson}                            \\\
+        --buildtype=plain                 \\\
+        --prefix=%{_prefix}               \\\
+        --libdir=%{_libdir}               \\\
+        --libexecdir=%{_libexecdir}       \\\
+        --bindir=%{_bindir}               \\\
+        --includedir=%{_includedir}       \\\
+        --datadir=%{_datadir}             \\\
+        --mandir=%{_mandir}               \\\
+        --localedir=%{_datadir}/locale    \\\
+        --sysconfdir=%{_sysconfdir}       \\\
+        --localstatedir=%{_localstatedir} \\\
+        %{__sourcedir} %{__builddir}      \\\
+        %{nil}
 
 %meson_build \
     %ninja_build -C %{__builddir}
-- 
2.11.0