From 9c4b72f3e5d908c4914f2a2d82563f6023ce33db Mon Sep 17 00:00:00 2001
From: Link Dupont
Date: Sun, 1 Jan 2017 22:30:56 -0800
Subject: [PATCH] Fix CCFLAGS override within SConstruct
---
...-sky-0.9.4-remove-additional-ccflags.patch | 19 +++++++++++++++++++
endless-sky.spec | 15 ++++++++++-----
2 files changed, 29 insertions(+), 5 deletions(-)
create mode 100644 endless-sky-0.9.4-remove-additional-ccflags.patch
diff --git a/endless-sky-0.9.4-remove-additional-ccflags.patch b/endless-sky-0.9.4-remove-additional-ccflags.patch
new file mode 100644
index 0000000..3a194b5
--- /dev/null
+++ b/endless-sky-0.9.4-remove-additional-ccflags.patch
@@ -0,0 +1,19 @@
+diff -up ./SConstruct.orig ./SConstruct
+--- ./SConstruct.orig 2017-01-01 22:16:40.914893288 -0800
++++ ./SConstruct 2017-01-01 22:22:26.934720111 -0800
+@@ -22,14 +22,7 @@ opts.Update(env)
+
+ Help(opts.GenerateHelpText(env))
+
+-flags = ["-std=gnu++11", "-Wall"]
+-if env["mode"] != "debug":
+- flags += ["-O3"]
+-if env["mode"] == "debug":
+- flags += ["-g"]
+-if env["mode"] == "profile":
+- flags += ["-pg"]
+- env.Append(LINKFLAGS = ["-pg"])
++flags = ["-std=gnu++11"]
+
+ # Required build flags. If you want to use SSE optimization, you can turn on
+ # -msse3 or (if just building for your own computer) -march=native.
diff --git a/endless-sky.spec b/endless-sky.spec
index f55655c..afaba21 100644
--- a/endless-sky.spec
+++ b/endless-sky.spec
@@ -2,7 +2,7 @@
Name: endless-sky
Version: 0.9.4
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Space exploration, trading, and combat game
License: GPLv3
@@ -16,6 +16,8 @@ Patch0: endless-sky-0.8.10-remove-games-path.patch
# Use gnu++11 standard instead of c++11. Fixes a FTBFS issue on ppc64le.
# https://github.com/endless-sky/endless-sky/pull/1804
Patch1: endless-sky-0.9.4-std-gnu++11.patch
+# Unset CCFLAGS override inside SConstruct.
+Patch2: endless-sky-0.9.4-remove-additional-ccflags.patch
Requires: %{name}-data = %{version}-%{release}
BuildRequires: scons
@@ -53,8 +55,8 @@ Images, sound, and game data for %{name}.
%build
-CCFLAGS="${CCFLAGS:-%__global_cflags}" \
-LDFLAGS="${LDFLAGS:-%__global_ldflags}" \
+CCFLAGS="%{optflags}" \
+LDFLAGS="%{?__global_ldflags}" \
%{_bindir}/scons \
%{?_smp_mflags} \
PREFIX=%{_prefix} \
@@ -66,8 +68,8 @@ desktop-file-validate %{name}.desktop
%install
-CCFLAGS="${CCFLAGS:-%__global_cflags}" \
-LDFLAGS="${LDFLAGS:-%__global_ldflags}" \
+CCFLAGS="%{optflags}" \
+LDFLAGS="%{?__global_ldflags}" \
%{_bindir}/scons \
%{?_smp_mflags} \
PREFIX=%{_prefix} \
@@ -110,6 +112,9 @@ fi
%changelog
+* Sun Jan 1 2017 Link Dupont - 0.9.4-4
+- Remove CCFLAGS override inside SConstruct
+
* Sat Dec 31 2016 Link Dupont - 0.9.4-3
- Build and install with identical CXXFLAGS (RH#1402807)