Fix FTBFS in Rawhide

epel8
Scott Talbert 9 years ago
parent ade3f6cc92
commit 0c7f9b37af

@ -0,0 +1,39 @@
From 73e9e18ea09ffffcaac50237def0d9728a213c02 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Sat, 20 Feb 2016 00:08:14 -0500
Subject: [PATCH] Fix STC compilation with GCC6
Use std::abs() from <cmath> instead of abs() from <math.h> to avoid problems
with ambiguous overloads.
Closes #17147.
Closes https://github.com/wxWidgets/wxWidgets/pull/222
---
src/stc/scintilla/src/Editor.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/stc/scintilla/src/Editor.cxx b/src/stc/scintilla/src/Editor.cxx
index cd72953..2081df2 100644
--- a/src/stc/scintilla/src/Editor.cxx
+++ b/src/stc/scintilla/src/Editor.cxx
@@ -11,6 +11,7 @@
#include <ctype.h>
#include <assert.h>
+#include <cmath>
#include <string>
#include <vector>
#include <map>
@@ -5841,9 +5842,9 @@ void Editor::GoToLine(int lineNo) {
}
static bool Close(Point pt1, Point pt2) {
- if (abs(pt1.x - pt2.x) > 3)
+ if (std::abs(pt1.x - pt2.x) > 3)
return false;
- if (abs(pt1.y - pt2.y) > 3)
+ if (std::abs(pt1.y - pt2.y) > 3)
return false;
return true;
}

