prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Jpeg recipe is broken
  It is missing /home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/Application.mk
  Perpaps just the path is incorrect?
  
  ```
  [INFO]:    Prebuilding jpeg for armeabi
  [INFO]:    jpeg has no prebuild_armeabi, skipping
  [DEBUG]:   -> running cp /home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/Application.mk /home/brussee/.local/share/python-for-android/build/other_builds/jpeg/armeabi/jpeg/Application.mk
  [DEBUG]:    /bin/cp: cannot stat ‘/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/Application.mk’: No such file or directory
  Traceback (most recent call last):
    File "/home/brussee/.local/bin/p4a", line 9, in <module>
      load_entry_point('python-for-android==0.3', 'console_scripts', 'p4a')()
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 708, in main
      ToolchainCL()
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 323, in __init__
      getattr(self, args.command)(unknown)
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 105, in wrapper_func
      build_dist_from_args(ctx, dist, dist_args)
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 142, in build_dist_from_args
      build_recipes(build_order, python_modules, ctx)
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/build.py", line 543, in build_recipes
      recipe.prebuild_arch(arch)
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/__init__.py", line 22, in prebuild_arch
      shprint(sh.cp, join(self.get_recipe_dir(), 'Application.mk'), app_mk)
    File "/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/logger.py", line 160, in shprint
      for line in output:
    File "/home/brussee/.local/lib/python2.7/site-packages/sh.py", line 565, in next
      self.wait()
    File "/home/brussee/.local/lib/python2.7/site-packages/sh.py", line 500, in wait
      self.handle_command_exit_code(exit_code)
    File "/home/brussee/.local/lib/python2.7/site-packages/sh.py", line 516, in handle_command_exit_code
      raise exc(self.ran, self.process.stdout, self.process.stderr)
  sh.ErrorReturnCode_1
  ```
  
  
  </issue>
  <code>
  [start of setup.py]
  1 
  2 from setuptools import setup, find_packages
  3 from os import walk
  4 from os.path import join, dirname, sep
  5 import os
  6 import glob
  7 
  8 # NOTE: All package data should also be set in MANIFEST.in
  9 
  10 packages = find_packages()
  11 
  12 package_data = {'': ['*.tmpl',
  13                      '*.patch', ], }
  14 
  15 data_files = []
  16 
  17 # By specifying every file manually, package_data will be able to
  18 # include them in binary distributions. Note that we have to add
  19 # everything as a 'pythonforandroid' rule, using '' apparently doesn't
  20 # work.
  21 def recursively_include(results, directory, patterns):
  22     for root, subfolders, files in walk(directory):
  23         for fn in files:
  24             if not any([glob.fnmatch.fnmatch(fn, pattern) for pattern in patterns]):
  25                 continue
  26             filename = join(root, fn)
  27             directory = 'pythonforandroid'
  28             if directory not in results:
  29                 results[directory] = []
  30             results[directory].append(join(*filename.split(sep)[1:]))
  31 
  32 recursively_include(package_data, 'pythonforandroid/recipes',
  33                     ['*.patch', 'Setup*', '*.pyx', '*.py', '*.c', '*.h', ])
  34 recursively_include(package_data, 'pythonforandroid/bootstraps',
  35                     ['*.properties', '*.xml', '*.java', '*.tmpl', '*.txt', '*.png',
  36                      '*.mk', '*.c', '*.h', '*.py', '*.sh', '*.jpg', '*.aidl', ])
  37 recursively_include(package_data, 'pythonforandroid/bootstraps',
  38                     ['sdl-config', ])
  39 recursively_include(package_data, 'pythonforandroid',
  40                     ['liblink', 'biglink', 'liblink.sh'])
  41 
  42 setup(name='python-for-android',
  43       version='0.3',
  44       description='Android APK packager for Python scripts and apps',
  45       author='The Kivy team',
  46       author_email='kivy-dev@googlegroups.com',
  47       url='https://github.com/kivy/python-for-android', 
  48       license='MIT', 
  49       install_requires=['appdirs', 'colorama>0.3', 'sh', 'jinja2', 'argparse',
  50                         'six'],
  51       entry_points={
  52           'console_scripts': [
  53               'python-for-android = pythonforandroid.toolchain:main',
  54               'p4a = pythonforandroid.toolchain:main',
  55               ],
  56           'distutils.commands': [
  57               'bdist_apk = pythonforandroid.bdist_apk:BdistAPK',
  58               ],
  59           },
  60       classifiers = [
  61           'Development Status :: 3 - Alpha',
  62           'Intended Audience :: Developers',
  63           'License :: OSI Approved :: MIT License',
  64           'Operating System :: Microsoft :: Windows',
  65           'Operating System :: OS Independent',
  66           'Operating System :: POSIX :: Linux',
  67           'Operating System :: MacOS :: MacOS X',
  68           'Programming Language :: C',
  69           'Programming Language :: Python :: 2',
  70           'Programming Language :: Python :: 3',
  71           'Topic :: Software Development',
  72           'Topic :: Utilities',
  73           ],
  74       packages=packages,
  75       package_data=package_data,
  76       )
  77
  [end of setup.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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -30,7 +30,8 @@
               results[directory].append(join(*filename.split(sep)[1:]))
   
   recursively_include(package_data, 'pythonforandroid/recipes',
  -                    ['*.patch', 'Setup*', '*.pyx', '*.py', '*.c', '*.h', ])
  +                    ['*.patch', 'Setup*', '*.pyx', '*.py', '*.c', '*.h',
  +                     '*.mk', ])
   recursively_include(package_data, 'pythonforandroid/bootstraps',
                       ['*.properties', '*.xml', '*.java', '*.tmpl', '*.txt', '*.png',
                        '*.mk', '*.c', '*.h', '*.py', '*.sh', '*.jpg', '*.aidl', ])
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -30,7 +30,8 @@\n             results[directory].append(join(*filename.split(sep)[1:]))\n \n recursively_include(package_data, 'pythonforandroid/recipes',\n-                    ['*.patch', 'Setup*', '*.pyx', '*.py', '*.c', '*.h', ])\n+                    ['*.patch', 'Setup*', '*.pyx', '*.py', '*.c', '*.h',\n+                     '*.mk', ])\n recursively_include(package_data, 'pythonforandroid/bootstraps',\n                     ['*.properties', '*.xml', '*.java', '*.tmpl', '*.txt', '*.png',\n                      '*.mk', '*.c', '*.h', '*.py', '*.sh', '*.jpg', '*.aidl', ])\n", "issue": "Jpeg recipe is broken\nIt is missing /home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/Application.mk\nPerpaps just the path is incorrect?\n\n```\n[INFO]:    Prebuilding jpeg for armeabi\n[INFO]:    jpeg has no prebuild_armeabi, skipping\n[DEBUG]:   -> running cp /home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/Application.mk /home/brussee/.local/share/python-for-android/build/other_builds/jpeg/armeabi/jpeg/Application.mk\n[DEBUG]:    /bin/cp: cannot stat \u2018/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/Application.mk\u2019: No such file or directory\nTraceback (most recent call last):\n  File \"/home/brussee/.local/bin/p4a\", line 9, in <module>\n    load_entry_point('python-for-android==0.3', 'console_scripts', 'p4a')()\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py\", line 708, in main\n    ToolchainCL()\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py\", line 323, in __init__\n    getattr(self, args.command)(unknown)\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py\", line 105, in wrapper_func\n    build_dist_from_args(ctx, dist, dist_args)\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py\", line 142, in build_dist_from_args\n    build_recipes(build_order, python_modules, ctx)\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/build.py\", line 543, in build_recipes\n    recipe.prebuild_arch(arch)\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/recipes/jpeg/__init__.py\", line 22, in prebuild_arch\n    shprint(sh.cp, join(self.get_recipe_dir(), 'Application.mk'), app_mk)\n  File \"/home/brussee/.local/lib/python2.7/site-packages/pythonforandroid/logger.py\", line 160, in shprint\n    for line in output:\n  File \"/home/brussee/.local/lib/python2.7/site-packages/sh.py\", line 565, in next\n    self.wait()\n  File \"/home/brussee/.local/lib/python2.7/site-packages/sh.py\", line 500, in wait\n    self.handle_command_exit_code(exit_code)\n  File \"/home/brussee/.local/lib/python2.7/site-packages/sh.py\", line 516, in handle_command_exit_code\n    raise exc(self.ran, self.process.stdout, self.process.stderr)\nsh.ErrorReturnCode_1\n```\n\n", "before_files": [{"content": "\nfrom setuptools import setup, find_packages\nfrom os import walk\nfrom os.path import join, dirname, sep\nimport os\nimport glob\n\n# NOTE: All package data should also be set in MANIFEST.in\n\npackages = find_packages()\n\npackage_data = {'': ['*.tmpl',\n                     '*.patch', ], }\n\ndata_files = []\n\n# By specifying every file manually, package_data will be able to\n# include them in binary distributions. Note that we have to add\n# everything as a 'pythonforandroid' rule, using '' apparently doesn't\n# work.\ndef recursively_include(results, directory, patterns):\n    for root, subfolders, files in walk(directory):\n        for fn in files:\n            if not any([glob.fnmatch.fnmatch(fn, pattern) for pattern in patterns]):\n                continue\n            filename = join(root, fn)\n            directory = 'pythonforandroid'\n            if directory not in results:\n                results[directory] = []\n            results[directory].append(join(*filename.split(sep)[1:]))\n\nrecursively_include(package_data, 'pythonforandroid/recipes',\n                    ['*.patch', 'Setup*', '*.pyx', '*.py', '*.c', '*.h', ])\nrecursively_include(package_data, 'pythonforandroid/bootstraps',\n                    ['*.properties', '*.xml', '*.java', '*.tmpl', '*.txt', '*.png',\n                     '*.mk', '*.c', '*.h', '*.py', '*.sh', '*.jpg', '*.aidl', ])\nrecursively_include(package_data, 'pythonforandroid/bootstraps',\n                    ['sdl-config', ])\nrecursively_include(package_data, 'pythonforandroid',\n                    ['liblink', 'biglink', 'liblink.sh'])\n\nsetup(name='python-for-android',\n      version='0.3',\n      description='Android APK packager for Python scripts and apps',\n      author='The Kivy team',\n      author_email='kivy-dev@googlegroups.com',\n      url='https://github.com/kivy/python-for-android', \n      license='MIT', \n      install_requires=['appdirs', 'colorama>0.3', 'sh', 'jinja2', 'argparse',\n                        'six'],\n      entry_points={\n          'console_scripts': [\n              'python-for-android = pythonforandroid.toolchain:main',\n              'p4a = pythonforandroid.toolchain:main',\n              ],\n          'distutils.commands': [\n              'bdist_apk = pythonforandroid.bdist_apk:BdistAPK',\n              ],\n          },\n      classifiers = [\n          'Development Status :: 3 - Alpha',\n          'Intended Audience :: Developers',\n          'License :: OSI Approved :: MIT License',\n          'Operating System :: Microsoft :: Windows',\n          'Operating System :: OS Independent',\n          'Operating System :: POSIX :: Linux',\n          'Operating System :: MacOS :: MacOS X',\n          'Programming Language :: C',\n          'Programming Language :: Python :: 2',\n          'Programming Language :: Python :: 3',\n          'Topic :: Software Development',\n          'Topic :: Utilities',\n          ],\n      packages=packages,\n      package_data=package_data,\n      )\n", "path": "setup.py"}]}