commit:     3c65e999c45f956a48f434581ed74f27732c9c2a
Author:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Mon Feb 18 13:44:27 2019 +0000
Commit:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
CommitDate: Mon Feb 18 13:44:27 2019 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=3c65e999

sci-biology/bowtie: add some compile patches from Debian

Seems both bowtie1 and bowtie2 are bound too much to SeqAn-1.1
and need more patches for SeqAn-1.4. Per reports on github
it seems one should be able to compile bowtie-1.2.2 using
-std=c++03 (but not me).

Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Martin Mokrejs <mmokrejs <AT> fold.natur.cuni.cz>

 sci-biology/bowtie/bowtie-1.2.2.ebuild             | 77 ++++++++++++++++++++++
 sci-biology/bowtie/bowtie-2.3.4.3.ebuild           | 62 +++++++++++++++++
 .../files/bowtie-1.2.2-_ContextLss-1.1-1.4.patch   | 17 +++++
 .../files/bowtie-1.2.2-fix-Intel-compilation.patch | 32 +++++++++
 .../bowtie/files/bowtie-1.2.2-unbundle-seqan.patch | 14 ++++
 .../bowtie/files/bowtie-1.2.2-void2int.patch       | 16 +++++
 sci-biology/bowtie/metadata.xml                    | 16 +++++
 7 files changed, 234 insertions(+)

