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