Backport to EPEL7

This commit is contained in:
Benjamin A. Beasley 2023-01-23 09:01:39 -05:00
parent 12a043d8eb
commit cc0098b324
2 changed files with 27 additions and 50 deletions

View File

@ -1,38 +0,0 @@
From 66e78f979c8826bb193c00a4ba744e3ce8774a8e Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Thu, 19 Jan 2023 09:24:27 -0500
Subject: [PATCH] =?UTF-8?q?Remove=20std::move=E2=80=99s=20reported=20as=20?=
=?UTF-8?q?redundant=20by=20GCC=2013?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/gn/desc_builder.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gn/desc_builder.cc b/src/gn/desc_builder.cc
index 444a5e02..3ef170c3 100644
--- a/src/gn/desc_builder.cc
+++ b/src/gn/desc_builder.cc
@@ -167,7 +167,7 @@ class BaseDescBuilder {
base::ListValue res;
for (const auto& v : vector)
res.GetList().emplace_back(ToBaseValue(v));
- return std::move(res);
+ return res;
}
base::Value ToBaseValue(const Scope* scope) {
@@ -176,7 +176,7 @@ class BaseDescBuilder {
scope->GetCurrentScopeValues(&map);
for (const auto& v : map)
res.SetKey(v.first, ToBaseValue(v.second));
- return std::move(res);
+ return res;
}
base::Value ToBaseValue(const Value& val) {
--
2.39.0

39
gn.spec
View File

@ -4,6 +4,11 @@
# Its nice to be able to turn it on, though.
%bcond_with werror
# We require C++17 support, so we cannot use the base GCC in EL7. This gives us
# several possible devtoolset revisions to choose from; we choose a relatively
# recent one.
%global dts devtoolset-11
Name: gn
# Upstream uses the number of commits in the git history as the version number.
# See gn --version, which outputs something like “1874 (2b683eff)”. The commit
@ -31,8 +36,8 @@ Name: gn
%global access 20220714
%global shortcommit %(echo '%{commit}' | cut -b -12)
%global position 2077
Version: %{position}^%{access}git%{shortcommit}
Release: %autorelease
Version: %{position}
Release: %autorelease -s %{access}git%{shortcommit}
Summary: Meta-build system that generates build files for Ninja
# The entire source is BSD-3-Clause, except:
@ -53,20 +58,19 @@ Source2: update-version
# Stop overriding optimization flags; not sent upstream because this is
# intentional on their part
Patch: gn-0153d369-no-O3.patch
# Error: redundant move in return statement (GCC 13)
# https://bugs.chromium.org/p/gn/issues/detail?id=318
Patch: gn-5e19d2fb166f-redundant-move.patch
Patch1: gn-0153d369-no-O3.patch
# Missing #include <stdint.h> for uint8_t (GCC 13)
# https://bugs.chromium.org/p/gn/issues/detail?id=319
Patch: gn-5e19d2fb166f-stdint.patch
Patch2: gn-5e19d2fb166f-stdint.patch
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}
BuildRequires: python3-devel
BuildRequires: ninja-build
BuildRequires: gcc-c++
BuildRequires: %{dts}-gcc-c++
BuildRequires: /usr/bin/pathfix.py
# For RPM macros:
BuildRequires: emacs-common
@ -122,11 +126,18 @@ cp -vp '%{SOURCE1}' ./out
cp -vp misc/vim/README.md README-vim.md
# Fix shebangs in examples and such.
%py3_shebang_fix .
# -p preserves timestamps
# -n prevents creating ~backup files
# -i specifies the interpreter for the shebang
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" .
%build
. /opt/rh/%{dts}/enable
AR='gcc-ar'; export AR
# We need to set CC and CXX explicitly before Fedora 33, including on the EPELs.
CC='gcc'; export CC
CXX='g++'; export CXX
%set_build_flags
# Both --use-icf and --use-lto add compiler flags that only work with clang++,
# not with g++. We do get LTO on Fedora anyway, since we respect the
@ -158,7 +169,8 @@ help2man \
%install
install -t '%{buildroot}%{_bindir}' -D -p out/gn
install -d '%{buildroot}%{_bindir}'
install -t '%{buildroot}%{_bindir}' -p out/gn
install -d '%{buildroot}%{_datadir}/vim/vimfiles'
cp -vrp misc/vim/* '%{buildroot}%{_datadir}/vim/vimfiles'
@ -166,9 +178,11 @@ find '%{buildroot}%{_datadir}/vim/vimfiles' \
-type f -name 'README.*' -print -delete
%py_byte_compile %{python3} '%{buildroot}%{_datadir}/vim/vimfiles/gn-format.py'
install -t '%{buildroot}%{_emacs_sitestartdir}' -D -p -m 0644 misc/emacs/*.el
install -d '%{buildroot}%{_emacs_sitestartdir}'
install -t '%{buildroot}%{_emacs_sitestartdir}' -p -m 0644 misc/emacs/*.el
install -t '%{buildroot}%{_mandir}/man1' -D -m 0644 -p out/gn.1
install -d '%{buildroot}%{_mandir}/man1'
install -t '%{buildroot}%{_mandir}/man1' -m 0644 -p out/gn.1
%check
@ -190,6 +204,7 @@ grep -E '^#define[[:blank:]]+LAST_COMMIT_POSITION[[:blank:]]+'\
%{_mandir}/man1/gn.1*
%{_datadir}/vim/vimfiles/gn-format.py
%{_datadir}/vim/vimfiles/gn-format.py?
%{_datadir}/vim/vimfiles/autoload/gn.vim
%{_datadir}/vim/vimfiles/ftdetect/gnfiletype.vim
%{_datadir}/vim/vimfiles/ftplugin/gn.vim