fix host_setuptools
This commit is contained in:
parent
d6f2e3f8d2
commit
73adae58c3
4 changed files with 14 additions and 18 deletions
|
@ -9,25 +9,11 @@ import shutil
|
|||
class HostSetuptools(Recipe):
|
||||
depends = ["hostpython"]
|
||||
archs = ["x86_64"]
|
||||
url = ""
|
||||
url = "setuptools"
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python")
|
||||
build_env = arch.get_env()
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
# shprint(hostpython, "./ez_setup.py", "--to-dir", dest_dir)
|
||||
shprint(hostpython, "./ez_setup.py", _env=build_env)
|
||||
|
||||
# def install(self):
|
||||
# arch = list(self.filtered_archs)[0]
|
||||
# build_dir = self.get_build_dir(arch.arch)
|
||||
# os.chdir(build_dir)
|
||||
# hostpython = sh.Command(self.ctx.hostpython)
|
||||
# build_env = arch.get_env()
|
||||
# dest_dir = join(self.ctx.dist_dir, "root", "python")
|
||||
# build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
# shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
shprint(hostpython, "./ez_setup.py")
|
||||
|
||||
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):
|
||||
version = "2.7.1"
|
||||
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
|
||||
depends = ["hostlibffi", ]
|
||||
depends = ["hostlibffi"]
|
||||
optional_depends = ["openssl"]
|
||||
archs = ["x86_64"]
|
||||
|
||||
def init_with_ctx(self, ctx):
|
||||
|
@ -19,13 +20,15 @@ class HostpythonRecipe(Recipe):
|
|||
print("Global: hostpgen located at {}".format(self.ctx.hostpgen))
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.copy_file("_scproxy.py", "Lib/_scproxy.py")
|
||||
self.apply_patch("ssize-t-max.patch")
|
||||
self.apply_patch("dynload.patch")
|
||||
self.apply_patch("static-_sqlite3.patch")
|
||||
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")
|
||||
|
||||
def postbuild_arch(self, arch):
|
||||
|
@ -59,6 +62,11 @@ class HostpythonRecipe(Recipe):
|
|||
"--sysroot={}".format(sdk_path),
|
||||
"-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"))
|
||||
shprint(configure,
|
||||
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
|
||||
|
|
Loading…
Add table
Reference in a new issue