Merge branch 'master' of git://github.com/kivy/kivy-ios
This commit is contained in:
commit
cc2dfb4f13
4 changed files with 30 additions and 19 deletions
|
@ -7,27 +7,28 @@ import shutil
|
||||||
|
|
||||||
|
|
||||||
class HostSetuptools(Recipe):
|
class HostSetuptools(Recipe):
|
||||||
depends = ["hostpython"]
|
depends = ["openssl", "hostpython"]
|
||||||
archs = ["x86_64"]
|
archs = ["x86_64"]
|
||||||
url = ""
|
url = "setuptools"
|
||||||
|
|
||||||
def prebuild_arch(self, arch):
|
def prebuild_arch(self, arch):
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
||||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
shprint(hostpython, "./ez_setup.py")
|
||||||
build_env = arch.get_env()
|
# Extract setuptools egg and remove .pth files. Otherwise subsequent
|
||||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
# python package installations using setuptools will raise exceptions.
|
||||||
# shprint(hostpython, "./ez_setup.py", "--to-dir", dest_dir)
|
# Setuptools version 28.3.0
|
||||||
shprint(hostpython, "./ez_setup.py", _env=build_env)
|
site_packages_path = join(
|
||||||
|
self.ctx.dist_dir, 'hostpython',
|
||||||
# def install(self):
|
'lib', 'python2.7', 'site-packages')
|
||||||
# arch = list(self.filtered_archs)[0]
|
os.chdir(site_packages_path)
|
||||||
# build_dir = self.get_build_dir(arch.arch)
|
with open('setuptools.pth', 'r') as f:
|
||||||
# os.chdir(build_dir)
|
setuptools_egg_path = f.read().strip('./').strip('\n')
|
||||||
# hostpython = sh.Command(self.ctx.hostpython)
|
unzip = sh.Command('unzip')
|
||||||
# build_env = arch.get_env()
|
shprint(unzip, setuptools_egg_path)
|
||||||
# dest_dir = join(self.ctx.dist_dir, "root", "python")
|
os.remove(setuptools_egg_path)
|
||||||
# build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
os.remove('setuptools.pth')
|
||||||
# shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
os.remove('easy-install.pth')
|
||||||
|
shutil.rmtree('EGG-INFO')
|
||||||
|
|
||||||
recipe = HostSetuptools()
|
recipe = HostSetuptools()
|
||||||
|
|
1
recipes/host_setuptools/setuptools/README.rst
Normal file
1
recipes/host_setuptools/setuptools/README.rst
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Make toolchain happy
|
1
recipes/hostpython/ModulesSetup.openssl
Normal file
1
recipes/hostpython/ModulesSetup.openssl
Normal file
|
@ -0,0 +1 @@
|
||||||
|
_ssl _ssl.c -DUSE_SSL -lssl -lcrypto
|
|
@ -8,7 +8,8 @@ import shutil
|
||||||
class HostpythonRecipe(Recipe):
|
class HostpythonRecipe(Recipe):
|
||||||
version = "2.7.1"
|
version = "2.7.1"
|
||||||
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
|
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
|
||||||
depends = ["hostlibffi", ]
|
depends = ["hostlibffi"]
|
||||||
|
optional_depends = ["openssl"]
|
||||||
archs = ["x86_64"]
|
archs = ["x86_64"]
|
||||||
|
|
||||||
def init_with_ctx(self, ctx):
|
def init_with_ctx(self, ctx):
|
||||||
|
@ -19,13 +20,15 @@ class HostpythonRecipe(Recipe):
|
||||||
print("Global: hostpgen located at {}".format(self.ctx.hostpgen))
|
print("Global: hostpgen located at {}".format(self.ctx.hostpgen))
|
||||||
|
|
||||||
def prebuild_arch(self, arch):
|
def prebuild_arch(self, arch):
|
||||||
if self.has_marker("patched"):
|
if self.has_marker("patched"):
|
||||||
return
|
return
|
||||||
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
|
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
|
||||||
self.apply_patch("ssize-t-max.patch")
|
self.apply_patch("ssize-t-max.patch")
|
||||||
self.apply_patch("dynload.patch")
|
self.apply_patch("dynload.patch")
|
||||||
self.apply_patch("static-_sqlite3.patch")
|
self.apply_patch("static-_sqlite3.patch")
|
||||||
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
||||||
|
if "openssl.build_all" in self.ctx.state:
|
||||||
|
self.append_file("ModulesSetup.openssl", "Modules/Setup.local")
|
||||||
self.set_marker("patched")
|
self.set_marker("patched")
|
||||||
|
|
||||||
def postbuild_arch(self, arch):
|
def postbuild_arch(self, arch):
|
||||||
|
@ -59,6 +62,11 @@ class HostpythonRecipe(Recipe):
|
||||||
"--sysroot={}".format(sdk_path),
|
"--sysroot={}".format(sdk_path),
|
||||||
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if "openssl.build_all" in self.ctx.state:
|
||||||
|
build_env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "include",
|
||||||
|
"x86_64", "openssl"))
|
||||||
|
|
||||||
configure = sh.Command(join(self.build_dir, "configure"))
|
configure = sh.Command(join(self.build_dir, "configure"))
|
||||||
shprint(configure,
|
shprint(configure,
|
||||||
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
|
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
|
||||||
|
|
Loading…
Reference in a new issue