summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2023-01-16 20:31:00 -0600
committerGitHub <noreply@github.com>2023-01-17 03:31:00 +0100
commit6f19eb5e674a05f1be7a46891f0eb3eaf7000446 (patch)
treefd52b49f30792831bf54170941de42f8f6d60ddc /var
parentb7e416046f95b21f64f1ac0af7e8ce7a04ad4eec (diff)
downloadspack-6f19eb5e674a05f1be7a46891f0eb3eaf7000446.tar.gz
spack-6f19eb5e674a05f1be7a46891f0eb3eaf7000446.tar.bz2
spack-6f19eb5e674a05f1be7a46891f0eb3eaf7000446.tar.xz
spack-6f19eb5e674a05f1be7a46891f0eb3eaf7000446.zip
hisat2: add version 2.2.1 and sra variant (#34966)
- add python dependency - add perl dependency - set python and perl interpreters in scripts
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hisat2/package.py70
-rw-r--r--var/spack/repos/builtin/packages/hisat2/sra.patch11
2 files changed, 77 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/hisat2/package.py b/var/spack/repos/builtin/packages/hisat2/package.py
index 2542942a21..37dd78b60e 100644
--- a/var/spack/repos/builtin/packages/hisat2/package.py
+++ b/var/spack/repos/builtin/packages/hisat2/package.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import glob
from spack.package import *
@@ -17,6 +18,12 @@ class Hisat2(MakefilePackage):
url = "ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/downloads/hisat2-2.1.0-source.zip"
version(
+ "2.2.1",
+ sha256="48e933330d4d8470d2b3dfe7ec3918f2e98a75f7381891e23b7df1fb4f135eb1",
+ url="https://cloud.biohpc.swmed.edu/index.php/s/fE9QCsX3NH4QwBi/download",
+ extension="zip",
+ )
+ version(
"2.2.0",
sha256="0dd55168853b82c1b085f79ed793dd029db163773f52272d7eb51b3b5e4a4cdd",
url="https://cloud.biohpc.swmed.edu/index.php/s/hisat2-220-source/download",
@@ -24,14 +31,36 @@ class Hisat2(MakefilePackage):
)
version("2.1.0", sha256="89a276eed1fc07414b1601947bc9466bdeb50e8f148ad42074186fe39a1ee781")
+ variant("sra", default=False, description="Add SRA (Sequence Read Archive) support")
+
+ depends_on("perl", type="run")
+ depends_on("python", type="run")
+
+ depends_on("sra-tools", when="+sra")
+ depends_on("ncbi-vdb", when="+sra")
+
+ # patch to get SRA working
+ patch("sra.patch", when="+sra")
+
+ @when("+sra")
+ def build(self, spec, prefix):
+ make(
+ "USE_SRA=1",
+ "NCBI_NGS_DIR={0}".format(spec["sra-tools"].prefix),
+ "NCBI_VDB_DIR={0}".format(spec["ncbi-vdb"].prefix),
+ )
+
def install(self, spec, prefix):
if spec.satisfies("@:2.1.0"):
install_tree("doc", prefix.doc)
install_tree("example", prefix.example)
- install_tree("hisatgenotype_modules", prefix.hisatgenotype_modules)
- install_tree("hisatgenotype_scripts", prefix.hisatgenotype_scripts)
install_tree("scripts", prefix.scripts)
+
+ if "@:2.2.0" in spec:
+ install_tree("hisatgenotype_modules", prefix.hisatgenotype_modules)
+ install_tree("hisatgenotype_scripts", prefix.hisatgenotype_scripts)
+
mkdirp(prefix.bin)
install("hisat2", prefix.bin)
install("hisat2-align-s", prefix.bin)
@@ -44,5 +73,38 @@ class Hisat2(MakefilePackage):
install("hisat2-inspect-l", prefix.bin)
install("*.py", prefix.bin)
- def setup_run_environment(self, env):
- env.prepend_path("PATH", self.spec.prefix)
+ if "@2.2:" in spec:
+ install("hisat2-repeat", prefix.bin)
+
+ @run_after("install")
+ def filter_sbang(self):
+ with working_dir(self.prefix.bin):
+ pattern = "^#!.*/usr/bin/env python"
+ repl = "#!{0}".format(self.spec["python"].command.path)
+ files = [
+ "hisat2-build",
+ "hisat2-inspect",
+ ]
+ for file in files:
+ filter_file(pattern, repl, *files, backup=False)
+
+ pattern = "^#!.*/usr/bin/env perl"
+ repl = "#!{0}".format(self.spec["perl"].command.path)
+ files = [
+ "hisat2",
+ ]
+ for file in files:
+ filter_file(pattern, repl, *files, backup=False)
+
+ pattern = "^#!.*/usr/bin/env python3"
+ repl = "#!{0}".format(self.spec["python"].command.path)
+ files = glob.glob("*.py")
+ for file in files:
+ filter_file(pattern, repl, *files, backup=False)
+
+ with working_dir(self.prefix.scripts):
+ pattern = "^#!.*/usr/bin/perl"
+ repl = "#!{0}".format(self.spec["perl"].command.path)
+ files = glob.glob("*.pl")
+ for file in files:
+ filter_file(pattern, repl, *files, backup=False)
diff --git a/var/spack/repos/builtin/packages/hisat2/sra.patch b/var/spack/repos/builtin/packages/hisat2/sra.patch
new file mode 100644
index 0000000000..b7cbec035c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hisat2/sra.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2020-07-24 10:46:16.000000000 -0500
++++ b/Makefile 2023-01-12 20:28:08.919588735 -0600
+@@ -94,7 +94,7 @@
+ SERACH_INC =
+ ifeq (1,$(USE_SRA))
+ SRA_DEF = -DUSE_SRA
+- SRA_LIB = -lncbi-ngs-c++-static -lngs-c++-static -lncbi-vdb-static -ldl
++ SRA_LIB = -lncbi-ngs-c++-static -lngs-c++-static -lncbi-ngs-static -lncbi-vdb-static -ldl
+ SEARCH_INC += -I$(NCBI_NGS_DIR)/include -I$(NCBI_VDB_DIR)/include
+ SEARCH_LIBS += -L$(NCBI_NGS_DIR)/lib64 -L$(NCBI_VDB_DIR)/lib64
+ endif