tweaks for cffi and python recipes
This commit is contained in:
parent
a1a7ae7d54
commit
839307bb75
3 changed files with 31 additions and 2 deletions
|
@ -36,6 +36,13 @@ class CffiRecipe(CythonRecipe):
|
|||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
# hack: copy _cffi_backend.so from hostpython
|
||||
so_file = "_cffi_backend.so"
|
||||
egg_name = "cffi-1.11.5-py2.7-macosx-10.4-x86_64.egg" # harded - needs to change
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python", "lib", "python2.7", "site-packages", egg_name)
|
||||
src_dir = join(self.ctx.dist_dir, "hostpython", "lib", "python2.7", "site-packages", egg_name)
|
||||
sh.cp(join(src_dir, so_file), join(dest_dir, so_file))
|
||||
|
||||
|
||||
recipe = CffiRecipe()
|
||||
|
|
|
@ -1 +1,8 @@
|
|||
_ssl _ssl.c -DUSE_SSL -lssl -lcrypto
|
||||
SSL=
|
||||
SSL_LIBS=
|
||||
_ssl _ssl.c \
|
||||
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
|
||||
-L$(SSL_LIBS) -lssl -lcrypto
|
||||
_hashlib _hashopenssl.c \
|
||||
-I$(SSL)/include -I$(SSL)/include/openssl \
|
||||
-L$(SSL_LIBS) -lssl -lcrypto
|
||||
|
|
|
@ -32,7 +32,13 @@ class PythonRecipe(Recipe):
|
|||
self.apply_patch("setuppath.patch")
|
||||
self.apply_patch("posixmodule.patch")
|
||||
if "openssl.build_all" in self.ctx.state:
|
||||
self.append_file("ModulesSetup.openssl", "Modules/Setup.local")
|
||||
self.copy_file("ModulesSetup.openssl", "Modules/Setup.openssl")
|
||||
r = Recipe.get_recipe('openssl', self.ctx)
|
||||
openssl_build_dir = r.get_build_dir(arch.arch)
|
||||
shprint(sh.sed, '-i.backup', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), "Modules/Setup.openssl")
|
||||
shprint(sh.sed, '-i.backup', 's#^SSL_LIBS=.*#SSL_LIBS={}#'.format(join(self.ctx.dist_dir, "lib")), "Modules/Setup.openssl")
|
||||
os.system('cat Modules/Setup.openssl >> Modules/Setup.local')
|
||||
sh.rm("Modules/Setup.openssl")
|
||||
|
||||
self.set_marker("patched")
|
||||
|
||||
|
@ -42,6 +48,14 @@ class PythonRecipe(Recipe):
|
|||
local_arch = arch.arch
|
||||
if arch.arch == "arm64" :
|
||||
local_arch = "aarch64"
|
||||
|
||||
if "openssl.build_all" in self.ctx.state:
|
||||
r = Recipe.get_recipe('openssl', self.ctx)
|
||||
openssl_build_dir = r.get_build_dir(arch.arch)
|
||||
build_env['OPENSSL_VERSION'] = r.version
|
||||
build_env['CFLAGS'] += ' -I%s' % join(openssl_build_dir, "include")
|
||||
build_env['LDFLAGS'] += ' -L%s' % join(self.ctx.dist_dir, "lib")
|
||||
|
||||
shprint(configure,
|
||||
"CC={}".format(build_env["CC"]),
|
||||
"LD={}".format(build_env["LD"]),
|
||||
|
@ -72,6 +86,7 @@ class PythonRecipe(Recipe):
|
|||
arch = list(self.filtered_archs)[0]
|
||||
build_env = arch.get_env()
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
build_env["LD_LIBRRAY_PATH"] = join(self.ctx.dist_dir, "lib")
|
||||
build_env["PATH"] = os.environ["PATH"]
|
||||
shprint(sh.make,
|
||||
"-C", build_dir,
|
||||
|
|
Loading…
Reference in a new issue