Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-visualization/spyview/files/, sci-visualization/spyview/
Date: Mon, 11 Dec 2017 19:46:54
Message-Id: 1513021591.776786adddb5a10fb7ae368fdfe32b09e2fbe8b7.mgorny@gentoo
1 commit: 776786adddb5a10fb7ae368fdfe32b09e2fbe8b7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 11 19:44:52 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 11 19:46:31 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=776786ad
7
8 sci-visualization/spyview: [QA] Move patches to a distfile
9
10 Closes: https://bugs.gentoo.org/620630
11
12 sci-visualization/spyview/Manifest | 1 +
13 .../files/spyview-20150124-gcc6cxx14-9.patch | 1249 --------------------
14 .../spyview-20150124-gnuplot_interface_fix.patch | 10 -
15 .../spyview/spyview-20150124-r1.ebuild | 7 +-
16 4 files changed, 5 insertions(+), 1262 deletions(-)
17
18 diff --git a/sci-visualization/spyview/Manifest b/sci-visualization/spyview/Manifest
19 index 1ef9bbc835b..4c8bca76ba0 100644
20 --- a/sci-visualization/spyview/Manifest
21 +++ b/sci-visualization/spyview/Manifest
22 @@ -1 +1,2 @@
23 +DIST spyview-20150124-patchset.tar.bz2 8268 BLAKE2B db7a710e2d61ad4f68e9dd31834f855b122b57fa532eb047a5efd7dd02423974f47652e4770144d02a317bf5a50c0ff852fd752ab331bad0c9efe237905916e0 SHA512 615465056df3786e18d5916dea0ad8ebd31c37ddf6531b85c080f53e0d9776c4f7519bd160ca8a0f29343b2f9fad40abef8d6b7194c4e54d6e2e14557562cc49
24 DIST spyview-20150124.tgz 14772947 BLAKE2B 18d3298e0498c4be91065c8651d379428541f3156ec7f2f0a6970ce5caafaa81da2ff6fbfcca42d77cfffedd293484aad19c7240ab9500e0cf7764cdb5e6ee4c SHA512 63c58c7729ceab9e1bfbb14b5d257a1d4ca51e43f7b014caffc8adf66767c17b47794b34cfc2f754c2905ff926302d66d438a582fe359a6c8d3e04b072993f5b
25
26 diff --git a/sci-visualization/spyview/files/spyview-20150124-gcc6cxx14-9.patch b/sci-visualization/spyview/files/spyview-20150124-gcc6cxx14-9.patch
27 deleted file mode 100644
28 index 0c19851d445..00000000000
29 --- a/sci-visualization/spyview/files/spyview-20150124-gcc6cxx14-9.patch
30 +++ /dev/null
31 @@ -1,1249 +0,0 @@
32 -diff --git a/configure.ac b/configure.ac
33 -index 5e1cfff..f1d777f 100644
34 ---- a/configure.ac
35 -+++ b/configure.ac
36 -@@ -6,6 +6,9 @@ AC_CONFIG_SRCDIR([spyview/ImageWindow.C])
37 - AC_CONFIG_HEADER([config.h])
38 - USER_DIRS
39 -
40 -+# For local macros
41 -+AC_CONFIG_MACRO_DIR([m4])
42 -+
43 - #
44 - # Work out our target
45 - #
46 -@@ -27,6 +30,10 @@ AM_CONDITIONAL(WINDOWS,test $windows_target = yes)
47 - AC_PROG_CXX
48 - AC_PROG_CC
49 - AM_PROG_CC_C_O
50 -+
51 -+# Check for C++11 language standard
52 -+AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
53 -+
54 - # Check for fluid
55 - AC_PATH_PROG(FLUID,fluid,none)
56 - AC_ARG_VAR(FLUID,[path to executable to compile .fl files])
57 -diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
58 -new file mode 100644
59 -index 0000000..5032bba
60 ---- /dev/null
61 -+++ b/m4/ax_cxx_compile_stdcxx.m4
62 -@@ -0,0 +1,982 @@
63 -+# ===========================================================================
64 -+# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
65 -+# ===========================================================================
66 -+#
67 -+# SYNOPSIS
68 -+#
69 -+# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
70 -+#
71 -+# DESCRIPTION
72 -+#
73 -+# Check for baseline language coverage in the compiler for the specified
74 -+# version of the C++ standard. If necessary, add switches to CXX and
75 -+# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
76 -+# or '14' (for the C++14 standard).
77 -+#
78 -+# The second argument, if specified, indicates whether you insist on an
79 -+# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
80 -+# -std=c++11). If neither is specified, you get whatever works, with
81 -+# preference for an extended mode.
82 -+#
83 -+# The third argument, if specified 'mandatory' or if left unspecified,
84 -+# indicates that baseline support for the specified C++ standard is
85 -+# required and that the macro should error out if no mode with that
86 -+# support is found. If specified 'optional', then configuration proceeds
87 -+# regardless, after defining HAVE_CXX${VERSION} if and only if a
88 -+# supporting mode is found.
89 -+#
90 -+# LICENSE
91 -+#
92 -+# Copyright (c) 2008 Benjamin Kosnik <bkoz@××××××.com>
93 -+# Copyright (c) 2012 Zack Weinberg <zackw@×××××.com>
94 -+# Copyright (c) 2013 Roy Stogner <roystgnr@×××××××××××.edu>
95 -+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@××××××.com>
96 -+# Copyright (c) 2015 Paul Norman <penorman@×××.com>
97 -+# Copyright (c) 2015 Moritz Klammler <moritz@××××××××.eu>
98 -+# Copyright (c) 2016 Krzesimir Nowak <qdlacz@×××××.com>
99 -+#
100 -+# Copying and distribution of this file, with or without modification, are
101 -+# permitted in any medium without royalty provided the copyright notice
102 -+# and this notice are preserved. This file is offered as-is, without any
103 -+# warranty.
104 -+
105 -+#serial 7
106 -+
107 -+dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
108 -+dnl (serial version number 13).
109 -+
110 -+AX_REQUIRE_DEFINED([AC_MSG_WARN])
111 -+AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
112 -+ m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
113 -+ [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
114 -+ [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
115 -+ [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
116 -+ m4_if([$2], [], [],
117 -+ [$2], [ext], [],
118 -+ [$2], [noext], [],
119 -+ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
120 -+ m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
121 -+ [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
122 -+ [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
123 -+ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
124 -+ AC_LANG_PUSH([C++])dnl
125 -+ ac_success=no
126 -+ AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
127 -+ ax_cv_cxx_compile_cxx$1,
128 -+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
129 -+ [ax_cv_cxx_compile_cxx$1=yes],
130 -+ [ax_cv_cxx_compile_cxx$1=no])])
131 -+ if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
132 -+ ac_success=yes
133 -+ fi
134 -+
135 -+ m4_if([$2], [noext], [], [dnl
136 -+ if test x$ac_success = xno; then
137 -+ for alternative in ${ax_cxx_compile_alternatives}; do
138 -+ switch="-std=gnu++${alternative}"
139 -+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
140 -+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
141 -+ $cachevar,
142 -+ [ac_save_CXX="$CXX"
143 -+ CXX="$CXX $switch"
144 -+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
145 -+ [eval $cachevar=yes],
146 -+ [eval $cachevar=no])
147 -+ CXX="$ac_save_CXX"])
148 -+ if eval test x\$$cachevar = xyes; then
149 -+ CXX="$CXX $switch"
150 -+ if test -n "$CXXCPP" ; then
151 -+ CXXCPP="$CXXCPP $switch"
152 -+ fi
153 -+ ac_success=yes
154 -+ break
155 -+ fi
156 -+ done
157 -+ fi])
158 -+
159 -+ m4_if([$2], [ext], [], [dnl
160 -+ if test x$ac_success = xno; then
161 -+ dnl HP's aCC needs +std=c++11 according to:
162 -+ dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
163 -+ dnl Cray's crayCC needs "-h std=c++11"
164 -+ for alternative in ${ax_cxx_compile_alternatives}; do
165 -+ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
166 -+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
167 -+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
168 -+ $cachevar,
169 -+ [ac_save_CXX="$CXX"
170 -+ CXX="$CXX $switch"
171 -+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
172 -+ [eval $cachevar=yes],
173 -+ [eval $cachevar=no])
174 -+ CXX="$ac_save_CXX"])
175 -+ if eval test x\$$cachevar = xyes; then
176 -+ CXX="$CXX $switch"
177 -+ if test -n "$CXXCPP" ; then
178 -+ CXXCPP="$CXXCPP $switch"
179 -+ fi
180 -+ ac_success=yes
181 -+ break
182 -+ fi
183 -+ done
184 -+ if test x$ac_success = xyes; then
185 -+ break
186 -+ fi
187 -+ done
188 -+ fi])
189 -+ AC_LANG_POP([C++])
190 -+ if test x$ax_cxx_compile_cxx$1_required = xtrue; then
191 -+ if test x$ac_success = xno; then
192 -+ AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
193 -+ fi
194 -+ fi
195 -+ if test x$ac_success = xno; then
196 -+ HAVE_CXX$1=0
197 -+ AC_MSG_NOTICE([No compiler with C++$1 support was found])
198 -+ else
199 -+ HAVE_CXX$1=1
200 -+ AC_DEFINE(HAVE_CXX$1,1,
201 -+ [define if the compiler supports basic C++$1 syntax])
202 -+ fi
203 -+ AC_SUBST(HAVE_CXX$1)
204 -+ m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])])
205 -+])
206 -+
207 -+
208 -+dnl Test body for checking C++11 support
209 -+
210 -+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
211 -+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
212 -+)
213 -+
214 -+
215 -+dnl Test body for checking C++14 support
216 -+
217 -+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
218 -+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
219 -+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
220 -+)
221 -+
222 -+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
223 -+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
224 -+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
225 -+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
226 -+)
227 -+
228 -+dnl Tests for new features in C++11
229 -+
230 -+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
231 -+
232 -+// If the compiler admits that it is not ready for C++11, why torture it?
233 -+// Hopefully, this will speed up the test.
234 -+
235 -+#ifndef __cplusplus
236 -+
237 -+#error "This is not a C++ compiler"
238 -+
239 -+#elif __cplusplus < 201103L
240 -+
241 -+#error "This is not a C++11 compiler"
242 -+
243 -+#else
244 -+
245 -+namespace cxx11
246 -+{
247 -+
248 -+ namespace test_static_assert
249 -+ {
250 -+
251 -+ template <typename T>
252 -+ struct check
253 -+ {
254 -+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
255 -+ };
256 -+
257 -+ }
258 -+
259 -+ namespace test_final_override
260 -+ {
261 -+
262 -+ struct Base
263 -+ {
264 -+ virtual void f() {}
265 -+ };
266 -+
267 -+ struct Derived : public Base
268 -+ {
269 -+ virtual void f() override {}
270 -+ };
271 -+
272 -+ }
273 -+
274 -+ namespace test_double_right_angle_brackets
275 -+ {
276 -+
277 -+ template < typename T >
278 -+ struct check {};
279 -+
280 -+ typedef check<void> single_type;
281 -+ typedef check<check<void>> double_type;
282 -+ typedef check<check<check<void>>> triple_type;
283 -+ typedef check<check<check<check<void>>>> quadruple_type;
284 -+
285 -+ }
286 -+
287 -+ namespace test_decltype
288 -+ {
289 -+
290 -+ int
291 -+ f()
292 -+ {
293 -+ int a = 1;
294 -+ decltype(a) b = 2;
295 -+ return a + b;
296 -+ }
297 -+
298 -+ }
299 -+
300 -+ namespace test_type_deduction
301 -+ {
302 -+
303 -+ template < typename T1, typename T2 >
304 -+ struct is_same
305 -+ {
306 -+ static const bool value = false;
307 -+ };
308 -+
309 -+ template < typename T >
310 -+ struct is_same<T, T>
311 -+ {
312 -+ static const bool value = true;
313 -+ };
314 -+
315 -+ template < typename T1, typename T2 >
316 -+ auto
317 -+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
318 -+ {
319 -+ return a1 + a2;
320 -+ }
321 -+
322 -+ int
323 -+ test(const int c, volatile int v)
324 -+ {
325 -+ static_assert(is_same<int, decltype(0)>::value == true, "");
326 -+ static_assert(is_same<int, decltype(c)>::value == false, "");
327 -+ static_assert(is_same<int, decltype(v)>::value == false, "");
328 -+ auto ac = c;
329 -+ auto av = v;
330 -+ auto sumi = ac + av + 'x';
331 -+ auto sumf = ac + av + 1.0;
332 -+ static_assert(is_same<int, decltype(ac)>::value == true, "");
333 -+ static_assert(is_same<int, decltype(av)>::value == true, "");
334 -+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
335 -+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
336 -+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
337 -+ return (sumf > 0.0) ? sumi : add(c, v);
338 -+ }
339 -+
340 -+ }
341 -+
342 -+ namespace test_noexcept
343 -+ {
344 -+
345 -+ int f() { return 0; }
346 -+ int g() noexcept { return 0; }
347 -+
348 -+ static_assert(noexcept(f()) == false, "");
349 -+ static_assert(noexcept(g()) == true, "");
350 -+
351 -+ }
352 -+
353 -+ namespace test_constexpr
354 -+ {
355 -+
356 -+ template < typename CharT >
357 -+ unsigned long constexpr
358 -+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
359 -+ {
360 -+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
361 -+ }
362 -+
363 -+ template < typename CharT >
364 -+ unsigned long constexpr
365 -+ strlen_c(const CharT *const s) noexcept
366 -+ {
367 -+ return strlen_c_r(s, 0UL);
368 -+ }
369 -+
370 -+ static_assert(strlen_c("") == 0UL, "");
371 -+ static_assert(strlen_c("1") == 1UL, "");
372 -+ static_assert(strlen_c("example") == 7UL, "");
373 -+ static_assert(strlen_c("another\0example") == 7UL, "");
374 -+
375 -+ }
376 -+
377 -+ namespace test_rvalue_references
378 -+ {
379 -+
380 -+ template < int N >
381 -+ struct answer
382 -+ {
383 -+ static constexpr int value = N;
384 -+ };
385 -+
386 -+ answer<1> f(int&) { return answer<1>(); }
387 -+ answer<2> f(const int&) { return answer<2>(); }
388 -+ answer<3> f(int&&) { return answer<3>(); }
389 -+
390 -+ void
391 -+ test()
392 -+ {
393 -+ int i = 0;
394 -+ const int c = 0;
395 -+ static_assert(decltype(f(i))::value == 1, "");
396 -+ static_assert(decltype(f(c))::value == 2, "");
397 -+ static_assert(decltype(f(0))::value == 3, "");
398 -+ }
399 -+
400 -+ }
401 -+
402 -+ namespace test_uniform_initialization
403 -+ {
404 -+
405 -+ struct test
406 -+ {
407 -+ static const int zero {};
408 -+ static const int one {1};
409 -+ };
410 -+
411 -+ static_assert(test::zero == 0, "");
412 -+ static_assert(test::one == 1, "");
413 -+
414 -+ }
415 -+
416 -+ namespace test_lambdas
417 -+ {
418 -+
419 -+ void
420 -+ test1()
421 -+ {
422 -+ auto lambda1 = [](){};
423 -+ auto lambda2 = lambda1;
424 -+ lambda1();
425 -+ lambda2();
426 -+ }
427 -+
428 -+ int
429 -+ test2()
430 -+ {
431 -+ auto a = [](int i, int j){ return i + j; }(1, 2);
432 -+ auto b = []() -> int { return '0'; }();
433 -+ auto c = [=](){ return a + b; }();
434 -+ auto d = [&](){ return c; }();
435 -+ auto e = [a, &b](int x) mutable {
436 -+ const auto identity = [](int y){ return y; };
437 -+ for (auto i = 0; i < a; ++i)
438 -+ a += b--;
439 -+ return x + identity(a + b);
440 -+ }(0);
441 -+ return a + b + c + d + e;
442 -+ }
443 -+
444 -+ int
445 -+ test3()
446 -+ {
447 -+ const auto nullary = [](){ return 0; };
448 -+ const auto unary = [](int x){ return x; };
449 -+ using nullary_t = decltype(nullary);
450 -+ using unary_t = decltype(unary);
451 -+ const auto higher1st = [](nullary_t f){ return f(); };
452 -+ const auto higher2nd = [unary](nullary_t f1){
453 -+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
454 -+ };
455 -+ return higher1st(nullary) + higher2nd(nullary)(unary);
456 -+ }
457 -+
458 -+ }
459 -+
460 -+ namespace test_variadic_templates
461 -+ {
462 -+
463 -+ template <int...>
464 -+ struct sum;
465 -+
466 -+ template <int N0, int... N1toN>
467 -+ struct sum<N0, N1toN...>
468 -+ {
469 -+ static constexpr auto value = N0 + sum<N1toN...>::value;
470 -+ };
471 -+
472 -+ template <>
473 -+ struct sum<>
474 -+ {
475 -+ static constexpr auto value = 0;
476 -+ };
477 -+
478 -+ static_assert(sum<>::value == 0, "");
479 -+ static_assert(sum<1>::value == 1, "");
480 -+ static_assert(sum<23>::value == 23, "");
481 -+ static_assert(sum<1, 2>::value == 3, "");
482 -+ static_assert(sum<5, 5, 11>::value == 21, "");
483 -+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
484 -+
485 -+ }
486 -+
487 -+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
488 -+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
489 -+ // because of this.
490 -+ namespace test_template_alias_sfinae
491 -+ {
492 -+
493 -+ struct foo {};
494 -+
495 -+ template<typename T>
496 -+ using member = typename T::member_type;
497 -+
498 -+ template<typename T>
499 -+ void func(...) {}
500 -+
501 -+ template<typename T>
502 -+ void func(member<T>*) {}
503 -+
504 -+ void test();
505 -+
506 -+ void test() { func<foo>(0); }
507 -+
508 -+ }
509 -+
510 -+} // namespace cxx11
511 -+
512 -+#endif // __cplusplus >= 201103L
513 -+
514 -+]])
515 -+
516 -+
517 -+dnl Tests for new features in C++14
518 -+
519 -+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
520 -+
521 -+// If the compiler admits that it is not ready for C++14, why torture it?
522 -+// Hopefully, this will speed up the test.
523 -+
524 -+#ifndef __cplusplus
525 -+
526 -+#error "This is not a C++ compiler"
527 -+
528 -+#elif __cplusplus < 201402L
529 -+
530 -+#error "This is not a C++14 compiler"
531 -+
532 -+#else
533 -+
534 -+namespace cxx14
535 -+{
536 -+
537 -+ namespace test_polymorphic_lambdas
538 -+ {
539 -+
540 -+ int
541 -+ test()
542 -+ {
543 -+ const auto lambda = [](auto&&... args){
544 -+ const auto istiny = [](auto x){
545 -+ return (sizeof(x) == 1UL) ? 1 : 0;
546 -+ };
547 -+ const int aretiny[] = { istiny(args)... };
548 -+ return aretiny[0];
549 -+ };
550 -+ return lambda(1, 1L, 1.0f, '1');
551 -+ }
552 -+
553 -+ }
554 -+
555 -+ namespace test_binary_literals
556 -+ {
557 -+
558 -+ constexpr auto ivii = 0b0000000000101010;
559 -+ static_assert(ivii == 42, "wrong value");
560 -+
561 -+ }
562 -+
563 -+ namespace test_generalized_constexpr
564 -+ {
565 -+
566 -+ template < typename CharT >
567 -+ constexpr unsigned long
568 -+ strlen_c(const CharT *const s) noexcept
569 -+ {
570 -+ auto length = 0UL;
571 -+ for (auto p = s; *p; ++p)
572 -+ ++length;
573 -+ return length;
574 -+ }
575 -+
576 -+ static_assert(strlen_c("") == 0UL, "");
577 -+ static_assert(strlen_c("x") == 1UL, "");
578 -+ static_assert(strlen_c("test") == 4UL, "");
579 -+ static_assert(strlen_c("another\0test") == 7UL, "");
580 -+
581 -+ }
582 -+
583 -+ namespace test_lambda_init_capture
584 -+ {
585 -+
586 -+ int
587 -+ test()
588 -+ {
589 -+ auto x = 0;
590 -+ const auto lambda1 = [a = x](int b){ return a + b; };
591 -+ const auto lambda2 = [a = lambda1(x)](){ return a; };
592 -+ return lambda2();
593 -+ }
594 -+
595 -+ }
596 -+
597 -+ namespace test_digit_separators
598 -+ {
599 -+
600 -+ constexpr auto ten_million = 100'000'000;
601 -+ static_assert(ten_million == 100000000, "");
602 -+
603 -+ }
604 -+
605 -+ namespace test_return_type_deduction
606 -+ {
607 -+
608 -+ auto f(int& x) { return x; }
609 -+ decltype(auto) g(int& x) { return x; }
610 -+
611 -+ template < typename T1, typename T2 >
612 -+ struct is_same
613 -+ {
614 -+ static constexpr auto value = false;
615 -+ };
616 -+
617 -+ template < typename T >
618 -+ struct is_same<T, T>
619 -+ {
620 -+ static constexpr auto value = true;
621 -+ };
622 -+
623 -+ int
624 -+ test()
625 -+ {
626 -+ auto x = 0;
627 -+ static_assert(is_same<int, decltype(f(x))>::value, "");
628 -+ static_assert(is_same<int&, decltype(g(x))>::value, "");
629 -+ return x;
630 -+ }
631 -+
632 -+ }
633 -+
634 -+} // namespace cxx14
635 -+
636 -+#endif // __cplusplus >= 201402L
637 -+
638 -+]])
639 -+
640 -+
641 -+dnl Tests for new features in C++17
642 -+
643 -+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
644 -+
645 -+// If the compiler admits that it is not ready for C++17, why torture it?
646 -+// Hopefully, this will speed up the test.
647 -+
648 -+#ifndef __cplusplus
649 -+
650 -+#error "This is not a C++ compiler"
651 -+
652 -+#elif __cplusplus <= 201402L
653 -+
654 -+#error "This is not a C++17 compiler"
655 -+
656 -+#else
657 -+
658 -+#if defined(__clang__)
659 -+ #define REALLY_CLANG
660 -+#else
661 -+ #if defined(__GNUC__)
662 -+ #define REALLY_GCC
663 -+ #endif
664 -+#endif
665 -+
666 -+#include <initializer_list>
667 -+#include <utility>
668 -+#include <type_traits>
669 -+
670 -+namespace cxx17
671 -+{
672 -+
673 -+#if !defined(REALLY_CLANG)
674 -+ namespace test_constexpr_lambdas
675 -+ {
676 -+
677 -+ // TODO: test it with clang++ from git
678 -+
679 -+ constexpr int foo = [](){return 42;}();
680 -+
681 -+ }
682 -+#endif // !defined(REALLY_CLANG)
683 -+
684 -+ namespace test::nested_namespace::definitions
685 -+ {
686 -+
687 -+ }
688 -+
689 -+ namespace test_fold_expression
690 -+ {
691 -+
692 -+ template<typename... Args>
693 -+ int multiply(Args... args)
694 -+ {
695 -+ return (args * ... * 1);
696 -+ }
697 -+
698 -+ template<typename... Args>
699 -+ bool all(Args... args)
700 -+ {
701 -+ return (args && ...);
702 -+ }
703 -+
704 -+ }
705 -+
706 -+ namespace test_extended_static_assert
707 -+ {
708 -+
709 -+ static_assert (true);
710 -+
711 -+ }
712 -+
713 -+ namespace test_auto_brace_init_list
714 -+ {
715 -+
716 -+ auto foo = {5};
717 -+ auto bar {5};
718 -+
719 -+ static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
720 -+ static_assert(std::is_same<int, decltype(bar)>::value);
721 -+ }
722 -+
723 -+ namespace test_typename_in_template_template_parameter
724 -+ {
725 -+
726 -+ template<template<typename> typename X> struct D;
727 -+
728 -+ }
729 -+
730 -+ namespace test_fallthrough_nodiscard_maybe_unused_attributes
731 -+ {
732 -+
733 -+ int f1()
734 -+ {
735 -+ return 42;
736 -+ }
737 -+
738 -+ [[nodiscard]] int f2()
739 -+ {
740 -+ [[maybe_unused]] auto unused = f1();
741 -+
742 -+ switch (f1())
743 -+ {
744 -+ case 17:
745 -+ f1();
746 -+ [[fallthrough]];
747 -+ case 42:
748 -+ f1();
749 -+ }
750 -+ return f1();
751 -+ }
752 -+
753 -+ }
754 -+
755 -+ namespace test_extended_aggregate_initialization
756 -+ {
757 -+
758 -+ struct base1
759 -+ {
760 -+ int b1, b2 = 42;
761 -+ };
762 -+
763 -+ struct base2
764 -+ {
765 -+ base2() {
766 -+ b3 = 42;
767 -+ }
768 -+ int b3;
769 -+ };
770 -+
771 -+ struct derived : base1, base2
772 -+ {
773 -+ int d;
774 -+ };
775 -+
776 -+ derived d1 {{1, 2}, {}, 4}; // full initialization
777 -+ derived d2 {{}, {}, 4}; // value-initialized bases
778 -+
779 -+ }
780 -+
781 -+ namespace test_general_range_based_for_loop
782 -+ {
783 -+
784 -+ struct iter
785 -+ {
786 -+ int i;
787 -+
788 -+ int& operator* ()
789 -+ {
790 -+ return i;
791 -+ }
792 -+
793 -+ const int& operator* () const
794 -+ {
795 -+ return i;
796 -+ }
797 -+
798 -+ iter& operator++()
799 -+ {
800 -+ ++i;
801 -+ return *this;
802 -+ }
803 -+ };
804 -+
805 -+ struct sentinel
806 -+ {
807 -+ int i;
808 -+ };
809 -+
810 -+ bool operator== (const iter& i, const sentinel& s)
811 -+ {
812 -+ return i.i == s.i;
813 -+ }
814 -+
815 -+ bool operator!= (const iter& i, const sentinel& s)
816 -+ {
817 -+ return !(i == s);
818 -+ }
819 -+
820 -+ struct range
821 -+ {
822 -+ iter begin() const
823 -+ {
824 -+ return {0};
825 -+ }
826 -+
827 -+ sentinel end() const
828 -+ {
829 -+ return {5};
830 -+ }
831 -+ };
832 -+
833 -+ void f()
834 -+ {
835 -+ range r {};
836 -+
837 -+ for (auto i : r)
838 -+ {
839 -+ [[maybe_unused]] auto v = i;
840 -+ }
841 -+ }
842 -+
843 -+ }
844 -+
845 -+ namespace test_lambda_capture_asterisk_this_by_value
846 -+ {
847 -+
848 -+ struct t
849 -+ {
850 -+ int i;
851 -+ int foo()
852 -+ {
853 -+ return [*this]()
854 -+ {
855 -+ return i;
856 -+ }();
857 -+ }
858 -+ };
859 -+
860 -+ }
861 -+
862 -+ namespace test_enum_class_construction
863 -+ {
864 -+
865 -+ enum class byte : unsigned char
866 -+ {};
867 -+
868 -+ byte foo {42};
869 -+
870 -+ }
871 -+
872 -+ namespace test_constexpr_if
873 -+ {
874 -+
875 -+ template <bool cond>
876 -+ int f ()
877 -+ {
878 -+ if constexpr(cond)
879 -+ {
880 -+ return 13;
881 -+ }
882 -+ else
883 -+ {
884 -+ return 42;
885 -+ }
886 -+ }
887 -+
888 -+ }
889 -+
890 -+ namespace test_selection_statement_with_initializer
891 -+ {
892 -+
893 -+ int f()
894 -+ {
895 -+ return 13;
896 -+ }
897 -+
898 -+ int f2()
899 -+ {
900 -+ if (auto i = f(); i > 0)
901 -+ {
902 -+ return 3;
903 -+ }
904 -+
905 -+ switch (auto i = f(); i + 4)
906 -+ {
907 -+ case 17:
908 -+ return 2;
909 -+
910 -+ default:
911 -+ return 1;
912 -+ }
913 -+ }
914 -+
915 -+ }
916 -+
917 -+#if !defined(REALLY_CLANG)
918 -+ namespace test_template_argument_deduction_for_class_templates
919 -+ {
920 -+
921 -+ // TODO: test it with clang++ from git
922 -+
923 -+ template <typename T1, typename T2>
924 -+ struct pair
925 -+ {
926 -+ pair (T1 p1, T2 p2)
927 -+ : m1 {p1},
928 -+ m2 {p2}
929 -+ {}
930 -+
931 -+ T1 m1;
932 -+ T2 m2;
933 -+ };
934 -+
935 -+ void f()
936 -+ {
937 -+ [[maybe_unused]] auto p = pair{13, 42u};
938 -+ }
939 -+
940 -+ }
941 -+#endif // !defined(REALLY_CLANG)
942 -+
943 -+ namespace test_non_type_auto_template_parameters
944 -+ {
945 -+
946 -+ template <auto n>
947 -+ struct B
948 -+ {};
949 -+
950 -+ B<5> b1;
951 -+ B<'a'> b2;
952 -+
953 -+ }
954 -+
955 -+#if !defined(REALLY_CLANG)
956 -+ namespace test_structured_bindings
957 -+ {
958 -+
959 -+ // TODO: test it with clang++ from git
960 -+
961 -+ int arr[2] = { 1, 2 };
962 -+ std::pair<int, int> pr = { 1, 2 };
963 -+
964 -+ auto f1() -> int(&)[2]
965 -+ {
966 -+ return arr;
967 -+ }
968 -+
969 -+ auto f2() -> std::pair<int, int>&
970 -+ {
971 -+ return pr;
972 -+ }
973 -+
974 -+ struct S
975 -+ {
976 -+ int x1 : 2;
977 -+ volatile double y1;
978 -+ };
979 -+
980 -+ S f3()
981 -+ {
982 -+ return {};
983 -+ }
984 -+
985 -+ auto [ x1, y1 ] = f1();
986 -+ auto& [ xr1, yr1 ] = f1();
987 -+ auto [ x2, y2 ] = f2();
988 -+ auto& [ xr2, yr2 ] = f2();
989 -+ const auto [ x3, y3 ] = f3();
990 -+
991 -+ }
992 -+#endif // !defined(REALLY_CLANG)
993 -+
994 -+#if !defined(REALLY_CLANG)
995 -+ namespace test_exception_spec_type_system
996 -+ {
997 -+
998 -+ // TODO: test it with clang++ from git
999 -+
1000 -+ struct Good {};
1001 -+ struct Bad {};
1002 -+
1003 -+ void g1() noexcept;
1004 -+ void g2();
1005 -+
1006 -+ template<typename T>
1007 -+ Bad
1008 -+ f(T*, T*);
1009 -+
1010 -+ template<typename T1, typename T2>
1011 -+ Good
1012 -+ f(T1*, T2*);
1013 -+
1014 -+ static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
1015 -+
1016 -+ }
1017 -+#endif // !defined(REALLY_CLANG)
1018 -+
1019 -+ namespace test_inline_variables
1020 -+ {
1021 -+
1022 -+ template<class T> void f(T)
1023 -+ {}
1024 -+
1025 -+ template<class T> inline T g(T)
1026 -+ {
1027 -+ return T{};
1028 -+ }
1029 -+
1030 -+ template<> inline void f<>(int)
1031 -+ {}
1032 -+
1033 -+ template<> int g<>(int)
1034 -+ {
1035 -+ return 5;
1036 -+ }
1037 -+
1038 -+ }
1039 -+
1040 -+} // namespace cxx17
1041 -+
1042 -+#endif // __cplusplus <= 201402L
1043 -+
1044 -+]])
1045 -diff --git a/spyview/Fl_Listbox.H b/spyview/Fl_Listbox.H
1046 -index 35803fc..832792b 100644
1047 ---- a/spyview/Fl_Listbox.H
1048 -+++ b/spyview/Fl_Listbox.H
1049 -@@ -5,7 +5,8 @@
1050 - #include <string>
1051 - #include <vector>
1052 -
1053 --using namespace std;
1054 -+using std::string;
1055 -+using std::vector;
1056 -
1057 - class Fl_Listbox : public Fl_Table
1058 - {
1059 -diff --git a/spyview/ImageData.C b/spyview/ImageData.C
1060 -index 7ee936a..eaac7a6 100644
1061 ---- a/spyview/ImageData.C
1062 -+++ b/spyview/ImageData.C
1063 -@@ -9,6 +9,9 @@
1064 - #include "mypam.h"
1065 - #include "../config.h"
1066 -
1067 -+#include <cmath>
1068 -+using std::isnan;
1069 -+
1070 - #include <algorithm>
1071 - // From http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/gcc/variadic-macros.html
1072 -
1073 -@@ -2007,7 +2010,7 @@ void ImageData::grad_mag(double axis_bias)
1074 - xderv();
1075 - width = w;
1076 - height = h;
1077 -- swap(tmpx,raw_data);
1078 -+ std::swap(tmpx,raw_data);
1079 - yderv();
1080 - width = w;
1081 - height = h;
1082 -@@ -2083,7 +2086,7 @@ void ImageData::dderv(double theta) // theta in degrees!
1083 - xderv();
1084 - width = w;
1085 - height = h;
1086 -- swap(tmpx,raw_data);
1087 -+ std::swap(tmpx,raw_data);
1088 - yderv();
1089 - width = w;
1090 - height = h;
1091 -diff --git a/spyview/ImageData.H b/spyview/ImageData.H
1092 -index b68cb73..4cdecb1 100644
1093 ---- a/spyview/ImageData.H
1094 -+++ b/spyview/ImageData.H
1095 -@@ -22,7 +22,8 @@
1096 -
1097 - #define CHECK_ARRAY_LIMITS 0
1098 -
1099 --using namespace std;
1100 -+using std::string;
1101 -+using std::vector;
1102 -
1103 - typedef enum { YZ = 0, XY = 2, XZ = 1 } mtxcut_t;
1104 - typedef enum { COLUMNS = 0, INDEX = 1} gpload_t;
1105 -diff --git a/spyview/ImagePrinter.H b/spyview/ImagePrinter.H
1106 -index d85b440..f34ee67 100644
1107 ---- a/spyview/ImagePrinter.H
1108 -+++ b/spyview/ImagePrinter.H
1109 -@@ -11,7 +11,7 @@
1110 -
1111 - #include "ImagePrinter_Control.h"
1112 -
1113 --using namespace std;
1114 -+using std::string;
1115 -
1116 - class ImageWindow;
1117 - class Image_Printer_Control;
1118 -diff --git a/spyview/ImageWindow.C b/spyview/ImageWindow.C
1119 -index b8bd0f9..eeae649 100644
1120 ---- a/spyview/ImageWindow.C
1121 -+++ b/spyview/ImageWindow.C
1122 -@@ -12,6 +12,11 @@
1123 - #include "ImageWindow_Module.H"
1124 - #include <ctype.h>
1125 -
1126 -+#include <cmath>
1127 -+using std::isnan;
1128 -+
1129 -+#include "mypam.h"
1130 -+
1131 - #ifdef WIN32
1132 -
1133 - #include <windows.h>
1134 -@@ -36,8 +41,6 @@
1135 - #define alt(state) (!(state & FL_CTRL) && !(state & FL_SHIFT) && (state & FL_ALT))
1136 - #define none(state) (!(state & FL_CTRL) && !(state & FL_SHIFT) && !(state & FL_ALT))
1137 -
1138 --using namespace std;
1139 --
1140 - FILE *fopenwarn(const char *name, const char *mode)
1141 - {
1142 - FILE *fp = fopen(name, mode);
1143 -@@ -482,7 +485,7 @@ double current_time()
1144 - stop.tv_usec = (long)(tmpres % 1000000UL);
1145 - #endif
1146 - double time = (((double)(stop.tv_sec)) + ((double)(stop.tv_usec) * 1e-6));
1147 -- if (!isnormal(time))
1148 -+ if (!std::isnormal(time))
1149 - info("time %e sec %d usec %d\n", time, stop.tv_sec, stop.tv_usec);
1150 - return time;
1151 - }
1152 -@@ -1609,7 +1612,7 @@ void ImageWindow::runQueue()
1153 - for (int n=0; n<op->num_parameters; n++)
1154 - {
1155 - operations_string += "-";
1156 -- ostringstream os;
1157 -+ std::ostringstream os;
1158 - os << op->parameters[n].value;
1159 - operations_string += os.str();
1160 - }
1161 -diff --git a/spyview/ImageWindow.H b/spyview/ImageWindow.H
1162 -index 30e94ba..5d1a1e1 100644
1163 ---- a/spyview/ImageWindow.H
1164 -+++ b/spyview/ImageWindow.H
1165 -@@ -32,7 +32,7 @@
1166 - #define VERTLINE 4
1167 - #define OTHERLINE 8
1168 -
1169 --#include "mypam.h"
1170 -+using std::string;
1171 -
1172 - typedef enum { XAXIS, YAXIS, DISTANCE } lc_axis_t;
1173 - typedef enum { KEEPZOOM, KEEPSIZE, RESETZOOM } window_size_action_t;
1174 -diff --git a/spyview/ImageWindow3d.C b/spyview/ImageWindow3d.C
1175 -index 40b93e6..24fa8f4 100644
1176 ---- a/spyview/ImageWindow3d.C
1177 -+++ b/spyview/ImageWindow3d.C
1178 -@@ -5,6 +5,8 @@
1179 - #define LINEMESH 2
1180 - #define POLYGONS 3
1181 -
1182 -+#include "mypam.h"
1183 -+
1184 - ImageWindow3d::ImageWindow3d(int x,int y,int w,int h,const char *l) : Fl_Gl_Window(x,y,w,h,l)
1185 - {
1186 - data_matrix = NULL;
1187 -diff --git a/spyview/ImageWindow3d.H b/spyview/ImageWindow3d.H
1188 -index 683015b..e6f296f 100644
1189 ---- a/spyview/ImageWindow3d.H
1190 -+++ b/spyview/ImageWindow3d.H
1191 -@@ -25,9 +25,7 @@
1192 - #define POINTSOURCE 1
1193 - #define DIRECTIONAL 2
1194 -
1195 --#include "mypam.h"
1196 -
1197 --using namespace std;
1198 -
1199 - #define LMAX USHRT_MAX
1200 -
1201 -diff --git a/spyview/bisector.H b/spyview/bisector.H
1202 -index b22fb8f..c7e64a6 100644
1203 ---- a/spyview/bisector.H
1204 -+++ b/spyview/bisector.H
1205 -@@ -2,7 +2,9 @@
1206 - #define __bisector_h__
1207 - #include <assert.h>
1208 - #include <math.h>
1209 --using namespace std;
1210 -+
1211 -+#include <cmath>
1212 -+using std::isnan;
1213 -
1214 - class bisector
1215 - {
1216 -diff --git a/spyview/misc.h b/spyview/misc.h
1217 -index 9ed7dfc..8ed8ba8 100644
1218 ---- a/spyview/misc.h
1219 -+++ b/spyview/misc.h
1220 -@@ -3,7 +3,7 @@
1221 -
1222 - #include <string>
1223 -
1224 --using namespace std;
1225 -+using std::string;
1226 -
1227 - //Some useful functions
1228 -
1229 -diff --git a/spyview/spypal_gradient.C b/spyview/spypal_gradient.C
1230 -index e522b42..4997fbd 100644
1231 ---- a/spyview/spypal_gradient.C
1232 -+++ b/spyview/spypal_gradient.C
1233 -@@ -22,7 +22,7 @@ void Spypal_Slider_Dragger::start_dragging(Fl_Spypal_GSlider *todrag, bool can_d
1234 - assert(dragging == NULL);
1235 - can_delete = can_delete_p;
1236 - dragging = todrag;
1237 -- colored = false;
1238 -+ colored = NULL;
1239 - shown = find(g->sliders.begin(),g->sliders.end(), dragging) != g->sliders.end();
1240 - if(!shown && (Fl::event_inside(g) || !can_delete))
1241 - show_dragged();
1242 -diff --git a/spyview/spyview.C b/spyview/spyview.C
1243 -index cd99eeb..5e5c1f6 100644
1244 ---- a/spyview/spyview.C
1245 -+++ b/spyview/spyview.C
1246 -@@ -27,8 +27,6 @@
1247 - #include "spypal_import.H"
1248 - #include <libgen.h>
1249 -
1250 --using namespace std;
1251 --
1252 - //How's this for lazy...?
1253 - char **arg_values;
1254 - int arg_count;
1255 -diff --git a/spyview/spyview.H b/spyview/spyview.H
1256 -index 3536354..0411e87 100644
1257 ---- a/spyview/spyview.H
1258 -+++ b/spyview/spyview.H
1259 -@@ -10,6 +10,8 @@
1260 - #include <vector>
1261 - #include "spyview_ui.h"
1262 -
1263 -+using std::string;
1264 -+
1265 - /*void minl_cb(Fl_Widget *, void *);
1266 - void maxl_cb(Fl_Widget *, void *);
1267 - void dminl_cb(Fl_Widget *, void *);
1268 -diff --git a/spyview/spyview3d.C b/spyview/spyview3d.C
1269 -index b9398d5..068d4a1 100644
1270 ---- a/spyview/spyview3d.C
1271 -+++ b/spyview/spyview3d.C
1272 -@@ -18,8 +18,6 @@
1273 -
1274 - #include "mypam.h"
1275 -
1276 --using namespace std;
1277 --
1278 - int *data;
1279 - int *databuf;
1280 - int w,h;
1281
1282 diff --git a/sci-visualization/spyview/files/spyview-20150124-gnuplot_interface_fix.patch b/sci-visualization/spyview/files/spyview-20150124-gnuplot_interface_fix.patch
1283 deleted file mode 100644
1284 index 6f15296012f..00000000000
1285 --- a/sci-visualization/spyview/files/spyview-20150124-gnuplot_interface_fix.patch
1286 +++ /dev/null
1287 @@ -1,10 +0,0 @@
1288 ---- a/spyview/Gnuplot_Interface.C
1289 -+++ b/spyview/Gnuplot_Interface.C
1290 -@@ -13,6 +13,7 @@
1291 - #else
1292 - #include <sys/stat.h>
1293 - #include <sys/types.h>
1294 -+#include <sys/wait.h>
1295 - #endif
1296 - using namespace boost;
1297 -
1298
1299 diff --git a/sci-visualization/spyview/spyview-20150124-r1.ebuild b/sci-visualization/spyview/spyview-20150124-r1.ebuild
1300 index d873c7d008c..e031660d4b1 100644
1301 --- a/sci-visualization/spyview/spyview-20150124-r1.ebuild
1302 +++ b/sci-visualization/spyview/spyview-20150124-r1.ebuild
1303 @@ -7,7 +7,8 @@ inherit autotools flag-o-matic
1304
1305 DESCRIPTION="2D and 3D data visualization and analysis program"
1306 HOMEPAGE="http://nsweb.tn.tudelft.nl/~gsteele/spyview/"
1307 -SRC_URI="https://github.com/gsteele13/spyview/archive/966012afae2fbb77262bd96a7e530e81b0ed3b90.tar.gz -> $P.tgz"
1308 +SRC_URI="https://github.com/gsteele13/spyview/archive/966012afae2fbb77262bd96a7e530e81b0ed3b90.tar.gz -> $P.tgz
1309 + https://dev.gentoo.org/~mgorny/dist/${P}-patchset.tar.bz2"
1310
1311 LICENSE="GPL-3"
1312 SLOT="0"
1313 @@ -29,8 +30,8 @@ RDEPEND="${COMMON_DEPEND}
1314 sci-visualization/gnuplot"
1315
1316 PATCHES=(
1317 - "${FILESDIR}/${P}"-gnuplot_interface_fix.patch
1318 - "${FILESDIR}/${P}"-gcc6cxx14-9.patch
1319 + "${WORKDIR}/${P}-patchset/${P}"-gnuplot_interface_fix.patch
1320 + "${WORKDIR}/${P}-patchset/${P}"-gcc6cxx14-9.patch
1321 )
1322
1323 src_unpack() {