@ -0,0 +1,60 @@
From 01f62c02957cc1443ea761ddffe0b4322d987a1d Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 21 Jun 2015 15:56:06 +0200
Subject: [PATCH] Avoid warnings about narrowing casts in the long long tests.
Recent g++ versions give -Wnarrowing warning when a value outside of the type
range is used to initialize a variable of this type in { }. Avoid it in the
long long tests using explicit casts as we already cast between long long and
unsigned long long values here anyhow.
---
tests/strings/strings.cpp | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/tests/strings/strings.cpp b/tests/strings/strings.cpp
index b016294..78a3a9d 100644
--- a/tests/strings/strings.cpp
+++ b/tests/strings/strings.cpp
@@ -589,14 +589,16 @@ enum
Number_Long = 16 // only for long tests
};
+#ifdef wxLongLong_t
+typedef wxLongLong_t TestValue_t;
+#else
+typedef long TestValue_t;
+#endif
+
static const struct ToLongData
{
const wxChar *str;
-#ifdef wxLongLong_t
- wxLongLong_t value;
-#else
- long value;
-#endif // wxLongLong_t
+ TestValue_t value;
int flags;
int base;
@@ -618,7 +620,7 @@ static const struct ToLongData
{ wxT("-1"), -1, Number_Signed | Number_Long },
// this is surprising but consistent with strtoul() behaviour
- { wxT("-1"), ULONG_MAX, Number_Unsigned | Number_Long },
+ { wxT("-1"), (TestValue_t)ULONG_MAX, Number_Unsigned | Number_Long },
// this must overflow, even with 64 bit long
{ wxT("922337203685477580711"), 0, Number_Invalid },
@@ -626,8 +628,9 @@ static const struct ToLongData
#ifdef wxLongLong_t
{ wxT("2147483648"), wxLL(2147483648), Number_LongLong },
{ wxT("-2147483648"), wxLL(-2147483648), Number_LongLong | Number_Signed },
- { wxT("9223372036854775808"), wxULL(9223372036854775808), Number_LongLong |
- Number_Unsigned },
+ { wxT("9223372036854775808"),
+ TestValue_t(wxULL(9223372036854775808)),
+ Number_LongLong | Number_Unsigned },
#endif // wxLongLong_t
// Base tests.

@ -11,7 +11,7 @@
Name: %{wxgtkname} Name: %{wxgtkname}
Version: 3.0.2 Version: 3.0.2
Release: 14%{?dist} Release: 15%{?dist}
Summary: GTK port of the wxWidgets GUI library Summary: GTK port of the wxWidgets GUI library
License: wxWidgets License: wxWidgets
Group: System Environment/Libraries Group: System Environment/Libraries
@ -39,6 +39,14 @@ Patch3: %{name}-%{version}-checkradio.patch
# For more details, see the upstream bug: # For more details, see the upstream bug:
# http://trac.wxwidgets.org/ticket/16688 # http://trac.wxwidgets.org/ticket/16688
Patch4: %{name}-%{version}-wayland.patch Patch4: %{name}-%{version}-wayland.patch
# This fixes wxSTC compilation with GCC6
# For more details, see the upstream commit:
# https://github.com/wxWidgets/wxWidgets/commit/73e9e18ea09ffffcaac50237def0d9728a213c02
Patch5: %{name}-%{version}-stc-gcc6.patch
# This fixes compilation of the strings tests with GCC6
# For more details, see the upstream commit:
# https://github.com/wxWidgets/wxWidgets/commit/01f62c02957cc1443ea761ddffe0b4322d987a1d
Patch6: %{name}-%{version}-strings-tests-gcc6.patch
BuildRequires: gtk%{gtkver}-devel BuildRequires: gtk%{gtkver}-devel
#Note webkitgtk (GTK2) does not appear to be supported #Note webkitgtk (GTK2) does not appear to be supported
%if %{gtkver} == 3 %if %{gtkver} == 3
@ -144,6 +152,8 @@ This package provides documentation for the %{srcname} library.
%patch2 -p1 -b .spinbutt %patch2 -p1 -b .spinbutt
%patch3 -p1 -b .checkradio %patch3 -p1 -b .checkradio
%patch4 -p1 -b .wayland %patch4 -p1 -b .wayland
%patch5 -p1 -b .stc-gcc6
%patch6 -p1 -b .strings-tests-gcc6
# patch some installed files to avoid conflicts with 2.8.* # patch some installed files to avoid conflicts with 2.8.*
sed -i -e 's|aclocal)|aclocal/wxwin3.m4)|' Makefile.in sed -i -e 's|aclocal)|aclocal/wxwin3.m4)|' Makefile.in
@ -158,6 +168,9 @@ mv %{srcname}-%{version} html
sed -i -e 's|/usr/lib\b|%{_libdir}|' wx-config.in configure sed -i -e 's|/usr/lib\b|%{_libdir}|' wx-config.in configure
sed -i -e 's|/lib|/%{_lib}|' src/unix/stdpaths.cpp sed -i -e 's|/lib|/%{_lib}|' src/unix/stdpaths.cpp
# Trick configure into using pkg-config for cppunit-config
sed -i -e 's|$CPPUNIT_CONFIG --version|$CPPUNIT_CONFIG --modversion|' configure
%build %build
# likely still dereferences type-punned pointers # likely still dereferences type-punned pointers
@ -165,6 +178,8 @@ CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# fix unused-direct-shlib-dependency error: # fix unused-direct-shlib-dependency error:
export LDFLAGS="-Wl,--as-needed" export LDFLAGS="-Wl,--as-needed"
# Trick configure into using pkg-config for cppunit-config
export CPPUNIT_CONFIG="/usr/bin/pkg-config cppunit"
%configure \ %configure \
--with-gtk=%{gtkver} \ --with-gtk=%{gtkver} \
@ -269,6 +284,11 @@ popd
%doc html %doc html
%changelog %changelog
* Tue Feb 23 2016 Scott Talbert <swt@techie.net> - 3.0.2-15
- Add GCC6 patches for STC and strings tests
- Adapt cppunit to use pkg-config (cppunit-config has been removed in F24)
- Fixes FTBFS in F24 Rawhide, RH#1308244
* Mon Feb 22 2016 Jeremy Newton <alexjnewt AT hotmail DOT com> - 3.0.2-14 * Mon Feb 22 2016 Jeremy Newton <alexjnewt AT hotmail DOT com> - 3.0.2-14
- Should actually fix RH#1294712 - Should actually fix RH#1294712

Loading…
Cancel
Save