Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
a96747964f
3 changed files with 14 additions and 14 deletions
|
@ -16,8 +16,8 @@ class Hostpython2Recipe(Recipe):
|
|||
super(Hostpython2Recipe, self).init_with_ctx(ctx)
|
||||
self.set_hostpython(self, 2.7)
|
||||
self.ctx.so_suffix = ".so"
|
||||
self.ctx.hostpython = join(self.ctx.dist_dir, "hostpython", "bin", "python")
|
||||
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython", "bin", "pgen")
|
||||
self.ctx.hostpython = join(self.ctx.dist_dir, "hostpython2", "bin", "python")
|
||||
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython2", "bin", "pgen")
|
||||
print("Global: hostpython located at {}".format(self.ctx.hostpython))
|
||||
print("Global: hostpgen located at {}".format(self.ctx.hostpgen))
|
||||
|
||||
|
@ -74,13 +74,13 @@ class Hostpython2Recipe(Recipe):
|
|||
|
||||
configure = sh.Command(join(self.build_dir, "configure"))
|
||||
shprint(configure,
|
||||
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
|
||||
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython2")),
|
||||
"--disable-toolbox-glue",
|
||||
"--without-gcc",
|
||||
_env=build_env)
|
||||
shprint(sh.make, "-C", self.build_dir, self.ctx.concurrent_make, "python", "Parser/pgen",
|
||||
_env=build_env)
|
||||
shutil.move("python", "hostpython")
|
||||
shutil.move("python", "hostpython2")
|
||||
shutil.move("Parser/pgen", "Parser/hostpgen")
|
||||
|
||||
def install(self):
|
||||
|
@ -91,13 +91,13 @@ class Hostpython2Recipe(Recipe):
|
|||
# Compiling sometimes looks for Python-ast.py in the 'Python' i.s.o.
|
||||
# the 'hostpython' folder. Create a symlink to fix. See issue #201
|
||||
shprint(sh.ln, "-s",
|
||||
join(build_dir, "hostpython"),
|
||||
join(build_dir, "hostpython2"),
|
||||
join(build_dir, "Python"))
|
||||
shprint(sh.make, self.ctx.concurrent_make,
|
||||
"-C", build_dir,
|
||||
"bininstall", "inclinstall",
|
||||
_env=build_env)
|
||||
pylib_dir = join(self.ctx.dist_dir, "hostpython", "lib", "python2.7")
|
||||
pylib_dir = join(self.ctx.dist_dir, "hostpython2", "lib", "python2.7")
|
||||
if exists(pylib_dir):
|
||||
shutil.rmtree(pylib_dir)
|
||||
shutil.copytree(
|
||||
|
@ -109,7 +109,7 @@ class Hostpython2Recipe(Recipe):
|
|||
join(pylib_dir, "config", "Makefile"))
|
||||
shutil.copy(
|
||||
join(build_dir, "Parser", "pgen"),
|
||||
join(self.ctx.dist_dir, "hostpython", "bin", "pgen"))
|
||||
join(self.ctx.dist_dir, "hostpython2", "bin", "pgen"))
|
||||
|
||||
|
||||
recipe = Hostpython2Recipe()
|
||||
|
|
|
@ -16,7 +16,7 @@ class Python2Recipe(Recipe):
|
|||
super(Python2Recipe, self).init_with_ctx(ctx)
|
||||
self.set_python(self, 2.7)
|
||||
ctx.python_ver_dir = "python2.7"
|
||||
ctx.python_prefix = join(ctx.dist_dir, "root", "python")
|
||||
ctx.python_prefix = join(ctx.dist_dir, "root", "python2")
|
||||
ctx.site_packages_dir = join(
|
||||
ctx.python_prefix, "lib", ctx.python_ver_dir, "site-packages")
|
||||
|
||||
|
@ -75,7 +75,7 @@ class Python2Recipe(Recipe):
|
|||
"install",
|
||||
"CROSS_COMPILE_TARGET=yes",
|
||||
"HOSTPYTHON={}".format(self.ctx.hostpython),
|
||||
"prefix={}".format(join(self.ctx.dist_dir, "root", "python")),
|
||||
"prefix={}".format(join(self.ctx.dist_dir, "root", "python2")),
|
||||
_env=build_env)
|
||||
self.reduce_python()
|
||||
|
||||
|
@ -119,13 +119,13 @@ class Python2Recipe(Recipe):
|
|||
oldpwd = os.getcwd()
|
||||
try:
|
||||
print("Remove files unlikely to be used")
|
||||
os.chdir(join(self.ctx.dist_dir, "root", "python"))
|
||||
os.chdir(join(self.ctx.dist_dir, "root", "python2"))
|
||||
sh.rm("-rf", "share")
|
||||
sh.rm("-rf", "bin")
|
||||
os.chdir(join(self.ctx.dist_dir, "root", "python", "lib"))
|
||||
os.chdir(join(self.ctx.dist_dir, "root", "python2", "lib"))
|
||||
sh.rm("-rf", "pkgconfig")
|
||||
sh.rm("libpython2.7.a")
|
||||
os.chdir(join(self.ctx.dist_dir, "root", "python", "lib", "python2.7"))
|
||||
os.chdir(join(self.ctx.dist_dir, "root", "python2", "lib", "python2.7"))
|
||||
sh.find(".", "-iname", "*.pyc", "-exec", "rm", "{}", ";")
|
||||
sh.find(".", "-iname", "*.py", "-exec", "rm", "{}", ";")
|
||||
#sh.find(".", "-iname", "test*", "-exec", "rm", "-rf", "{}", ";")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Tool for compiling iOS toolchain
|
||||
================================
|
||||
|
@ -1410,7 +1410,7 @@ Xcode:
|
|||
"PYTHONOPTIMIZE": "2",
|
||||
# "PIP_INSTALL_TARGET": ctx.site_packages_dir
|
||||
}
|
||||
pip_path = sh.which("pip2")
|
||||
pip_path = sh.which("pip")
|
||||
pip_args = []
|
||||
if len(sys.argv) > 2 and sys.argv[2] == "install":
|
||||
pip_args = ["--isolated", "--prefix", ctx.python_prefix]
|
||||
|
|
Loading…
Reference in a new issue