summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorLevi Baber <baberlevi@gmail.com>2018-07-12 03:23:22 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2018-07-12 10:23:22 +0200
commit1846bc5ed6384b55d10fc2085d47e4a519565476 (patch)
treefd6a8dd42af0558c8084451d7b67732c80eb0d95 /var
parentecff47538e7064c7c5529abf0213a1c9378c6010 (diff)
downloadspack-1846bc5ed6384b55d10fc2085d47e4a519565476.tar.gz
spack-1846bc5ed6384b55d10fc2085d47e4a519565476.tar.bz2
spack-1846bc5ed6384b55d10fc2085d47e4a519565476.tar.xz
spack-1846bc5ed6384b55d10fc2085d47e4a519565476.zip
mitofates: more deps and a patch to make it functional (#8686)
* mitofates: more deps and a patch to make it functional
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch13
-rw-r--r--var/spack/repos/builtin/packages/mitofates/package.py26
2 files changed, 39 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch b/var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch
new file mode 100644
index 0000000000..85e836878e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch
@@ -0,0 +1,13 @@
+--- a/bin/modules/DirichletRegulator_fast.pm 2014-10-23 01:59:55.000000000 -0500
++++ b/bin/modules/DirichletRegulator_fast.pm 2018-07-11 11:19:07.814358134 -0500
+@@ -10,9 +10,7 @@
+ use strict;
+ use warnings;
+ use FindBin qw($Bin);
+-use Inline (Config =>
+- DIRECTORY => "$Bin/modules/_Inline/",
+- );
++use Inline;
+ use Inline 'C';
+
+ # Sub-routin: DirichletParser
diff --git a/var/spack/repos/builtin/packages/mitofates/package.py b/var/spack/repos/builtin/packages/mitofates/package.py
index 8b968af5b5..4dff8ff5c0 100644
--- a/var/spack/repos/builtin/packages/mitofates/package.py
+++ b/var/spack/repos/builtin/packages/mitofates/package.py
@@ -23,6 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
+import glob
class Mitofates(Package):
@@ -36,7 +37,32 @@ class Mitofates(Package):
depends_on('libsvm')
depends_on('perl', type='run')
+ depends_on('perl-inline-c', type='run')
+ depends_on('perl-perl6-slurp', type='run')
+ depends_on('perl-math-cephes', type='run')
+
+ # The DirichletRegulator_fast.pm sets the perl Inline directory
+ # to be inside the deployed source (which won't be writable by
+ # the end user of site wide deployed software.
+ # Removing that config entry will cause the inline module to auto
+ # create a directory in the user's homedir instead
+ patch('DirichletRegulator_fast.patch')
+
+ def patch(self):
+ perlscripts = FileFilter('MitoFates.pl')
+ perlscripts.filter('#!/usr/bin/perl', '#!/usr/bin/env perl')
+
+ # other perl module files probably should get this filter too
+ with working_dir(join_path(self.stage.source_path, 'bin/modules')):
+ perlmodules = glob.glob('*.pm')
+ filter_file('#!/usr/bin/perl', '#!/usr/bin/env perl', *perlmodules)
def install(self, spec, prefix):
install_tree('bin', prefix.bin)
install('MitoFates.pl', prefix)
+ chmod = which('chmod')
+ chmod('+x', join_path(prefix, 'MitoFates.pl'))
+
+ def setup_environment(self, spack_env, run_env):
+ # We want the main MitoFates.pl script in the path
+ run_env.prepend_path('PATH', self.prefix)