🔥 Drops garden support
Garden are now installed like normal packages, refs: https://kivy.org/doc/stable/api-kivy.garden.html#update-to-garden-structure
This commit is contained in:
parent
ffe73a67b5
commit
e8b20d5beb
3 changed files with 4 additions and 60 deletions
|
@ -14,6 +14,7 @@ import sys
|
||||||
import select
|
import select
|
||||||
import codecs
|
import codecs
|
||||||
import textwrap
|
import textwrap
|
||||||
|
import warnings
|
||||||
from buildozer.jsonstore import JsonStore
|
from buildozer.jsonstore import JsonStore
|
||||||
from sys import stdout, stderr, exit
|
from sys import stdout, stderr, exit
|
||||||
from re import search
|
from re import search
|
||||||
|
@ -171,7 +172,6 @@ class Buildozer:
|
||||||
self.info('Check application requirements')
|
self.info('Check application requirements')
|
||||||
self.check_application_requirements()
|
self.check_application_requirements()
|
||||||
|
|
||||||
self.info('Check garden requirements')
|
|
||||||
self.check_garden_requirements()
|
self.check_garden_requirements()
|
||||||
|
|
||||||
self.info('Compile platform')
|
self.info('Compile platform')
|
||||||
|
@ -509,44 +509,10 @@ class Buildozer:
|
||||||
cwd=self.buildozer_dir)
|
cwd=self.buildozer_dir)
|
||||||
|
|
||||||
def check_garden_requirements(self):
|
def check_garden_requirements(self):
|
||||||
'''Ensure required garden packages are available to be included.
|
|
||||||
'''
|
|
||||||
garden_requirements = self.config.getlist('app',
|
garden_requirements = self.config.getlist('app',
|
||||||
'garden_requirements', '')
|
'garden_requirements', '')
|
||||||
|
if garden_requirements:
|
||||||
# have we installed the garden packages?
|
warnings.warn("`garden_requirements` settings is deprecated, use `requirements` instead", DeprecationWarning)
|
||||||
if exists(self.gardenlibs_dir) and \
|
|
||||||
self.state.get('cache.gardenlibs', '') == garden_requirements:
|
|
||||||
self.debug('Garden requirements already installed, pass')
|
|
||||||
return
|
|
||||||
|
|
||||||
# we're going to reinstall all the garden libs.
|
|
||||||
self.rmdir(self.gardenlibs_dir)
|
|
||||||
|
|
||||||
# but if we don't have requirements, or if the user removed everything,
|
|
||||||
# don't do anything.
|
|
||||||
if not garden_requirements:
|
|
||||||
self.state['cache.gardenlibs'] = garden_requirements
|
|
||||||
return
|
|
||||||
|
|
||||||
self._ensure_virtualenv()
|
|
||||||
self.cmd('pip install Kivy-Garden==0.1.1', env=self.env_venv)
|
|
||||||
|
|
||||||
# recreate gardenlibs
|
|
||||||
self.mkdir(self.gardenlibs_dir)
|
|
||||||
|
|
||||||
for requirement in garden_requirements:
|
|
||||||
self._install_garden_package(requirement)
|
|
||||||
|
|
||||||
# save gardenlibs state
|
|
||||||
self.state['cache.gardenlibs'] = garden_requirements
|
|
||||||
|
|
||||||
def _install_garden_package(self, package):
|
|
||||||
self._ensure_virtualenv()
|
|
||||||
self.debug('Install garden package {} in buildozer_dir'.format(package))
|
|
||||||
self.cmd('garden install --app {}'.format(package),
|
|
||||||
env=self.env_venv,
|
|
||||||
cwd=self.buildozer_dir)
|
|
||||||
|
|
||||||
def _ensure_virtualenv(self):
|
def _ensure_virtualenv(self):
|
||||||
if hasattr(self, 'venv'):
|
if hasattr(self, 'venv'):
|
||||||
|
@ -715,7 +681,6 @@ class Buildozer:
|
||||||
def build_application(self):
|
def build_application(self):
|
||||||
self._copy_application_sources()
|
self._copy_application_sources()
|
||||||
self._copy_application_libs()
|
self._copy_application_libs()
|
||||||
self._copy_garden_libs()
|
|
||||||
self._add_sitecustomize()
|
self._add_sitecustomize()
|
||||||
|
|
||||||
def _copy_application_sources(self):
|
def _copy_application_sources(self):
|
||||||
|
@ -816,10 +781,6 @@ class Buildozer:
|
||||||
# copy also the libs
|
# copy also the libs
|
||||||
copytree(self.applibs_dir, join(self.app_dir, '_applibs'))
|
copytree(self.applibs_dir, join(self.app_dir, '_applibs'))
|
||||||
|
|
||||||
def _copy_garden_libs(self):
|
|
||||||
if exists(self.gardenlibs_dir):
|
|
||||||
copytree(self.gardenlibs_dir, join(self.app_dir, 'libs'))
|
|
||||||
|
|
||||||
def _add_sitecustomize(self):
|
def _add_sitecustomize(self):
|
||||||
copyfile(join(dirname(__file__), 'sitecustomize.py'),
|
copyfile(join(dirname(__file__), 'sitecustomize.py'),
|
||||||
join(self.app_dir, 'sitecustomize.py'))
|
join(self.app_dir, 'sitecustomize.py'))
|
||||||
|
@ -889,10 +850,6 @@ class Buildozer:
|
||||||
def applibs_dir(self):
|
def applibs_dir(self):
|
||||||
return join(self.buildozer_dir, 'applibs')
|
return join(self.buildozer_dir, 'applibs')
|
||||||
|
|
||||||
@property
|
|
||||||
def gardenlibs_dir(self):
|
|
||||||
return join(self.buildozer_dir, 'libs')
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def global_buildozer_dir(self):
|
def global_buildozer_dir(self):
|
||||||
return join(expanduser('~'), '.buildozer')
|
return join(expanduser('~'), '.buildozer')
|
||||||
|
|
|
@ -42,9 +42,6 @@ requirements = python3,kivy
|
||||||
# Sets custom source for any requirements with recipes
|
# Sets custom source for any requirements with recipes
|
||||||
# requirements.source.kivy = ../../kivy
|
# requirements.source.kivy = ../../kivy
|
||||||
|
|
||||||
# (list) Garden requirements
|
|
||||||
#garden_requirements =
|
|
||||||
|
|
||||||
# (str) Presplash of the application
|
# (str) Presplash of the application
|
||||||
#presplash.filename = %(source.dir)s/data/presplash.png
|
#presplash.filename = %(source.dir)s/data/presplash.png
|
||||||
|
|
||||||
|
|
|
@ -98,16 +98,6 @@ Section [app]
|
||||||
the compilation here. If you want to make it work, contribute to the
|
the compilation here. If you want to make it work, contribute to the
|
||||||
Python-for-android project by creating a recipe. See :doc:`contribute`.
|
Python-for-android project by creating a recipe. See :doc:`contribute`.
|
||||||
|
|
||||||
- `garden_requirements`: List, Garden packages to include.
|
|
||||||
|
|
||||||
Add here the list of Kivy's garden packages to include. For example::
|
|
||||||
|
|
||||||
garden_requirements = graph
|
|
||||||
|
|
||||||
Please note that if it doesn't work, it might be because of the garden
|
|
||||||
package itself. Refer to the author of the package if he already tested
|
|
||||||
it on your target platform, not us.
|
|
||||||
|
|
||||||
- `presplash.filename`: String, loading screen of your application.
|
- `presplash.filename`: String, loading screen of your application.
|
||||||
|
|
||||||
Presplash is the image shown on the device during application loading.
|
Presplash is the image shown on the device during application loading.
|
||||||
|
|
Loading…
Reference in a new issue