diff options
author | Kacper Kowalik <xarthisius@gentoo.org> | 2010-10-05 08:27:06 +0000 |
---|---|---|
committer | Kacper Kowalik <xarthisius@gentoo.org> | 2010-10-05 08:27:06 +0000 |
commit | e9a0ff4d795945a68ca2f5ff429ec6d5e58acfcd (patch) | |
tree | 7da02b169485919a5e7590468b3c7f7ee9e64659 /sci-biology/mothur | |
parent | Respect LDFLAGS. Bug #337184 (diff) | |
download | gentoo-2-e9a0ff4d795945a68ca2f5ff429ec6d5e58acfcd.tar.gz gentoo-2-e9a0ff4d795945a68ca2f5ff429ec6d5e58acfcd.tar.bz2 gentoo-2-e9a0ff4d795945a68ca2f5ff429ec6d5e58acfcd.zip |
Fix buffer overflows and building with --as-needed wrt bug 339753. Thanks to Diego for the report. Correct dependencies. Drop old.
(Portage version: 2.2_rc88/cvs/Linux x86_64)
Diffstat (limited to 'sci-biology/mothur')
-rw-r--r-- | sci-biology/mothur/ChangeLog | 10 | ||||
-rw-r--r-- | sci-biology/mothur/files/mothur-1.13.0-makefile.patch | 43 | ||||
-rw-r--r-- | sci-biology/mothur/files/mothur-1.13.0-overflows.patch | 82 | ||||
-rw-r--r-- | sci-biology/mothur/mothur-1.13.0-r1.ebuild | 43 | ||||
-rw-r--r-- | sci-biology/mothur/mothur-1.13.0.ebuild | 36 | ||||
-rw-r--r-- | sci-biology/mothur/mothur-1.7.2-r1.ebuild | 30 |
6 files changed, 177 insertions, 67 deletions
diff --git a/sci-biology/mothur/ChangeLog b/sci-biology/mothur/ChangeLog index aa5507440a3a..ca6cbe7cce71 100644 --- a/sci-biology/mothur/ChangeLog +++ b/sci-biology/mothur/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sci-biology/mothur # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-biology/mothur/ChangeLog,v 1.7 2010/09/26 02:30:24 weaver Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-biology/mothur/ChangeLog,v 1.8 2010/10/05 08:27:06 xarthisius Exp $ + +*mothur-1.13.0-r1 (05 Oct 2010) + + 05 Oct 2010; Kacper Kowalik <xarthisius@gentoo.org> + -mothur-1.7.2-r1.ebuild, -mothur-1.13.0.ebuild, +mothur-1.13.0-r1.ebuild, + +files/mothur-1.13.0-makefile.patch, +files/mothur-1.13.0-overflows.patch: + Fix buffer overflows and building with --as-needed wrt bug 339753. Thanks + to Diego for the report. Correct dependencies. Drop old. *mothur-1.13.0 (26 Sep 2010) diff --git a/sci-biology/mothur/files/mothur-1.13.0-makefile.patch b/sci-biology/mothur/files/mothur-1.13.0-makefile.patch new file mode 100644 index 000000000000..6b2f0f1bd201 --- /dev/null +++ b/sci-biology/mothur/files/mothur-1.13.0-makefile.patch @@ -0,0 +1,43 @@ +Fix build with --as-needed, respect CXX, CXXFLAGS + +http://www.mothur.org/forum/viewtopic.php?f=4&t=590 +http://bugs.gentoo.org/show_bug.cgi?id=339753 + +--- makefile ++++ makefile +@@ -11,7 +11,7 @@ + + # Optimize to level 3: + +-CXXFLAGS += -O3 ++#CXXFLAGS += -O3 + + MOTHUR_FILES = "\"Enter_your_default_path_here\"" + +@@ -49,7 +49,7 @@ + + ifeq ($(strip $(USEREADLINE)),yes) + CXXFLAGS += -DUSE_READLINE +- LDFLAGS += \ ++ LIBS = \ + -lreadline\ + -lncurses + endif +@@ -57,7 +57,7 @@ + USEMPI ?= no + + ifeq ($(strip $(USEMPI)),yes) +- CXX = mpic++ ++# CXX = mpic++ + CXXFLAGS += -DUSE_MPI + endif + +@@ -74,7 +74,7 @@ + OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp)) + + mothur : $(OBJECTS) +- $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) ++ $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS) + + install : mothur + cp mothur ../Release/mothur diff --git a/sci-biology/mothur/files/mothur-1.13.0-overflows.patch b/sci-biology/mothur/files/mothur-1.13.0-overflows.patch new file mode 100644 index 000000000000..0cd9d7f3a47e --- /dev/null +++ b/sci-biology/mothur/files/mothur-1.13.0-overflows.patch @@ -0,0 +1,82 @@ +Fix buffer overflows + +http://www.mothur.org/forum/viewtopic.php?f=4&t=591 + +--- Mothur.source/filterseqscommand.cpp ++++ Mothur.source/filterseqscommand.cpp +@@ -305,8 +305,8 @@ + + //wait on chidren + for(int i = 1; i < processors; i++) { +- char buf[4]; +- MPI_Recv(buf, 4, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status); ++ char buf[5]; ++ MPI_Recv(buf, 5, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status); + } + + }else { //you are a child process +@@ -326,11 +326,11 @@ + + if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); return 0; } + +- char buf[4]; ++ char buf[5]; + strcpy(buf, "done"); + + //tell parent you are done. +- MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD); ++ MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD); + } + + MPI_File_close(&outMPI); +--- Mothur.source/distancecommand.cpp ++++ Mothur.source/distancecommand.cpp +@@ -271,8 +271,8 @@ + for(int i = 1; i < processors; i++) { + if (m->control_pressed) { MPI_File_close(&outMPI); delete distCalculator; return 0; } + +- char buf[4]; +- MPI_Recv(buf, 4, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status); ++ char buf[5]; ++ MPI_Recv(buf, 5, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status); + } + }else { //you are a child process + //do your part +@@ -280,10 +280,10 @@ + + if (m->control_pressed) { MPI_File_close(&outMPI); delete distCalculator; return 0; } + +- char buf[4]; ++ char buf[5]; + strcpy(buf, "done"); + //tell parent you are done. +- MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD); ++ MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD); + } + + MPI_File_close(&outMPI); +--- Mothur.source/chimeracheckcommand.cpp ++++ Mothur.source/chimeracheckcommand.cpp +@@ -269,8 +269,8 @@ + + //wait on chidren + for(int j = 1; j < processors; j++) { +- char buf[4]; +- MPI_Recv(buf, 4, MPI_CHAR, j, tag, MPI_COMM_WORLD, &status); ++ char buf[5]; ++ MPI_Recv(buf, 5, MPI_CHAR, j, tag, MPI_COMM_WORLD, &status); + } + }else{ //you are a child process + MPI_Recv(&numSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status); +@@ -288,9 +288,9 @@ + if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; } + + //tell parent you are done. +- char buf[4]; ++ char buf[5]; + strcpy(buf, "done"); +- MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD); ++ MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD); + } + + //close files diff --git a/sci-biology/mothur/mothur-1.13.0-r1.ebuild b/sci-biology/mothur/mothur-1.13.0-r1.ebuild new file mode 100644 index 000000000000..afe819b495f6 --- /dev/null +++ b/sci-biology/mothur/mothur-1.13.0-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-biology/mothur/mothur-1.13.0-r1.ebuild,v 1.1 2010/10/05 08:27:06 xarthisius Exp $ + +EAPI="2" + +inherit eutils toolchain-funcs + +DESCRIPTION="A suite of algorithms for ecological bioinformatics" +HOMEPAGE="http://schloss.micro.umass.edu/wiki/Main_Page" +SRC_URI="mirror://gentoo/${P}.zip" + +LICENSE="GPL-3" +SLOT="0" +IUSE="mpi +readline" +KEYWORDS="~amd64 ~x86" + +DEPEND="${RDEPEND} + app-arch/unzip" +RDEPEND="mpi? ( virtual/mpi )" + +S=${WORKDIR}/Mothur.source + +pkg_setup() { + use mpi && CXX=mpicxx || CXX=$(tc-getCXX) +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-makefile.patch \ + "${FILESDIR}"/${P}-overflows.patch +} + +use_yn() { + useq $1 && echo "yes" || echo "no" +} + +src_compile() { + emake USEMPI=$(use_yn mpi) USEREADLINE=$(use_yn readline) || die +} + +src_install() { + dobin mothur || die +} diff --git a/sci-biology/mothur/mothur-1.13.0.ebuild b/sci-biology/mothur/mothur-1.13.0.ebuild deleted file mode 100644 index 392961eb18b6..000000000000 --- a/sci-biology/mothur/mothur-1.13.0.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-biology/mothur/mothur-1.13.0.ebuild,v 1.1 2010/09/26 02:30:24 weaver Exp $ - -EAPI="2" - -inherit toolchain-funcs flag-o-matic - -DESCRIPTION="A suite of algorithms for ecological bioinformatics" -HOMEPAGE="http://schloss.micro.umass.edu/wiki/Main_Page" -SRC_URI="mirror://gentoo/${P}.zip" - -LICENSE="GPL-3" -SLOT="0" -IUSE="mpi +readline" -KEYWORDS="~amd64 ~x86" - -DEPEND="app-arch/unzip - mpi? ( virtual/mpi )" -RDEPEND="" - -S="${WORKDIR}/Mothur.source" - -src_prepare() { - filter-ldflags -Wl,--as-needed - sed -i -e 's/CC_OPTIONS =/CC_OPTIONS = ${CXXFLAGS} /' \ - -e '/USEMPI ?=/ d' -e '/USEREADLINE ?=/ d' \ - -e 's|CC = g++|CC = '$(tc-getCXX)'|' "${S}/makefile" || die - - use mpi && sed -i '1 a USEMPI = yes' "${S}/makefile" - use readline && sed -i '1 a USEREADLINE = yes' "${S}/makefile" -} - -src_install() { - dobin mothur || die -} diff --git a/sci-biology/mothur/mothur-1.7.2-r1.ebuild b/sci-biology/mothur/mothur-1.7.2-r1.ebuild deleted file mode 100644 index 79e5c5168da5..000000000000 --- a/sci-biology/mothur/mothur-1.7.2-r1.ebuild +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-biology/mothur/mothur-1.7.2-r1.ebuild,v 1.1 2010/08/27 09:28:47 xarthisius Exp $ - -EAPI="2" - -inherit toolchain-funcs - -DESCRIPTION="A suite of algorithms for ecological bioinformatics" -HOMEPAGE="http://schloss.micro.umass.edu/wiki/Main_Page" -SRC_URI="mirror://gentoo/${P}.zip" - -LICENSE="GPL-3" -SLOT="0" -IUSE="" -KEYWORDS="~amd64 ~x86" - -DEPEND="app-arch/unzip" -RDEPEND="" - -S=${WORKDIR}/Mothur.source - -src_compile() { - emake CC_OPTIONS="${CXXFLAGS}" CC="$(tc-getCXX)" \ - LNK_OPTIONS="${LDFLAGS}" || die -} - -src_install() { - dobin mothur || die -} |