prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Installation issue: dbus (missing libsm dependency)
  
  <!-- Thanks for taking the time to report this build failure. To proceed with the report please:
  
  1. Title the issue "Installation issue: <name-of-the-package>".
  2. Provide the information required below.
  
  We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->
  
  I am trying to install visit, and I am hitting an error when it tries to install dbus.  This appears
  to be due to dbus depending on libSM (and through that libuuid), but not declaring that dependency in Spack. So in my build of visit, the libuuid dependency is picked up and set to use the spack installed libuuid via some other package visit depends on, but dbus ends up using the system installed libSM, and there is a mismatch between the two.  But the dbus
  package should not be linking against system libSM.
  
  ### Steps to reproduce the issue
  I am trying to install visit, and I am hitting an error when it tries to install dbus.  This appears
  to be 
  spack install dbus@1.12.8%gcc@8.4.0 ^libuuid@1.0.3
  eventually aborts with
    CCLD     dbus-run-session
  /lib/../lib64/libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0'
  /lib/../lib64/libSM.so: undefined reference to `uuid_generate@UUID_1.0'
  collect2: error: ld returned 1 exit status
  
  Error appears due to the attempt to link the system /lib64/libSM.so
  
  ### Information on your system
  spack debug report
  * **Spack:** 0.14.2
  * **Python:** 2.7.16
  * **Platform:** linux-rhel7-broadwell
  
  ### Additional information
  [spack-build-env.txt](https://github.com/spack/spack/files/5125717/spack-build-env.txt)
  [spack-build-out.txt](https://github.com/spack/spack/files/5125718/spack-build-out.txt)
  
  No maintainers for dbus
  
  ### General information
  
  <!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
  - [x ] I have run `spack debug report` and reported the version of Spack/Python/Platform
  - [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
  - [x ] I have uploaded the build log and environment files
  - [ x] I have searched the issues of this repo and believe this is not a duplicate
  
  
  </issue>
  <code>
  [start of var/spack/repos/builtin/packages/dbus/package.py]
  1 # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
  2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
  3 #
  4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
  5 
  6 from spack import *
  7 
  8 
  9 class Dbus(Package):
  10     """D-Bus is a message bus system, a simple way for applications to
  11        talk to one another. D-Bus supplies both a system daemon (for
  12        events such new hardware device printer queue ) and a
  13        per-user-login-session daemon (for general IPC needs among user
  14        applications). Also, the message bus is built on top of a
  15        general one-to-one message passing framework, which can be used
  16        by any two applications to communicate directly (without going
  17        through the message bus daemon)."""
  18 
  19     homepage = "http://dbus.freedesktop.org/"
  20     url      = "http://dbus.freedesktop.org/releases/dbus/dbus-1.8.8.tar.gz"
  21 
  22     version('1.12.8', sha256='e2dc99e7338303393b6663a98320aba6a63421bcdaaf571c8022f815e5896eb3')
  23     version('1.11.2', sha256='5abc4c57686fa82669ad0039830788f9b03fdc4fff487f0ccf6c9d56ba2645c9')
  24     version('1.9.0', sha256='38ebc695b5cbbd239e0f149aa5d5395f0051a0fec1b74f21ff2921b22a31c171')
  25     version('1.8.8', sha256='dfab263649a979d0fff64a30cac374891a8e9940350e41f3bbd7679af32bd1fd')
  26     version('1.8.6', sha256='eded83ca007b719f32761e60fd8b9ffd0f5796a4caf455b01b5a5ef740ebd23f')
  27     version('1.8.4', sha256='3ef63dc8d0111042071ee7f7bafa0650c6ce2d7be957ef0b7ec269495a651ff8')
  28     version('1.8.2', sha256='5689f7411165adc953f37974e276a3028db94447c76e8dd92efe910c6d3bae08')
  29 
  30     depends_on('pkgconfig', type='build')
  31     depends_on('expat')
  32     depends_on('glib')
  33 
  34     def install(self, spec, prefix):
  35         configure(
  36             "--prefix=%s" % prefix,
  37             "--disable-systemd",
  38             "--disable-launchd")
  39         make()
  40         make("install")
  41 
  42         # dbus needs a machine id generated after install
  43         dbus_uuidgen = Executable(join_path(prefix.bin, 'dbus-uuidgen'))
  44         dbus_uuidgen('--ensure')
  45
  [end of var/spack/repos/builtin/packages/dbus/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/dbus/package.py b/var/spack/repos/builtin/packages/dbus/package.py
  --- a/var/spack/repos/builtin/packages/dbus/package.py
  +++ b/var/spack/repos/builtin/packages/dbus/package.py
  @@ -30,6 +30,7 @@
       depends_on('pkgconfig', type='build')
       depends_on('expat')
       depends_on('glib')
  +    depends_on('libsm')
   
       def install(self, spec, prefix):
           configure(
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/dbus/package.py b/var/spack/repos/builtin/packages/dbus/package.py\n--- a/var/spack/repos/builtin/packages/dbus/package.py\n+++ b/var/spack/repos/builtin/packages/dbus/package.py\n@@ -30,6 +30,7 @@\n     depends_on('pkgconfig', type='build')\n     depends_on('expat')\n     depends_on('glib')\n+    depends_on('libsm')\n \n     def install(self, spec, prefix):\n         configure(\n", "issue": "Installation issue: dbus (missing libsm dependency)\n\r\n<!-- Thanks for taking the time to report this build failure. To proceed with the report please:\r\n\r\n1. Title the issue \"Installation issue: <name-of-the-package>\".\r\n2. Provide the information required below.\r\n\r\nWe encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->\r\n\r\nI am trying to install visit, and I am hitting an error when it tries to install dbus.  This appears\r\nto be due to dbus depending on libSM (and through that libuuid), but not declaring that dependency in Spack. So in my build of visit, the libuuid dependency is picked up and set to use the spack installed libuuid via some other package visit depends on, but dbus ends up using the system installed libSM, and there is a mismatch between the two.  But the dbus\r\npackage should not be linking against system libSM.\r\n\r\n### Steps to reproduce the issue\r\nI am trying to install visit, and I am hitting an error when it tries to install dbus.  This appears\r\nto be \r\nspack install dbus@1.12.8%gcc@8.4.0 ^libuuid@1.0.3\r\neventually aborts with\r\n  CCLD     dbus-run-session\r\n/lib/../lib64/libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0'\r\n/lib/../lib64/libSM.so: undefined reference to `uuid_generate@UUID_1.0'\r\ncollect2: error: ld returned 1 exit status\r\n\r\nError appears due to the attempt to link the system /lib64/libSM.so\r\n\r\n### Information on your system\r\nspack debug report\r\n* **Spack:** 0.14.2\r\n* **Python:** 2.7.16\r\n* **Platform:** linux-rhel7-broadwell\r\n\r\n### Additional information\r\n[spack-build-env.txt](https://github.com/spack/spack/files/5125717/spack-build-env.txt)\r\n[spack-build-out.txt](https://github.com/spack/spack/files/5125718/spack-build-out.txt)\r\n\r\nNo maintainers for dbus\r\n\r\n### General information\r\n\r\n<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->\r\n- [x ] I have run `spack debug report` and reported the version of Spack/Python/Platform\r\n- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers\r\n- [x ] I have uploaded the build log and environment files\r\n- [ x] I have searched the issues of this repo and believe this is not a duplicate\r\n\n", "before_files": [{"content": "# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass Dbus(Package):\n    \"\"\"D-Bus is a message bus system, a simple way for applications to\n       talk to one another. D-Bus supplies both a system daemon (for\n       events such new hardware device printer queue ) and a\n       per-user-login-session daemon (for general IPC needs among user\n       applications). Also, the message bus is built on top of a\n       general one-to-one message passing framework, which can be used\n       by any two applications to communicate directly (without going\n       through the message bus daemon).\"\"\"\n\n    homepage = \"http://dbus.freedesktop.org/\"\n    url      = \"http://dbus.freedesktop.org/releases/dbus/dbus-1.8.8.tar.gz\"\n\n    version('1.12.8', sha256='e2dc99e7338303393b6663a98320aba6a63421bcdaaf571c8022f815e5896eb3')\n    version('1.11.2', sha256='5abc4c57686fa82669ad0039830788f9b03fdc4fff487f0ccf6c9d56ba2645c9')\n    version('1.9.0', sha256='38ebc695b5cbbd239e0f149aa5d5395f0051a0fec1b74f21ff2921b22a31c171')\n    version('1.8.8', sha256='dfab263649a979d0fff64a30cac374891a8e9940350e41f3bbd7679af32bd1fd')\n    version('1.8.6', sha256='eded83ca007b719f32761e60fd8b9ffd0f5796a4caf455b01b5a5ef740ebd23f')\n    version('1.8.4', sha256='3ef63dc8d0111042071ee7f7bafa0650c6ce2d7be957ef0b7ec269495a651ff8')\n    version('1.8.2', sha256='5689f7411165adc953f37974e276a3028db94447c76e8dd92efe910c6d3bae08')\n\n    depends_on('pkgconfig', type='build')\n    depends_on('expat')\n    depends_on('glib')\n\n    def install(self, spec, prefix):\n        configure(\n            \"--prefix=%s\" % prefix,\n            \"--disable-systemd\",\n            \"--disable-launchd\")\n        make()\n        make(\"install\")\n\n        # dbus needs a machine id generated after install\n        dbus_uuidgen = Executable(join_path(prefix.bin, 'dbus-uuidgen'))\n        dbus_uuidgen('--ensure')\n", "path": "var/spack/repos/builtin/packages/dbus/package.py"}]}