cleanup; builds for xcode 6 and 7

This commit is contained in:
Joe deBlaquiere 2015-11-01 15:27:21 -05:00
parent 1ef0fd54e3
commit 29b4aeec5e
7 changed files with 10 additions and 64 deletions

View file

@ -37,7 +37,7 @@ class LibffiRecipe(Recipe):
shprint(sh.xcodebuild,
"ONLY_ACTIVE_ARCH=NO",
"ARCHS={}".format(arch.arch),
"-sdk", "macosx10.11",
"-sdk", "macosx",
"install", "installhdrs",
"-project", "libffi.xcodeproj",
"-target", "libffi-Mac",

View file

@ -13,7 +13,6 @@ class HostpythonRecipe(Recipe):
def init_with_ctx(self, ctx):
super(HostpythonRecipe, self).init_with_ctx(ctx)
#self.ctx.hostpython = "\"" + join("PYTHONHOME=",self.ctx.dist_dir, "hostpython") + " " + join(self.ctx.dist_dir, "hostpython", "bin", "python") + "\""
self.ctx.hostpython = join(self.ctx.dist_dir, "hostpython", "bin", "python")
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython", "bin", "pgen")
print("Global: hostpython located at {}".format(self.ctx.hostpython))
@ -26,7 +25,6 @@ class HostpythonRecipe(Recipe):
self.apply_patch("ssize-t-max.patch")
self.apply_patch("dynload.patch")
self.apply_patch("static-_sqlite3.patch")
self.apply_patch("ldfix.patch")
self.copy_file("ModulesSetup", "Modules/Setup.local")
self.set_marker("patched")
@ -52,8 +50,10 @@ class HostpythonRecipe(Recipe):
build_env = self.ctx.env.copy()
build_env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
build_env["LDFLAGS"] = " ".join([
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib")),
"-lsqlite3"])
"-lsqlite3",
"-lffi",
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib"))
])
build_env["CFLAGS"] = " ".join([
"--sysroot={}".format(sdk_path),
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
@ -62,7 +62,6 @@ class HostpythonRecipe(Recipe):
shprint(configure,
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
"--disable-toolbox-glue",
"--with-system-ffi",
"--without-gcc",
_env=build_env)
shprint(sh.make, "-C", self.build_dir, "-j4", "python.exe", "Parser/pgen",

View file

@ -1,11 +0,0 @@
--- Python-2.7.1/Makefile.pre.in 2015-10-26 19:29:02.000000000 -0400
+++ Python-2.7.1-orig/Makefile.pre.in 2015-10-26 19:28:35.000000000 -0400
@@ -395,7 +395,7 @@
$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/python.o \
- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -lffi
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
platform: $(BUILDPYTHON)
$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform

View file

@ -1,16 +1,6 @@
from toolchain import CythonRecipe
from os.path import join
from sys import stdout
import sh
def shprint(command, *args, **kwargs):
kwargs["_iter"] = True
kwargs["_out_bufsize"] = 1
kwargs["_err_to_out"] = True
for line in command(*args, **kwargs):
stdout.write(line)
class KivyRecipe(CythonRecipe):
version = "1.9.0"
@ -31,21 +21,7 @@ class KivyRecipe(CythonRecipe):
def build_arch(self, arch):
self._patch_setup()
build_env = self.get_recipe_env(arch)
build_env["PYTHONHOME"] = join(self.ctx.dist_dir, "hostpython")
#print 'build_env=', build_env
hostpython = sh.Command(self.ctx.hostpython)
#hostpython = sh.Command("/usr/bin/python2.7")
if self.pre_build_ext:
try:
shprint(hostpython, "setup.py", "build_ext", "-g",
_env=build_env)
except:
pass
self.cythonize_build()
shprint(hostpython, "setup.py", "build_ext", "-g",
_env=build_env)
self.biglink()
super(KivyRecipe, self).build_arch(arch)
def _patch_setup(self):
# patch setup to remove some functionnalities

View file

@ -8,7 +8,6 @@ class PythonRecipe(Recipe):
version = "2.7.1"
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
depends = ["hostpython", "libffi", ]
#depends = ["libffi", ]
optional_depends = ["openssl"]
library = "libpython2.7.a"
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
@ -47,8 +46,7 @@ class PythonRecipe(Recipe):
"LDFLAGS={} -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
"--without-pymalloc",
"--disable-toolbox-glue",
"--target={}-apple-ios7.0".format(arch),
"--host=x86_64-apple-darwin",
"--host={}-apple-darwin".format(arch),
"--prefix=/python",
"--with-system-ffi",
"--without-doc-strings",
@ -62,10 +60,6 @@ class PythonRecipe(Recipe):
"CROSS_COMPILE_TARGET=yes",
"HOSTPYTHON={}".format(self.ctx.hostpython),
"HOSTPGEN={}".format(self.ctx.hostpgen))
# shprint(sh.make, "-j4",
# "CROSS_COMPILE_TARGET=yes",
# "HOSTPYTHON={}".format("/usr/bin/python2.7"),
# "HOSTPGEN={}".format(self.ctx.hostpgen))
def install(self):
arch = list(self.filtered_archs)[0]
@ -79,13 +73,6 @@ class PythonRecipe(Recipe):
"HOSTPYTHON={}".format(self.ctx.hostpython),
"prefix={}".format(join(self.ctx.dist_dir, "root", "python")),
_env=build_env)
# shprint(sh.make,
# "-C", build_dir,
# "install",
# "CROSS_COMPILE_TARGET=yes",
# "HOSTPYTHON={}".format("/usr/bin/python2.7"),
# "prefix={}".format(join(self.ctx.dist_dir, "root", "python")),
# _env=build_env)
self.reduce_python()
def _patch_pyconfig(self):

View file

@ -174,7 +174,7 @@ class ArchSimulator(Arch):
sdk = "iphonesimulator"
arch = "i386"
triple = "i386-apple-darwin11"
version_min = "-miphoneos-version-min=7.0"
version_min = "-miphoneos-version-min=6.0.0"
sysroot = sh.xcrun("--sdk", "iphonesimulator", "--show-sdk-path").strip()
@ -190,7 +190,7 @@ class ArchIOS(Arch):
sdk = "iphoneos"
arch = "armv7"
triple = "arm-apple-darwin11"
version_min = "-miphoneos-version-min=7.0"
version_min = "-miphoneos-version-min=6.0.0"
sysroot = sh.xcrun("--sdk", "iphoneos", "--show-sdk-path").strip()
@ -816,9 +816,7 @@ class PythonRecipe(Recipe):
print("Install {} into the site-packages".format(name))
build_dir = self.get_build_dir(arch.arch)
chdir(build_dir)
env["PYTHONHOME"] = join(self.ctx.dist_dir, "hostpython")
hostpython = sh.Command(self.ctx.hostpython)
#hostpython = sh.Command("/usr/bin/python2.7")
iosbuild = join(build_dir, "iosbuild")
shprint(hostpython, "setup.py", "install", "-O2",
"--prefix", iosbuild,
@ -881,9 +879,7 @@ class CythonRecipe(PythonRecipe):
def build_arch(self, arch):
build_env = self.get_recipe_env(arch)
build_env["PYTHONHOME"] = join(self.ctx.dist_dir, "hostpython")
hostpython = sh.Command(self.ctx.hostpython)
#hostpython = sh.Command("/usr/bin/python2.7")
if self.pre_build_ext:
try:
shprint(hostpython, "setup.py", "build_ext", "-g",

View file

@ -76,5 +76,4 @@ f.close()
print('Liblink redirect linking with', objects)
ld = environ.get('ARM_LD')
arch = environ.get('ARCH', 'armv7')
print('linking with {} for arch {}'.format(ld, arch))
subprocess.call([ld, '-r', '-arch', arch, '-ios_version_min', '7.0', '-o', output + '.o'] + objects)
subprocess.call([ld, '-r', '-o', output + '.o', '-ios_version_min', '7.0', '-arch', arch] + objects)