prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  bison doesn't find m4 at run time
  While building `flex`, I had `bison` fail because it could not execute `m4`. The reason was that I had uninstalled the `m4` package (via Spack) which `bison` installed as its build dependency. Then, `bison` failed since this `m4` executable did not exist any more.
  
  I think `m4` needs to be a run-time dependency of `bison` as well.
  
  </issue>
  <code>
  [start of var/spack/repos/builtin/packages/autoconf/package.py]
  1 ##############################################################################
  2 # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
  3 # Produced at the Lawrence Livermore National Laboratory.
  4 #
  5 # This file is part of Spack.
  6 # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
  7 # LLNL-CODE-647188
  8 #
  9 # For details, see https://github.com/llnl/spack
  10 # Please also see the LICENSE file for our notice and the LGPL.
  11 #
  12 # This program is free software; you can redistribute it and/or modify
  13 # it under the terms of the GNU Lesser General Public License (as
  14 # published by the Free Software Foundation) version 2.1, February 1999.
  15 #
  16 # This program is distributed in the hope that it will be useful, but
  17 # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
  18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
  19 # conditions of the GNU Lesser General Public License for more details.
  20 #
  21 # You should have received a copy of the GNU Lesser General Public
  22 # License along with this program; if not, write to the Free Software
  23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24 ##############################################################################
  25 from spack import *
  26 
  27 
  28 class Autoconf(AutotoolsPackage):
  29     """Autoconf -- system configuration part of autotools"""
  30 
  31     homepage = 'https://www.gnu.org/software/autoconf/'
  32     url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz'
  33 
  34     version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b')
  35     version('2.62', '6c1f3b3734999035d77da5024aab4fbd')
  36     version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0')
  37     version('2.13', '9de56d4a161a723228220b0f425dc711')
  38 
  39     depends_on('m4@1.4.6:',   type='build')
  40 
  41     build_directory = 'spack-build'
  42 
  43     def _make_executable(self, name):
  44         return Executable(join_path(self.prefix.bin, name))
  45 
  46     def setup_dependent_package(self, module, dependent_spec):
  47         # Autoconf is very likely to be a build dependency,
  48         # so we add the tools it provides to the dependent module
  49         executables = ['autoconf',
  50                        'autoheader',
  51                        'autom4te',
  52                        'autoreconf',
  53                        'autoscan',
  54                        'autoupdate',
  55                        'ifnames']
  56         for name in executables:
  57             setattr(module, name, self._make_executable(name))
  58
  [end of var/spack/repos/builtin/packages/autoconf/package.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py
  --- a/var/spack/repos/builtin/packages/autoconf/package.py
  +++ b/var/spack/repos/builtin/packages/autoconf/package.py
  @@ -36,7 +36,9 @@
       version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0')
       version('2.13', '9de56d4a161a723228220b0f425dc711')
   
  -    depends_on('m4@1.4.6:',   type='build')
  +    # Note: m4 is not a pure build-time dependency of autoconf. m4 is
  +    # needed when autoconf runs, not only when autoconf is built.
  +    depends_on('m4@1.4.6:', type=('build', 'run'))
   
       build_directory = 'spack-build'
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py\n--- a/var/spack/repos/builtin/packages/autoconf/package.py\n+++ b/var/spack/repos/builtin/packages/autoconf/package.py\n@@ -36,7 +36,9 @@\n     version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0')\n     version('2.13', '9de56d4a161a723228220b0f425dc711')\n \n-    depends_on('m4@1.4.6:',   type='build')\n+    # Note: m4 is not a pure build-time dependency of autoconf. m4 is\n+    # needed when autoconf runs, not only when autoconf is built.\n+    depends_on('m4@1.4.6:', type=('build', 'run'))\n \n     build_directory = 'spack-build'\n", "issue": "bison doesn't find m4 at run time\nWhile building `flex`, I had `bison` fail because it could not execute `m4`. The reason was that I had uninstalled the `m4` package (via Spack) which `bison` installed as its build dependency. Then, `bison` failed since this `m4` executable did not exist any more.\r\n\r\nI think `m4` needs to be a run-time dependency of `bison` as well.\n", "before_files": [{"content": "##############################################################################\n# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory.\n#\n# This file is part of Spack.\n# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.\n# LLNL-CODE-647188\n#\n# For details, see https://github.com/llnl/spack\n# Please also see the LICENSE file for our notice and the LGPL.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License (as\n# published by the Free Software Foundation) version 2.1, February 1999.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and\n# conditions of the GNU Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n##############################################################################\nfrom spack import *\n\n\nclass Autoconf(AutotoolsPackage):\n    \"\"\"Autoconf -- system configuration part of autotools\"\"\"\n\n    homepage = 'https://www.gnu.org/software/autoconf/'\n    url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz'\n\n    version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b')\n    version('2.62', '6c1f3b3734999035d77da5024aab4fbd')\n    version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0')\n    version('2.13', '9de56d4a161a723228220b0f425dc711')\n\n    depends_on('m4@1.4.6:',   type='build')\n\n    build_directory = 'spack-build'\n\n    def _make_executable(self, name):\n        return Executable(join_path(self.prefix.bin, name))\n\n    def setup_dependent_package(self, module, dependent_spec):\n        # Autoconf is very likely to be a build dependency,\n        # so we add the tools it provides to the dependent module\n        executables = ['autoconf',\n                       'autoheader',\n                       'autom4te',\n                       'autoreconf',\n                       'autoscan',\n                       'autoupdate',\n                       'ifnames']\n        for name in executables:\n            setattr(module, name, self._make_executable(name))\n", "path": "var/spack/repos/builtin/packages/autoconf/package.py"}]}