summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch (renamed from var/spack/repos/builtin/packages/fastqc/fastqc.patch)0
-rw-r--r--var/spack/repos/builtin/packages/fastqc/fastqc_0.12.x.patch31
-rw-r--r--var/spack/repos/builtin/packages/fastqc/package.py12
3 files changed, 40 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/fastqc/fastqc.patch b/var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch
index a0a1155905..a0a1155905 100644
--- a/var/spack/repos/builtin/packages/fastqc/fastqc.patch
+++ b/var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch
diff --git a/var/spack/repos/builtin/packages/fastqc/fastqc_0.12.x.patch b/var/spack/repos/builtin/packages/fastqc/fastqc_0.12.x.patch
new file mode 100644
index 0000000000..1e4fd23c9c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fastqc/fastqc_0.12.x.patch
@@ -0,0 +1,31 @@
+--- fastqc.orig 2023-05-26 08:02:49.123718275 +0100
++++ fastqc 2023-05-26 08:12:19.980320240 +0100
+@@ -38,13 +38,21 @@
+ $delimiter = ';';
+ }
+
+-if ($ENV{CLASSPATH}) {
+- $ENV{CLASSPATH} .= "$delimiter$RealBin$delimiter$RealBin/htsjdk.jar$delimiter$RealBin/jbzip2-0.9.jar$delimiter$RealBin/cisd-jhdf5.jar";
+-}
+-else {
+- $ENV{CLASSPATH} = "$RealBin$delimiter$RealBin/htsjdk.jar$delimiter$RealBin/jbzip2-0.9.jar$delimiter$RealBin/cisd-jhdf5.jar";
+-}
+-
++# The lib dir is $RealBin/../lib
++# start with list of jars we need and prefix them with the lib dir
++# then stick CLASSPATH onto the front (empty or otherwise...)
++# then filter out anything that's empty (perhaps CLASSPATH...)
++# then join all the remainings bits with the delimiter.
++use File::Basename;
++use File::Spec::Functions;
++my $_lib = catfile(dirname($RealBin), 'lib');
++$ENV{CLASSPATH} =
++ join($delimiter,
++ grep {$_}
++ ($ENV{CLASSPATH},
++ $_lib,
++ map {"$_lib/$_"}
++ qw(htsjdk.jar jbzip2-0.9.jar cisd-jhdf5.jar)));
+
+ # We need to find the java interpreter. We'll start from the assumption that this
+ # is included in the path.
diff --git a/var/spack/repos/builtin/packages/fastqc/package.py b/var/spack/repos/builtin/packages/fastqc/package.py
index 247c00dab7..b2a1cf7b64 100644
--- a/var/spack/repos/builtin/packages/fastqc/package.py
+++ b/var/spack/repos/builtin/packages/fastqc/package.py
@@ -12,6 +12,7 @@ class Fastqc(Package):
homepage = "https://www.bioinformatics.babraham.ac.uk/projects/fastqc/"
url = "https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.5.zip"
+ version("0.12.1", sha256="5f4dba8780231a25a6b8e11ab2c238601920c9704caa5458d9de559575d58aa7")
version("0.11.9", sha256="15510a176ef798e40325b717cac556509fb218268cfdb9a35ea6776498321369")
version("0.11.7", sha256="59cf50876bbe5f363442eb989e43ae3eaab8d932c49e8cff2c1a1898dd721112")
version("0.11.5", sha256="dd7a5ad80ceed2588cf6d6ffe35e0f161c0d9977ed08355f5e4d9473282cbd66")
@@ -20,7 +21,8 @@ class Fastqc(Package):
depends_on("java", type="run")
depends_on("perl") # for fastqc "script", any perl will do
- patch("fastqc.patch", level=0)
+ patch("fastqc_0.12.x.patch", level=0, when="@0.12:")
+ patch("fastqc_0.11.x.patch", level=0, when="@:0.11.9")
def patch(self):
filter_file("/usr/bin/perl", self.spec["perl"].command.path, "fastqc", backup=False)
@@ -29,8 +31,12 @@ class Fastqc(Package):
mkdir(prefix.bin)
mkdir(prefix.lib)
install("fastqc", prefix.bin)
- for j in ["cisd-jhdf5.jar", "jbzip2-0.9.jar", "sam-1.103.jar"]:
- install(j, prefix.lib)
+ install("cisd-jhdf5.jar", prefix.lib)
+ install("jbzip2-0.9.jar", prefix.lib)
+ if self.spec.satisfies("@:0.11.9"):
+ install("sam-1.103.jar", prefix.lib)
+ else:
+ install("htsjdk.jar", prefix.lib)
for d in ["Configuration", "net", "org", "Templates", "uk"]:
install_tree(d, join_path(prefix.lib, d))
chmod = which("chmod")