This commit is contained in:
Robert Niederreiter 2017-10-10 14:26:35 +02:00
commit 457ee51a07
27 changed files with 751 additions and 179 deletions

View file

@ -1,23 +1,202 @@
# Change Log # Change Log
## [0.33](https://github.com/kivy/buildozer/tree/0.33) (2017-05-15)
[Full Changelog](https://github.com/kivy/buildozer/compare/v0.32...0.33)
**Fixed bugs:**
- Installation of python for android is missing dependencies [\#501](https://github.com/kivy/buildozer/issues/501)
**Closed issues:**
- Break buildozer if the user try to release a version with "org.test" as a domain [\#500](https://github.com/kivy/buildozer/issues/500)
- Migrate p4a options to its own subkey [\#499](https://github.com/kivy/buildozer/issues/499)
- Use stable branch from python-for-android [\#498](https://github.com/kivy/buildozer/issues/498)
- Migrate android to android\_new, and add android\_old [\#497](https://github.com/kivy/buildozer/issues/497)
- sh.CommandNotFound: cmake [\#496](https://github.com/kivy/buildozer/issues/496)
- Need Help Fatal signal 11 \(SIGSEGV\) at 0x00000000 \(code=1\), thread 4579 \(SDLThread\) [\#495](https://github.com/kivy/buildozer/issues/495)
- Buildozer APK Cannot LAUNCH [\#493](https://github.com/kivy/buildozer/issues/493)
- Buildozer Error [\#492](https://github.com/kivy/buildozer/issues/492)
- android\_new target hardcodes python2 support for p4a [\#491](https://github.com/kivy/buildozer/issues/491)
- android.arch ignored [\#488](https://github.com/kivy/buildozer/issues/488)
- fail to install distribute [\#486](https://github.com/kivy/buildozer/issues/486)
- sh.py raise a exception and fail to build [\#485](https://github.com/kivy/buildozer/issues/485)
- some functionality lost when debugged with android\_new command [\#481](https://github.com/kivy/buildozer/issues/481)
- Problem when deploy to android device [\#480](https://github.com/kivy/buildozer/issues/480)
- dlopen failed: python2.7/site-packages/grpc/\_cython/cygrpc.so not 32-bit: 2 [\#479](https://github.com/kivy/buildozer/issues/479)
- Cannot build APK with python3crystax and flask - conflicting dependencies [\#477](https://github.com/kivy/buildozer/issues/477)
- Buildozer can't download NDK [\#474](https://github.com/kivy/buildozer/issues/474)
- websocket-client "SSL not available." [\#473](https://github.com/kivy/buildozer/issues/473)
- Using Cython with Kivy-iOS and Buildozer [\#472](https://github.com/kivy/buildozer/issues/472)
- android.requirements does not merge with app.requirements [\#471](https://github.com/kivy/buildozer/issues/471)
- buildozer fails to find Android SDK [\#468](https://github.com/kivy/buildozer/issues/468)
- Crash of APK on start [\#467](https://github.com/kivy/buildozer/issues/467)
- App not launching [\#461](https://github.com/kivy/buildozer/issues/461)
- sqlite3 not working with android\_new [\#457](https://github.com/kivy/buildozer/issues/457)
- how to set path for p4a [\#454](https://github.com/kivy/buildozer/issues/454)
- TypeError: write\(\) argument 1 must be unicode, not str [\#452](https://github.com/kivy/buildozer/issues/452)
- New toolchain - lxml included but not able to import [\#451](https://github.com/kivy/buildozer/issues/451)
- sqlite3 with python2.7 and buildozer 0.33dev and new toolchain not working [\#450](https://github.com/kivy/buildozer/issues/450)
- Update the Virtual Machine @ https://kivy.org/\#download [\#449](https://github.com/kivy/buildozer/issues/449)
- “No module named setuptools” after installing setuptools [\#444](https://github.com/kivy/buildozer/issues/444)
- how to add --arch=armeabi-v7a to buildozer spec [\#443](https://github.com/kivy/buildozer/issues/443)
- `buildozer android debug` fails with `jinja2.exceptions.TemplateNotFound: build.xml` [\#442](https://github.com/kivy/buildozer/issues/442)
- buildozer.spec - requirements - kivy == master [\#440](https://github.com/kivy/buildozer/issues/440)
- Buildozer can't find zlib [\#437](https://github.com/kivy/buildozer/issues/437)
- Expose kivy download source? [\#435](https://github.com/kivy/buildozer/issues/435)
- compiling crash [\#431](https://github.com/kivy/buildozer/issues/431)
- Buildozer unable to make apk [\#430](https://github.com/kivy/buildozer/issues/430)
- Crash APK on start [\#429](https://github.com/kivy/buildozer/issues/429)
- More like a noob question [\#428](https://github.com/kivy/buildozer/issues/428)
- keka failed to download \(OS X El Capitan\) [\#427](https://github.com/kivy/buildozer/issues/427)
- Buildozer fails with pure python library pint [\#425](https://github.com/kivy/buildozer/issues/425)
- Invalid argument to arm-linux-androideabi-gcc [\#424](https://github.com/kivy/buildozer/issues/424)
- dlopen failed: \_clock.so is 64-bit instead of 32-bit [\#423](https://github.com/kivy/buildozer/issues/423)
- how to solve the build error for "java"? [\#421](https://github.com/kivy/buildozer/issues/421)
- Problems in patching files during building for android\_new [\#416](https://github.com/kivy/buildozer/issues/416)
- Buildozer doesn't work with multiple first-class directories [\#415](https://github.com/kivy/buildozer/issues/415)
- Buildozer suddenly not working, Linux, Python 2.7 \(build.xml: Failed to find version-tag string\) [\#414](https://github.com/kivy/buildozer/issues/414)
- Buildozer not finding aidl [\#413](https://github.com/kivy/buildozer/issues/413)
- buildozer android created apk fails if application source kept in multiple files [\#411](https://github.com/kivy/buildozer/issues/411)
- Python 3 unicode print \(\) / copy to clipboard crashes app on Android [\#404](https://github.com/kivy/buildozer/issues/404)
- checking whether the C compiler works... no [\#402](https://github.com/kivy/buildozer/issues/402)
- configure: error: C compiler cannot create executables [\#395](https://github.com/kivy/buildozer/issues/395)
- ConfigParser.NoOptionError: No option 'p4a.local\_recipes' in section: 'app' \(android\_new\) [\#394](https://github.com/kivy/buildozer/issues/394)
- Google has changed the type of archive the new NDK [\#393](https://github.com/kivy/buildozer/issues/393)
- Why does buildozer build and pull python for android from old\_toolchain branch ? [\#389](https://github.com/kivy/buildozer/issues/389)
- buildozer android\_new does not show the presplash [\#387](https://github.com/kivy/buildozer/issues/387)
- Error when using buildozer android\_new with python3crystax [\#386](https://github.com/kivy/buildozer/issues/386)
- Command failed: tar xzf android-sdk\_r20-linux.tgz [\#383](https://github.com/kivy/buildozer/issues/383)
- When will you add requests lib to recipes? [\#382](https://github.com/kivy/buildozer/issues/382)
- Presplash does not work with "android\_new" as target. [\#380](https://github.com/kivy/buildozer/issues/380)
- Build for Android is Inconsistent with the Linux Version [\#378](https://github.com/kivy/buildozer/issues/378)
- \[question\] What are the supported OS ? [\#369](https://github.com/kivy/buildozer/issues/369)
- AttributeError: 'AnsiCodes' object has no attribute 'LIGHTBLUE\_EX' [\#366](https://github.com/kivy/buildozer/issues/366)
- splash image not hide after kivy loaded [\#364](https://github.com/kivy/buildozer/issues/364)
- app always crash in android [\#360](https://github.com/kivy/buildozer/issues/360)
- Plyer not available in buildozer android\_new [\#358](https://github.com/kivy/buildozer/issues/358)
- Runs empty directory instead of binary \(android\_new\) [\#357](https://github.com/kivy/buildozer/issues/357)
- App built with buildozer does not open on android [\#356](https://github.com/kivy/buildozer/issues/356)
- Error when running buildozer android\_new debug [\#354](https://github.com/kivy/buildozer/issues/354)
- ios list\_identities returns no identities [\#353](https://github.com/kivy/buildozer/issues/353)
- buildozer not working [\#350](https://github.com/kivy/buildozer/issues/350)
- error: Cython does not appear to be installed [\#349](https://github.com/kivy/buildozer/issues/349)
- AttributeError: 'Context' object has no attribute 'hostpython' [\#347](https://github.com/kivy/buildozer/issues/347)
- osx packaging results in venv error [\#345](https://github.com/kivy/buildozer/issues/345)
- Requirement example requirements = kivy,requests fails [\#344](https://github.com/kivy/buildozer/issues/344)
- Unavailability of important packages [\#343](https://github.com/kivy/buildozer/issues/343)
- no way to change bootstrap [\#341](https://github.com/kivy/buildozer/issues/341)
- Apk built with buildozer and multiple python file crashes [\#331](https://github.com/kivy/buildozer/issues/331)
- Please upgrade the documentation [\#255](https://github.com/kivy/buildozer/issues/255)
- Buildozer doesn't recognize "profile" option anymore [\#254](https://github.com/kivy/buildozer/issues/254)
- Try to build with caldav requirement fails [\#248](https://github.com/kivy/buildozer/issues/248)
- Trouble building for older android versions [\#240](https://github.com/kivy/buildozer/issues/240)
- removing old apk file seems to fail before installing the new one [\#238](https://github.com/kivy/buildozer/issues/238)
- Build fails due to python-distribute.org being down [\#200](https://github.com/kivy/buildozer/issues/200)
- I am struggling with building an apk [\#153](https://github.com/kivy/buildozer/issues/153)
- fresh android sdk install requires sdk update [\#151](https://github.com/kivy/buildozer/issues/151)
- FYI - Ubuntu 14.04 Necessary Java Path Adjustment [\#141](https://github.com/kivy/buildozer/issues/141)
- Cannot compile `iri2uri.py` in `httplib2` [\#135](https://github.com/kivy/buildozer/issues/135)
- can't add django to requirement [\#130](https://github.com/kivy/buildozer/issues/130)
- add an ssh target [\#1](https://github.com/kivy/buildozer/issues/1)
**Merged pull requests:**
- close \#452 as suggested by SpotlightKid [\#489](https://github.com/kivy/buildozer/pull/489) ([pat1](https://github.com/pat1))
- Update README.rst [\#487](https://github.com/kivy/buildozer/pull/487) ([matletix](https://github.com/matletix))
- Made buildozer run p4a using the current sys.executable [\#484](https://github.com/kivy/buildozer/pull/484) ([inclement](https://github.com/inclement))
- ios: refactor deprecated PackageApplication command [\#483](https://github.com/kivy/buildozer/pull/483) ([kived](https://github.com/kived))
- android\_new: change skip\_update to skip all updates [\#465](https://github.com/kivy/buildozer/pull/465) ([ZingBallyhoo](https://github.com/ZingBallyhoo))
- android\_new: add "android.arch" config option [\#458](https://github.com/kivy/buildozer/pull/458) ([ZingBallyhoo](https://github.com/ZingBallyhoo))
- Fix Py3 Incompatable str + bytes issue. [\#456](https://github.com/kivy/buildozer/pull/456) ([FeralBytes](https://github.com/FeralBytes))
- spec file: dont use fullscreen by default [\#447](https://github.com/kivy/buildozer/pull/447) ([rafalo1333](https://github.com/rafalo1333))
- spec file: use portrait orientation by default [\#446](https://github.com/kivy/buildozer/pull/446) ([rafalo1333](https://github.com/rafalo1333))
- Add presplash background color support for android\_new toolchain [\#436](https://github.com/kivy/buildozer/pull/436) ([rnixx](https://github.com/rnixx))
- Fix file\_matches to never return None [\#432](https://github.com/kivy/buildozer/pull/432) ([inclement](https://github.com/inclement))
- Fixed 64 bit detection \(it failed under python3\) [\#409](https://github.com/kivy/buildozer/pull/409) ([inclement](https://github.com/inclement))
- Added p4a.local\_recipes to default.spec and handled its absence [\#405](https://github.com/kivy/buildozer/pull/405) ([inclement](https://github.com/inclement))
- Adding README.rst entries for how to use buildozer with python3 [\#403](https://github.com/kivy/buildozer/pull/403) ([andyDoucette](https://github.com/andyDoucette))
- Update installation.rst \(Ubuntu16.04\) [\#399](https://github.com/kivy/buildozer/pull/399) ([FermiParadox](https://github.com/FermiParadox))
- Update quickstart.rst [\#398](https://github.com/kivy/buildozer/pull/398) ([FermiParadox](https://github.com/FermiParadox))
- Add p4a.local\_recipes to buildozer.spec to specify a local recipe dir… [\#385](https://github.com/kivy/buildozer/pull/385) ([cidermole](https://github.com/cidermole))
- Always pass required args to p4a in android\_new [\#375](https://github.com/kivy/buildozer/pull/375) ([inclement](https://github.com/inclement))
- Changed p4a command order to work with argparse [\#374](https://github.com/kivy/buildozer/pull/374) ([inclement](https://github.com/inclement))
- buildozer has no attribute builddir [\#351](https://github.com/kivy/buildozer/pull/351) ([nilutz](https://github.com/nilutz))
- throw error early if running in venv [\#346](https://github.com/kivy/buildozer/pull/346) ([kived](https://github.com/kived))
- allow selection of bootstrap for android\_new [\#342](https://github.com/kivy/buildozer/pull/342) ([kived](https://github.com/kived))
- bump version to 0.33dev [\#340](https://github.com/kivy/buildozer/pull/340) ([kived](https://github.com/kived))
- trying to fix Kivy install for OS X builds [\#316](https://github.com/kivy/buildozer/pull/316) ([derPinguin](https://github.com/derPinguin))
- update installation info [\#256](https://github.com/kivy/buildozer/pull/256) ([kiok46](https://github.com/kiok46))
## [v0.32](https://github.com/kivy/buildozer/tree/v0.32) (2016-05-09) ## [v0.32](https://github.com/kivy/buildozer/tree/v0.32) (2016-05-09)
[Full Changelog](https://github.com/kivy/buildozer/compare/v0.31...v0.32) [Full Changelog](https://github.com/kivy/buildozer/compare/v0.31...v0.32)
- Added `source.include_patterns` app option **Closed issues:**
- Added `android_new` target to use the python-for-android revamp toolchain
- Added `build_dir` and `bin_dir` buildozer options - When is the support coming to build windows .exe using buildozer? [\#333](https://github.com/kivy/buildozer/issues/333)
- Stopped using pip `--download-cache` flag, as it has been removed from recent pip versions - outdated openssl [\#332](https://github.com/kivy/buildozer/issues/332)
- Always use ios-deploy 1.7.0 - newer versions are completely different - ios deployment fails \(buildozer --verbose ios debug deploy\) [\#330](https://github.com/kivy/buildozer/issues/330)
- Fix bugs with Unicode app titles - Can't add uuid pytz datetime time dbf to requirements [\#329](https://github.com/kivy/buildozer/issues/329)
- Fix bugs with directory handling - AttributeError: 'NoneType' object has no attribute 'startswith' [\#326](https://github.com/kivy/buildozer/issues/326)
- Support using a custom kivy-ios dir - android.p4a\_dir use old toolchain? [\#325](https://github.com/kivy/buildozer/issues/325)
- Add `adb` command to android/android_new targets - Switch from pygame to sdl2 easily [\#313](https://github.com/kivy/buildozer/issues/313)
- Disable bitcode on iOS builds (needed for newer Xcode) - IOError: \[Errno 2\] No such file or directory: "/home/andrew/CODE/Python/kivy-test-android/.buildozer/android/platform/python-for-android/dist/helloworld/bin/HelloWorld-'1.0'-debug.apk" [\#312](https://github.com/kivy/buildozer/issues/312)
- Fix `api`/`minapi` values for android target - Marshmallow sdk not found [\#310](https://github.com/kivy/buildozer/issues/310)
- Use kivy-ios to build icons for all supported sizes - Install Buildozer: Finished processing dependencies for buildozer==0.32dev [\#304](https://github.com/kivy/buildozer/issues/304)
- Fix p4a branch handling - Bump default min SDK to 13: Fix crash on orientation change bug [\#302](https://github.com/kivy/buildozer/issues/302)
- Let p4a handle pure-Python packages (android_new) - Disable "Open with file manager" when USB cable is connected in virtual machine [\#299](https://github.com/kivy/buildozer/issues/299)
- Use colored output in p4a (android_new) - Check presence of main.py during build time [\#298](https://github.com/kivy/buildozer/issues/298)
- Py3: 'Buildozer' object has no attribute 'critical' [\#297](https://github.com/kivy/buildozer/issues/297)
- The splash screen isn't automatically resized [\#292](https://github.com/kivy/buildozer/issues/292)
- buildozer don't work if whitespace in path [\#287](https://github.com/kivy/buildozer/issues/287)
- buildozer help fail [\#285](https://github.com/kivy/buildozer/issues/285)
- Buildozer.spec 's title of your application can not be a Chinese character [\#284](https://github.com/kivy/buildozer/issues/284)
- How to build apk with a cython file [\#283](https://github.com/kivy/buildozer/issues/283)
- pip no longer has a --download-cache option, so downloading requirements has stopped working [\#279](https://github.com/kivy/buildozer/issues/279)
- Cython2 not recognized in Fedora23 ? [\#278](https://github.com/kivy/buildozer/issues/278)
- Buildozer VIrtual Machine Error: /jni/application/src/': Not a directory [\#277](https://github.com/kivy/buildozer/issues/277)
- buildozer android debug deploy run hangs [\#275](https://github.com/kivy/buildozer/issues/275)
- Is it possible to move the .buildozer folder somewhere else? [\#273](https://github.com/kivy/buildozer/issues/273)
- configure: error: C compiler cannot create executables [\#272](https://github.com/kivy/buildozer/issues/272)
- buildozer deploy error [\#271](https://github.com/kivy/buildozer/issues/271)
- Cannot set Android API version [\#268](https://github.com/kivy/buildozer/issues/268)
- Support python3 [\#265](https://github.com/kivy/buildozer/issues/265)
- App crash when changing orientation [\#264](https://github.com/kivy/buildozer/issues/264)
- Broken update command [\#261](https://github.com/kivy/buildozer/issues/261)
- error while deploying android [\#257](https://github.com/kivy/buildozer/issues/257)
- jnius/jnius.c: No such file or directory [\#251](https://github.com/kivy/buildozer/issues/251)
- Implement source.include\_patterns [\#245](https://github.com/kivy/buildozer/issues/245)
- Buildozer Python 3 Compatability Issues [\#175](https://github.com/kivy/buildozer/issues/175)
**Merged pull requests:**
- prepare for release 0.32 [\#339](https://github.com/kivy/buildozer/pull/339) ([kived](https://github.com/kived))
- use p4a --color argument [\#338](https://github.com/kivy/buildozer/pull/338) ([kived](https://github.com/kived))
- fix changing android branch [\#337](https://github.com/kivy/buildozer/pull/337) ([kived](https://github.com/kived))
- use cp -a not cp -r [\#336](https://github.com/kivy/buildozer/pull/336) ([akshayaurora](https://github.com/akshayaurora))
- improve build directory handling, add values to default.spec [\#335](https://github.com/kivy/buildozer/pull/335) ([kived](https://github.com/kived))
- fix incorrect api/minapi values [\#334](https://github.com/kivy/buildozer/pull/334) ([kived](https://github.com/kived))
- fix bad placement of expanduser\(\) [\#328](https://github.com/kivy/buildozer/pull/328) ([kived](https://github.com/kived))
- use custom source dirs for android\_new [\#324](https://github.com/kivy/buildozer/pull/324) ([kived](https://github.com/kived))
- use p4a revamp --storage-dir option [\#323](https://github.com/kivy/buildozer/pull/323) ([kived](https://github.com/kived))
- add adb and p4a commands to android/android\_new [\#322](https://github.com/kivy/buildozer/pull/322) ([kived](https://github.com/kived))
- fix py3 str has no decode issue [\#321](https://github.com/kivy/buildozer/pull/321) ([kived](https://github.com/kived))
- let p4a revamp handle pure python requirements [\#320](https://github.com/kivy/buildozer/pull/320) ([kived](https://github.com/kived))
- fix icons for ios target [\#319](https://github.com/kivy/buildozer/pull/319) ([kived](https://github.com/kived))
- support using custom kivy-ios source dir [\#318](https://github.com/kivy/buildozer/pull/318) ([kived](https://github.com/kived))
- disable bitcode for ios target [\#317](https://github.com/kivy/buildozer/pull/317) ([kived](https://github.com/kived))
- Add window option for target android\_new [\#315](https://github.com/kivy/buildozer/pull/315) ([pythonic64](https://github.com/pythonic64))
- fix usage exception [\#311](https://github.com/kivy/buildozer/pull/311) ([kived](https://github.com/kived))
- add python3 compatibility to verbose output for android build \(\#221\) [\#303](https://github.com/kivy/buildozer/pull/303) ([pohmelie](https://github.com/pohmelie))
- Allow app title to contain Unicode characters [\#293](https://github.com/kivy/buildozer/pull/293) ([udiboy1209](https://github.com/udiboy1209))
- use ios-deploy version 1.7.0 [\#291](https://github.com/kivy/buildozer/pull/291) ([cbenhagen](https://github.com/cbenhagen))
- Add spec option to skip automated update of installed android package [\#290](https://github.com/kivy/buildozer/pull/290) ([pastcompute](https://github.com/pastcompute))
- Fix issues with android.p4a\_dir spec file property [\#288](https://github.com/kivy/buildozer/pull/288) ([pastcompute](https://github.com/pastcompute))
- Remove pip --download-cache flag \(fixes \#279\) [\#282](https://github.com/kivy/buildozer/pull/282) ([cbenhagen](https://github.com/cbenhagen))
- put bin/ in builddir if specified in buildozer.spec [\#274](https://github.com/kivy/buildozer/pull/274) ([jabbalaci](https://github.com/jabbalaci))
- Implement source.include\_patterns [\#269](https://github.com/kivy/buildozer/pull/269) ([udiboy1209](https://github.com/udiboy1209))
- Updated Licence Year [\#266](https://github.com/kivy/buildozer/pull/266) ([CodeMaxx](https://github.com/CodeMaxx))
- fix android.branch option [\#250](https://github.com/kivy/buildozer/pull/250) ([tshirtman](https://github.com/tshirtman))
## [v0.31](https://github.com/kivy/buildozer/tree/v0.31) (2016-01-07) ## [v0.31](https://github.com/kivy/buildozer/tree/v0.31) (2016-01-07)
[Full Changelog](https://github.com/kivy/buildozer/compare/0.30...v0.31) [Full Changelog](https://github.com/kivy/buildozer/compare/0.30...v0.31)

View file

@ -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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -10,8 +10,13 @@ OSX and/or Linux.
Buildozer currently supports packaging for Android via the `python-for-android Buildozer currently supports packaging for Android via the `python-for-android
<http://github.com/kivy/python-for-android/>`_ <http://github.com/kivy/python-for-android/>`_
project, and for iOS via the kivy-ios project. Support for other operating systems project, and for iOS via the kivy-ios project. iOS and OSX are still under work.
is intended in the future.
For Android: please have a look at `Android-SDK-NDK-Informations
<https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Informations>`_. Please note that
the default SDK/NDK coded in Buildozer works for Python 2.
We provide a ready-to-use `Virtual Machine for Virtualbox <https://kivy.org/#download>`_.
Note that this tool has nothing to do with the eponymous online build service Note that this tool has nothing to do with the eponymous online build service
`buildozer.io <http://buildozer.io />`_. `buildozer.io <http://buildozer.io />`_.
@ -37,7 +42,7 @@ Installing Buildozer with python2 support:
buildozer init buildozer init
# edit the buildozer.spec, then # edit the buildozer.spec, then
buildozer android_new debug deploy run buildozer android debug deploy run
Installing Buildozer with python3 support: Installing Buildozer with python3 support:
------------------------------------------ ------------------------------------------
@ -66,10 +71,9 @@ The pip package does not yet support python3.
#. Finally, build, deploy and run the app on your phone:: #. Finally, build, deploy and run the app on your phone::
buildozer android_new debug deploy run buildozer android debug deploy run
#. Please note the "android_new" buildozer target, and use that for any and all buildozer commands you run (even if the docs just say "android"). Python3 only works with the **android_new** toolchain.
#. Please note the "android" buildozer target, and use that for any and all buildozer commands you run (even if the docs just say "android").
Examples of Buildozer commands: Examples of Buildozer commands:
@ -78,17 +82,17 @@ Examples of Buildozer commands:
:: ::
# buildozer target command # buildozer target command
buildozer android_new clean buildozer android clean
buildozer android_new update buildozer android update
buildozer android_new deploy buildozer android deploy
buildozer android_new debug buildozer android debug
buildozer android_new release buildozer android release
# or all in one (compile in debug, deploy on device) # or all in one (compile in debug, deploy on device)
buildozer android_new debug deploy buildozer android debug deploy
# set the default command if nothing set # set the default command if nothing set
buildozer setdefault android_new debug deploy run buildozer setdefault android debug deploy run
Usage Usage
@ -101,9 +105,9 @@ Usage
buildozer --version buildozer --version
Available targets: Available targets:
android Android target, based on python-for-android project (old toolchain) android Android target, based on python-for-android project
ios iOS target, based on kivy-ios project ios iOS target, based on kivy-ios project
android_new Android target, based on python-for-android project (new toolchain) android_old Android target, based on python-for-android project (old toolchain)
Global commands (without target): Global commands (without target):
distclean Clean the whole Buildozer environment. distclean Clean the whole Buildozer environment.
@ -122,7 +126,7 @@ Usage
run Run the application on the device run Run the application on the device
serve Serve the bin directory via SimpleHTTPServer serve Serve the bin directory via SimpleHTTPServer
Target "android" commands: Target "android_old" commands:
adb Run adb from the Android SDK. Args must come after --, or adb Run adb from the Android SDK. Args must come after --, or
use --alias to make an alias use --alias to make an alias
logcat Show the log from the device logcat Show the log from the device
@ -131,7 +135,7 @@ Usage
list_identities List the available identities to use for signing. list_identities List the available identities to use for signing.
xcode Open the xcode project. xcode Open the xcode project.
Target "android_new" commands: Target "android" commands:
adb Run adb from the Android SDK. Args must come after --, or adb Run adb from the Android SDK. Args must come after --, or
use --alias to make an alias use --alias to make an alias
logcat Show the log from the device logcat Show the log from the device
@ -160,27 +164,21 @@ config, along with the environment variables that would override them.
- ``title`` -> ``$APP_TITLE`` - ``title`` -> ``$APP_TITLE``
- ``package.name`` -> ``$APP_PACKAGE_NAME`` - ``package.name`` -> ``$APP_PACKAGE_NAME``
- ``android.p4a_dir`` -> ``$APP_ANDROID_P4A_DIR`` - ``p4a.source_dir`` -> ``$APP_P4A_SOURCE_DIR``
Buildozer Virtual Machine Buildozer Virtual Machine
------------------------- -------------------------
The current virtual machine (available via https://kivy.org/downloads/) allow The current virtual machine (available via https://kivy.org/downloads/) allow
you to have a ready to use vm for building android application. But you to have a ready to use vm for building android application.
the current one have many flaw.
We're in the process to deliver a new VM that fixes most of them.
Using shared folders Using shared folders
++++++++++++++++++++ ++++++++++++++++++++
The Virtualbox Guest tools are outdated, install the latest one: If the Virtualbox Guest tools are outdated, install the latest one:
- in the Virtualbox: `Devices` -> `Install Guest Additions CD images` - in the Virtualbox: `Devices` -> `Install Guest Additions CD images`
- in the guest/linux: Go to the cdrom and run the installer - in the guest/linux: Go to the cdrom and run the installer
The `kivy` user is not in the `vboxsf` groups, so in a terminal:
- `sudo adduser kivy vboxsf`
- reboot the vm - reboot the vm
VirtualBox filesystem doesn't support symlink anymore (don't VirtualBox filesystem doesn't support symlink anymore (don't
@ -191,34 +189,13 @@ do the build outside the shared folder. One solution:
- `sudo chown kivy /build` - `sudo chown kivy /build`
- In your buildozer.spec, section `[buildozer]`, set `build_dir = /build/buildozer-myapp` - In your buildozer.spec, section `[buildozer]`, set `build_dir = /build/buildozer-myapp`
No space left
+++++++++++++
If you build on the current VM, you'll hit the no space left on device:
- Stop your VM
- Adjust the disk size to 20GB: `VBoxManage modifyhd ~/Downloads/Buildozer/Buildozer.vdi --resize 20000`
- Download the http://www.slitaz.org/en/get/#stable
- In the virtualbox, `Devices` -> `Optical Drive` -> Select the slitaz iso
- Reboot the VM
- In slitaz, open a terminal, and unmount the swap: `swapoff -a`
- Open gparted
- delete sda2
- extend sda1 to 18000
- add a primary partition, set the format to linux-swap
- you should have a sda2 partition
- save
- Unmount the slitaz iso `Devices` -> `Optical Drive` -> `Eject`
- Reset/Restart the VM
- Check your disk is 20GB: `df -h`
Using your devices via the VM Using your devices via the VM
+++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
There is a little icon on the bottom left that represent an USB plug. There is a little icon on the bottom left that represent an USB plug.
Select it, and select your android device on it. Then you can check: Select it, and select your android device on it. Then you can check:
- `buildozer android_new adb -- devices` - `buildozer android adb -- devices`
If it doesn't, use Google. They are so many differents way / issues If it doesn't, use Google. They are so many differents way / issues
depending your phone that Google will be your only source of depending your phone that Google will be your only source of

View file

@ -6,7 +6,7 @@ Generic Python packager for Android / iOS. Desktop later.
''' '''
__version__ = '0.33dev' __version__ = '0.34dev'
import os import os
import re import re
@ -152,6 +152,7 @@ class Buildozer(object):
def set_target(self, target): def set_target(self, target):
'''Set the target to use (one of buildozer.targets, such as "android") '''Set the target to use (one of buildozer.targets, such as "android")
''' '''
target = self.translate_target(target)
self.targetname = target self.targetname = target
m = __import__('buildozer.targets.{0}'.format(target), m = __import__('buildozer.targets.{0}'.format(target),
fromlist=['buildozer']) fromlist=['buildozer'])
@ -381,6 +382,7 @@ class Buildozer(object):
'''Ensure the spec file is 'correct'. '''Ensure the spec file is 'correct'.
''' '''
self.info('Check configuration tokens') self.info('Check configuration tokens')
self.migrate_configuration_tokens()
get = self.config.getdefault get = self.config.getdefault
errors = [] errors = []
adderror = errors.append adderror = errors.append
@ -417,6 +419,25 @@ class Buildozer(object):
print(error) print(error)
exit(1) exit(1)
def migrate_configuration_tokens(self):
config = self.config
if config.has_section("app"):
migration = (
("android.p4a_dir", "p4a.source_dir"),
("android.p4a_whitelist", "android.whitelist"),
("android.bootstrap", "p4a.bootstrap"),
("android.branch", "p4a.branch"),
("android.p4a_whitelist_src", "android.whitelist_src"),
("android.p4a_blacklist_src", "android.blacklist_src")
)
for entry_old, entry_new in migration:
if not config.has_option("app", entry_old):
continue
value = config.get("app", entry_old)
config.set("app", entry_new, value)
config.remove_option("app", entry_old)
self.error("In section [app]: {} is deprecated, rename to {}!".format(
entry_old, entry_new))
def check_build_layout(self): def check_build_layout(self):
'''Ensure the build (local and global) directory layout and files are '''Ensure the build (local and global) directory layout and files are
@ -894,6 +915,23 @@ class Buildozer(object):
# command line invocation # command line invocation
# #
def translate_target(self, target, inverse=False):
# FIXME at some point, refactor to remove completely android old toolchain
if inverse:
if target == "android":
target = "android_old"
elif target == "android_new":
target = "android"
else:
if target == "android":
target = "android_new"
elif target == "android_new":
self.error("ERROR: The target android_new is now android")
exit(1)
elif target == "android_old":
target = "android"
return target
def targets(self): def targets(self):
for fn in listdir(join(dirname(__file__), 'targets')): for fn in listdir(join(dirname(__file__), 'targets')):
if fn.startswith('.') or fn.startswith('__'): if fn.startswith('.') or fn.startswith('__'):
@ -904,7 +942,7 @@ class Buildozer(object):
try: try:
m = __import__('buildozer.targets.{0}'.format(target), m = __import__('buildozer.targets.{0}'.format(target),
fromlist=['buildozer']) fromlist=['buildozer'])
yield target, m yield self.translate_target(target, inverse=True), m
except NotImplementedError: except NotImplementedError:
pass pass
except: except:
@ -1012,8 +1050,8 @@ class Buildozer(object):
# maybe it's a target? # maybe it's a target?
targets = [x[0] for x in self.targets()] targets = [x[0] for x in self.targets()]
if command not in targets: if self.translate_target(command, inverse=True) not in targets:
print('Unknown command/target {}'.format(command)) print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
exit(1) exit(1)
self.set_target(command) self.set_target(command)

View file

@ -118,29 +118,23 @@ fullscreen = 0
# (str) ANT directory (if empty, it will be automatically downloaded.) # (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path = #android.ant_path =
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#android.p4a_dir =
# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =
# (str) Filename to the hook for p4a
#p4a.hook =
# (list) python-for-android whitelist
#android.p4a_whitelist =
# (bool) If True, then skip trying to update the Android sdk # (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time # This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package # when an update is due and you just want to test/build your package
# android.skip_update = False # android.skip_update = False
# (str) Bootstrap to use for android builds (android_new only)
# android.bootstrap = sdl2
# (str) Android entry point, default is ok for Kivy-based app # (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity #android.entrypoint = org.renpy.android.PythonActivity
# (list) Pattern to whitelist for the whole project
#android.whitelist =
# (str) Path to a custom whitelist file
#android.whitelist_src =
# (str) Path to a custom blacklist file
#android.blacklist_src =
# (list) List of Java .jar files to add to the libs so that pyjnius can access # (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow # their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example: # down the build process. Allows wildcards matching, for example:
@ -151,9 +145,16 @@ fullscreen = 0
# directory containing the files) # directory containing the files)
#android.add_src = #android.add_src =
# (str) python-for-android branch to use, if not master, useful to try # (list) Android AAR archives to add (currently works only with sdl2_gradle
# not yet merged features. # bootstrap)
#android.branch = master #android.add_aars =
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
#android.gradle_dependencies =
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
# (str) OUYA Console category. Should be one of GAME or APP # (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled # If you leave this blank, OUYA support will not be enabled
@ -191,6 +192,23 @@ fullscreen = 0
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86 # (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = armeabi-v7a android.arch = armeabi-v7a
#
# Python for android (p4a) specific
#
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =
# (str) Filename to the hook for p4a
#p4a.hook =
# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2
# #
# iOS specific # iOS specific
# #

View file

@ -103,7 +103,38 @@ class Target(object):
self.buildozer.build() self.buildozer.build()
def cmd_release(self, *args): def cmd_release(self, *args):
error = self.buildozer.error
self.buildozer.prepare_for_build() self.buildozer.prepare_for_build()
if self.buildozer.config.get("app", "package.domain") == "org.test":
error("")
error("ERROR: Trying to release a package that starts with org.test")
error("")
error("The package.domain org.test is, as the name intented, a test.")
error("Once you published an application with org.test,")
error("you cannot change it, it will be part of the identifier")
error("for Google Play / App Store / etc.")
error("")
error("So change package.domain to anything else.")
error("")
error("If you messed up before, set the environment variable to force the build:")
error("export BUILDOZER_ALLOW_ORG_TEST_DOMAIN=1")
error("")
if "BUILDOZER_ALLOW_ORG_TEST_DOMAIN" not in os.environ:
exit(1)
if self.buildozer.config.get("app", "package.domain") == "org.kivy":
error("")
error("ERROR: Trying to release a package that starts with org.kivy")
error("")
error("The package.domain org.kivy is reserved for the Kivy official")
error("applications. Please use your own domain.")
error("")
error("If you are a Kivy developer, add an export in your shell")
error("export BUILDOZER_ALLOW_KIVY_ORG_DOMAIN=1")
error("")
if "BUILDOZER_ALLOW_KIVY_ORG_DOMAIN" not in os.environ:
exit(1)
self.build_mode = 'release' self.build_mode = 'release'
self.buildozer.build() self.buildozer.build()
@ -115,4 +146,3 @@ class Target(object):
def cmd_serve(self, *args): def cmd_serve(self, *args):
self.buildozer.cmd_serve() self.buildozer.cmd_serve()

View file

@ -20,6 +20,8 @@ APACHE_ANT_VERSION = '1.9.4'
import traceback import traceback
import os import os
import io import io
import re
import ast
from pipes import quote from pipes import quote
from sys import platform, executable from sys import platform, executable
from buildozer import BuildozerException from buildozer import BuildozerException
@ -35,7 +37,7 @@ from buildozer.libs.version import parse
class TargetAndroid(Target): class TargetAndroid(Target):
targetname = 'android' targetname = 'android_old'
p4a_directory = "python-for-android" p4a_directory = "python-for-android"
p4a_branch = 'old_toolchain' p4a_branch = 'old_toolchain'
p4a_apk_cmd = "python build.py" p4a_apk_cmd = "python build.py"
@ -461,18 +463,37 @@ class TargetAndroid(Target):
raise BuildozerException() raise BuildozerException()
def install_platform(self): def install_platform(self):
self._install_p4a()
self._install_apache_ant()
self._install_android_sdk()
self._install_android_ndk()
self._install_android_packages()
# ultimate configuration check.
# some of our configuration cannot be check without platform.
self.check_configuration_tokens()
self.buildozer.environ.update({
'PACKAGES_PATH': self.buildozer.global_packages_dir,
'ANDROIDSDK': self.android_sdk_dir,
'ANDROIDNDK': self.android_ndk_dir,
'ANDROIDAPI': self.android_api,
'ANDROIDNDKVER': 'r{}'.format(self.android_ndk_version)
})
def _install_p4a(self):
cmd = self.buildozer.cmd cmd = self.buildozer.cmd
source = self.buildozer.config.getdefault('app', 'android.branch', source = self.buildozer.config.getdefault('app', 'p4a.branch',
self.p4a_branch) self.p4a_branch)
self.pa_dir = pa_dir = join(self.buildozer.platform_dir, self.pa_dir = pa_dir = join(self.buildozer.platform_dir,
self.p4a_directory) self.p4a_directory)
system_p4a_dir = self.buildozer.config.getdefault('app', system_p4a_dir = self.buildozer.config.getdefault('app',
'android.p4a_dir') 'p4a.source_dir')
if system_p4a_dir: if system_p4a_dir:
self.pa_dir = pa_dir = expanduser(system_p4a_dir) self.pa_dir = pa_dir = expanduser(system_p4a_dir)
if not self.buildozer.file_exists(pa_dir): if not self.buildozer.file_exists(pa_dir):
self.buildozer.error( self.buildozer.error(
'Path for android.p4a_dir does not exist') 'Path for p4a.source_dir does not exist')
self.buildozer.error('') self.buildozer.error('')
raise BuildozerException() raise BuildozerException()
else: else:
@ -493,22 +514,19 @@ class TargetAndroid(Target):
cwd=pa_dir) cwd=pa_dir)
cmd('git checkout {}'.format(source), cwd=pa_dir) cmd('git checkout {}'.format(source), cwd=pa_dir)
self._install_apache_ant() # also install dependencies (currently, only setup.py knows about it)
self._install_android_sdk() # let's extract them.
self._install_android_ndk() try:
self._install_android_packages() with open(join(self.pa_dir, "setup.py")) as fd:
setup = fd.read()
# ultimate configuration check. deps = re.findall("install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[1]
# some of our configuration cannot be check without platform. deps = ast.literal_eval(deps)
self.check_configuration_tokens() except Exception:
deps = []
self.buildozer.environ.update({ pip_deps = []
'PACKAGES_PATH': self.buildozer.global_packages_dir, for dep in deps:
'ANDROIDSDK': self.android_sdk_dir, pip_deps.append('"{}"'.format(dep))
'ANDROIDNDK': self.android_ndk_dir, cmd('pip install -q --user {}'.format(" ".join(pip_deps)))
'ANDROIDAPI': self.android_api,
'ANDROIDNDKVER': 'r{}'.format(self.android_ndk_version)
})
def get_available_packages(self): def get_available_packages(self):
available_modules = self.buildozer.cmd('./distribute.sh -l', available_modules = self.buildozer.cmd('./distribute.sh -l',
@ -594,7 +612,7 @@ class TargetAndroid(Target):
def _generate_whitelist(self, dist_dir): def _generate_whitelist(self, dist_dir):
p4a_whitelist = self.buildozer.config.getlist( p4a_whitelist = self.buildozer.config.getlist(
'app', 'android.p4a_whitelist') or [] 'app', 'android.whitelist') or []
whitelist_fn = join(dist_dir, 'whitelist.txt') whitelist_fn = join(dist_dir, 'whitelist.txt')
with open(whitelist_fn, 'w') as fd: with open(whitelist_fn, 'w') as fd:
for wl in p4a_whitelist: for wl in p4a_whitelist:
@ -763,23 +781,36 @@ class TargetAndroid(Target):
pass pass
# XXX found how the apk name is really built from the title # XXX found how the apk name is really built from the title
bl = u'\'" ,' if exists(join(dist_dir, "build.gradle")):
apptitle = config.get('app', 'title') # on gradle build, the apk use the package name, and have no version
if hasattr(apptitle, 'decode'): packagename = config.get('app', 'package.name')
apptitle = apptitle.decode('utf-8') apk = u'{packagename}-{mode}.apk'.format(
apktitle = ''.join([x for x in apptitle if x not in bl]) packagename=packagename, mode=mode)
apk = u'{title}-{version}-{mode}.apk'.format( apk_dir = join(dist_dir, "build", "outputs", "apk")
title=apktitle, apk_dest = u'{packagename}-{version}-{mode}.apk'.format(
version=version, packagename=packagename, mode=mode, version=version)
mode=mode)
else:
# on ant, the apk use the title, and have version
bl = u'\'" ,'
apptitle = config.get('app', 'title')
if hasattr(apptitle, 'decode'):
apptitle = apptitle.decode('utf-8')
apktitle = ''.join([x for x in apptitle if x not in bl])
apk = u'{title}-{version}-{mode}.apk'.format(
title=apktitle,
version=version,
mode=mode)
apk_dir = join(dist_dir, "bin")
apk_dest = apk
# copy to our place # copy to our place
copyfile(join(dist_dir, 'bin', apk), join(self.buildozer.bin_dir, apk)) copyfile(join(apk_dir, apk), join(self.buildozer.bin_dir, apk_dest))
self.buildozer.info('Android packaging done!') self.buildozer.info('Android packaging done!')
self.buildozer.info( self.buildozer.info(
u'APK {0} available in the bin directory'.format(apk)) u'APK {0} available in the bin directory'.format(apk_dest))
self.buildozer.state['android:latestapk'] = apk self.buildozer.state['android:latestapk'] = apk_dest
self.buildozer.state['android:latestmode'] = self.build_mode self.buildozer.state['android:latestmode'] = self.build_mode
def _update_libraries_references(self, dist_dir): def _update_libraries_references(self, dist_dir):
@ -819,7 +850,12 @@ class TargetAndroid(Target):
# recreate the project.properties # recreate the project.properties
with io.open(project_fn, 'w', encoding='utf-8') as fd: with io.open(project_fn, 'w', encoding='utf-8') as fd:
fd.writelines((line.encode('utf-8') for line in content)) try:
fd.writelines((line.encode('utf-8') for line in content))
except:
fd.writelines(content)
if not content[-1].endswith(u'\n'):
fd.write(u'\n')
for index, ref in enumerate(references): for index, ref in enumerate(references):
fd.write(u'android.library.reference.{}={}\n'.format(index + 1, ref)) fd.write(u'android.library.reference.{}={}\n'.format(index + 1, ref))
@ -827,7 +863,10 @@ class TargetAndroid(Target):
def _add_java_src(self, dist_dir): def _add_java_src(self, dist_dir):
java_src = self.buildozer.config.getlist('app', 'android.add_src', []) java_src = self.buildozer.config.getlist('app', 'android.add_src', [])
src_dir = join(dist_dir, 'src') if exists(join(dist_dir, "build.gradle")):
src_dir = join(dist_dir, "src", "main", "java")
else:
src_dir = join(dist_dir, 'src')
for pattern in java_src: for pattern in java_src:
for fn in glob(expanduser(pattern.strip())): for fn in glob(expanduser(pattern.strip())):
last_component = basename(fn) last_component = basename(fn)

View file

@ -1,29 +1,29 @@
# coding=utf-8 # coding=utf-8
''' '''
Android target, based on python-for-android project (new toolchain) Android target, based on python-for-android project
''' '''
import sys import sys
import buildozer
from buildozer.targets.android import TargetAndroid
from buildozer import USE_COLOR from buildozer import USE_COLOR
from buildozer.targets.android import TargetAndroid
from os.path import join, expanduser, realpath from os.path import join, expanduser, realpath
class TargetAndroidNew(TargetAndroid): class TargetAndroidNew(TargetAndroid):
targetname = 'android_new' targetname = 'android'
p4a_branch = "master" p4a_branch = "stable"
p4a_directory = "python-for-android-master" p4a_directory = "python-for-android-master"
p4a_apk_cmd = "apk --debug --bootstrap=" p4a_apk_cmd = "apk --debug --bootstrap="
extra_p4a_args = '' extra_p4a_args = ''
def __init__(self, buildozer): def __init__(self, *args, **kwargs):
super(TargetAndroidNew, self).__init__(buildozer) super(TargetAndroidNew, self).__init__(*args, **kwargs)
self._build_dir = join(self.buildozer.platform_dir, 'build') self._build_dir = join(self.buildozer.platform_dir, 'build')
executable = sys.executable or 'python' executable = sys.executable or 'python'
self._p4a_cmd = '{} -m pythonforandroid.toolchain '.format(executable) self._p4a_cmd = '{} -m pythonforandroid.toolchain '.format(executable)
self._p4a_bootstrap = self.buildozer.config.getdefault( self._p4a_bootstrap = self.buildozer.config.getdefault(
'app', 'android.bootstrap', 'sdl2') 'app', 'p4a.bootstrap', 'sdl2')
self.p4a_apk_cmd += self._p4a_bootstrap self.p4a_apk_cmd += self._p4a_bootstrap
color = 'always' if USE_COLOR else 'never' color = 'always' if USE_COLOR else 'never'
self.extra_p4a_args = ' --color={} --storage-dir={}'.format( self.extra_p4a_args = ' --color={} --storage-dir={}'.format(
@ -98,6 +98,8 @@ class TargetAndroidNew(TargetAndroid):
elif option == "--sdk": elif option == "--sdk":
cmd.append("--android_api") cmd.append("--android_api")
cmd.extend(values) cmd.extend(values)
cmd.append("--sdk")
cmd.extend(values)
else: else:
cmd.extend(args) cmd.extend(args)
@ -123,8 +125,8 @@ class TargetAndroidNew(TargetAndroid):
cmd.append(local_recipes) cmd.append(local_recipes)
# support for blacklist/whitelist filename # support for blacklist/whitelist filename
whitelist_src = self.buildozer.config.getdefault('app', 'android.p4a_whitelist_src', None) whitelist_src = self.buildozer.config.getdefault('app', 'android.whitelist_src', None)
blacklist_src = self.buildozer.config.getdefault('app', 'android.p4a_blacklist_src', None) blacklist_src = self.buildozer.config.getdefault('app', 'android.blacklist_src', None)
if whitelist_src: if whitelist_src:
cmd.append('--whitelist') cmd.append('--whitelist')
cmd.append(realpath(whitelist_src)) cmd.append(realpath(whitelist_src))
@ -132,6 +134,18 @@ class TargetAndroidNew(TargetAndroid):
cmd.append('--blacklist') cmd.append('--blacklist')
cmd.append(realpath(blacklist_src)) cmd.append(realpath(blacklist_src))
# support for aars
aars = self.buildozer.config.getlist('app', 'android.add_aars', [])
for aar in aars:
cmd.append('--add-aar')
cmd.append(realpath(aar))
# support for gradle dependencies
gradle_dependencies = self.buildozer.config.getlist('app', 'android.gradle_dependencies', [])
for gradle_dependency in gradle_dependencies:
cmd.append('--depend')
cmd.append(gradle_dependency)
cmd.append('--arch') cmd.append('--arch')
cmd.append(self.buildozer.config.getdefault('app', 'android.arch', "armeabi-v7a")) cmd.append(self.buildozer.config.getdefault('app', 'android.arch', "armeabi-v7a"))

View file

@ -59,6 +59,7 @@ li { padding: 1em; }
''' '''
class TargetIos(Target): class TargetIos(Target):
targetname = "ios"
def check_requirements(self): def check_requirements(self):
checkbin = self.buildozer.checkbin checkbin = self.buildozer.checkbin

View file

@ -28,6 +28,7 @@ from buildozer.libs.version import parse
class TargetOSX(Target): class TargetOSX(Target):
targetname = "osx"
def ensure_sdk(self): def ensure_sdk(self):
self.buildozer.info('Check if kivy-sdk-packager exists') self.buildozer.info('Check if kivy-sdk-packager exists')
@ -57,30 +58,17 @@ class TargetOSX(Target):
'Kivy.app'), cwd=cwd) 'Kivy.app'), cwd=cwd)
else: 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...') self.buildozer.info('Downloading kivy...')
check_call( check_call(
('curl', '-L', '-o', 'Kivy{}.7z'.format(py_branch), ('curl', '-L', '-o', 'Kivy{}.dmg'.format(py_branch),
'http://kivy.org/downloads/{}/Kivy-{}-osx-python{}.7z'\ 'http://kivy.org/downloads/{}/Kivy-{}-osx-python{}.dmg'\
.format(current_kivy_vers, current_kivy_vers, py_branch)), .format(current_kivy_vers, current_kivy_vers, py_branch)),
cwd=cwd) 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.4-intel.dmg'),
cwd=cwd)
check_call(('hdiutil', 'attach', 'Keka-1.0.4-intel.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...') self.buildozer.info('Extracting and installing Kivy...')
check_call( check_call(('hdiutil', 'attach', cwd + '/Kivy{}.dmg'.format(py_branch)))
(join(cwd, 'Keka.app/Contents/MacOS/Keka'), check_call(('cp', '-a', '/Volumes/Kivy/Kivy.app', './Kivy.app'), cwd=cwd)
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)
def ensure_kivyapp(self): def ensure_kivyapp(self):
self.buildozer.info('check if Kivy.app exists in local dir') self.buildozer.info('check if Kivy.app exists in local dir')

2
buildozer/tools/packer/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
packer_cache
output-kivy-buildozer-vm

View file

@ -0,0 +1,7 @@
## Release 2.0 - 13 May 2017
- Brand new VM image using latest zesty (x)ubuntu (64 bits)
- Image created for Virtualbox 5.1.22, with guest-tools
- Increase disk space to 20GB
- /build can store buildozer builds (specify with build_dir=/build/myapp)
- Rewrite welcome document

View file

@ -0,0 +1,34 @@
.PHONY: all build
VERSION := 2.0
ANN1 = udp://public.popcorn-tracker.org:6969/announce
ANN2 = udp://ipv4.tracker.harry.lu/announce
ANN3 = udp://tracker.opentrackr.org:1337/announce
ANN4 = udp://9.rarbg.com:2710/announce
ANN5 = udp://explodie.org:6969
ANN6 = udp://tracker.coppersurfer.tk:6969
ANN7 = udp://tracker.leechers-paradise.org:6969
ANN8 = udp://zer0day.ch:1337
TORRENT_ANNOUNCE := ${ANN1},${ANN2},${ANN3},${ANN4},${ANN5},${ANN6},${ANN7},${ANN8}
PACKAGE_FILENAME = kivy-buildozer-vm-${VERSION}.zip
all: packer repackage torrent upload
build:
packer-io build template.json
repackage:
cd output-kivy-buildozer-vm && mv Kivy kivy-buildozer-vm-${VERSION}
cd output-kivy-buildozer-vm && zip -0 -r ${PACKAGE_FILENAME} kivy-buildozer-vm-${VERSION}
torrent:
rm -f output-kivy-buildozer-vm/kivy-buildozer-vm.torrent
mktorrent \
-a ${TORRENT_ANNOUNCE} \
-o output-kivy-buildozer-vm/kivy-buildozer-vm.torrent \
-w http://txzone.net/files/torrents/${PACKAGE_FILENAME} \
-v output-kivy-buildozer-vm/${PACKAGE_FILENAME}
upload:
# txzone only for now, don't have access to kivy server
rsync -avz --info=progress2 output-kivy-buildozer-vm/${PACKAGE_FILENAME} txzone.net:/var/www/websites/txzone.net/files/torrents/
rsync -avz --info=progress2 output-kivy-buildozer-vm/kivy-buildozer-vm.torrent txzone.net:/var/www/websites/txzone.net/files/torrents/

View file

@ -1,6 +1,7 @@
# Introduction # Introduction
It is an example packer template based on netboot iso that adds packages for xubuntu and buildozer. This is the packer template for building the official Kivy/Buildozer VM.
It is based on xubuntu.
# Configure # Configure
@ -8,13 +9,29 @@ You want to edit `http/preseed.cfg` and `template.json` before building an image
# Build # Build
`packer build template.json` ```
make packer
```
# Testing the image after it's built. # Release
`./launch` 1. Update Makefile to increase the version number
2. Update the CHANGELOG
3. Commit
# TODO Then:
- [compact the image](https://crysol.github.io/recipe/2013-10-15/virtualbox-compact-vmdk-images/) ```
- trigger a build on travis, torrent creation and gdrive upload when buildozer is released make all
# make packer < build the image
# make repackage < just zip it (no compression)
# make torrent < create the torrent
# make upload < upload on txzone.net (tito only)
```
# Notes
- trigger a build on travis, torrent creation and gdrive upload when buildozer is
released
- https://www.packer.io/docs/builders/virtualbox-ovf.html

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Buildozer
Exec=firefox -url "file:///usr/share/applications/buildozer-welcome/index.html" -width 600 -height 800
Icon=/usr/share/applications/buildozer-welcome/icon.png
Categories=Application;Development;favourite;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -6,16 +6,16 @@ d-i keyboard-configuration/variant string us
### Network ### Network
d-i netcfg/choose_interface select auto d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string kivy-buildozer-vm
d-i netcfg/get_hostname string ubuntu
d-i netcfg/get_domain string local d-i netcfg/get_domain string local
d-i netcfg/wireless_wep string d-i netcfg/wireless_wep string
### Mirror ### Mirror
d-i mirror/country string manual d-i mirror/country string manual
d-i mirror/http/hostname string jp.archive.ubuntu.com d-i mirror/http/hostname string fr.archive.ubuntu.com
d-i mirror/http/directory string /ubuntu d-i mirror/http/directory string /ubuntu
# d-i mirror/http/hostname string 192.168.1.16:3142
# d-i mirror/http/directory string /fr.archive.ubuntu.com/ubuntu
d-i mirror/http/proxy string d-i mirror/http/proxy string
### Time ### Time

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -0,0 +1,15 @@
body {
padding: 20px;
}
pre {
padding: 20px;
}
.warning {
background-color: #fff5f6;
border-left: 2px solid #c0392b;
padding: 20px;
margin-bottom: 2.5rem;
padding-bottom: 1px;
}

View file

@ -0,0 +1,102 @@
<html>
<head>
<meta charset="UTF-8">
<title>Kivy/Buildozer VM</title>
<link rel="stylesheet" href="milligram.min.css">
<link rel="stylesheet" href="buildozer.css"
</head>
<body>
<h1>Welcome to the Kivy/Buildozer VM</h1>
<p id="menu">
<a href="https://github.com/kivy/buildozer">Github</a> -
<a href="https://buildozer.readthedocs.io/en/latest/">Documentation</a>
</p>
<p>
Thanks for using Kivy/Buildozer VM. It has been installed only for
packaging Kivy application for Android.<br/>
<b>Credentials</b>: username: <code>kivy</code> / password: <code>kivy</code>
</p>
<h2>How to use the VM</h2>
<p>
Buildozer is ready to be used. You'll need internet connection for
download the Android SDK/NDK (automatically done), and during the first
compilation.
<br/>
It is preferrable to add a <a href="#sharefolder">share a folder
</a> between your host and the VM, then build from there.<br/>
By the time we shipped the VM and you using it, you may need to
<a href="#update-buildozer">update buildozer</a>.
</p>
<p>
<b>Don't try to use latest Android SDK or NDK</b>. The defaults from buildozer
works: Android SDK 20, Android NDK 9c. Recent Android SDK doesn't work
the same as before (no more android command), and python-for-android
project have issues with it. As for NDK, you can use 13b, it works too.
</p>
<ol>
<li>First time only, in your project directory: <code>buildozer init</code></li>
<li>Adjust the <code>buildozer.spec</code>:
<pre>[buildozer]
# change the name of your app
package.name = myapp
# change the domain of your package
package.domain = com.mydomain
# specify hostpython2 manually. If you want to use python 3, check buildozer
# README about it, the VM is not preinstalled for that.
requirements = hostpython2,kivy
[buildozer]
# update the build directory (issue with virtualbox shared folder and symlink)
build_dir = /build/myapp
</pre></li>
<li>Build your application: <code>buildozer android debug</code></li>
<li>Build and deploy, run and get the logs: <code>buildozer android debug deploy run logcat</code></li>
</ol>
<h2 id="sharefolder">Share a folder</h2>
<p>
Virtualbox allows you to share a folder between your computer and the
VM. To do, just:
<ol>
<li>Go into Devices &gt; Shared Folders &gt; Shared Folders Settings</li>
<li>Add a new folder, select the automount option</li>
<li>Reboot the VM (that's easier)</li>
<li>You'll find your new directory at <code>/media/sf_directoryname</code></li>
</ol>
</p>
<div class="warning">
Virtualbox doesn't support symlink in Shared Folder anymore. So buildozer
will fail during the build.<br/>
We already created a <code>/build</code> directory where you can put your
build in it. Edit your <code>buildozer.ini</code>:
<pre>[buildozer]
build_dir = /build/buildozer-myapp</pre>
</div>
<h2 id="update-buildozer">Update buildozer</h2>
<p>
The buildozer version you have may be outdated, as well as the dependencies.
The best is to regulary update buildozer:
<pre>sudo pip install -U buildozer</pre>
</p>
<h2>Cleaning cache</h2>
<p>
The simplest way to update kivy and other modules is to clean all the
buildozer cache, and rebuild everything.
<pre>rm -rf ~/.buildozer/android/packages</pre>
<p>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,17 @@
#!/bin/bash -eux #!/bin/bash -eux
# Don't use openjdk-9, the conf directory is missing, and we get
# an error when using the android sdk:
# "Can't read cryptographic policy directory: unlimited"
wget http://bootstrap.pypa.io/get-pip.py wget http://bootstrap.pypa.io/get-pip.py
python get-pip.py python get-pip.py
rm get-pip.py rm get-pip.py
apt-get -y install git openjdk-7-jdk --no-install-recommends zlib1g-dev
pip install cython buildozer apt-get -y install lib32stdc++6 lib32z1 lib32ncurses5
apt-get -y install build-essential
apt-get -y install git openjdk-8-jdk --no-install-recommends zlib1g-dev
pip install cython buildozer python-for-android
# latest sh is too slow, use a previous working version
# CF https://github.com/amoffat/sh/issues/378
pip install sh\<1.12.5

View file

@ -0,0 +1,12 @@
#!/bin/bash
# Mount the disk image
cd /tmp
mkdir /tmp/isomount
mount -t iso9660 /dev/sr1 /tmp/isomount
# Install the drivers
/tmp/isomount/VBoxLinuxAdditions.run
# Cleanup
umount isomount

View file

@ -1,5 +1,11 @@
#!/bin/bash #!/bin/bash
# Remove unwanted applications
apt-get -y remove --purge libreoffice*
apt-get -y remove --purge pidgin*
apt-get -y remove --purge thunderbird*
apt-get -y remove --purge fonts-noto-cjk
# Remove APT cache # Remove APT cache
apt-get -y --purge autoremove apt-get -y --purge autoremove
apt-get -y clean apt-get -y clean
@ -9,13 +15,13 @@ find /var/log -type f | while read f; do echo -ne '' > $f; done;
# Whiteout root # Whiteout root
count=`df --sync -kP / | tail -n1 | awk -F ' ' '{print $4}'`; count=`df --sync -kP / | tail -n1 | awk -F ' ' '{print $4}'`;
let count-- count=$(expr $count - 1)
dd if=/dev/zero of=/tmp/whitespace bs=1024 count=$count; dd if=/dev/zero of=/tmp/whitespace bs=1024 count=$count;
rm /tmp/whitespace; rm /tmp/whitespace;
# Whiteout /boot # Whiteout /boot
count=`df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}'`; count=`df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}'`;
let count-- count=$(expr $count - 1)
dd if=/dev/zero of=/boot/whitespace bs=1024 count=$count; dd if=/dev/zero of=/boot/whitespace bs=1024 count=$count;
rm /boot/whitespace; rm /boot/whitespace;

View file

@ -0,0 +1,61 @@
#!/bin/bash
# xfconf doesn't work with sudo, even with XAUTHORITY + DISPLAY
# seems that the user need to log to be able to use them.
# keep them for reference for now.
# change theme (works better for this wallpaper)
# xfconf-query -c xfce4-desktop \
# --property /backdrop/screen0/monitor0/workspace0/last-image \
# --set /usr/share/backgrounds/kivy-wallpaper.png
# xfconf-query -c xsettings \
# --property /Net/ThemeName \
# --set Adwaita
# xfconf-query -c xsettings \
# --property /Net/IconThemeName \
# --set elementary-xfce-darker
set -x
# ensure the kivy user can mount shared folders
adduser kivy vboxsf
# create a space specifically for builds
mkdir /build
chown kivy /build
# add a little face
wget $PACKER_HTTP_ADDR/kivy-icon-96.png
mv kivy-icon-96.png /home/kivy/.face
chown kivy.kivy /home/kivy/.face
# set wallpaper
wget $PACKER_HTTP_ADDR/wallpaper.png
mv wallpaper.png /usr/share/backgrounds/kivy-wallpaper.png
sed -i "s:/usr/share/xfce4/backdrops/xubuntu-wallpaper.png:/usr/share/backgrounds/kivy-wallpaper.png:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml
sed -i "s:elementary-xfce-darker:elementary-xfce-darkest:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
sed -i "s:elementary-xfce-dark:elementary-xfce-darkest:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
# add desktop icon
wget $PACKER_HTTP_ADDR/buildozer.desktop
mkdir -p /home/kivy/Desktop
cp buildozer.desktop /home/kivy/Desktop/
chown kivy.kivy -R /home/kivy/Desktop
chmod +x /home/kivy/Desktop/buildozer.desktop
mv buildozer.desktop /usr/share/applications/
sed -i "s:^favorites=.*$:favorites=buildozer.desktop,exo-terminal-emulator.desktop,exo-web-browser.desktop,xfce-keyboard-settings.desktop,exo-file-manager.desktop,org.gnome.Software.desktop,xfhelp4.desktop:g" /etc/xdg/xdg-xubuntu/xfce4/whiskermenu/defaults.rc
# copy welcome directory
mkdir -p /usr/share/applications/buildozer-welcome
cd /usr/share/applications/buildozer-welcome
wget $PACKER_HTTP_ADDR/welcome/milligram.min.css
wget $PACKER_HTTP_ADDR/welcome/buildozer.css
wget $PACKER_HTTP_ADDR/welcome/index.html
wget $PACKER_HTTP_ADDR/kivy-icon-96.png
mv kivy-icon-96.png icon.png
cd -

View file

@ -4,16 +4,16 @@
"disk_format": "ovf", "disk_format": "ovf",
"ssh_username": "kivy", "ssh_username": "kivy",
"ssh_password": "kivy", "ssh_password": "kivy",
"hostname": "ubuntu" "hostname": "kivyvm"
}, },
"description": "Build a Xubuntu Virtual Machine", "description": "Build a Xubuntu Virtual Machine",
"builders": [{ "builders": [{
"type": "virtualbox-iso", "type": "virtualbox-iso",
"name": "from-netboot-iso", "name": "kivy-buildozer-vm",
"http_directory": "http", "http_directory": "http",
"iso_checksum": "4c58dcf09083cd3aa602eb1b79810a0ff58b7c21", "iso_checksum": "6131e2cc90cf30407af18f3f1af16c54bf58ffc8",
"iso_checksum_type": "sha1", "iso_checksum_type": "sha1",
"iso_url": "http://archive.ubuntu.com/ubuntu/dists/vivid/main/installer-i386/current/images/netboot/mini.iso", "iso_url": "http://archive.ubuntu.com/ubuntu/dists/zesty/main/installer-amd64/current/images/netboot/mini.iso",
"ssh_username": "{{user `ssh_username`}}", "ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}", "ssh_password": "{{user `ssh_password`}}",
"boot_wait": "3s", "boot_wait": "3s",
@ -31,13 +31,17 @@
"format": "{{user `disk_format`}}", "format": "{{user `disk_format`}}",
"headless": false, "headless": false,
"shutdown_command": "echo {{user `ssh_password`}} | sudo -S shutdown -P now", "shutdown_command": "echo {{user `ssh_password`}} | sudo -S shutdown -P now",
"vm_name": "ubuntu", "vm_name": "Kivy/Buildozer VM",
"guest_os_type": "Ubuntu_64",
"guest_additions_mode": "attach",
"ssh_wait_timeout": "120m" "ssh_wait_timeout": "120m"
}], }],
"provisioners": [{ "provisioners": [{
"type": "shell", "type": "shell",
"execute_command": "echo {{user `ssh_password`}} | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", "execute_command": "echo {{user `ssh_password`}} | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"scripts": [ "scripts": [
"scripts/install-virtualbox-guest-additions.sh",
"scripts/setup.sh",
"scripts/additional-packages.sh", "scripts/additional-packages.sh",
"scripts/minimize.sh" "scripts/minimize.sh"
] ]

View file

@ -22,7 +22,7 @@ To test your own recipe via Buildozer, you need to:
#. Change your `buildozer.spec` to reference your version:: #. Change your `buildozer.spec` to reference your version::
android.p4a_dir = /path/to/your/python-for-android p4a.source_dir = /path/to/your/python-for-android
#. Copy your recipe into `python-for-android/recipes/YOURLIB/recipe.sh` #. Copy your recipe into `python-for-android/recipes/YOURLIB/recipe.sh`