1 |
commit: b81e4c632efa6b2d53c8750b84deb2b315c86dd0 |
2 |
Author: Sergei Trofimovich <slyfox <AT> inbox <DOT> ru> |
3 |
AuthorDate: Fri Sep 23 13:16:56 2016 +0000 |
4 |
Commit: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de> |
5 |
CommitDate: Fri Sep 23 13:16:56 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=b81e4c63 |
7 |
|
8 |
sci-biology/abyss: tweak for gcc-6, bug #594254 (#681) |
9 |
|
10 |
Build failed as: |
11 |
``` |
12 |
In file included from AssemblyAlgorithms.cpp:4:0: |
13 |
../DataLayer/FastaReader.h: In member function ‘FastaReader::operator void*() const’: |
14 |
../DataLayer/FastaReader.h:49:35: error: cannot convert ‘std::istream {aka std::basic_istream<char>}’ to ‘void*’ ... |
15 |
operator void*() const { return m_in; } |
16 |
^~~~ |
17 |
``` |
18 |
|
19 |
In the following source: |
20 |
|
21 |
```c++ |
22 |
static bool existFile(const char* f) |
23 |
{ |
24 |
ifstream file(f); |
25 |
return file; |
26 |
} |
27 |
|
28 |
``` |
29 |
|
30 |
c++98 provides file->operator void*() |
31 |
c++11 provides file->explicit operator bool() |
32 |
|
33 |
Hence the failure on c++11. |
34 |
|
35 |
The change adds explicit casts around istream. |
36 |
|
37 |
Reported-by: Toralf Förster |
38 |
Bug: https://bugs.gentoo.org/594254 |
39 |
|
40 |
Package-Manager: portage-2.3.0 |
41 |
|
42 |
sci-biology/abyss/abyss-1.9.0.ebuild | 1 + |
43 |
sci-biology/abyss/files/abyss-1.9.0-gcc-6.patch | 34 +++++++++++++++++++++++++ |
44 |
2 files changed, 35 insertions(+) |
45 |
|
46 |
diff --git a/sci-biology/abyss/abyss-1.9.0.ebuild b/sci-biology/abyss/abyss-1.9.0.ebuild |
47 |
index b2de141..c32b477 100644 |
48 |
--- a/sci-biology/abyss/abyss-1.9.0.ebuild |
49 |
+++ b/sci-biology/abyss/abyss-1.9.0.ebuild |
50 |
@@ -33,6 +33,7 @@ DEPEND="${RDEPEND} |
51 |
|
52 |
PATCHES=( |
53 |
"${FILESDIR}"/${P}-ac_prog_ar.patch |
54 |
+ "${FILESDIR}"/${P}-gcc-6.patch |
55 |
) |
56 |
|
57 |
src_prepare() { |
58 |
|
59 |
diff --git a/sci-biology/abyss/files/abyss-1.9.0-gcc-6.patch b/sci-biology/abyss/files/abyss-1.9.0-gcc-6.patch |
60 |
new file mode 100644 |
61 |
index 0000000..49a30f9 |
62 |
--- /dev/null |
63 |
+++ b/sci-biology/abyss/files/abyss-1.9.0-gcc-6.patch |
64 |
@@ -0,0 +1,34 @@ |
65 |
+diff --git a/DataBase/db-csv.cc b/DataBase/db-csv.cc |
66 |
+index 05cac19..48e3b44 100644 |
67 |
+--- a/DataBase/db-csv.cc |
68 |
++++ b/DataBase/db-csv.cc |
69 |
+@@ -18,11 +18,11 @@ static const char TABLE_LIST[] = |
70 |
+ typedef vector<string> vs; |
71 |
+ |
72 |
+ static bool existFile(const char* f) |
73 |
+ { |
74 |
+ ifstream file(f); |
75 |
+- return file; |
76 |
++ return bool(file); |
77 |
+ } |
78 |
+ |
79 |
+ template <typename D> |
80 |
+ static bool existTable( |
81 |
+ D& db, const string& t) |
82 |
+diff --git a/SimpleGraph/SimpleGraph.cpp b/SimpleGraph/SimpleGraph.cpp |
83 |
+index 373ec70..0a9ebd3 100644 |
84 |
+--- a/SimpleGraph/SimpleGraph.cpp |
85 |
++++ b/SimpleGraph/SimpleGraph.cpp |
86 |
+@@ -645,11 +645,11 @@ static void* worker(void* pArg) |
87 |
+ for (;;) { |
88 |
+ /** Lock the input stream. */ |
89 |
+ static pthread_mutex_t inMutex = PTHREAD_MUTEX_INITIALIZER; |
90 |
+ pthread_mutex_lock(&inMutex); |
91 |
+ EstimateRecord er; |
92 |
+- bool good = (*arg.in) >> er; |
93 |
++ bool good = bool((*arg.in) >> er); |
94 |
+ pthread_mutex_unlock(&inMutex); |
95 |
+ if (!good) |
96 |
+ break; |
97 |
+ |
98 |
+ // Flip the anterior distance estimates. |