diff --git a/sci-biology/bowtie/bowtie-1.2.2.ebuild 
b/sci-biology/bowtie/bowtie-1.2.2.ebuild
new file mode 100644
index 000000000..cae085bff
--- /dev/null
+++ b/sci-biology/bowtie/bowtie-1.2.2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Popular short read aligner for Next-generation sequencing data"
+HOMEPAGE="http://bowtie-bio.sourceforge.net/";
+SRC_URI="mirror://sourceforge/bowtie-bio/${P}-src.zip"
+
+LICENSE="Artistic"
+SLOT="1"
+KEYWORDS=""
+
+IUSE="examples +tbb"
+
+RDEPEND="tbb? ( dev-cpp/tbb )"
+DEPEND="${RDEPEND}
+       sci-biology/seqan:1.4
+       app-arch/unzip"
+
+DOCS=( AUTHORS NEWS TUTORIAL doc/README )
+HTML_DOCS=( doc/{manual.html,style.css} )
+
+PATCHES=(
+       "${FILESDIR}/${P}-_ContextLss-1.1-1.4.patch"
+       "${FILESDIR}/${P}-fix-Intel-compilation.patch"
+       "${FILESDIR}/${P}-unbundle-seqan.patch"
+)
+# other patches to be still considered
+#      "${FILESDIR}/${P}-fix-setBegin-call.patch"
+#      "${FILESDIR}/${P}-seqan-popcount.patch"
+#      "${FILESDIR}/${P}-seqan-rename-ChunkPool.patch"
+#      "${FILESDIR}/${P}-seqan-rename-fill-to-resize.patch"
+#      "${FILESDIR}/${P}-spelling.patch"
+#      "${FILESDIR}/${P}-tbb-tinythread-missing.patch"
+#)
+
+src_prepare() {
+       default
+
+       # remove bundled libraries, use system seqan 1.4
+       rm -rf SeqAn-1.1/ third_party/ || die
+
+       # innocuous non-security flags, prevent log pollution
+       append-cxxflags \
+               -Wno-unused-local-typedefs \
+               -Wno-unused-but-set-variable \
+               -Wno-unused-variable
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" \
+               CPP="$(tc-getCXX)" \
+               CFLAGS="" \
+               CXXFLAGS="" \
+               EXTRA_FLAGS="${LDFLAGS}" \
+               RELEASE_FLAGS="${CXXFLAGS}" \
+               WITH_TBB="$(usex tbb 1 0)"
+}
+
+src_install() {
+       dobin ${PN} ${PN}-*
+
+       exeinto /usr/libexec/${PN}
+       doexe scripts/*
+
+       newman MANUAL ${PN}.1
+       einstalldocs
+
+       if use examples; then
+               insinto /usr/share/${PN}
+               doins -r genomes indexes
+       fi
+}

diff --git a/sci-biology/bowtie/bowtie-2.3.4.3.ebuild 
b/sci-biology/bowtie/bowtie-2.3.4.3.ebuild
new file mode 100644
index 000000000..eea3059cf
--- /dev/null
+++ b/sci-biology/bowtie/bowtie-2.3.4.3.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="Popular short read aligner for Next-generation sequencing data"
+HOMEPAGE="http://bowtie-bio.sourceforge.net/bowtie2/";
+SRC_URI="mirror://sourceforge/project/${PN}-bio/${PN}2/${PV}/${PN}2-${PV}-source.zip"
+
+LICENSE="GPL-3"
+SLOT="2"
+KEYWORDS=""
+
+IUSE="examples cpu_flags_x86_sse2 +tbb"
+
+RDEPEND="dev-lang/perl
+       tbb? ( dev-cpp/tbb )"
+DEPEND="${RDEPEND}
+       app-arch/unzip
+       sys-libs/readline"
+
+S="${WORKDIR}/${PN}2-${PV}"
+
+DOCS=( AUTHORS NEWS TUTORIAL )
+HTML_DOCS=( doc/{manual.html,style.css} )
+#PATCHES=( "${FILESDIR}/${P}-fix-c++14.patch" ) # needs 2.3.4.3 update
+
+pkg_pretend() {
+       if ! use cpu_flags_x86_sse2 ; then
+               eerror "This package requires a CPU supporting the SSE2 
instruction set."
+               die "SSE2 support missing"
+       fi
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" \
+               CPP="$(tc-getCXX)" \
+               CXX="$(tc-getCXX)" \
+               CFLAGS="" \
+               CXXFLAGS="" \
+               EXTRA_FLAGS="${LDFLAGS}" \
+               RELEASE_FLAGS="${CXXFLAGS} -msse2" \
+               WITH_TBB="$(usex tbb 1 0)"
+}
+
+src_install() {
+       dobin ${PN}2 ${PN}2-*
+
+       exeinto /usr/libexec/${PN}2
+       doexe scripts/*
+
+       newman MANUAL ${PN}2.1
+       einstalldocs
+
+       if use examples; then
+               insinto /usr/share/${PN}2
+               doins -r example
+       fi
+}

diff --git a/sci-biology/bowtie/files/bowtie-1.2.2-_ContextLss-1.1-1.4.patch 
b/sci-biology/bowtie/files/bowtie-1.2.2-_ContextLss-1.1-1.4.patch
new file mode 100644
index 000000000..4bcd61ba3
--- /dev/null
+++ b/sci-biology/bowtie/files/bowtie-1.2.2-_ContextLss-1.1-1.4.patch
@@ -0,0 +1,17 @@
+Description: Change class name of _Context_LSS
+ New version 1.4 of SeQan uses a different name of the class. 
+Forwarded: no
+Author: Gert Wollny <[email protected]>
+Last-Update: 2014-100-06
+
+--- bowtie-1.2.2/diff_sample.h 2017-11-03 01:25:56.000000000 +0100
++++ bowtie-1.2.2/diff_sample.h 2019-02-18 12:50:37.894674282 +0100
+@@ -979,7 +979,7 @@
+       {
+               Timer timer(cout, "  Invoking Larsson-Sadakane on ranks time: 
", this->verbose());
+               VMSG_NL("  Invoking Larsson-Sadakane on ranks");
+-              _Context_LSS<TIndexOff> c;
++              ContextLss_<TIndexOff> c;
+               c.suffixsort(
+                       (TIndexOff*)begin(_isaPrime, Standard()),
+                       (TIndexOff*)begin(sPrime, Standard()),

diff --git a/sci-biology/bowtie/files/bowtie-1.2.2-fix-Intel-compilation.patch 
b/sci-biology/bowtie/files/bowtie-1.2.2-fix-Intel-compilation.patch
new file mode 100644
index 000000000..75942efb5
--- /dev/null
+++ b/sci-biology/bowtie/files/bowtie-1.2.2-fix-Intel-compilation.patch
@@ -0,0 +1,32 @@
+fix compilation errors with Intel compilers:
+error: no operator "=" matches these operands
+author: Ward Poelmans
+--- bowtie-1.2.2/hit.h 2018-01-24 12:57:47.135575442 +0100
++++ bowtie-1.2.2/hit.h 2018-01-24 12:57:58.615869774 +0100
+@@ -640,10 +640,26 @@
+                       s.moveTo(btString);
+               }
+ 
++              batch(const batch &other)
++                {
++                    batchId = other.batchId;
++                    isWritten = other.isWritten;
++                    btString = other.btString;
++                }
++
+               bool operator<(const batch& other) const {
+                       return batchId < other.batchId;
+               }
+ 
++              batch& operator=(batch&& other) {
++                      if (&other != this) {
++                              batchId = other.batchId;
++                              isWritten = other.isWritten;
++                              other.btString.moveTo(btString);
++                      }
++                      return *this;
++              }
++
+               batch& operator=(batch& other) {
+                       if (&other != this) {
+                               batchId = other.batchId;

diff --git a/sci-biology/bowtie/files/bowtie-1.2.2-unbundle-seqan.patch 
b/sci-biology/bowtie/files/bowtie-1.2.2-unbundle-seqan.patch
new file mode 100644
index 000000000..b1a5f98f5
--- /dev/null
+++ b/sci-biology/bowtie/files/bowtie-1.2.2-unbundle-seqan.patch
@@ -0,0 +1,14 @@
+--- bowtie-1.2.2/Makefile      2019-02-18 13:26:29.490835084 +0100
++++ bowtie-1.2.2/Makefile      2019-02-18 13:28:36.864742545 +0100
+@@ -5,10 +5,7 @@
+ prefix = /usr/local
+ bindir = $(prefix)/bin
+ 
+-SEQAN_DIR = ./SeqAn-1.1
+-# treat SeqAn as a sysdir to suppress warnings
+-SEQAN_INC = -isystem $(SEQAN_DIR)
+-INC = $(if $(RELEASE_BUILD),-I$(CURDIR)/.include) $(SEQAN_INC) -I third_party
++INC = $(if $(RELEASE_BUILD),-I$(CURDIR)/.include) `pkg-config --cflags 
seqan-1.4` -I third_party
+ CPP = g++
+ CXX = $(CPP)
+ CC = gcc

diff --git a/sci-biology/bowtie/files/bowtie-1.2.2-void2int.patch 
b/sci-biology/bowtie/files/bowtie-1.2.2-void2int.patch
new file mode 100644
index 000000000..822b673ae
--- /dev/null
+++ b/sci-biology/bowtie/files/bowtie-1.2.2-void2int.patch
@@ -0,0 +1,16 @@
+#The latest Intel compiler (2016,2017) complains about the incompatibility of 
"void *" argument
+#being incompatible with parameter of type "int *"
+#M. Fujinaga ([email protected])
+--- processor_support.h        2017-02-02 21:48:42.436432756 +0000
++++ processor_support.h        2017-02-02 21:48:54.419309743 +0000
+@@ -44,8 +44,8 @@
+ 
+     try {
+ #if ( defined(USING_INTEL_COMPILER) || defined(USING_MSC_COMPILER) )
+-        __cpuid((void *) &regs,0); // test if __cpuid() works, if not catch 
the exception
+-        __cpuid((void *) &regs,0x1); // POPCNT bit is bit 23 in ECX
++        __cpuid((int *) &regs,0); // test if __cpuid() works, if not catch 
the exception
++        __cpuid((int *) &regs,0x1); // POPCNT bit is bit 23 in ECX
+ #elif defined(USING_GCC_COMPILER)
+         __get_cpuid(0x1, &regs.EAX, &regs.EBX, &regs.ECX, &regs.EDX);
+ #else

diff --git a/sci-biology/bowtie/metadata.xml b/sci-biology/bowtie/metadata.xml
new file mode 100644
index 000000000..71e8d3bb8
--- /dev/null
+++ b/sci-biology/bowtie/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="project">
+    <email>[email protected]</email>
+    <name>Gentoo Biology Project</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="sourceforge">bowtie-bio</remote-id>
+  </upstream>
+  <use>
+    <flag name="tbb">Enables building bowtie with the Intel
+      Threading Building Blocks from <pkg>dev-cpp/tbb</pkg>. This
+      flag is recommended.</flag>
+  </use>
+</pkgmetadata>

Reply via email to