summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/mothur/package.py83
1 files changed, 63 insertions, 20 deletions
diff --git a/var/spack/repos/builtin/packages/mothur/package.py b/var/spack/repos/builtin/packages/mothur/package.py
index 2d546c7958..3e88378a5d 100644
--- a/var/spack/repos/builtin/packages/mothur/package.py
+++ b/var/spack/repos/builtin/packages/mothur/package.py
@@ -4,7 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
-from spack.pkg.builtin.boost import Boost
class Mothur(MakefilePackage):
@@ -15,37 +14,81 @@ class Mothur(MakefilePackage):
homepage = "https://github.com/mothur/mothur"
url = "https://github.com/mothur/mothur/archive/v1.39.5.tar.gz"
+ version("1.48.0", sha256="9494406abd8d14b821782ab9db811f045ded9424f28f01234ee6764d4e78941d")
version("1.46.1", sha256="29b500b3c92d726cde34922f697f2e47f0b7127d76d9a6fb167cc2b8ba3d00fd")
version("1.43.0", sha256="12ccd95a85bec3bb1564b8feabd244ea85413973740754803d01fc71ecb0a2c1")
version("1.42.1", sha256="6b61591dda289ac2d8361f9c1547ffbeeba3b9fbdff877dd286bad850bbd5539")
version("1.40.5", sha256="a0fbdfa68b966d7adc4560e3787506a0dad8b47b4b996c2663cd6c0b416d101a")
version("1.39.5", sha256="9f1cd691e9631a2ab7647b19eb59cd21ea643f29b22cde73d7f343372dfee342")
+ maintainers = ["snehring"]
- variant("vsearch", default=False, description="Use vsearch")
+ variant(
+ "boost",
+ default=True,
+ description="Build with boost support (allow make.contigs to read gz files).",
+ )
+ variant("hdf5", default=False, description="Build with hdf5 support", when="@1.41.0:")
+ variant(
+ "gsl", default=False, description="Build with the gnu scientific libaries", when="@1.43.0:"
+ )
- # TODO: replace this with an explicit list of components of Boost,
- # for instance depends_on('boost +filesystem')
- # See https://github.com/spack/spack/pull/22303 for reference
- depends_on(Boost.with_default_variants)
+ depends_on("boost+iostreams+filesystem+system", when="+boost")
+ depends_on("gsl", when="+gsl")
+ depends_on("hdf5+cxx", when="+hdf5")
depends_on("readline")
- depends_on("vsearch@2.13.3", when="+vsearch", type="run")
+ depends_on("vsearch@2.13.5:", type="run")
+ depends_on("usearch", type="run")
+ depends_on("zlib", when="+boost")
def edit(self, spec, prefix):
- makefile = FileFilter("Makefile")
- makefile.filter(
- 'BOOST_LIBRARY_DIR="\\"Enter_your_boost_library_path' '_here\\""',
- "BOOST_LIBRARY_DIR=%s" % self.spec["boost"].prefix.lib,
- )
- makefile.filter(
- 'BOOST_INCLUDE_DIR="\\"Enter_your_boost_include_path' '_here\\""',
- "BOOST_INCLUDE_DIR=%s" % self.spec["boost"].prefix.include,
- )
- makefile.filter(
- 'MOTHUR_FILES="\\"Enter_your_default_path_' 'here\\""', "MOTHUR_FILES=%s" % prefix
- )
+ filter_file(r"^.*DMOTHUR_TOOLS.*$", "", "Makefile")
+ filter_file(r"^.*DMOTHUR_FILES.*$", "", "Makefile")
+ filter_file(r"(\$\(skipUchime\))", r"\1, source/", "Makefile")
+ if spec.satisfies("@1.40.5"):
+ filter_file(
+ r"^(#define writer_h)", "\\1 \n#include<memory>", join_path("source", "writer.h")
+ )
+ # this includes the public domain uchime, which needs work to
+ # compile on newer compilers we'll use what's in usearch
+ filter_file(" uchime", "", "Makefile")
+ if spec.satisfies("+boost"):
+ filter_file(r"USEBOOST \?=.*$", "USEBOOST = yes", "Makefile")
+ filter_file(
+ r"^BOOST_LIBRARY_DIR .*$",
+ "BOOST_LIBRARY_DIR=%s" % self.spec["boost"].prefix.lib,
+ "Makefile",
+ )
+ filter_file(
+ r"BOOST_INCLUDE_DIR .*$",
+ "BOOST_INCLUDE_DIR=%s" % self.spec["boost"].prefix.include,
+ "Makefile",
+ )
+ if spec.satisfies("+hdf5"):
+ filter_file(r"USEHDF5 \?=.*$", "USEHDF5 = yes", "Makefile")
+ filter_file(
+ r"^HDF5_LIBRARY_DIR \?=.*$",
+ "HDF5_LIBRARY_DIR = " + spec["hdf5"].prefix.lib,
+ "Makefile",
+ )
+ filter_file(
+ r"^HDF5_INCLUDE_DIR \?=.*$",
+ "HDF5_INCLUDE_DIR = " + spec["hdf5"].prefix.include,
+ "Makefile",
+ )
+ if spec.satisfies("+gsl"):
+ filter_file(r"^USEGSL \?=.*$", "USEGSL = yes", "Makefile")
+ filter_file(
+ r"GSL_LIBRARY_DIR \?=.*$",
+ "GSL_LIBRARY_DIR = " + spec["gsl"].prefix.lib,
+ "Makefile",
+ )
+ filter_file(
+ r"GSL_INCLUDE_DIR \?=.*$",
+ "GSL_INCLUDE_DIR = " + spec["gsl"].prefix.include,
+ "Makefile",
+ )
def install(self, spec, prefix):
mkdirp(prefix.bin)
install("mothur", prefix.bin)
- install("uchime", prefix.bin)
install_tree("source", prefix.include)