prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  MUMmer easyblock corrupts binaries by running apply_regex_substitutions
  I ran into weird issues with a PR for a toolchain bump of the existing MUMmer easyconfig, see:
  https://github.com/easybuilders/easybuild-easyconfigs/pull/14474
  
  The resulting executable doesn't work at all:
  ```
  $ file ./mummer
  ./mummer: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked error reading (Invalid argument)
  
  $ ./mummer
  Segmentation fault (core dumped)
  ```
  
  After some debugging, I found that the installation step does a `apply_regex_substitutions` on all files in the build directory, including binaries:
  https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/m/mummer.py#L75
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `easybuild/easyblocks/m/mummer.py`
  Content:
  ```
  1 ##
  2 # Copyright 2009-2021 Ghent University
  3 #
  4 # This file is part of EasyBuild,
  5 # originally created by the HPC team of the University of Ghent (http://ugent.be/hpc).
  6 #
  7 # https://github.com/easybuilders/easybuild
  8 #
  9 # EasyBuild is free software: you can redistribute it and/or modify
  10 # it under the terms of the GNU General Public License as published by
  11 # the Free Software Foundation v2.
  12 #
  13 # EasyBuild is distributed in the hope that it will be useful,
  14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16 # GNU General Public License for more details.
  17 #
  18 # You should have received a copy of the GNU General Public License
  19 # along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.
  20 #
  21 # This work implements a part of the HPCBIOS project and is a component of the policy:
  22 # http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-94.html
  23 ##
  24 """
  25 EasyBuild support for building and installing MUMmer, implemented as an easyblock
  26 
  27 @author: Cedric Laczny (Uni.Lu)
  28 @author: Fotis Georgatos (Uni.Lu)
  29 @author: Kenneth Hoste (Ghent University)
  30 @author: Jens Timmerman (Ghent University)
  31 @author: Matt Lesko (NIH/NHGRI)
  32 """
  33 import os
  34 
  35 from easybuild.easyblocks.generic.configuremake import ConfigureMake
  36 from easybuild.easyblocks.perl import get_major_perl_version
  37 from easybuild.tools.filetools import apply_regex_substitutions, copy_file, mkdir
  38 from easybuild.tools.run import run_cmd
  39 
  40 
  41 class EB_MUMmer(ConfigureMake):
  42     """Support for building and installing MUMmer (rapidly aligning entire genomes)."""
  43 
  44     def __init__(self, *args, **kwargs):
  45         """Define list of bin/aux_bin files."""
  46 
  47         super(EB_MUMmer, self).__init__(*args, **kwargs)
  48 
  49         self.bin_files = [
  50             "mummer", "annotate", "combineMUMs", "delta-filter", "gaps", "mgaps",
  51             "repeat-match", "show-aligns", "show-coords", "show-tiling", "show-snps",
  52             "show-diff", "exact-tandems", "mapview", "mummerplot", "nucmer", "promer",
  53             "run-mummer1", "run-mummer3", "nucmer2xfig", "dnadiff",
  54         ]
  55         self.script_files = ["Foundation.pm"]
  56         self.aux_bin_files = ["postnuc", "postpro", "prenuc", "prepro"]
  57 
  58     def configure_step(self):
  59         """Configure MUMmer build by running make check and setting make options."""
  60 
  61         cmd = "%s make check %s" % (self.cfg['preconfigopts'], self.cfg['configopts'])
  62         run_cmd(cmd, log_all=True, simple=True, log_output=True)
  63 
  64         self.cfg.update('buildopts', 'all')
  65 
  66     def install_step(self):
  67         """Patch files to avoid use of build dir, install by copying files to install dir."""
  68         # patch build dir out of files, replace by install dir
  69         pattern = r'%s' % self.cfg['start_dir']
  70         if pattern[-1] == os.path.sep:
  71             pattern = pattern[:-1]
  72 
  73         installdir_bin = os.path.join(self.installdir, 'bin')
  74 
  75         for fil in [f for f in os.listdir(self.cfg['start_dir']) if os.path.isfile(f)]:
  76             self.log.debug("Patching build dir out of %s, replacing by install bin dir)", fil)
  77             apply_regex_substitutions(fil, [(pattern, installdir_bin)])
  78 
  79         # copy files to install dir
  80         file_tuples = [
  81             (self.cfg['start_dir'], 'bin', self.bin_files),
  82             (os.path.join(self.cfg['start_dir'], 'aux_bin'), os.path.join('bin', 'aux_bin'), self.aux_bin_files),
  83             (os.path.join(self.cfg['start_dir'], 'scripts'), os.path.join('bin', 'scripts'), self.script_files),
  84         ]
  85         for srcdir, dest, files in file_tuples:
  86             destdir = os.path.join(self.installdir, dest)
  87             mkdir(destdir, parents=True)
  88             for filename in files:
  89                 srcfile = os.path.join(srcdir, filename)
  90                 copy_file(srcfile, destdir)
  91 
  92     def make_module_extra(self):
  93         """Correctly prepend $PATH and $PERLXLIB for MUMmer."""
  94         # determine major version for Perl (e.g. '5'), required for e.g. $PERL5LIB
  95         perlmajver = get_major_perl_version()
  96 
  97         # set $PATH and $PERLXLIB correctly
  98         txt = super(EB_MUMmer, self).make_module_extra()
  99         txt += self.module_generator.prepend_paths("PATH", ['bin'])
  100         txt += self.module_generator.prepend_paths("PATH", ['bin/aux_bin'])
  101         txt += self.module_generator.prepend_paths("PERL%sLIB" % perlmajver, ['bin/scripts'])
  102         return txt
  103 
  104     def sanity_check_step(self):
  105         """Custom sanity check for MUMmer."""
  106 
  107         custom_paths = {
  108             'files':
  109                 ['bin/%s' % x for x in self.bin_files] +
  110                 ['bin/aux_bin/%s' % x for x in self.aux_bin_files] +
  111                 ['bin/scripts/%s' % x for x in self.script_files],
  112             'dirs': []
  113         }
  114         super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths)
  115
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/easybuild/easyblocks/m/mummer.py b/easybuild/easyblocks/m/mummer.py
  --- a/easybuild/easyblocks/m/mummer.py
  +++ b/easybuild/easyblocks/m/mummer.py
  @@ -34,7 +34,7 @@
   
   from easybuild.easyblocks.generic.configuremake import ConfigureMake
   from easybuild.easyblocks.perl import get_major_perl_version
  -from easybuild.tools.filetools import apply_regex_substitutions, copy_file, mkdir
  +from easybuild.tools.filetools import apply_regex_substitutions, copy_file, is_binary, mkdir, read_file
   from easybuild.tools.run import run_cmd
   
   
  @@ -63,6 +63,14 @@
   
           self.cfg.update('buildopts', 'all')
   
  +    def build_step(self):
  +        """Custom build procedure for MUMmer."""
  +
  +        # make sure that compiler options specified by EasyBuild are used
  +        self.cfg.update('buildopts', 'CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS"')
  +
  +        super(EB_MUMmer, self).build_step()
  +
       def install_step(self):
           """Patch files to avoid use of build dir, install by copying files to install dir."""
           # patch build dir out of files, replace by install dir
  @@ -73,8 +81,11 @@
           installdir_bin = os.path.join(self.installdir, 'bin')
   
           for fil in [f for f in os.listdir(self.cfg['start_dir']) if os.path.isfile(f)]:
  -            self.log.debug("Patching build dir out of %s, replacing by install bin dir)", fil)
  -            apply_regex_substitutions(fil, [(pattern, installdir_bin)])
  +            # only use apply_regex_substitutions() on non-binary files
  +            # for more details, see https://github.com/easybuilders/easybuild-easyblocks/issues/2629)
  +            if not is_binary(read_file(fil, mode='rb')):
  +                self.log.debug("Patching build dir out of %s, replacing by install bin dir)", fil)
  +                apply_regex_substitutions(fil, [(pattern, installdir_bin)])
   
           # copy files to install dir
           file_tuples = [
  @@ -96,7 +107,6 @@
   
           # set $PATH and $PERLXLIB correctly
           txt = super(EB_MUMmer, self).make_module_extra()
  -        txt += self.module_generator.prepend_paths("PATH", ['bin'])
           txt += self.module_generator.prepend_paths("PATH", ['bin/aux_bin'])
           txt += self.module_generator.prepend_paths("PERL%sLIB" % perlmajver, ['bin/scripts'])
           return txt
  @@ -111,4 +121,7 @@
                   ['bin/scripts/%s' % x for x in self.script_files],
               'dirs': []
           }
  -        super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths)
  +
  +        custom_commands = ["mummer -h"]
  +
  +        super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
  
verification_info: {"golden_diff": "diff --git a/easybuild/easyblocks/m/mummer.py b/easybuild/easyblocks/m/mummer.py\n--- a/easybuild/easyblocks/m/mummer.py\n+++ b/easybuild/easyblocks/m/mummer.py\n@@ -34,7 +34,7 @@\n \n from easybuild.easyblocks.generic.configuremake import ConfigureMake\n from easybuild.easyblocks.perl import get_major_perl_version\n-from easybuild.tools.filetools import apply_regex_substitutions, copy_file, mkdir\n+from easybuild.tools.filetools import apply_regex_substitutions, copy_file, is_binary, mkdir, read_file\n from easybuild.tools.run import run_cmd\n \n \n@@ -63,6 +63,14 @@\n \n         self.cfg.update('buildopts', 'all')\n \n+    def build_step(self):\n+        \"\"\"Custom build procedure for MUMmer.\"\"\"\n+\n+        # make sure that compiler options specified by EasyBuild are used\n+        self.cfg.update('buildopts', 'CXXFLAGS=\"$CXXFLAGS\" CFLAGS=\"$CFLAGS\"')\n+\n+        super(EB_MUMmer, self).build_step()\n+\n     def install_step(self):\n         \"\"\"Patch files to avoid use of build dir, install by copying files to install dir.\"\"\"\n         # patch build dir out of files, replace by install dir\n@@ -73,8 +81,11 @@\n         installdir_bin = os.path.join(self.installdir, 'bin')\n \n         for fil in [f for f in os.listdir(self.cfg['start_dir']) if os.path.isfile(f)]:\n-            self.log.debug(\"Patching build dir out of %s, replacing by install bin dir)\", fil)\n-            apply_regex_substitutions(fil, [(pattern, installdir_bin)])\n+            # only use apply_regex_substitutions() on non-binary files\n+            # for more details, see https://github.com/easybuilders/easybuild-easyblocks/issues/2629)\n+            if not is_binary(read_file(fil, mode='rb')):\n+                self.log.debug(\"Patching build dir out of %s, replacing by install bin dir)\", fil)\n+                apply_regex_substitutions(fil, [(pattern, installdir_bin)])\n \n         # copy files to install dir\n         file_tuples = [\n@@ -96,7 +107,6 @@\n \n         # set $PATH and $PERLXLIB correctly\n         txt = super(EB_MUMmer, self).make_module_extra()\n-        txt += self.module_generator.prepend_paths(\"PATH\", ['bin'])\n         txt += self.module_generator.prepend_paths(\"PATH\", ['bin/aux_bin'])\n         txt += self.module_generator.prepend_paths(\"PERL%sLIB\" % perlmajver, ['bin/scripts'])\n         return txt\n@@ -111,4 +121,7 @@\n                 ['bin/scripts/%s' % x for x in self.script_files],\n             'dirs': []\n         }\n-        super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths)\n+\n+        custom_commands = [\"mummer -h\"]\n+\n+        super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)\n", "issue": "MUMmer easyblock corrupts binaries by running apply_regex_substitutions\nI ran into weird issues with a PR for a toolchain bump of the existing MUMmer easyconfig, see:\r\nhttps://github.com/easybuilders/easybuild-easyconfigs/pull/14474\r\n\r\nThe resulting executable doesn't work at all:\r\n```\r\n$ file ./mummer\r\n./mummer: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked error reading (Invalid argument)\r\n\r\n$ ./mummer\r\nSegmentation fault (core dumped)\r\n```\r\n\r\nAfter some debugging, I found that the installation step does a `apply_regex_substitutions` on all files in the build directory, including binaries:\r\nhttps://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/m/mummer.py#L75\r\n\n", "before_files": [{"content": "##\n# Copyright 2009-2021 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of the University of Ghent (http://ugent.be/hpc).\n#\n# https://github.com/easybuilders/easybuild\n#\n# EasyBuild is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation v2.\n#\n# EasyBuild is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.\n#\n# This work implements a part of the HPCBIOS project and is a component of the policy:\n# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-94.html\n##\n\"\"\"\nEasyBuild support for building and installing MUMmer, implemented as an easyblock\n\n@author: Cedric Laczny (Uni.Lu)\n@author: Fotis Georgatos (Uni.Lu)\n@author: Kenneth Hoste (Ghent University)\n@author: Jens Timmerman (Ghent University)\n@author: Matt Lesko (NIH/NHGRI)\n\"\"\"\nimport os\n\nfrom easybuild.easyblocks.generic.configuremake import ConfigureMake\nfrom easybuild.easyblocks.perl import get_major_perl_version\nfrom easybuild.tools.filetools import apply_regex_substitutions, copy_file, mkdir\nfrom easybuild.tools.run import run_cmd\n\n\nclass EB_MUMmer(ConfigureMake):\n    \"\"\"Support for building and installing MUMmer (rapidly aligning entire genomes).\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Define list of bin/aux_bin files.\"\"\"\n\n        super(EB_MUMmer, self).__init__(*args, **kwargs)\n\n        self.bin_files = [\n            \"mummer\", \"annotate\", \"combineMUMs\", \"delta-filter\", \"gaps\", \"mgaps\",\n            \"repeat-match\", \"show-aligns\", \"show-coords\", \"show-tiling\", \"show-snps\",\n            \"show-diff\", \"exact-tandems\", \"mapview\", \"mummerplot\", \"nucmer\", \"promer\",\n            \"run-mummer1\", \"run-mummer3\", \"nucmer2xfig\", \"dnadiff\",\n        ]\n        self.script_files = [\"Foundation.pm\"]\n        self.aux_bin_files = [\"postnuc\", \"postpro\", \"prenuc\", \"prepro\"]\n\n    def configure_step(self):\n        \"\"\"Configure MUMmer build by running make check and setting make options.\"\"\"\n\n        cmd = \"%s make check %s\" % (self.cfg['preconfigopts'], self.cfg['configopts'])\n        run_cmd(cmd, log_all=True, simple=True, log_output=True)\n\n        self.cfg.update('buildopts', 'all')\n\n    def install_step(self):\n        \"\"\"Patch files to avoid use of build dir, install by copying files to install dir.\"\"\"\n        # patch build dir out of files, replace by install dir\n        pattern = r'%s' % self.cfg['start_dir']\n        if pattern[-1] == os.path.sep:\n            pattern = pattern[:-1]\n\n        installdir_bin = os.path.join(self.installdir, 'bin')\n\n        for fil in [f for f in os.listdir(self.cfg['start_dir']) if os.path.isfile(f)]:\n            self.log.debug(\"Patching build dir out of %s, replacing by install bin dir)\", fil)\n            apply_regex_substitutions(fil, [(pattern, installdir_bin)])\n\n        # copy files to install dir\n        file_tuples = [\n            (self.cfg['start_dir'], 'bin', self.bin_files),\n            (os.path.join(self.cfg['start_dir'], 'aux_bin'), os.path.join('bin', 'aux_bin'), self.aux_bin_files),\n            (os.path.join(self.cfg['start_dir'], 'scripts'), os.path.join('bin', 'scripts'), self.script_files),\n        ]\n        for srcdir, dest, files in file_tuples:\n            destdir = os.path.join(self.installdir, dest)\n            mkdir(destdir, parents=True)\n            for filename in files:\n                srcfile = os.path.join(srcdir, filename)\n                copy_file(srcfile, destdir)\n\n    def make_module_extra(self):\n        \"\"\"Correctly prepend $PATH and $PERLXLIB for MUMmer.\"\"\"\n        # determine major version for Perl (e.g. '5'), required for e.g. $PERL5LIB\n        perlmajver = get_major_perl_version()\n\n        # set $PATH and $PERLXLIB correctly\n        txt = super(EB_MUMmer, self).make_module_extra()\n        txt += self.module_generator.prepend_paths(\"PATH\", ['bin'])\n        txt += self.module_generator.prepend_paths(\"PATH\", ['bin/aux_bin'])\n        txt += self.module_generator.prepend_paths(\"PERL%sLIB\" % perlmajver, ['bin/scripts'])\n        return txt\n\n    def sanity_check_step(self):\n        \"\"\"Custom sanity check for MUMmer.\"\"\"\n\n        custom_paths = {\n            'files':\n                ['bin/%s' % x for x in self.bin_files] +\n                ['bin/aux_bin/%s' % x for x in self.aux_bin_files] +\n                ['bin/scripts/%s' % x for x in self.script_files],\n            'dirs': []\n        }\n        super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths)\n", "path": "easybuild/easyblocks/m/mummer.py"}], "after_files": [{"content": "##\n# Copyright 2009-2021 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of the University of Ghent (http://ugent.be/hpc).\n#\n# https://github.com/easybuilders/easybuild\n#\n# EasyBuild is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation v2.\n#\n# EasyBuild is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.\n#\n# This work implements a part of the HPCBIOS project and is a component of the policy:\n# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-94.html\n##\n\"\"\"\nEasyBuild support for building and installing MUMmer, implemented as an easyblock\n\n@author: Cedric Laczny (Uni.Lu)\n@author: Fotis Georgatos (Uni.Lu)\n@author: Kenneth Hoste (Ghent University)\n@author: Jens Timmerman (Ghent University)\n@author: Matt Lesko (NIH/NHGRI)\n\"\"\"\nimport os\n\nfrom easybuild.easyblocks.generic.configuremake import ConfigureMake\nfrom easybuild.easyblocks.perl import get_major_perl_version\nfrom easybuild.tools.filetools import apply_regex_substitutions, copy_file, is_binary, mkdir, read_file\nfrom easybuild.tools.run import run_cmd\n\n\nclass EB_MUMmer(ConfigureMake):\n    \"\"\"Support for building and installing MUMmer (rapidly aligning entire genomes).\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Define list of bin/aux_bin files.\"\"\"\n\n        super(EB_MUMmer, self).__init__(*args, **kwargs)\n\n        self.bin_files = [\n            \"mummer\", \"annotate\", \"combineMUMs\", \"delta-filter\", \"gaps\", \"mgaps\",\n            \"repeat-match\", \"show-aligns\", \"show-coords\", \"show-tiling\", \"show-snps\",\n            \"show-diff\", \"exact-tandems\", \"mapview\", \"mummerplot\", \"nucmer\", \"promer\",\n            \"run-mummer1\", \"run-mummer3\", \"nucmer2xfig\", \"dnadiff\",\n        ]\n        self.script_files = [\"Foundation.pm\"]\n        self.aux_bin_files = [\"postnuc\", \"postpro\", \"prenuc\", \"prepro\"]\n\n    def configure_step(self):\n        \"\"\"Configure MUMmer build by running make check and setting make options.\"\"\"\n\n        cmd = \"%s make check %s\" % (self.cfg['preconfigopts'], self.cfg['configopts'])\n        run_cmd(cmd, log_all=True, simple=True, log_output=True)\n\n        self.cfg.update('buildopts', 'all')\n\n    def build_step(self):\n        \"\"\"Custom build procedure for MUMmer.\"\"\"\n\n        # make sure that compiler options specified by EasyBuild are used\n        self.cfg.update('buildopts', 'CXXFLAGS=\"$CXXFLAGS\" CFLAGS=\"$CFLAGS\"')\n\n        super(EB_MUMmer, self).build_step()\n\n    def install_step(self):\n        \"\"\"Patch files to avoid use of build dir, install by copying files to install dir.\"\"\"\n        # patch build dir out of files, replace by install dir\n        pattern = r'%s' % self.cfg['start_dir']\n        if pattern[-1] == os.path.sep:\n            pattern = pattern[:-1]\n\n        installdir_bin = os.path.join(self.installdir, 'bin')\n\n        for fil in [f for f in os.listdir(self.cfg['start_dir']) if os.path.isfile(f)]:\n            # only use apply_regex_substitutions() on non-binary files\n            # for more details, see https://github.com/easybuilders/easybuild-easyblocks/issues/2629)\n            if not is_binary(read_file(fil, mode='rb')):\n                self.log.debug(\"Patching build dir out of %s, replacing by install bin dir)\", fil)\n                apply_regex_substitutions(fil, [(pattern, installdir_bin)])\n\n        # copy files to install dir\n        file_tuples = [\n            (self.cfg['start_dir'], 'bin', self.bin_files),\n            (os.path.join(self.cfg['start_dir'], 'aux_bin'), os.path.join('bin', 'aux_bin'), self.aux_bin_files),\n            (os.path.join(self.cfg['start_dir'], 'scripts'), os.path.join('bin', 'scripts'), self.script_files),\n        ]\n        for srcdir, dest, files in file_tuples:\n            destdir = os.path.join(self.installdir, dest)\n            mkdir(destdir, parents=True)\n            for filename in files:\n                srcfile = os.path.join(srcdir, filename)\n                copy_file(srcfile, destdir)\n\n    def make_module_extra(self):\n        \"\"\"Correctly prepend $PATH and $PERLXLIB for MUMmer.\"\"\"\n        # determine major version for Perl (e.g. '5'), required for e.g. $PERL5LIB\n        perlmajver = get_major_perl_version()\n\n        # set $PATH and $PERLXLIB correctly\n        txt = super(EB_MUMmer, self).make_module_extra()\n        txt += self.module_generator.prepend_paths(\"PATH\", ['bin/aux_bin'])\n        txt += self.module_generator.prepend_paths(\"PERL%sLIB\" % perlmajver, ['bin/scripts'])\n        return txt\n\n    def sanity_check_step(self):\n        \"\"\"Custom sanity check for MUMmer.\"\"\"\n\n        custom_paths = {\n            'files':\n                ['bin/%s' % x for x in self.bin_files] +\n                ['bin/aux_bin/%s' % x for x in self.aux_bin_files] +\n                ['bin/scripts/%s' % x for x in self.script_files],\n            'dirs': []\n        }\n\n        custom_commands = [\"mummer -h\"]\n\n        super(EB_MUMmer, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)\n", "path": "easybuild/easyblocks/m/mummer.py"}]}