From cd93f9bfe90669d9e656a2c798672cb60c273da6 Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Thu, 8 Dec 2016 18:17:14 +0100 Subject: [PATCH 01/16] ignores --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index c42423a..88b1184 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,10 @@ pip-log.txt #Mr Developer .mr.developer.cfg MANIFEST + +# Eclipse +.project +.pydevproject + +# Custom virtualenv location +venv From 90981b4e55f171280c773a2fb4733bc09e921373 Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Thu, 8 Dec 2016 18:21:24 +0100 Subject: [PATCH 02/16] More ignores, use rnixx fork of python-for-android --- .gitignore | 1 + buildozer/targets/android.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 88b1184..f76e722 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ MANIFEST # Eclipse .project .pydevproject +.settings # Custom virtualenv location venv diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 2816c3a..dddaaa4 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -480,7 +480,7 @@ class TargetAndroid(Target): if not self.buildozer.file_exists(pa_dir): cmd( ('git clone -b {} --single-branch ' - 'https://github.com/kivy/python-for-android.git ' + 'https://github.com/rnixx/python-for-android.git ' '{}').format(source, self.p4a_directory), cwd=self.buildozer.platform_dir) elif self.platform_update: From b1f34c75fdff26698695613bac04d7e82f9a056f Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Tue, 13 Dec 2016 14:56:26 +0100 Subject: [PATCH 03/16] Add presplash background color support for android when using the new toolchain --- buildozer/default.spec | 7 +++++++ buildozer/targets/android_new.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/buildozer/default.spec b/buildozer/default.spec index af60c30..12c9274 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -71,6 +71,13 @@ orientation = landscape # (bool) Indicate if the application should be fullscreen or not fullscreen = 1 +# (string) Presplash background color (for new android toolchain) +# Supported formats are: #RRGGBB #AARRGGBB or one of the following names: +# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, +# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, +# olive, purple, silver, teal. +#android.presplash_color = #FFFFFF + # (list) Permissions #android.permissions = INTERNET diff --git a/buildozer/targets/android_new.py b/buildozer/targets/android_new.py index 7b65bb2..072b285 100644 --- a/buildozer/targets/android_new.py +++ b/buildozer/targets/android_new.py @@ -98,6 +98,12 @@ class TargetAndroidNew(TargetAndroid): else: cmd.extend(args) + # support for presplash background color + presplash_color = self.buildozer.config.getdefault('app', 'android.presplash_color', None) + if presplash_color: + cmd.append('--presplash-color') + cmd.append(presplash_color) + # support for services services = self.buildozer.config.getlist('app', 'services', []) for service in services: From e718520c6c3304359962094970af307df1823441 Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Tue, 13 Dec 2016 15:22:49 +0100 Subject: [PATCH 04/16] Presplash color needs to be passed in single quotes --- buildozer/targets/android_new.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/targets/android_new.py b/buildozer/targets/android_new.py index 072b285..ba34099 100644 --- a/buildozer/targets/android_new.py +++ b/buildozer/targets/android_new.py @@ -102,7 +102,7 @@ class TargetAndroidNew(TargetAndroid): presplash_color = self.buildozer.config.getdefault('app', 'android.presplash_color', None) if presplash_color: cmd.append('--presplash-color') - cmd.append(presplash_color) + cmd.append("'{}'".format(presplash_color)) # support for services services = self.buildozer.config.getlist('app', 'services', []) From 92ef490f6375247749da8622fe870e5d06402b1d Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Thu, 18 May 2017 18:37:16 +0530 Subject: [PATCH 05/16] Use dmg instead of 7z --- buildozer/targets/osx.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/buildozer/targets/osx.py b/buildozer/targets/osx.py index 121b765..66caf02 100644 --- a/buildozer/targets/osx.py +++ b/buildozer/targets/osx.py @@ -58,30 +58,17 @@ class TargetOSX(Target): 'Kivy.app'), cwd=cwd) else: - if not exists(join(cwd, 'Kivy{}.7z'.format(py_branch))): + if not exists(join(cwd, 'Kivy{}.dmg'.format(py_branch))): self.buildozer.info('Downloading kivy...') check_call( - ('curl', '-L', '-o', 'Kivy{}.7z'.format(py_branch), - 'http://kivy.org/downloads/{}/Kivy-{}-osx-python{}.7z'\ + ('curl', '-L', '-o', 'Kivy{}.dmg'.format(py_branch), + 'http://kivy.org/downloads/{}/Kivy-{}-osx-python{}.dmg'\ .format(current_kivy_vers, current_kivy_vers, py_branch)), cwd=cwd) - if not exists(join(cwd, 'Keka.app')): - self.buildozer.info( - 'Downloading Keka as dependency (to install Kivy)') - check_call( - ('curl', '-O', 'http://www.kekaosx.com/release/Keka-1.0.8.dmg'), - cwd=cwd) - check_call(('hdiutil', 'attach', 'Keka-1.0.8.dmg'), cwd=cwd) - check_call(('cp', '-a','/Volumes/Keka/Keka.app', './Keka.app'), cwd=cwd) - check_call(('hdiutil', 'detach', '/Volumes/Keka')) - self.buildozer.info('Extracting and installing Kivy...') - check_call( - (join(cwd, 'Keka.app/Contents/MacOS/Keka'), - join(cwd, 'Kivy{}.7z').format(py_branch)), cwd=cwd) - check_call(('rm', 'Kivy{}.7z'.format(py_branch)), cwd=cwd) - check_call(('mv', 'Kivy{}.app'.format(py_branch), 'Kivy.app'),cwd=cwd) + check_call(('hdiutil', 'attach', cwd + '/Kivy{}.dmg'.format(py_branch))) + check_call(('cp', '-a', '/Volumes/Kivy/Kivy.app', './Kivy.app'), cwd=cwd) def ensure_kivyapp(self): self.buildozer.info('check if Kivy.app exists in local dir') From 7b87d805609cd489a3978f8272e14eec4e41bd5a Mon Sep 17 00:00:00 2001 From: Jamie Alexandre Date: Tue, 27 Jun 2017 13:43:44 -0700 Subject: [PATCH 06/16] Fix unicode coding error in android build target Using Python 2.7, attempting to run `encode(utf-8)` was throwing `write() argument 1 must be unicode, not str`. As the file being written has `encoding='utf-8'`, I'm assuming the intention was to decode the lines from an `str` into a unicode string, and I believe that's what this change does. Please let me know if I've misinterpreted something. Making this change fixed my build locally. Also not sure where I should be targeting this. --- buildozer/targets/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 9914000..40e3207 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -851,7 +851,7 @@ class TargetAndroid(Target): # recreate the project.properties with io.open(project_fn, 'w', encoding='utf-8') as fd: try: - fd.writelines((line.encode('utf-8') for line in content)) + fd.writelines((line.decode('utf-8') for line in content)) except: fd.writelines(content) if not content[-1].endswith(u'\n'): From 8f3f1bc3e92f78adc1319f0e97b8003c9c932c39 Mon Sep 17 00:00:00 2001 From: Peter Badida Date: Fri, 11 Aug 2017 21:39:18 +0200 Subject: [PATCH 07/16] Update copyright year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5915a74..d5d6b13 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2010-2016 Kivy Team and other contributors +Copyright (c) 2010-2017 Kivy Team and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From c256fd294fc5a65bb437c838aed634da099f06e1 Mon Sep 17 00:00:00 2001 From: Craig MacEachern Date: Mon, 11 Sep 2017 17:40:18 -0400 Subject: [PATCH 08/16] Update specifications.rst Typos and syntactic corrections. --- docs/source/specifications.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/specifications.rst b/docs/source/specifications.rst index c9fe199..35a0ceb 100644 --- a/docs/source/specifications.rst +++ b/docs/source/specifications.rst @@ -10,7 +10,7 @@ Section [app] - `title`: String, title of your application. It might be possible that some characters are not working depending on the - targeted paltform. It's best to try and see if everything works as expected. + targeted platform. It's best to try and see if everything works as expected. Try to avoid too long titles, as they will also not fit in the title displayed under the icon. @@ -32,14 +32,14 @@ Section [app] The location must be a directory that contains a `main.py` file. It defaults to the directory where `buildozer.spec` is. -- `source.include_exts`: List, files' extensions to include. +- `source.include_exts`: List, file extensions to include. By default, not all files in your `source.dir` are included, but only some of them (`py,png,jpg,kv,atlas`), depending on the extension. Feel free to add your own extensions, or use an empty value if you want to include everything. -- `source.exclude_exts`: List, files' extensions to exclude. +- `source.exclude_exts`: List, file extensions to exclude. In contrary to `source.include_exts`, you could include all the files you want except the ones that end with an extension listed in this token. If @@ -115,7 +115,7 @@ Section [app] have different requirements depending the platform. Currently, Buildozer works well only with Android, iOS support is not great on this. - The image must be a JPG or PNG, preferable with Power-of-two size. Ie, an + The image must be a JPG or PNG, preferable with Power-of-two size, e.g., a 512x512 image is perfect to target all the devices. The image is not fitted, scaled, or anything on the device. If you provide a too-large image, it might not fit on small screens. From 827f943698f5e6fd9cffda22b9cd877821e98cee Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Wed, 11 Oct 2017 11:26:08 +0200 Subject: [PATCH 09/16] use kivy p4a again --- buildozer/targets/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 2919aa8..9914000 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -500,7 +500,7 @@ class TargetAndroid(Target): if not self.buildozer.file_exists(pa_dir): cmd( ('git clone -b {} --single-branch ' - 'https://github.com/rnixx/python-for-android.git ' + 'https://github.com/kivy/python-for-android.git ' '{}').format(source, self.p4a_directory), cwd=self.buildozer.platform_dir) elif self.platform_update: From 075e11ab3b61cffc22a977ecee2f7eb826c0a686 Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Wed, 11 Oct 2017 12:44:30 +0200 Subject: [PATCH 10/16] Properly decode lines in targets.android.TargetAndroid._update_libraries_references --- buildozer/targets/android.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 9914000..b36b3d7 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -850,10 +850,11 @@ class TargetAndroid(Target): # recreate the project.properties with io.open(project_fn, 'w', encoding='utf-8') as fd: - try: - fd.writelines((line.encode('utf-8') for line in content)) - except: - fd.writelines(content) + lines = [ + line if isinstance(line, unicode) else line.decode('utf-8') + for line in content + ] + fd.writelines(lines) if not content[-1].endswith(u'\n'): fd.write(u'\n') for index, ref in enumerate(references): From a0ece89e754fee6b26182f68616982cf658ed14d Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Wed, 11 Oct 2017 12:46:57 +0200 Subject: [PATCH 11/16] Remove duplicate setting in default.spec --- buildozer/default.spec | 7 ------- 1 file changed, 7 deletions(-) diff --git a/buildozer/default.spec b/buildozer/default.spec index 4f84bca..78ba4bc 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -84,13 +84,6 @@ fullscreen = 0 # olive, purple, silver, teal. #android.presplash_color = #FFFFFF -# (string) Presplash background color (for new android toolchain) -# Supported formats are: #RRGGBB #AARRGGBB or one of the following names: -# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, -# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, -# olive, purple, silver, teal. -#android.presplash_color = #FFFFFF - # (list) Permissions #android.permissions = INTERNET From a8b0d3e3fc9e46c7d6aa2cf8904f4267392f26fa Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Wed, 11 Oct 2017 13:12:01 +0200 Subject: [PATCH 12/16] Fix path generation for android release apk name in old toolchain --- buildozer/targets/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index b36b3d7..8ca2b87 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -768,7 +768,7 @@ class TargetAndroid(Target): mode = 'debug' else: build_cmd += [("release", )] - mode = 'release' + mode = 'release-unsigned' self.execute_build_package(build_cmd) From 6f62acc957bb92fdeccb4fa7d60ea6af906ab4ae Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Thu, 19 Oct 2017 14:23:29 +0200 Subject: [PATCH 13/16] Fix old toolchain index error --- buildozer/targets/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 9914000..22a90da 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -854,7 +854,7 @@ class TargetAndroid(Target): fd.writelines((line.encode('utf-8') for line in content)) except: fd.writelines(content) - if not content[-1].endswith(u'\n'): + if content and not content[-1].endswith(u'\n'): fd.write(u'\n') for index, ref in enumerate(references): fd.write(u'android.library.reference.{}={}\n'.format(index + 1, ref)) From f672f258febb6e60a8af25a9ca5bbcb561a0b08d Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Fri, 20 Oct 2017 09:35:12 +0200 Subject: [PATCH 14/16] Remove eclipse and venv related entries from ignores --- .gitignore | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitignore b/.gitignore index 7c62cb9..a3d680b 100644 --- a/.gitignore +++ b/.gitignore @@ -32,11 +32,3 @@ MANIFEST release\.log\.utf-8\.tmp -# Eclipse -.project -.pydevproject -.settings - -# Custom virtualenv location -venv - From a424fb71941bb08ce10495f5ecc8de45021ff2b6 Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Fri, 20 Oct 2017 09:36:09 +0200 Subject: [PATCH 15/16] Remove superfluous blankline from ignores --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index a3d680b..3a75d55 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,3 @@ pip-log.txt MANIFEST release\.log\.utf-8\.tmp - From b79fdb1a887b10e2a29322bcb0241669042c997f Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Mon, 4 Dec 2017 00:22:36 +0000 Subject: [PATCH 16/16] Imported os to fix ImportError --- buildozer/target.py | 1 + 1 file changed, 1 insertion(+) diff --git a/buildozer/target.py b/buildozer/target.py index c06bd0d..f60666f 100644 --- a/buildozer/target.py +++ b/buildozer/target.py @@ -1,4 +1,5 @@ from sys import exit +import os def no_config(f):