Backport more RPM macro fixes (FPC ticket #655)

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Gnatenko 2016-12-15 21:34:40 +01:00
parent da6a24af48
commit d6502d0e67
4 changed files with 78 additions and 5 deletions

View File

@ -1,7 +1,7 @@
From dd2843cf8752d26575b15cd1ba73c43bd3501494 Mon Sep 17 00:00:00 2001
From 99948536aefc6ed661cf50caca026f10ee3d4679 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
Subject: [PATCH 1/3] 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:

View File

@ -1,7 +1,7 @@
From d98711cde68faf2ab61584b3c81a3ab66c3833d8 Mon Sep 17 00:00:00 2001
From 469fbaba002796975baf8d60f583c55d690e381a Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Tue, 13 Dec 2016 12:29:28 +0100
Subject: [PATCH 2/2] rpm: use __global_*flags
Subject: [PATCH 2/3] rpm: use __global_*flags
Using RPM's %{optflags} is definitely nice, but not enough. LDFLAGS
are not there, and idea of optflags is too generic. It is supposed

View File

@ -0,0 +1,69 @@
From be232228b77e9d91810efb62765f8bdf69584caa Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Tue, 13 Dec 2016 19:20:03 +0100
Subject: [PATCH 3/3] rpm: use VPATH macro
This is more or less standardized way to have one variable which
will work for all buildsystems defined in redhat-rpm-config.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
(cherry picked from commit b80f8b2dc2d1ca838c814ae1b8842860a39de175)
---
data/macros.meson | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/data/macros.meson b/data/macros.meson
index e8b15cdd..14d39da4 100644
--- a/data/macros.meson
+++ b/data/macros.meson
@@ -1,6 +1,4 @@
%__meson %{_bindir}/meson
-%__sourcedir .
-%__builddir %{_target_platform}
%meson \
export CFLAGS="${CFLAGS:-%__global_cflags}" \
@@ -8,25 +6,25 @@
export FFLAGS="${FFLAGS:-%__global_fflags}" \
export FCFLAGS="${FCFLAGS:-%__global_fcflags}" \
export LDFLAGS="${LDFLAGS:-%__global_ldflags}" \
- %{__meson} \\\
- --buildtype=plain \\\
- --prefix=%{_prefix} \\\
- --libdir=%{_libdir} \\\
- --libexecdir=%{_libexecdir} \\\
- --bindir=%{_bindir} \\\
- --includedir=%{_includedir} \\\
- --datadir=%{_datadir} \\\
- --mandir=%{_mandir} \\\
- --localedir=%{_datadir}/locale \\\
- --sysconfdir=%{_sysconfdir} \\\
- %{__sourcedir} %{__builddir} \\\
+ %{__meson} \\\
+ --buildtype=plain \\\
+ --prefix=%{_prefix} \\\
+ --libdir=%{_libdir} \\\
+ --libexecdir=%{_libexecdir} \\\
+ --bindir=%{_bindir} \\\
+ --includedir=%{_includedir} \\\
+ --datadir=%{_datadir} \\\
+ --mandir=%{_mandir} \\\
+ --localedir=%{_datadir}/locale \\\
+ --sysconfdir=%{_sysconfdir} \\\
+ %{_vpath_srcdir} %{_vpath_builddir} \\\
%{nil}
%meson_build \
- %ninja_build -C %{__builddir}
+ %ninja_build -C %{_vpath_builddir}
%meson_install \
- %ninja_install -C %{__builddir}
+ %ninja_install -C %{_vpath_builddir}
%meson_test \
- %ninja_test -C %{__builddir}
+ %ninja_test -C %{_vpath_builddir}
--
2.11.0

View File

@ -2,7 +2,7 @@
Name: meson
Version: 0.36.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: High productivity build system
License: ASL 2.0
@ -10,6 +10,7 @@ URL: http://mesonbuild.com/
Source0: https://github.com/mesonbuild/meson/archive/%{version}/%{name}-%{version}.tar.gz
Patch0001: 0001-rpm-use-meson-s-syntax-to-specify-sourcedir-and-buil.patch
Patch0002: 0002-rpm-use-__global_-flags.patch
Patch0003: 0003-rpm-use-VPATH-macro.patch
BuildArch: noarch
Obsoletes: %{name}-gui < 0.31.0-3
@ -92,6 +93,9 @@ export MESON_PRINT_TEST_OUTPUT=1
%{rpmmacrodir}/macros.%{name}
%changelog
* Thu Dec 15 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.36.0-4
- Backport more RPM macro fixes (FPC ticket #655)
* Tue Dec 13 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.36.0-3
- Backport fixes to RPM macros