spack/var/spack/repos/builtin/packages/fastqc/fastqc.patch
George Hartzell 6e1b3f621d Feature/add package for fastqc (#1573)
* Add package for fastqc

This tool is a java mess.  Their Way To Do It is to just copy the entire
tree into it's final resting place, make the perl script at the top
level executable and take it from there.

Yuck.

This package assumes that `set_executable` actually sets all the user
bits.  If that change doesn't go in, then something equivalent needs to
be done.

* Use chmod to make fastqc executable

I haven't gotten any feedback on changing set-executable, so switch to
using chmod (from the cuda package).

* Flake8 cleanup

* Install files neatly, don't just copy top level of dir

Rather than blindly copying everything in the distribution, carefully
put the necessary bits into reasonable places.  Neatness counts, etc...

This requires patching the `fastqc` perl script, so this commit adds a
patch file.

* Additional pep8 cleanup

* Let dependency handle adding jdk to PATH

* Flake8 cleanup

* Ensure that java is on PATH

I thought that the run dependency on the jdk would put
java on my PATH, but it does not appear to work.

For now, do it by hand.
2016-12-18 16:38:14 -08:00

31 lines
1.1 KiB
Diff

--- 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;