From e887991068e08515659b6b8b188647c1df3da307 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 10 Dec 2015 14:18:23 +0100 Subject: [PATCH 01/41] Update README.rst --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 12d76d4..f440ffb 100644 --- a/README.rst +++ b/README.rst @@ -103,6 +103,9 @@ FAQ Fatal error: "stdio.h" file not found You need to install the Command line tools: `xcode-select --install` + +You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)... + We don't support bitcode. You need to go to the your project setting, and disable bitcode Support ------- From ea335f77a67e6648d9c6dd88df03ca97caf9ffab Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Wed, 13 Jan 2016 17:00:02 +0200 Subject: [PATCH 02/41] Updated to latest version of OpenSLL --- recipes/openssl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openssl/__init__.py b/recipes/openssl/__init__.py index 07b7cf2..f37efb3 100644 --- a/recipes/openssl/__init__.py +++ b/recipes/openssl/__init__.py @@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc', class OpensslRecipe(Recipe): - version = "1.0.2d" + version = "1.0.2e" url = "http://www.openssl.org/source/openssl-{version}.tar.gz" libraries = ["libssl.a", "libcrypto.a"] include_dir = "include" From 5aa35570c452bc77d07efddb64c4ad6e978cb0c8 Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Thu, 14 Jan 2016 08:19:15 +0200 Subject: [PATCH 03/41] Prevent unbound local variable error on download fail --- toolchain.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolchain.py b/toolchain.py index 58bd2e0..246b5d2 100755 --- a/toolchain.py +++ b/toolchain.py @@ -418,6 +418,8 @@ class Recipe(object): print('This is usually caused by a corrupt download. The file' ' will be removed and re-downloaded on the next run.') remove(filename) + return + root = archive.next().path.split("/") return root[0] elif filename.endswith(".zip"): From 5fc587901b5186fe05fbcc4a872363fe711aeb27 Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Thu, 14 Jan 2016 10:52:49 +0200 Subject: [PATCH 04/41] Updated Kivy version to 1.9.1 Tested and working on iPad, iOS 9.2 --- recipes/kivy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/kivy/__init__.py b/recipes/kivy/__init__.py index 248899a..c941f26 100644 --- a/recipes/kivy/__init__.py +++ b/recipes/kivy/__init__.py @@ -3,7 +3,7 @@ from os.path import join class KivyRecipe(CythonRecipe): - version = "1.9.0" + version = "1.9.1" url = "https://github.com/kivy/kivy/archive/{version}.zip" library = "libkivy.a" depends = ["python", "sdl2", "sdl2_image", "sdl2_mixer", "sdl2_ttf", "ios"] From f6047f4a025fce4293dcdb690984d7939d5ce89b Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Thu, 14 Jan 2016 12:47:09 +0200 Subject: [PATCH 05/41] doc: Removed openssl warning about not being ported --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f440ffb..d37b967 100644 --- a/README.rst +++ b/README.rst @@ -15,8 +15,6 @@ The toolchain supports: These recipes are not ported to the new toolchain yet: -- openssl -- openssl-link - lxml @@ -56,6 +54,7 @@ You can list the available recipes and their versions with:: ios master kivy ios-poly-arch libffi 3.2.1 + openssl 1.0.2e pyobjus master python 2.7.1 sdl2 iOS-improvements From 8f3d6ca1204f3d636b4733219ac18d00b934658c Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Thu, 14 Jan 2016 12:51:07 +0200 Subject: [PATCH 06/41] doc: added note on adding recipes --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index d37b967..70b6b5f 100644 --- a/README.rst +++ b/README.rst @@ -66,6 +66,10 @@ Then, start the compilation with:: $ ./toolchain.py build kivy +You can build recipes at the same time by adding them as parameters:: + + $ ./toolchain.py build openssl kivy + The Kivy recipe depends on several others, like the sdl* and python recipes. These may in turn depend on others e.g. sdl2_ttf depends on freetype, etc. You can think of it as follows: the kivy recipe will compile everything From 0df37129802200de54e9d30d688e7315dd3c2d8d Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Tue, 26 Jan 2016 22:37:33 +0100 Subject: [PATCH 07/41] PyYaml recipe --- recipes/pyyaml/__init__.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 recipes/pyyaml/__init__.py diff --git a/recipes/pyyaml/__init__.py b/recipes/pyyaml/__init__.py new file mode 100644 index 0000000..276d733 --- /dev/null +++ b/recipes/pyyaml/__init__.py @@ -0,0 +1,22 @@ +# pure-python package, this can be removed when we'll support any python package +from toolchain import PythonRecipe, shprint +from os.path import join +import sh, os + +class PyYamlRecipe(PythonRecipe): + version = "3.11" + # url = "https://github.com/mitsuhiko/click/archive/{version}.zip" + url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz" + 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 = 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 = PyYamlRecipe() From 9c828b2932e09ee4af819051e84e743d36eb906e Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:42:47 +0100 Subject: [PATCH 08/41] pyyaml cleanup --- recipes/pyyaml/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/pyyaml/__init__.py b/recipes/pyyaml/__init__.py index 276d733..9f06bfa 100644 --- a/recipes/pyyaml/__init__.py +++ b/recipes/pyyaml/__init__.py @@ -1,11 +1,10 @@ # pure-python package, this can be removed when we'll support any python package +import os +import sh from toolchain import PythonRecipe, shprint -from os.path import join -import sh, os class PyYamlRecipe(PythonRecipe): version = "3.11" - # url = "https://github.com/mitsuhiko/click/archive/{version}.zip" url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz" depends = ["python"] @@ -15,8 +14,8 @@ class PyYamlRecipe(PythonRecipe): 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') + 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, "setup.py", "install", "--prefix", dest_dir, _env=build_env) recipe = PyYamlRecipe() From 6b09dacfbabcf546bec1c25406e2853dade87bbb Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:47:35 +0100 Subject: [PATCH 09/41] numpy fix to provide includes for other recipes --- recipes/numpy/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/numpy/__init__.py b/recipes/numpy/__init__.py index a30af2d..3ecdad4 100644 --- a/recipes/numpy/__init__.py +++ b/recipes/numpy/__init__.py @@ -9,6 +9,7 @@ class NumpyRecipe(CythonRecipe): url = "http://pypi.python.org/packages/source/n/numpy/numpy-{version}.tar.gz" library = "libnumpy.a" libraries = ["libnpymath.a", "libnpysort.a"] + include_dir = "numpy/core/include" depends = ["python"] pbx_frameworks = ["Accelerate"] cythonize = False @@ -51,5 +52,3 @@ class NumpyRecipe(CythonRecipe): shutil.rmtree(join(dest_dir, "tests")) recipe = NumpyRecipe() - - From 3a3cb2266669309f58e644c6f694b3ab9da86868 Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:49:25 +0100 Subject: [PATCH 10/41] my failed try to fix setuptools --- recipes/host_setuptools/__init__.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/recipes/host_setuptools/__init__.py b/recipes/host_setuptools/__init__.py index 95e6ff9..ccd0ffe 100644 --- a/recipes/host_setuptools/__init__.py +++ b/recipes/host_setuptools/__init__.py @@ -8,14 +8,26 @@ import shutil class HostSetuptools(Recipe): depends = ["hostpython"] - archs = 'i386' + archs = ["x86_64"] url = "" def prebuild_arch(self, arch): hostpython = sh.Command(self.ctx.hostpython) sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py") - shprint(hostpython, "./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) recipe = HostSetuptools() - - From d00ad73752a52a80e16ebc6e56fa7c966ebe0327 Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:50:43 +0100 Subject: [PATCH 11/41] distriute recipe, may be useless since distribute is already in python --- recipes/distribute/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 recipes/distribute/__init__.py diff --git a/recipes/distribute/__init__.py b/recipes/distribute/__init__.py new file mode 100644 index 0000000..fc82a11 --- /dev/null +++ b/recipes/distribute/__init__.py @@ -0,0 +1,21 @@ +from toolchain import PythonRecipe, shprint +from os.path import join +import sh, os + +class DistributeRecipe(PythonRecipe): + version = "0.7.3" + # url = "https://github.com/mitsuhiko/click/archive/{version}.zip" + url = "https://pypi.python.org/packages/source/d/distribute/distribute-{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 = 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 = DistributeRecipe() From 78a870c5f33632bde0ac7069c4fe4cd02773330d Mon Sep 17 00:00:00 2001 From: Akshay Arora Date: Wed, 17 Feb 2016 19:52:45 +0530 Subject: [PATCH 12/41] Update openssl version --- recipes/openssl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openssl/__init__.py b/recipes/openssl/__init__.py index f37efb3..e181c4a 100644 --- a/recipes/openssl/__init__.py +++ b/recipes/openssl/__init__.py @@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc', class OpensslRecipe(Recipe): - version = "1.0.2e" + version = "1.0.2f" url = "http://www.openssl.org/source/openssl-{version}.tar.gz" libraries = ["libssl.a", "libcrypto.a"] include_dir = "include" From 856af140506be380bc351553ee9f945e4fbbd7cf Mon Sep 17 00:00:00 2001 From: Ben Hagen Date: Thu, 18 Jun 2015 11:37:12 +0200 Subject: [PATCH 13/41] build version 3.2 instead of master --- recipes/ffpyplayer/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ffpyplayer/__init__.py b/recipes/ffpyplayer/__init__.py index 8dd2129..eae0580 100644 --- a/recipes/ffpyplayer/__init__.py +++ b/recipes/ffpyplayer/__init__.py @@ -4,7 +4,7 @@ import sh class FFPyplayerRecipe(CythonRecipe): - version = "master" + version = "v3.2" url = "https://github.com/matham/ffpyplayer/archive/{version}.zip" library = "libffpyplayer.a" depends = ["python", "ffmpeg"] From 7cd250958b1ef3477cf1a88bf477010360ef12cc Mon Sep 17 00:00:00 2001 From: Ben Hagen Date: Mon, 7 Mar 2016 15:20:58 +0100 Subject: [PATCH 14/41] Update openssl version --- recipes/openssl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openssl/__init__.py b/recipes/openssl/__init__.py index e181c4a..57d3de7 100644 --- a/recipes/openssl/__init__.py +++ b/recipes/openssl/__init__.py @@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc', class OpensslRecipe(Recipe): - version = "1.0.2f" + version = "1.0.2g" url = "http://www.openssl.org/source/openssl-{version}.tar.gz" libraries = ["libssl.a", "libcrypto.a"] include_dir = "include" From 220c0747e110f8df989125eb1d8a10c7500162a0 Mon Sep 17 00:00:00 2001 From: ericatkin Date: Tue, 5 Apr 2016 22:56:20 -0600 Subject: [PATCH 15/41] Remove .exe suffix on make target --- recipes/hostpython/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/hostpython/__init__.py b/recipes/hostpython/__init__.py index b259759..eb80cdb 100644 --- a/recipes/hostpython/__init__.py +++ b/recipes/hostpython/__init__.py @@ -64,9 +64,9 @@ class HostpythonRecipe(Recipe): "--disable-toolbox-glue", "--without-gcc", _env=build_env) - shprint(sh.make, "-C", self.build_dir, "-j4", "python.exe", "Parser/pgen", + shprint(sh.make, "-C", self.build_dir, "-j4", "python", "Parser/pgen", _env=build_env) - shutil.move("python.exe", "hostpython") + shutil.move("python", "hostpython") shutil.move("Parser/pgen", "Parser/hostpgen") def install(self): From d32074542b9053c7a40350dceec5a0756bab075f Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Tue, 12 Apr 2016 22:02:25 +0200 Subject: [PATCH 16/41] doc: corrected ambiguous documentation --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 70b6b5f..4013e04 100644 --- a/README.rst +++ b/README.rst @@ -107,8 +107,8 @@ FAQ Fatal error: "stdio.h" file not found You need to install the Command line tools: `xcode-select --install` -You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)... - We don't support bitcode. You need to go to the your project setting, and disable bitcode +You must build with bitcode disabled (Xcode setting ENABLE_BITCODE should be No). + We don't support bitcode. You need to go to the project setting, and disable bitcode. Support ------- From e02f51d2582703397b0bf234f4a158c2ffc68fdc Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Thu, 14 Apr 2016 01:23:49 +0200 Subject: [PATCH 17/41] doc: removed extraneous hash --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4013e04..dd9ba3d 100644 --- a/README.rst +++ b/README.rst @@ -84,7 +84,7 @@ Create the Xcode project The `toolchain.py` can create the initial Xcode project for you:: - $ # ./toolchain.py create <app_directory> + $ ./toolchain.py create <title> <app_directory> $ ./toolchain.py create Touchtracer ~/code/kivy/examples/demo/touchtracer Your app directory must contain a main.py. A directory named `<title>-ios` From 808f646b8f917d594819da2878dc04bc8c06ff7c Mon Sep 17 00:00:00 2001 From: Ryan Pessa <dkived@gmail.com> Date: Sat, 16 Apr 2016 23:13:58 -0500 Subject: [PATCH 18/41] select version from requirements --- toolchain.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/toolchain.py b/toolchain.py index 246b5d2..1b84fa0 100755 --- a/toolchain.py +++ b/toolchain.py @@ -783,11 +783,22 @@ class Recipe(object): def get_recipe(cls, name, ctx): if not hasattr(cls, "recipes"): cls.recipes = {} + + if '==' in name: + name, version = name.split('==') + else: + version = None + if name in cls.recipes: - return cls.recipes[name] - mod = importlib.import_module("recipes.{}".format(name)) - recipe = mod.recipe - recipe.recipe_dir = join(ctx.root_dir, "recipes", name) + recipe = cls.recipes[name] + else: + mod = importlib.import_module("recipes.{}".format(name)) + recipe = mod.recipe + recipe.recipe_dir = join(ctx.root_dir, "recipes", name) + + if version: + recipe.version = version + return recipe From 2dd764f8db070a95dd24131f63b2d546de08aa88 Mon Sep 17 00:00:00 2001 From: Ryan Pessa <dkived@gmail.com> Date: Sat, 16 Apr 2016 23:08:58 -0500 Subject: [PATCH 19/41] add ccache support --- recipes/hostpython/__init__.py | 3 ++- recipes/sdl2/__init__.py | 2 ++ toolchain.py | 28 +++++++++++++++++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/recipes/hostpython/__init__.py b/recipes/hostpython/__init__.py index b259759..3afb3a4 100644 --- a/recipes/hostpython/__init__.py +++ b/recipes/hostpython/__init__.py @@ -48,7 +48,8 @@ class HostpythonRecipe(Recipe): def build_x86_64(self): sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip() build_env = self.ctx.env.copy() - build_env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics" + ccache = (build_env["CCACHE"] + ' ') if 'CCACHE' in build_env else '' + build_env["CC"] = ccache + "clang -Qunused-arguments -fcolor-diagnostics" build_env["LDFLAGS"] = " ".join([ "-lsqlite3", "-lffi", diff --git a/recipes/sdl2/__init__.py b/recipes/sdl2/__init__.py index bb016d8..f3040c3 100644 --- a/recipes/sdl2/__init__.py +++ b/recipes/sdl2/__init__.py @@ -19,9 +19,11 @@ class LibSDL2Recipe(Recipe): self.set_marker("patched") def build_arch(self, arch): + env = arch.get_env() shprint(sh.xcodebuild, "ONLY_ACTIVE_ARCH=NO", "ARCHS={}".format(arch.arch), + "CC={}".format(env['CC']), "-sdk", arch.sdk, "-project", "Xcode-iOS/SDL/SDL.xcodeproj", "-target", "libSDL", diff --git a/toolchain.py b/toolchain.py index 1b84fa0..b2a3aa7 100755 --- a/toolchain.py +++ b/toolchain.py @@ -122,6 +122,7 @@ class Arch(object): def __init__(self, ctx): super(Arch, self).__init__() self.ctx = ctx + self._ccsh = None def __str__(self): return self.arch @@ -143,7 +144,32 @@ class Arch(object): for d in self.ctx.include_dirs] env = {} - env["CC"] = sh.xcrun("-find", "-sdk", self.sdk, "clang").strip() + ccache = sh.which('ccache').strip() + cc = sh.xcrun("-find", "-sdk", self.sdk, "clang").strip() + if ccache: + use_ccache = environ.get("USE_CCACHE", "1") + if use_ccache != '1': + env["CC"] = cc + else: + if not self._ccsh: + self._ccsh = ccsh = sh.mktemp().strip() + with open(ccsh, 'w') as f: + f.write('#!/bin/sh\n') + f.write(ccache + ' ' + cc + ' "$@"\n') + sh.chmod('+x', ccsh) + else: + ccsh = self._ccsh + env["USE_CCACHE"] = '1' + env["CCACHE"] = ccache + env["CC"] = ccsh + + env.update({k: v for k, v in environ.items() if k.startswith('CCACHE_')}) + env.setdefault('CCACHE_MAXSIZE', '10G') + env.setdefault('CCACHE_HARDLINK', 'true') + env.setdefault('CCACHE_SLOPPINESS', ('file_macro,time_macros,' + 'include_file_mtime,include_file_ctime,file_stat_matches')) + else: + env["CC"] = cc env["AR"] = sh.xcrun("-find", "-sdk", self.sdk, "ar").strip() env["LD"] = sh.xcrun("-find", "-sdk", self.sdk, "ld").strip() env["OTHER_CFLAGS"] = " ".join(include_dirs) From 30fc05e233e8c68d18a0a58ddccd0eae5baaca22 Mon Sep 17 00:00:00 2001 From: Edward Betts <edward@4angle.com> Date: Mon, 18 Apr 2016 05:46:43 +0100 Subject: [PATCH 20/41] use % formatter --- toolchain.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchain.py b/toolchain.py index b2a3aa7..0bd64c2 100755 --- a/toolchain.py +++ b/toolchain.py @@ -397,10 +397,10 @@ class Recipe(object): return def report_hook(index, blksize, size): if size <= 0: - progression = '{0} bytes'.format(index * blksize) + progression = '{} bytes'.format(index * blksize) else: - progression = '{0:.2f}%'.format( - index * blksize * 100. / float(size)) + progression = '{:.2%}'.format( + index * blksize / float(size)) stdout.write('- Download {}\r'.format(progression)) stdout.flush() From 241afb5d3ce4c24e886d96cef4174cc361b24ff6 Mon Sep 17 00:00:00 2001 From: Ryan Pessa <dkived@gmail.com> Date: Mon, 18 Apr 2016 15:22:15 -0500 Subject: [PATCH 21/41] fix sh.which usage when executable does not exist --- toolchain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain.py b/toolchain.py index b2a3aa7..cf26651 100755 --- a/toolchain.py +++ b/toolchain.py @@ -144,9 +144,10 @@ class Arch(object): for d in self.ctx.include_dirs] env = {} - ccache = sh.which('ccache').strip() + ccache = sh.which('ccache') cc = sh.xcrun("-find", "-sdk", self.sdk, "clang").strip() if ccache: + ccache = ccache.strip() use_ccache = environ.get("USE_CCACHE", "1") if use_ccache != '1': env["CC"] = cc From bc864ccad6a6fec92868b81f136a88eaae4d8d79 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel <mat@kivy.org> Date: Tue, 19 Apr 2016 19:53:34 +0200 Subject: [PATCH 22/41] toolchain: add Xcode command to open a specific project with Xcode --- toolchain.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/toolchain.py b/toolchain.py index cf26651..bc0f317 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1231,6 +1231,21 @@ Xcode: import xcassets self._xcassets("Icon", xcassets.icon) + def xcode(self): + parser = argparse.ArgumentParser(description="Open the xcode project") + parser.add_argument("filename", help="Path to your project or xcodeproj") + args = parser.parse_args(sys.argv[2:]) + filename = args.filename + if not filename.endswith(".xcodeproj"): + # try to find the xcodeproj + from glob import glob + xcodeproj = glob(join(filename, "*.xcodeproj")) + if not xcodeproj: + print("ERROR: Unable to find a xcodeproj in {}".format(filename)) + sys.exit(1) + filename = xcodeproj[0] + sh.open(filename) + def _xcassets(self, title, command): parser = argparse.ArgumentParser( description="Generate {} for your project".format(title)) From 5fa807cf5f3b595e55b9db5665a47284a110a3a9 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel <mat@kivy.org> Date: Tue, 19 Apr 2016 19:53:55 +0200 Subject: [PATCH 23/41] toolchain: add a pip command to ease the installation of pip packages within the toolchain --- toolchain.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/toolchain.py b/toolchain.py index bc0f317..89be0c5 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1223,6 +1223,36 @@ Xcode: print("--") print("Project {} updated".format(filename)) + def pip(self): + ctx = Context() + for recipe in Recipe.list_recipes(): + key = "{}.build_all".format(recipe) + if key not in ctx.state: + continue + recipe = Recipe.get_recipe(recipe, ctx) + recipe.init_with_ctx(ctx) + print(ctx.site_packages_dir) + if not hasattr(ctx, "site_packages_dir"): + print("ERROR: python must be compiled before using pip") + sys.exit(1) + + pip_env = { + "CC": "/bin/false", + "CXX": "/bin/false", + "PYTHONPATH": ctx.site_packages_dir, + "PYTHONOPTIMIZE": "2", + "PIP_INSTALL_TARGET": ctx.site_packages_dir + } + print pip_env + pip_path = sh.which("pip") + args = [pip_path] + sys.argv[2:] + if not pip_path: + print("ERROR: pip not found") + sys.exit(1) + import os + print("-- execute pip with: {}".format(args)) + os.execve(pip_path, args, pip_env) + def launchimage(self): import xcassets self._xcassets("LaunchImage", xcassets.launchimage) From 0df5316e3be0fac7616924107820a925cba81697 Mon Sep 17 00:00:00 2001 From: Richard Larkin <richard@camiweb.com> Date: Wed, 20 Apr 2016 12:59:58 +0200 Subject: [PATCH 24/41] doc: added command for complete option listing --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index dd9ba3d..0b1c881 100644 --- a/README.rst +++ b/README.rst @@ -79,6 +79,10 @@ Don't grab a coffee, just do diner. Compiling all the libraries for the first time, 4x over (remember, 4 archs, 2 per platforms), will take time. (TODO: provide a way to not compile for the simulator.). +To see a complete list of available commands, type:: + + $ ./toolchain.py + Create the Xcode project ------------------------ From 843d688cf496a4952da0c5a36c07bc194db5dd27 Mon Sep 17 00:00:00 2001 From: Zen-CODE <zenkey.zencode@gmail.com> Date: Wed, 20 Apr 2016 13:02:51 +0200 Subject: [PATCH 25/41] doc: Added toolchain command for command listing --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index dd9ba3d..ccd35ce 100644 --- a/README.rst +++ b/README.rst @@ -79,6 +79,10 @@ Don't grab a coffee, just do diner. Compiling all the libraries for the first time, 4x over (remember, 4 archs, 2 per platforms), will take time. (TODO: provide a way to not compile for the simulator.). +For a complete list of available commands, type:: + + $ ./toolchain.py + Create the Xcode project ------------------------ From cca0f026188da9906666d0fbdc2658fb8277e2d3 Mon Sep 17 00:00:00 2001 From: Ben Hagen <c.ben.hagen@gmail.com> Date: Tue, 3 May 2016 17:26:14 +0200 Subject: [PATCH 26/41] Update openssl to version 1.0.2h --- recipes/openssl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openssl/__init__.py b/recipes/openssl/__init__.py index 57d3de7..846ae84 100644 --- a/recipes/openssl/__init__.py +++ b/recipes/openssl/__init__.py @@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc', class OpensslRecipe(Recipe): - version = "1.0.2g" + version = "1.0.2h" url = "http://www.openssl.org/source/openssl-{version}.tar.gz" libraries = ["libssl.a", "libcrypto.a"] include_dir = "include" From 5d91cb7a57c63678cd458339b812ee80b4e11bb3 Mon Sep 17 00:00:00 2001 From: Ryan Pessa <ryan@essential-elements.net> Date: Tue, 3 May 2016 15:38:59 -0500 Subject: [PATCH 27/41] fix archive_root property to not return None --- toolchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.py b/toolchain.py index 1b84fa0..0be5a32 100755 --- a/toolchain.py +++ b/toolchain.py @@ -546,7 +546,7 @@ class Recipe(object): def archive_root(self): key = "{}.archive_root".format(self.name) value = self.ctx.state.get(key) - if not key: + if not value: value = self.get_archive_rootdir(self.archive_fn) self.ctx.state[key] = value return value From 72cbbd97106ba1d05b6f0f10d07daf16516d0929 Mon Sep 17 00:00:00 2001 From: akshayaurora <akshayaurora@gmail.com> Date: Wed, 25 May 2016 02:37:00 +0530 Subject: [PATCH 28/41] WIP:Initial implementation of keyboard_height, we get correct height. Moving window part is still not tested, fixed. --- recipes/ios/src/ios.pyx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/recipes/ios/src/ios.pyx b/recipes/ios/src/ios.pyx index 4583320..32e8dc1 100644 --- a/recipes/ios/src/ios.pyx +++ b/recipes/ios/src/ios.pyx @@ -171,3 +171,43 @@ def get_dpi(): '''Return the approximate DPI of the screen ''' return ios_uiscreen_get_dpi() + + +from pyobjus import autoclass, selector, protocol +from pyobjus.protocols import protocols + +NSNotificationCenter = autoclass('NSNotificationCenter') + +protocols["KeyboardDelegates"] = { + 'keyboardWillShow': ('v16@0:4@8', "v32@0:8@16"), + 'keyboardDidHide': ('v16@0:4@8', "v32@0:8@16")} + + +class IOSKeyboard(object): + '''Get listener for keyboard height. + ''' + + kheight = 0 + + def __init__(self, **kwargs): + super(IOSKeyboard, self).__init__() + NSNotificationCenter.defaultCenter().addObserver_selector_name_object_(self, selector("keyboardWillShow"), "UIKeyboardWillShowNotification", None) + NSNotificationCenter.defaultCenter().addObserver_selector_name_object_(self, selector("keyboardDidHide"), "UIKeyboardDidHideNotification", None) + + @protocol('KeyboardDelegates') + def keyboardWillShow(self, notification): + self.kheight = notification.userInfo().objectForKey_( + 'UIKeyboardFrameEndUserInfoKey').CGRectValue().size.height + from kivy.core.window import Window + Window.trigger_keyboard_height() + + @protocol('KeyboardDelegates') + def keyboardDidHide(self, notification): + self.kheight = 0 + from kivy.core.window import Window + Window.trigger_keyboard_height() + +iOSKeyboard = IOSKeyboard() + +def get_kheight(): + return iOSKeyboard.kheight From 2d174322daf115c3efad00b4aeeba3a2441c3120 Mon Sep 17 00:00:00 2001 From: akshayaurora <akshayaurora@gmail.com> Date: Thu, 26 May 2016 03:09:31 +0530 Subject: [PATCH 29/41] take account device density, for `softinput_mode` --- recipes/ios/src/ios.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ios/src/ios.pyx b/recipes/ios/src/ios.pyx index 32e8dc1..05e9831 100644 --- a/recipes/ios/src/ios.pyx +++ b/recipes/ios/src/ios.pyx @@ -196,7 +196,7 @@ class IOSKeyboard(object): @protocol('KeyboardDelegates') def keyboardWillShow(self, notification): - self.kheight = notification.userInfo().objectForKey_( + self.kheight = get_scale() * notification.userInfo().objectForKey_( 'UIKeyboardFrameEndUserInfoKey').CGRectValue().size.height from kivy.core.window import Window Window.trigger_keyboard_height() From 0750acf13244bbcc3d7d8623114178c4143d9a27 Mon Sep 17 00:00:00 2001 From: Scott Sievert <sieve121@umn.edu> Date: Thu, 2 Jun 2016 11:02:37 -0700 Subject: [PATCH 30/41] Clarifies docs to clarify building recipes --- toolchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.py b/toolchain.py index b06b04e..49745dd 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1060,7 +1060,7 @@ if __name__ == "__main__": usage="""toolchain <command> [<args>] Available commands: - build Build a specific recipe + build Build an external package, found in recipes/ clean Clean the build distclean Clean the build and the result recipes List all the available recipes From c613068e5b59ca72a1eeeed129e992bf837c0b0f Mon Sep 17 00:00:00 2001 From: Richard Larkin <richard@camiweb.com> Date: Fri, 24 Jun 2016 11:56:00 +0200 Subject: [PATCH 31/41] Added comments on orientation control --- .../main.m | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tools/templates/{{ cookiecutter.project_name }}-ios/main.m b/tools/templates/{{ cookiecutter.project_name }}-ios/main.m index 017a930..99f2325 100644 --- a/tools/templates/{{ cookiecutter.project_name }}-ios/main.m +++ b/tools/templates/{{ cookiecutter.project_name }}-ios/main.m @@ -83,12 +83,25 @@ int main(int argc, char *argv[]) { return ret; } -// This method read available orientations from the Info.plist, and share them -// in an environment variable. Kivy will automatically set the orientation -// according to this environment value, if exist. +// This method reads the available orientations from the Info.plist file and +// shares them via an environment variable. Kivy will automatically set the +// orientation according to this environment value, if it exists. To restrict +// the allowed orientation, please see the comments inside. void export_orientation() { NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; NSArray *orientations = [info objectForKey:@"UISupportedInterfaceOrientations"]; + + // Orientation restrictions + // ======================== + // Comment or uncomment blocks 1-3 in order the limit orientation support + + // 1. Landscape only + // NSString *result = [[NSString alloc] initWithString:@"KIVY_ORIENTATION=LandscapeLeft LandscapeRight"]; + + // 2. Portrait only + // NSString *result = [[NSString alloc] initWithString:@"KIVY_ORIENTATION=Portrait PortraitUpsideDown"]; + + // 3. All orientations NSString *result = [[NSString alloc] initWithString:@"KIVY_ORIENTATION="]; for (int i = 0; i < [orientations count]; i++) { NSString *item = [orientations objectAtIndex:i]; @@ -97,6 +110,7 @@ void export_orientation() { result = [result stringByAppendingString:@" "]; result = [result stringByAppendingString:item]; } + // ======================== putenv((char *)[result UTF8String]); NSLog(@"Available orientation: %@", result); From 5f048d3eadcbbfc714b3958abbf72ffb23995f0d Mon Sep 17 00:00:00 2001 From: Scott Sievert <sieve121@umn.edu> Date: Sun, 26 Jun 2016 10:33:33 -0500 Subject: [PATCH 32/41] Clarifies build help "(available packages in the recipes directory)" --- toolchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.py b/toolchain.py index 49745dd..be32e59 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1060,7 +1060,7 @@ if __name__ == "__main__": usage="""toolchain <command> [<args>] Available commands: - build Build an external package, found in recipes/ + build Build an external package (available packages in the recipes directory). clean Clean the build distclean Clean the build and the result recipes List all the available recipes From 6ee0a927b6d6db05256255bb544181c9fb501c15 Mon Sep 17 00:00:00 2001 From: Richard Larkin <richard@camiweb.com> Date: Tue, 28 Jun 2016 12:31:35 +0200 Subject: [PATCH 33/41] Added note on 'main.m' and orientation settings --- README.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ccd35ce..49cd6cb 100644 --- a/README.rst +++ b/README.rst @@ -99,12 +99,26 @@ You can open the Xcode project using:: Then click on `Play`, and enjoy. -.. notes:: +.. note:: Everytime you press `Play`, your application directory will be synced to the `<title>-ios/YourApp` directory. Don't make changes in the -ios directory directly. +Configuring your App +-------------------- + +When you first build your XCode project, a 'main.m' file is created in your +XCode project folder. This file configures your environment variables and +controls your application startup. You can edit this file to customize your +launch environment. + +.. note:: + + If you wish to restrict your apps orientation, you should do this via + the 'export_orientation' function in 'main.m'. The XCode orientation + settings should be set to support all. + FAQ --- From 7080a9dadcd0723a8dc19051191a89471d670990 Mon Sep 17 00:00:00 2001 From: Richard Larkin <richard@camiweb.com> Date: Tue, 28 Jun 2016 15:54:38 +0200 Subject: [PATCH 34/41] Updated version of openssl --- recipes/openssl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openssl/__init__.py b/recipes/openssl/__init__.py index e181c4a..846ae84 100644 --- a/recipes/openssl/__init__.py +++ b/recipes/openssl/__init__.py @@ -10,7 +10,7 @@ arch_mapper = {'i386': 'darwin-i386-cc', class OpensslRecipe(Recipe): - version = "1.0.2f" + version = "1.0.2h" url = "http://www.openssl.org/source/openssl-{version}.tar.gz" libraries = ["libssl.a", "libcrypto.a"] include_dir = "include" From 8cdc790375c9558b676b90c8ed3b58f9dffb9874 Mon Sep 17 00:00:00 2001 From: Zen-CODE <zenkey.zencode@gmail.com> Date: Fri, 1 Jul 2016 21:09:10 +0200 Subject: [PATCH 35/41] Tweaked wording --- toolchain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain.py b/toolchain.py index efe4603..07371bb 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1060,7 +1060,8 @@ if __name__ == "__main__": usage="""toolchain <command> [<args>] Available commands: - build Build an external package (available packages in the recipes directory). + build Build a recipe (compile a library for the required target + architecture) clean Clean the build distclean Clean the build and the result recipes List all the available recipes From 24b3ded9164b89855a207ba78b8299a61a41ed49 Mon Sep 17 00:00:00 2001 From: Richard Larkin <zenkey.zencode@gmail.com> Date: Mon, 4 Jul 2016 12:00:39 +0200 Subject: [PATCH 36/41] Redirect Python-ast lookup to 'hostpython'. Fixes #201 --- recipes/hostpython/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/hostpython/__init__.py b/recipes/hostpython/__init__.py index a1a0fd0..13284ce 100644 --- a/recipes/hostpython/__init__.py +++ b/recipes/hostpython/__init__.py @@ -75,6 +75,9 @@ class HostpythonRecipe(Recipe): build_env = arch.get_env() build_dir = self.get_build_dir(arch.arch) build_env["PATH"] = os.environ["PATH"] + shprint(sh.ln, "-s", + join(build_dir, "hostpython"), + join(build_dir, "Python")) shprint(sh.make, "-C", build_dir, "bininstall", "inclinstall", From 320c0808c09cbafe1651f8d32d310489d698f490 Mon Sep 17 00:00:00 2001 From: Richard Larkin <zenkey.zencode@gmail.com> Date: Mon, 11 Jul 2016 15:10:46 +0200 Subject: [PATCH 37/41] Added explanatory note --- recipes/hostpython/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/hostpython/__init__.py b/recipes/hostpython/__init__.py index 13284ce..ca3aac9 100644 --- a/recipes/hostpython/__init__.py +++ b/recipes/hostpython/__init__.py @@ -75,6 +75,8 @@ class HostpythonRecipe(Recipe): build_env = arch.get_env() build_dir = self.get_build_dir(arch.arch) build_env["PATH"] = os.environ["PATH"] + # Compiling sometimes looks for Python-ast.py in the 'Python' i.s.o + # the 'hospython' folder. Create a symlink to fix. See issue #201 shprint(sh.ln, "-s", join(build_dir, "hostpython"), join(build_dir, "Python")) From 3e4eb4bfed404442806e40e8bd7d451a6589b0ce Mon Sep 17 00:00:00 2001 From: Zen-CODE <zenkey.zencode@gmail.com> Date: Mon, 11 Jul 2016 21:43:44 +0200 Subject: [PATCH 38/41] Grammar tweaks --- recipes/hostpython/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/hostpython/__init__.py b/recipes/hostpython/__init__.py index ca3aac9..e0e1588 100644 --- a/recipes/hostpython/__init__.py +++ b/recipes/hostpython/__init__.py @@ -75,8 +75,8 @@ class HostpythonRecipe(Recipe): build_env = arch.get_env() build_dir = self.get_build_dir(arch.arch) build_env["PATH"] = os.environ["PATH"] - # Compiling sometimes looks for Python-ast.py in the 'Python' i.s.o - # the 'hospython' folder. Create a symlink to fix. See issue #201 + # Compiling sometimes looks for Python-ast.py in the 'Python' i.s.o. + # the 'hostpython' folder. Create a symlink to fix. See issue #201 shprint(sh.ln, "-s", join(build_dir, "hostpython"), join(build_dir, "Python")) From 1ca7756dc1e5ca7cda2b4f9aef9826db7061aeb5 Mon Sep 17 00:00:00 2001 From: Richard Larkin <zenkey.zencode@gmail.com> Date: Tue, 12 Jul 2016 15:36:45 +0200 Subject: [PATCH 39/41] Fixed filename extention matching. closes #193 --- toolchain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain.py b/toolchain.py index 8965dd5..804bf96 100755 --- a/toolchain.py +++ b/toolchain.py @@ -835,12 +835,12 @@ class PythonRecipe(Recipe): self.install_python_package() self.reduce_python_package() - def remove_junk(self, d): - exts = ["pyc", "py", "so.lib", "so.o", "sh"] + @staticmethod + def remove_junk(d): + exts = [".pyc", ".py", ".so.lib", ".so.o", ".sh"] for root, dirnames, filenames in walk(d): for fn in filenames: - ext = fn.rsplit(".", 1)[-1] - if ext in exts: + if any([fn.endswith(ext) for ext in exts]): unlink(join(root, fn)) def install_python_package(self, name=None, env=None, is_dir=True): From a9a4b281c3e4359c069ae2656e26d54bb791caf8 Mon Sep 17 00:00:00 2001 From: Richard Larkin <zenkey.zencode@gmail.com> Date: Thu, 28 Jul 2016 09:46:11 +0200 Subject: [PATCH 40/41] doc: added help on 'clean' command to remove build --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 49cd6cb..cea324e 100644 --- a/README.rst +++ b/README.rst @@ -70,6 +70,10 @@ You can build recipes at the same time by adding them as parameters:: $ ./toolchain.py build openssl kivy +Recipe builds can be removed via the clean command e.g.:: + + $ ./toolchain.py clean openssl + The Kivy recipe depends on several others, like the sdl* and python recipes. These may in turn depend on others e.g. sdl2_ttf depends on freetype, etc. You can think of it as follows: the kivy recipe will compile everything From 0f02ed793ca3bc51569baf51027f6b5f1084e0e2 Mon Sep 17 00:00:00 2001 From: Richard Larkin <zenkey.zencode@gmail.com> Date: Thu, 28 Jul 2016 10:14:18 +0200 Subject: [PATCH 41/41] doc: clarified clean command --- toolchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.py b/toolchain.py index 804bf96..f55a9d8 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1062,7 +1062,7 @@ if __name__ == "__main__": Available commands: build Build a recipe (compile a library for the required target architecture) - clean Clean the build + clean Clean the build of the specified recipe distclean Clean the build and the result recipes List all the available recipes status List all the recipes and their build status