summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/pilon/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/pilon/package.py')
-rw-r--r--var/spack/repos/builtin/packages/pilon/package.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/pilon/package.py b/var/spack/repos/builtin/packages/pilon/package.py
new file mode 100644
index 0000000000..afcdfd4a44
--- /dev/null
+++ b/var/spack/repos/builtin/packages/pilon/package.py
@@ -0,0 +1,40 @@
+# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+import os.path
+
+
+class Pilon(Package):
+ """Pilon is an automated genome assembly improvement and variant
+ detection tool."""
+
+ homepage = "https://github.com/broadinstitute/pilon"
+ url = "https://github.com/broadinstitute/pilon/releases/download/v1.22/pilon-1.22.jar"
+
+ version('1.22', '3c45568dc1b878a9a0316410ec62ab04', expand=False)
+ version('1.13', '9e96b4cf4ea595b1996c7e9ca76498b5', expand=False)
+
+ depends_on('java@1.7:', type='run')
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.bin)
+ jar_file = 'pilon-{0}.jar'.format(self.version.dotted)
+ install(jar_file, prefix.bin)
+
+ # Set up a helper script to call java on the jar file,
+ # explicitly codes the path for java and the jar file.
+ script_sh = join_path(os.path.dirname(__file__), "pilon.sh")
+ script = prefix.bin.pilon
+ install(script_sh, script)
+ set_executable(script)
+
+ # Munge the helper script to explicitly point to java and the
+ # jar file.
+ java = self.spec['java'].prefix.bin.java
+ kwargs = {'ignore_absent': False, 'backup': False, 'string': False}
+ filter_file('^java', java, script, **kwargs)
+ filter_file('pilon-{0}.jar', join_path(prefix.bin, jar_file),
+ script, **kwargs)