sci-biology/mosaik: Fix building with GCC 7
authorDavid Seifert <soap@gentoo.org>
Sun, 24 Dec 2017 11:53:03 +0000 (12:53 +0100)
committerDavid Seifert <soap@gentoo.org>
Sun, 24 Dec 2017 18:00:17 +0000 (19:00 +0100)
Closes: https://bugs.gentoo.org/638362
Package-Manager: Portage-2.3.19, Repoman-2.3.6

sci-biology/mosaik/files/mosaik-2.2.30-gcc7.patch [new file with mode: 0644]
sci-biology/mosaik/mosaik-2.2.30.ebuild

diff --git a/sci-biology/mosaik/files/mosaik-2.2.30-gcc7.patch b/sci-biology/mosaik/files/mosaik-2.2.30-gcc7.patch
new file mode 100644 (file)
index 0000000..ebf925a
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/CommonSource/ExternalReadFormats/BamWriter.cpp
++++ b/CommonSource/ExternalReadFormats/BamWriter.cpp
+@@ -496,7 +496,7 @@
+       buffer[6] = 0xffffffff;  // mate_pos
+       buffer[7] = 0;           // ins_size
+ 
+-      const char* startChar = '\0';
++      const char* startChar = NULL;
+       
+       // write the block size
+       const unsigned int dataBlockSize = nameLen + packedCigarLen + encodedQueryLen + queryLen;
+@@ -652,7 +652,7 @@
+       unsigned int zaTagLen = 0;
+       string zaTag;
+       char* pZaTag;
+-      if ((zaString != 0) && (zaString != (char)0)) {
++      if ((zaString != 0) && (zaString[0] != '\0')) {
+               zaTagLen = 3 + strlen( zaString ) + 1;
+               zaTag.resize( zaTagLen );
+               pZaTag = (char*)zaTag.data();
+@@ -776,7 +776,7 @@
+       BgzfWrite(mdTag.data(), mdTagLen);
+ 
+       // write the ZA tag
+-      if ( zaString != 0 && (zaString != (char)0))
++      if ( zaString != 0 && (zaString[0] != '\0'))
+               BgzfWrite(zaTag.data(), zaTagLen);
+       
+       // write the ZN tag
+--- a/MosaikAligner/AlignmentThread.cpp
++++ b/MosaikAligner/AlignmentThread.cpp
+@@ -591,7 +591,7 @@
+       buffer.al              = al;
+       buffer.noCigarMdNm     = noCigarMdNm;
+       buffer.notShowRnamePos = notShowRnamePos;
+-      if ( zaString == (char)0 ) 
++      if ( zaString == NULL ) 
+               buffer.zaString.clear();
+       else
+               buffer.zaString = zaString;
index 45633c47dab5c03b105d2685a613ecb69c667393..874edba4504d39a43adcdd9a33224868a0f767e2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -11,18 +11,15 @@ SRC_URI="https://github.com/wanpinglee/MOSAIK/archive/5c25216d3522d6a33e53875cd7
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE=""
 KEYWORDS="~amd64 ~x86"
 
-DEPEND=""
-RDEPEND=""
-
 S="${WORKDIR}/${P}/src"
 
 PATCHES=(
-       "${FILESDIR}/${P}-remove-platform-code.patch"
-       "${FILESDIR}/${P}-fix-build-system.patch"
-       "${FILESDIR}/${P}-Wformat-security.patch"
+       "${FILESDIR}"/${P}-remove-platform-code.patch
+       "${FILESDIR}"/${P}-fix-build-system.patch
+       "${FILESDIR}"/${P}-Wformat-security.patch
+       "${FILESDIR}"/${P}-gcc7.patch
 )
 
 src_configure() {