prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Cryptography recipe does not compile
  I'm trying to build Kivy app with:
  - sdl2 bootstrap
  - recipes python2,kivy,cryptography 
  - buildozer 0.32 
  - latest python-for-android master branch 
  
  In libffi recipe I had to replace [line](https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/libffi/__init__.py#L43) with:
  `shprint(sh.Command('autoreconf'), '-vif', _env=env)`.
  Without that change p4a was raising sh.CommandNotFound error. 
  
  Now running `buildozer android_new debug` produces the following error log: http://pastebin.com/22qjBJwL
  buildozer.spec file: http://pastebin.com/aLe7nLHG
  main.py file: http://pastebin.com/xSReYe6u
  
  
  </issue>
  <code>
  [start of pythonforandroid/recipes/libffi/__init__.py]
  1 from pythonforandroid.recipe import Recipe
  2 from pythonforandroid.logger import shprint
  3 from pythonforandroid.util import current_directory
  4 from os.path import exists, join
  5 import sh
  6 import glob
  7 
  8 
  9 class LibffiRecipe(Recipe):
  10 	name = 'libffi'
  11 	version = 'v3.2.1'
  12 	url = 'https://github.com/atgreen/libffi/archive/{version}.zip'
  13 
  14 	patches = ['remove-version-info.patch']
  15 
  16 	def get_host(self, arch):
  17 		with current_directory(self.get_build_dir(arch.arch)):
  18 			host = None
  19 			with open('Makefile') as f:
  20 				for line in f:
  21 					if line.startswith('host = '):
  22 						host = line.strip()[7:]
  23 						break
  24 
  25 			if not host or not exists(host):
  26 				raise RuntimeError('failed to find build output! ({})'
  27 				                   .format(host))
  28 			
  29 			return host
  30 
  31 	def should_build(self, arch):
  32 		# return not bool(glob.glob(join(self.ctx.get_libs_dir(arch.arch),
  33 		#                                'libffi.so*')))
  34 		return not exists(join(self.ctx.get_libs_dir(arch.arch), 'libffi.so'))
  35 		# return not exists(join(self.ctx.get_python_install_dir(), 'lib',
  36 		#                        'libffi.so'))
  37 
  38 	def build_arch(self, arch):
  39 		env = self.get_recipe_env(arch)
  40 		with current_directory(self.get_build_dir(arch.arch)):
  41 			if not exists('configure'):
  42 				shprint(sh.Command('./autogen.sh'), _env=env)
  43 			shprint(sh.Command('autoreconf -vif'), _env=env)
  44 			shprint(sh.Command('./configure'), '--host=' + arch.toolchain_prefix,
  45 			        '--prefix=' + self.ctx.get_python_install_dir(),
  46 			        '--enable-shared', _env=env)
  47 			shprint(sh.make, '-j5', 'libffi.la', _env=env)
  48 
  49 
  50 			# dlname = None
  51 			# with open(join(host, 'libffi.la')) as f:
  52 			# 	for line in f:
  53 			# 		if line.startswith('dlname='):
  54 			# 			dlname = line.strip()[8:-1]
  55 			# 			break
  56 			# 
  57 			# if not dlname or not exists(join(host, '.libs', dlname)):
  58 			# 	raise RuntimeError('failed to locate shared object! ({})'
  59 			# 	                   .format(dlname))
  60 
  61 			# shprint(sh.sed, '-i', 's/^dlname=.*$/dlname=\'libffi.so\'/', join(host, 'libffi.la'))
  62 
  63 			shprint(sh.cp, '-t', self.ctx.get_libs_dir(arch.arch),
  64 			        join(self.get_host(arch), '.libs', 'libffi.so')) #,
  65 			        # join(host, 'libffi.la'))
  66 
  67 	def get_include_dirs(self, arch):
  68 		return [join(self.get_build_dir(arch.arch), self.get_host(arch), 'include')]
  69 
  70 
  71 recipe = LibffiRecipe()
  72
  [end of pythonforandroid/recipes/libffi/__init__.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/pythonforandroid/recipes/libffi/__init__.py b/pythonforandroid/recipes/libffi/__init__.py
  --- a/pythonforandroid/recipes/libffi/__init__.py
  +++ b/pythonforandroid/recipes/libffi/__init__.py
  @@ -40,7 +40,7 @@
   		with current_directory(self.get_build_dir(arch.arch)):
   			if not exists('configure'):
   				shprint(sh.Command('./autogen.sh'), _env=env)
  -			shprint(sh.Command('autoreconf -vif'), _env=env)
  +			shprint(sh.Command('autoreconf'), '-vif', _env=env)
   			shprint(sh.Command('./configure'), '--host=' + arch.toolchain_prefix,
   			        '--prefix=' + self.ctx.get_python_install_dir(),
   			        '--enable-shared', _env=env)
  
verification_info: {"golden_diff": "diff --git a/pythonforandroid/recipes/libffi/__init__.py b/pythonforandroid/recipes/libffi/__init__.py\n--- a/pythonforandroid/recipes/libffi/__init__.py\n+++ b/pythonforandroid/recipes/libffi/__init__.py\n@@ -40,7 +40,7 @@\n \t\twith current_directory(self.get_build_dir(arch.arch)):\n \t\t\tif not exists('configure'):\n \t\t\t\tshprint(sh.Command('./autogen.sh'), _env=env)\n-\t\t\tshprint(sh.Command('autoreconf -vif'), _env=env)\n+\t\t\tshprint(sh.Command('autoreconf'), '-vif', _env=env)\n \t\t\tshprint(sh.Command('./configure'), '--host=' + arch.toolchain_prefix,\n \t\t\t        '--prefix=' + self.ctx.get_python_install_dir(),\n \t\t\t        '--enable-shared', _env=env)\n", "issue": "Cryptography recipe does not compile\nI'm trying to build Kivy app with:\n- sdl2 bootstrap\n- recipes python2,kivy,cryptography \n- buildozer 0.32 \n- latest python-for-android master branch \n\nIn libffi recipe I had to replace [line](https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/libffi/__init__.py#L43) with:\n`shprint(sh.Command('autoreconf'), '-vif', _env=env)`.\nWithout that change p4a was raising sh.CommandNotFound error. \n\nNow running `buildozer android_new debug` produces the following error log: http://pastebin.com/22qjBJwL\nbuildozer.spec file: http://pastebin.com/aLe7nLHG\nmain.py file: http://pastebin.com/xSReYe6u\n\n", "before_files": [{"content": "from pythonforandroid.recipe import Recipe\nfrom pythonforandroid.logger import shprint\nfrom pythonforandroid.util import current_directory\nfrom os.path import exists, join\nimport sh\nimport glob\n\n\nclass LibffiRecipe(Recipe):\n\tname = 'libffi'\n\tversion = 'v3.2.1'\n\turl = 'https://github.com/atgreen/libffi/archive/{version}.zip'\n\n\tpatches = ['remove-version-info.patch']\n\n\tdef get_host(self, arch):\n\t\twith current_directory(self.get_build_dir(arch.arch)):\n\t\t\thost = None\n\t\t\twith open('Makefile') as f:\n\t\t\t\tfor line in f:\n\t\t\t\t\tif line.startswith('host = '):\n\t\t\t\t\t\thost = line.strip()[7:]\n\t\t\t\t\t\tbreak\n\n\t\t\tif not host or not exists(host):\n\t\t\t\traise RuntimeError('failed to find build output! ({})'\n\t\t\t\t                   .format(host))\n\t\t\t\n\t\t\treturn host\n\n\tdef should_build(self, arch):\n\t\t# return not bool(glob.glob(join(self.ctx.get_libs_dir(arch.arch),\n\t\t#                                'libffi.so*')))\n\t\treturn not exists(join(self.ctx.get_libs_dir(arch.arch), 'libffi.so'))\n\t\t# return not exists(join(self.ctx.get_python_install_dir(), 'lib',\n\t\t#                        'libffi.so'))\n\n\tdef build_arch(self, arch):\n\t\tenv = self.get_recipe_env(arch)\n\t\twith current_directory(self.get_build_dir(arch.arch)):\n\t\t\tif not exists('configure'):\n\t\t\t\tshprint(sh.Command('./autogen.sh'), _env=env)\n\t\t\tshprint(sh.Command('autoreconf -vif'), _env=env)\n\t\t\tshprint(sh.Command('./configure'), '--host=' + arch.toolchain_prefix,\n\t\t\t        '--prefix=' + self.ctx.get_python_install_dir(),\n\t\t\t        '--enable-shared', _env=env)\n\t\t\tshprint(sh.make, '-j5', 'libffi.la', _env=env)\n\n\n\t\t\t# dlname = None\n\t\t\t# with open(join(host, 'libffi.la')) as f:\n\t\t\t# \tfor line in f:\n\t\t\t# \t\tif line.startswith('dlname='):\n\t\t\t# \t\t\tdlname = line.strip()[8:-1]\n\t\t\t# \t\t\tbreak\n\t\t\t# \n\t\t\t# if not dlname or not exists(join(host, '.libs', dlname)):\n\t\t\t# \traise RuntimeError('failed to locate shared object! ({})'\n\t\t\t# \t                   .format(dlname))\n\n\t\t\t# shprint(sh.sed, '-i', 's/^dlname=.*$/dlname=\\'libffi.so\\'/', join(host, 'libffi.la'))\n\n\t\t\tshprint(sh.cp, '-t', self.ctx.get_libs_dir(arch.arch),\n\t\t\t        join(self.get_host(arch), '.libs', 'libffi.so')) #,\n\t\t\t        # join(host, 'libffi.la'))\n\n\tdef get_include_dirs(self, arch):\n\t\treturn [join(self.get_build_dir(arch.arch), self.get_host(arch), 'include')]\n\n\nrecipe = LibffiRecipe()\n", "path": "pythonforandroid/recipes/libffi/__init__.py"}]}