work on hostpython and host_setuptools

This commit is contained in:
Robert Niederreiter 2016-10-14 09:57:34 +02:00
parent 0b696d6557
commit 805c52bd6d
6 changed files with 9 additions and 38 deletions

View file

@ -9,7 +9,7 @@ import shutil
class HostSetuptools(Recipe):
depends = ["hostpython"]
archs = ["x86_64"]
url = ""
url = "ez_setup"
def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython)
@ -20,14 +20,4 @@ class HostSetuptools(Recipe):
# 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)
recipe = HostSetuptools()

View file

@ -0,0 +1 @@
_ssl _ssl.c -DUSE_SSL -lssl -lcrypto

View file

@ -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):
@ -26,6 +27,8 @@ class HostpythonRecipe(Recipe):
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):

View file

@ -1,21 +0,0 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class HostSetuptoolsRecipe(PythonRecipe):
version = "28.0.0"
url = "https://github.com/pypa/setuptools/archive/v{version}.zip"
depends = ["python"]
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 = os.path.join(self.ctx.dist_dir, "root", "python")
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python2.7', 'site-packages')
shprint(hostpython, "bootstrap.py", _env=build_env)
shprint(hostpython, "setup.py", "install", _env=build_env)
recipe = HostSetuptoolsRecipe()

View file

@ -7,7 +7,7 @@ import os
class PythonRecipe(Recipe):
version = "2.7.1"
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
depends = ["hostpython", "libffi", ]
depends = ["hostpython", "libffi"]
optional_depends = ["openssl"]
library = "libpython2.7.a"
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
@ -33,7 +33,6 @@ class PythonRecipe(Recipe):
self.append_file("ModulesSetup.mobile", "Modules/Setup.local")
if "openssl.build_all" in self.ctx.state:
self.append_file("ModulesSetup.openssl", "Modules/Setup.local")
self.set_marker("patched")
def build_arch(self, arch):

View file

@ -5,7 +5,7 @@ import sh, os
class ZopeInterfaceRecipe(PythonRecipe):
version = "4.3.2"
url="https://github.com/zopefoundation/zope.interface/archive/{version}.zip"
depends = ["python", "hostsetuptools"]
depends = ["python", "host_setuptools"]
include_per_arch = True
def get_environ(self, arch):
@ -18,18 +18,17 @@ class ZopeInterfaceRecipe(PythonRecipe):
return build_env
def build_arch(self, arch):
print '########### build arch: ' + arch.arch
build_env = self.get_environ(arch)
hostpython = sh.Command(self.ctx.hostpython)
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
def install(self):
arch = list(self.filtered_archs)[0]
print '########### install arch: ' + arch.arch
build_dir = self.get_build_dir(arch.arch)
os.chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
build_env = self.get_environ(arch)
del build_env["ARCH"]
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python")
build_env['PYTHONPATH'] = os.path.join(
dest_dir, 'lib', 'python2.7', 'site-packages')