From 1846bc5ed6384b55d10fc2085d47e4a519565476 Mon Sep 17 00:00:00 2001 From: Levi Baber Date: Thu, 12 Jul 2018 03:23:22 -0500 Subject: mitofates: more deps and a patch to make it functional (#8686) * mitofates: more deps and a patch to make it functional --- .../mitofates/DirichletRegulator_fast.patch | 13 +++++++++++ .../repos/builtin/packages/mitofates/package.py | 26 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch 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) -- cgit v1.2.3-70-g09d2