cleanup; builds for xcode 6 and 7
This commit is contained in:
parent
1ef0fd54e3
commit
29b4aeec5e
7 changed files with 10 additions and 64 deletions
|
@ -37,7 +37,7 @@ class LibffiRecipe(Recipe):
|
||||||
shprint(sh.xcodebuild,
|
shprint(sh.xcodebuild,
|
||||||
"ONLY_ACTIVE_ARCH=NO",
|
"ONLY_ACTIVE_ARCH=NO",
|
||||||
"ARCHS={}".format(arch.arch),
|
"ARCHS={}".format(arch.arch),
|
||||||
"-sdk", "macosx10.11",
|
"-sdk", "macosx",
|
||||||
"install", "installhdrs",
|
"install", "installhdrs",
|
||||||
"-project", "libffi.xcodeproj",
|
"-project", "libffi.xcodeproj",
|
||||||
"-target", "libffi-Mac",
|
"-target", "libffi-Mac",
|
||||||
|
|
|
@ -13,7 +13,6 @@ class HostpythonRecipe(Recipe):
|
||||||
|
|
||||||
def init_with_ctx(self, ctx):
|
def init_with_ctx(self, ctx):
|
||||||
super(HostpythonRecipe, self).init_with_ctx(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.hostpython = join(self.ctx.dist_dir, "hostpython", "bin", "python")
|
||||||
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython", "bin", "pgen")
|
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython", "bin", "pgen")
|
||||||
print("Global: hostpython located at {}".format(self.ctx.hostpython))
|
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("ssize-t-max.patch")
|
||||||
self.apply_patch("dynload.patch")
|
self.apply_patch("dynload.patch")
|
||||||
self.apply_patch("static-_sqlite3.patch")
|
self.apply_patch("static-_sqlite3.patch")
|
||||||
self.apply_patch("ldfix.patch")
|
|
||||||
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
||||||
self.set_marker("patched")
|
self.set_marker("patched")
|
||||||
|
|
||||||
|
@ -52,8 +50,10 @@ class HostpythonRecipe(Recipe):
|
||||||
build_env = self.ctx.env.copy()
|
build_env = self.ctx.env.copy()
|
||||||
build_env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
|
build_env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
|
||||||
build_env["LDFLAGS"] = " ".join([
|
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([
|
build_env["CFLAGS"] = " ".join([
|
||||||
"--sysroot={}".format(sdk_path),
|
"--sysroot={}".format(sdk_path),
|
||||||
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
||||||
|
@ -62,7 +62,6 @@ class HostpythonRecipe(Recipe):
|
||||||
shprint(configure,
|
shprint(configure,
|
||||||
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
|
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
|
||||||
"--disable-toolbox-glue",
|
"--disable-toolbox-glue",
|
||||||
"--with-system-ffi",
|
|
||||||
"--without-gcc",
|
"--without-gcc",
|
||||||
_env=build_env)
|
_env=build_env)
|
||||||
shprint(sh.make, "-C", self.build_dir, "-j4", "python.exe", "Parser/pgen",
|
shprint(sh.make, "-C", self.build_dir, "-j4", "python.exe", "Parser/pgen",
|
||||||
|
|
|
@ -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
|
|
|
@ -1,16 +1,6 @@
|
||||||
from toolchain import CythonRecipe
|
from toolchain import CythonRecipe
|
||||||
from os.path import join
|
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):
|
class KivyRecipe(CythonRecipe):
|
||||||
version = "1.9.0"
|
version = "1.9.0"
|
||||||
|
@ -31,21 +21,7 @@ class KivyRecipe(CythonRecipe):
|
||||||
|
|
||||||
def build_arch(self, arch):
|
def build_arch(self, arch):
|
||||||
self._patch_setup()
|
self._patch_setup()
|
||||||
build_env = self.get_recipe_env(arch)
|
super(KivyRecipe, self).build_arch(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()
|
|
||||||
|
|
||||||
def _patch_setup(self):
|
def _patch_setup(self):
|
||||||
# patch setup to remove some functionnalities
|
# patch setup to remove some functionnalities
|
||||||
|
|
|
@ -8,7 +8,6 @@ class PythonRecipe(Recipe):
|
||||||
version = "2.7.1"
|
version = "2.7.1"
|
||||||
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
|
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
|
||||||
depends = ["hostpython", "libffi", ]
|
depends = ["hostpython", "libffi", ]
|
||||||
#depends = ["libffi", ]
|
|
||||||
optional_depends = ["openssl"]
|
optional_depends = ["openssl"]
|
||||||
library = "libpython2.7.a"
|
library = "libpython2.7.a"
|
||||||
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
|
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
|
||||||
|
@ -47,8 +46,7 @@ class PythonRecipe(Recipe):
|
||||||
"LDFLAGS={} -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
|
"LDFLAGS={} -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
|
||||||
"--without-pymalloc",
|
"--without-pymalloc",
|
||||||
"--disable-toolbox-glue",
|
"--disable-toolbox-glue",
|
||||||
"--target={}-apple-ios7.0".format(arch),
|
"--host={}-apple-darwin".format(arch),
|
||||||
"--host=x86_64-apple-darwin",
|
|
||||||
"--prefix=/python",
|
"--prefix=/python",
|
||||||
"--with-system-ffi",
|
"--with-system-ffi",
|
||||||
"--without-doc-strings",
|
"--without-doc-strings",
|
||||||
|
@ -62,10 +60,6 @@ class PythonRecipe(Recipe):
|
||||||
"CROSS_COMPILE_TARGET=yes",
|
"CROSS_COMPILE_TARGET=yes",
|
||||||
"HOSTPYTHON={}".format(self.ctx.hostpython),
|
"HOSTPYTHON={}".format(self.ctx.hostpython),
|
||||||
"HOSTPGEN={}".format(self.ctx.hostpgen))
|
"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):
|
def install(self):
|
||||||
arch = list(self.filtered_archs)[0]
|
arch = list(self.filtered_archs)[0]
|
||||||
|
@ -79,13 +73,6 @@ class PythonRecipe(Recipe):
|
||||||
"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", "python")),
|
||||||
_env=build_env)
|
_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()
|
self.reduce_python()
|
||||||
|
|
||||||
def _patch_pyconfig(self):
|
def _patch_pyconfig(self):
|
||||||
|
|
|
@ -174,7 +174,7 @@ class ArchSimulator(Arch):
|
||||||
sdk = "iphonesimulator"
|
sdk = "iphonesimulator"
|
||||||
arch = "i386"
|
arch = "i386"
|
||||||
triple = "i386-apple-darwin11"
|
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()
|
sysroot = sh.xcrun("--sdk", "iphonesimulator", "--show-sdk-path").strip()
|
||||||
|
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class ArchIOS(Arch):
|
||||||
sdk = "iphoneos"
|
sdk = "iphoneos"
|
||||||
arch = "armv7"
|
arch = "armv7"
|
||||||
triple = "arm-apple-darwin11"
|
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()
|
sysroot = sh.xcrun("--sdk", "iphoneos", "--show-sdk-path").strip()
|
||||||
|
|
||||||
|
|
||||||
|
@ -816,9 +816,7 @@ class PythonRecipe(Recipe):
|
||||||
print("Install {} into the site-packages".format(name))
|
print("Install {} into the site-packages".format(name))
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
chdir(build_dir)
|
chdir(build_dir)
|
||||||
env["PYTHONHOME"] = join(self.ctx.dist_dir, "hostpython")
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
#hostpython = sh.Command("/usr/bin/python2.7")
|
|
||||||
iosbuild = join(build_dir, "iosbuild")
|
iosbuild = join(build_dir, "iosbuild")
|
||||||
shprint(hostpython, "setup.py", "install", "-O2",
|
shprint(hostpython, "setup.py", "install", "-O2",
|
||||||
"--prefix", iosbuild,
|
"--prefix", iosbuild,
|
||||||
|
@ -881,9 +879,7 @@ class CythonRecipe(PythonRecipe):
|
||||||
|
|
||||||
def build_arch(self, arch):
|
def build_arch(self, arch):
|
||||||
build_env = self.get_recipe_env(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(self.ctx.hostpython)
|
||||||
#hostpython = sh.Command("/usr/bin/python2.7")
|
|
||||||
if self.pre_build_ext:
|
if self.pre_build_ext:
|
||||||
try:
|
try:
|
||||||
shprint(hostpython, "setup.py", "build_ext", "-g",
|
shprint(hostpython, "setup.py", "build_ext", "-g",
|
||||||
|
|
|
@ -76,5 +76,4 @@ f.close()
|
||||||
print('Liblink redirect linking with', objects)
|
print('Liblink redirect linking with', objects)
|
||||||
ld = environ.get('ARM_LD')
|
ld = environ.get('ARM_LD')
|
||||||
arch = environ.get('ARCH', 'armv7')
|
arch = environ.get('ARCH', 'armv7')
|
||||||
print('linking with {} for arch {}'.format(ld, arch))
|
subprocess.call([ld, '-r', '-o', output + '.o', '-ios_version_min', '7.0', '-arch', arch] + objects)
|
||||||
subprocess.call([ld, '-r', '-arch', arch, '-ios_version_min', '7.0', '-o', output + '.o'] + objects)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue