try to get cryptography and setuptools on ios

This commit is contained in:
Mathieu Virbel 2016-12-04 19:32:19 +01:00
parent 55e8785a53
commit 58a0bb7ba2
4 changed files with 44 additions and 8 deletions

View file

@ -1,11 +1,11 @@
from os.path import join
from toolchain import CythonRecipe
from toolchain import CythonRecipe, PythonRecipe
from toolchain import shprint
import os
import sh
class CryptographyRecipe(CythonRecipe):
class CryptographyRecipe(PythonRecipe):
name = "cryptography"
version = "1.5.2"
url = (
@ -13,8 +13,9 @@ class CryptographyRecipe(CythonRecipe):
"60984cb85cc38c4ebdfca27b32a6df6f1914959d8790f5a349608c78be61/"
"cryptography-{version}.tar.gz"
)
library = "libcryptography.a"
depends = ["host_setuptools", "cffi", "six", "idna", "pyasn1", "enum34"]
# library = "libcryptography.a"
depends = ["host_setuptools", "host_cffi", "cffi", "six", "idna", "pyasn1",
"enum34", "setuptools"]
cythonize = False
def get_recipe_env(self, arch):
@ -38,10 +39,11 @@ class CryptographyRecipe(CythonRecipe):
dest_dir = join(self.ctx.dist_dir, "root", "python")
pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages')
build_env['PYTHONPATH'] = pythonpath
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
shprint(*args, _env=build_env)
args = [hostpython, "setup.py", "install"]
args = [hostpython, "setup.py", "install", "--prefix", dest_dir,
"--old-and-unmanageable"]
shprint(*args, _env=build_env)
#args = [hostpython, "setup.py", "install"]
#shprint(*args, _env=build_env)
recipe = CryptographyRecipe()

View file

@ -7,7 +7,8 @@ import sh
class Enum34Recipe(PythonRecipe):
version = "1.1.6"
url = 'https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz'
url = "https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
# url = 'https://pypi.python.org/packages/source/e/enum34/enum34-{version}.tar.gz'
depends = ["python", "host_setuptools"]
def install(self):

View file

@ -0,0 +1,32 @@
from toolchain import CythonRecipe
class SetuptoolsRecipe(CythonRecipe):
name = "setuptools"
version = "4.3.2"
url = 'https://pypi.python.org/packages/f1/92/12c7251039b274c30106c3e0babdcb040cbd13c3ad4b3f0ef9a7c217e36a/setuptools-30.2.0.tar.gz'
depends = ["python", "host_setuptools"]
cythonize = False
def get_recipe_env(self, arch):
env = super(SetuptoolsRecipe, self).get_recipe_env(arch)
env["PYTHONPATH"] = self.get_build_dir(arch.arch) + "/iosbuild/lib/python2.7/site-packages"
return env
def install_python_package(self):
import sh
from toolchain import shprint
from os import chdir
arch = self.filtered_archs[0]
build_dir = self.get_build_dir(arch.arch)
chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
shprint(hostpython, "setup.py", "install", "--prefix",
self.ctx.install_dir, "--old-and-unmanageable")
# "--single-version-externally-managed", "--root", "/", "-O2")
recipe = SetuptoolsRecipe()

View file

@ -456,6 +456,7 @@ class Recipe(object):
urlcleanup()
print('Downloading {0}'.format(url))
print("filename", filename)
urlretrieve(url, filename, report_hook)
return filename