1 |
commit: fb0c0722916bbedf871d2340638f04f550d4c9b3 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 16 18:43:23 2017 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 16 18:43:52 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb0c0722 |
7 |
|
8 |
sci-visualization/spyview: Fix build with gcc 5 and 6 |
9 |
|
10 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
11 |
|
12 |
.../spyview/files/spyview-20150124-gcc6cxx14.patch | 221 +++++++++++++++++++++ |
13 |
.../spyview/spyview-20150124-r1.ebuild | 59 ++++++ |
14 |
2 files changed, 280 insertions(+) |
15 |
|
16 |
diff --git a/sci-visualization/spyview/files/spyview-20150124-gcc6cxx14.patch b/sci-visualization/spyview/files/spyview-20150124-gcc6cxx14.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..cc5198853bc |
19 |
--- /dev/null |
20 |
+++ b/sci-visualization/spyview/files/spyview-20150124-gcc6cxx14.patch |
21 |
@@ -0,0 +1,221 @@ |
22 |
+diff --git a/spyview/Fl_Listbox.H b/spyview/Fl_Listbox.H |
23 |
+index 35803fc..832792b 100644 |
24 |
+--- a/spyview/Fl_Listbox.H |
25 |
++++ b/spyview/Fl_Listbox.H |
26 |
+@@ -5,7 +5,8 @@ |
27 |
+ #include <string> |
28 |
+ #include <vector> |
29 |
+ |
30 |
+-using namespace std; |
31 |
++using std::string; |
32 |
++using std::vector; |
33 |
+ |
34 |
+ class Fl_Listbox : public Fl_Table |
35 |
+ { |
36 |
+diff --git a/spyview/ImageData.C b/spyview/ImageData.C |
37 |
+index 7ee936a..a9b2c17 100644 |
38 |
+--- a/spyview/ImageData.C |
39 |
++++ b/spyview/ImageData.C |
40 |
+@@ -2007,7 +2007,7 @@ void ImageData::grad_mag(double axis_bias) |
41 |
+ xderv(); |
42 |
+ width = w; |
43 |
+ height = h; |
44 |
+- swap(tmpx,raw_data); |
45 |
++ std::swap(tmpx,raw_data); |
46 |
+ yderv(); |
47 |
+ width = w; |
48 |
+ height = h; |
49 |
+@@ -2083,7 +2083,7 @@ void ImageData::dderv(double theta) // theta in degrees! |
50 |
+ xderv(); |
51 |
+ width = w; |
52 |
+ height = h; |
53 |
+- swap(tmpx,raw_data); |
54 |
++ std::swap(tmpx,raw_data); |
55 |
+ yderv(); |
56 |
+ width = w; |
57 |
+ height = h; |
58 |
+diff --git a/spyview/ImageData.H b/spyview/ImageData.H |
59 |
+index b68cb73..4cdecb1 100644 |
60 |
+--- a/spyview/ImageData.H |
61 |
++++ b/spyview/ImageData.H |
62 |
+@@ -22,7 +22,8 @@ |
63 |
+ |
64 |
+ #define CHECK_ARRAY_LIMITS 0 |
65 |
+ |
66 |
+-using namespace std; |
67 |
++using std::string; |
68 |
++using std::vector; |
69 |
+ |
70 |
+ typedef enum { YZ = 0, XY = 2, XZ = 1 } mtxcut_t; |
71 |
+ typedef enum { COLUMNS = 0, INDEX = 1} gpload_t; |
72 |
+diff --git a/spyview/ImagePrinter.H b/spyview/ImagePrinter.H |
73 |
+index d85b440..f34ee67 100644 |
74 |
+--- a/spyview/ImagePrinter.H |
75 |
++++ b/spyview/ImagePrinter.H |
76 |
+@@ -11,7 +11,7 @@ |
77 |
+ |
78 |
+ #include "ImagePrinter_Control.h" |
79 |
+ |
80 |
+-using namespace std; |
81 |
++using std::string; |
82 |
+ |
83 |
+ class ImageWindow; |
84 |
+ class Image_Printer_Control; |
85 |
+diff --git a/spyview/ImageWindow.C b/spyview/ImageWindow.C |
86 |
+index b8bd0f9..134b198 100644 |
87 |
+--- a/spyview/ImageWindow.C |
88 |
++++ b/spyview/ImageWindow.C |
89 |
+@@ -12,6 +12,8 @@ |
90 |
+ #include "ImageWindow_Module.H" |
91 |
+ #include <ctype.h> |
92 |
+ |
93 |
++#include "mypam.h" |
94 |
++ |
95 |
+ #ifdef WIN32 |
96 |
+ |
97 |
+ #include <windows.h> |
98 |
+@@ -36,8 +38,6 @@ |
99 |
+ #define alt(state) (!(state & FL_CTRL) && !(state & FL_SHIFT) && (state & FL_ALT)) |
100 |
+ #define none(state) (!(state & FL_CTRL) && !(state & FL_SHIFT) && !(state & FL_ALT)) |
101 |
+ |
102 |
+-using namespace std; |
103 |
+- |
104 |
+ FILE *fopenwarn(const char *name, const char *mode) |
105 |
+ { |
106 |
+ FILE *fp = fopen(name, mode); |
107 |
+@@ -482,7 +482,7 @@ double current_time() |
108 |
+ stop.tv_usec = (long)(tmpres % 1000000UL); |
109 |
+ #endif |
110 |
+ double time = (((double)(stop.tv_sec)) + ((double)(stop.tv_usec) * 1e-6)); |
111 |
+- if (!isnormal(time)) |
112 |
++ if (!std::isnormal(time)) |
113 |
+ info("time %e sec %d usec %d\n", time, stop.tv_sec, stop.tv_usec); |
114 |
+ return time; |
115 |
+ } |
116 |
+@@ -1609,7 +1609,7 @@ void ImageWindow::runQueue() |
117 |
+ for (int n=0; n<op->num_parameters; n++) |
118 |
+ { |
119 |
+ operations_string += "-"; |
120 |
+- ostringstream os; |
121 |
++ std::ostringstream os; |
122 |
+ os << op->parameters[n].value; |
123 |
+ operations_string += os.str(); |
124 |
+ } |
125 |
+diff --git a/spyview/ImageWindow.H b/spyview/ImageWindow.H |
126 |
+index 30e94ba..5d1a1e1 100644 |
127 |
+--- a/spyview/ImageWindow.H |
128 |
++++ b/spyview/ImageWindow.H |
129 |
+@@ -32,7 +32,7 @@ |
130 |
+ #define VERTLINE 4 |
131 |
+ #define OTHERLINE 8 |
132 |
+ |
133 |
+-#include "mypam.h" |
134 |
++using std::string; |
135 |
+ |
136 |
+ typedef enum { XAXIS, YAXIS, DISTANCE } lc_axis_t; |
137 |
+ typedef enum { KEEPZOOM, KEEPSIZE, RESETZOOM } window_size_action_t; |
138 |
+diff --git a/spyview/ImageWindow3d.C b/spyview/ImageWindow3d.C |
139 |
+index 40b93e6..24fa8f4 100644 |
140 |
+--- a/spyview/ImageWindow3d.C |
141 |
++++ b/spyview/ImageWindow3d.C |
142 |
+@@ -5,6 +5,8 @@ |
143 |
+ #define LINEMESH 2 |
144 |
+ #define POLYGONS 3 |
145 |
+ |
146 |
++#include "mypam.h" |
147 |
++ |
148 |
+ ImageWindow3d::ImageWindow3d(int x,int y,int w,int h,const char *l) : Fl_Gl_Window(x,y,w,h,l) |
149 |
+ { |
150 |
+ data_matrix = NULL; |
151 |
+diff --git a/spyview/ImageWindow3d.H b/spyview/ImageWindow3d.H |
152 |
+index 683015b..e6f296f 100644 |
153 |
+--- a/spyview/ImageWindow3d.H |
154 |
++++ b/spyview/ImageWindow3d.H |
155 |
+@@ -25,9 +25,7 @@ |
156 |
+ #define POINTSOURCE 1 |
157 |
+ #define DIRECTIONAL 2 |
158 |
+ |
159 |
+-#include "mypam.h" |
160 |
+ |
161 |
+-using namespace std; |
162 |
+ |
163 |
+ #define LMAX USHRT_MAX |
164 |
+ |
165 |
+diff --git a/spyview/bisector.H b/spyview/bisector.H |
166 |
+index b22fb8f..039c5ff 100644 |
167 |
+--- a/spyview/bisector.H |
168 |
++++ b/spyview/bisector.H |
169 |
+@@ -2,7 +2,7 @@ |
170 |
+ #define __bisector_h__ |
171 |
+ #include <assert.h> |
172 |
+ #include <math.h> |
173 |
+-using namespace std; |
174 |
++ |
175 |
+ |
176 |
+ class bisector |
177 |
+ { |
178 |
+diff --git a/spyview/misc.h b/spyview/misc.h |
179 |
+index 9ed7dfc..8ed8ba8 100644 |
180 |
+--- a/spyview/misc.h |
181 |
++++ b/spyview/misc.h |
182 |
+@@ -3,7 +3,7 @@ |
183 |
+ |
184 |
+ #include <string> |
185 |
+ |
186 |
+-using namespace std; |
187 |
++using std::string; |
188 |
+ |
189 |
+ //Some useful functions |
190 |
+ |
191 |
+diff --git a/spyview/spypal_gradient.C b/spyview/spypal_gradient.C |
192 |
+index e522b42..4997fbd 100644 |
193 |
+--- a/spyview/spypal_gradient.C |
194 |
++++ b/spyview/spypal_gradient.C |
195 |
+@@ -22,7 +22,7 @@ void Spypal_Slider_Dragger::start_dragging(Fl_Spypal_GSlider *todrag, bool can_d |
196 |
+ assert(dragging == NULL); |
197 |
+ can_delete = can_delete_p; |
198 |
+ dragging = todrag; |
199 |
+- colored = false; |
200 |
++ colored = NULL; |
201 |
+ shown = find(g->sliders.begin(),g->sliders.end(), dragging) != g->sliders.end(); |
202 |
+ if(!shown && (Fl::event_inside(g) || !can_delete)) |
203 |
+ show_dragged(); |
204 |
+diff --git a/spyview/spyview.C b/spyview/spyview.C |
205 |
+index cd99eeb..5e5c1f6 100644 |
206 |
+--- a/spyview/spyview.C |
207 |
++++ b/spyview/spyview.C |
208 |
+@@ -27,8 +27,6 @@ |
209 |
+ #include "spypal_import.H" |
210 |
+ #include <libgen.h> |
211 |
+ |
212 |
+-using namespace std; |
213 |
+- |
214 |
+ //How's this for lazy...? |
215 |
+ char **arg_values; |
216 |
+ int arg_count; |
217 |
+diff --git a/spyview/spyview.H b/spyview/spyview.H |
218 |
+index 3536354..0411e87 100644 |
219 |
+--- a/spyview/spyview.H |
220 |
++++ b/spyview/spyview.H |
221 |
+@@ -10,6 +10,8 @@ |
222 |
+ #include <vector> |
223 |
+ #include "spyview_ui.h" |
224 |
+ |
225 |
++using std::string; |
226 |
++ |
227 |
+ /*void minl_cb(Fl_Widget *, void *); |
228 |
+ void maxl_cb(Fl_Widget *, void *); |
229 |
+ void dminl_cb(Fl_Widget *, void *); |
230 |
+diff --git a/spyview/spyview3d.C b/spyview/spyview3d.C |
231 |
+index b9398d5..068d4a1 100644 |
232 |
+--- a/spyview/spyview3d.C |
233 |
++++ b/spyview/spyview3d.C |
234 |
+@@ -18,8 +18,6 @@ |
235 |
+ |
236 |
+ #include "mypam.h" |
237 |
+ |
238 |
+-using namespace std; |
239 |
+- |
240 |
+ int *data; |
241 |
+ int *databuf; |
242 |
+ int w,h; |
243 |
|
244 |
diff --git a/sci-visualization/spyview/spyview-20150124-r1.ebuild b/sci-visualization/spyview/spyview-20150124-r1.ebuild |
245 |
new file mode 100644 |
246 |
index 00000000000..918ef565f6c |
247 |
--- /dev/null |
248 |
+++ b/sci-visualization/spyview/spyview-20150124-r1.ebuild |
249 |
@@ -0,0 +1,59 @@ |
250 |
+# Copyright 1999-2017 Gentoo Foundation |
251 |
+# Distributed under the terms of the GNU General Public License v2 |
252 |
+ |
253 |
+EAPI=6 |
254 |
+ |
255 |
+inherit autotools flag-o-matic |
256 |
+ |
257 |
+DESCRIPTION="2D and 3D data visualization and analysis program" |
258 |
+HOMEPAGE="http://nsweb.tn.tudelft.nl/~gsteele/spyview/" |
259 |
+SRC_URI="https://github.com/gsteele13/spyview/archive/966012afae2fbb77262bd96a7e530e81b0ed3b90.tar.gz -> $P.tgz" |
260 |
+ |
261 |
+LICENSE="GPL-3" |
262 |
+SLOT="0" |
263 |
+KEYWORDS="~amd64 ~x86" |
264 |
+IUSE="" |
265 |
+ |
266 |
+COMMON_DEPEND=" |
267 |
+ >=dev-libs/boost-1.62.0:= |
268 |
+ media-libs/netpbm |
269 |
+ x11-libs/fltk:1[opengl] |
270 |
+ app-text/ghostscript-gpl |
271 |
+ virtual/glu |
272 |
+" |
273 |
+ |
274 |
+DEPEND="${COMMON_DEPEND} |
275 |
+ sys-apps/groff" |
276 |
+ |
277 |
+RDEPEND="${COMMON_DEPEND} |
278 |
+ sci-visualization/gnuplot" |
279 |
+ |
280 |
+PATCHES=( |
281 |
+ "${FILESDIR}/${P}"-gnuplot_interface_fix.patch |
282 |
+ "${FILESDIR}/${P}"-gcc6cxx14.patch |
283 |
+) |
284 |
+ |
285 |
+src_unpack() { |
286 |
+ default |
287 |
+ mv -v "${WORKDIR}"/spyview-*/source "${S}" || die |
288 |
+} |
289 |
+ |
290 |
+src_prepare() { |
291 |
+ append-cflags $(fltk-config --cflags) |
292 |
+ append-cxxflags $(fltk-config --cxxflags) |
293 |
+ |
294 |
+ append-cxxflags -std=c++14 |
295 |
+ |
296 |
+ append-cppflags -I"${EPREFIX}"/usr/include/netpbm |
297 |
+ |
298 |
+ # append-ldflags $(fltk-config --ldflags) |
299 |
+ # this one leads to an insane amount of warnings |
300 |
+ append-ldflags -L$(dirname $(fltk-config --libs)) |
301 |
+ |
302 |
+ while IFS="" read -d $'\0' -r file; do |
303 |
+ sed -i -e 's:-mwindows -mconsole::g' "$file" || die |
304 |
+ done < <(find "${S}" -name Makefile.am -print0) |
305 |
+ |
306 |
+ default |
307 |
+ eautoreconf |
308 |
+} |