From 110f8369273d29a57d0f8647fb6c2903ce148f0b Mon Sep 17 00:00:00 2001 From: George Young Date: Mon, 5 Jun 2023 16:07:51 +0100 Subject: fastqc: add 0.12.1, update patch files (#37934) * fastqc: add 0.12.1 * fastqc: add 0.12.1 * Update var/spack/repos/builtin/packages/fastqc/package.py Yeah, had considered doing the same, I'd just opted to maintain the status quo. All good. Co-authored-by: Alec Scott * Update package.py Style fiddles to make the bot contented. --------- Co-authored-by: LMS Bioinformatics Co-authored-by: Alec Scott --- .../repos/builtin/packages/fastqc/fastqc.patch | 30 --------------------- .../builtin/packages/fastqc/fastqc_0.11.x.patch | 30 +++++++++++++++++++++ .../builtin/packages/fastqc/fastqc_0.12.x.patch | 31 ++++++++++++++++++++++ var/spack/repos/builtin/packages/fastqc/package.py | 12 ++++++--- 4 files changed, 70 insertions(+), 33 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/fastqc/fastqc.patch create mode 100644 var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch create mode 100644 var/spack/repos/builtin/packages/fastqc/fastqc_0.12.x.patch diff --git a/var/spack/repos/builtin/packages/fastqc/fastqc.patch b/var/spack/repos/builtin/packages/fastqc/fastqc.patch deleted file mode 100644 index a0a1155905..0000000000 --- a/var/spack/repos/builtin/packages/fastqc/fastqc.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- fastqc.orig 2015-11-20 09:25:00.000000000 +0000 -+++ fastqc 2016-10-24 19:06:16.734000000 +0000 -@@ -38,12 +38,21 @@ - $delimiter = ';'; - } - --if ($ENV{CLASSPATH}) { -- $ENV{CLASSPATH} .= "$delimiter$RealBin$delimiter$RealBin/sam-1.103.jar$delimiter$RealBin/jbzip2-0.9.jar$delimiter$RealBin/cisd-jhdf5.jar"; --} --else { -- $ENV{CLASSPATH} = "$RealBin$delimiter$RealBin/sam-1.103.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(sam-1.103.jar jbzip2-0.9.jar cisd-jhdf5.jar))); - - my @java_args; - my @files; diff --git a/var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch b/var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch new file mode 100644 index 0000000000..a0a1155905 --- /dev/null +++ b/var/spack/repos/builtin/packages/fastqc/fastqc_0.11.x.patch @@ -0,0 +1,30 @@ +--- fastqc.orig 2015-11-20 09:25:00.000000000 +0000 ++++ fastqc 2016-10-24 19:06:16.734000000 +0000 +@@ -38,12 +38,21 @@ + $delimiter = ';'; + } + +-if ($ENV{CLASSPATH}) { +- $ENV{CLASSPATH} .= "$delimiter$RealBin$delimiter$RealBin/sam-1.103.jar$delimiter$RealBin/jbzip2-0.9.jar$delimiter$RealBin/cisd-jhdf5.jar"; +-} +-else { +- $ENV{CLASSPATH} = "$RealBin$delimiter$RealBin/sam-1.103.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(sam-1.103.jar jbzip2-0.9.jar cisd-jhdf5.jar))); + + my @java_args; + my @files; 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") -- cgit v1.2.3-70-g09d2