fix host_setuptools recipe

This commit is contained in:
Robert Niederreiter 2016-10-14 16:01:50 +02:00
parent 1c37a80b81
commit d0ba2dd4dd
2 changed files with 21 additions and 2 deletions

View file

@ -1,3 +1,4 @@
from os.path import join
from toolchain import CythonRecipe
@ -12,5 +13,10 @@ class CryptographyRecipe(CythonRecipe):
depends = ["host_setuptools", "six", "idna", "pyasn1"]
cythonize = False
def get_recipe_env(self, arch):
env = super(CryptographyRecipe, self).get_recipe_env(arch)
env["CC"] += " -I{}".format(
join(self.ctx.dist_dir, "include", arch.arch, "libffi"))
return env
recipe = CryptographyRecipe()

View file

@ -14,8 +14,21 @@ class HostSetuptools(Recipe):
def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython)
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
# Installed setuptools egg should be extracted in hostpython
# site-packages(v28.3.0)
shprint(hostpython, "./ez_setup.py")
# Extract setuptools egg and remove .pth files. Otherwise subsequent
# python package installations using setuptools will raise exceptions.
# Setuptools version 28.3.0
site_packages_path = join(
self.ctx.dist_dir, 'hostpython',
'lib', 'python2.7', 'site-packages')
os.chdir(site_packages_path)
with open('setuptools.pth', 'r') as f:
setuptools_egg_path = f.read().strip('./').strip('\n')
unzip = sh.Command('unzip')
shprint(unzip, setuptools_egg_path)
os.remove(setuptools_egg_path)
os.remove('setuptools.pth')
os.remove('easy-install.pth')
shutil.rmtree('EGG-INFO')
recipe = HostSetuptools()