kivy: remove unused files on iOS (examples, tools, tests)

This commit is contained in:
Mathieu Virbel 2019-09-22 23:25:18 +02:00
parent 3d76c34ec8
commit 0523593c0d

View file

@ -1,7 +1,10 @@
from toolchain import CythonRecipe, shprint from toolchain import CythonRecipe, shprint
from os.path import join from os.path import join
from os import chdir, listdir from os import chdir, listdir, getcwd
import sh import sh
import logging
logger = logging.getLogger(__name__)
class KivyRecipe(CythonRecipe): class KivyRecipe(CythonRecipe):
@ -45,8 +48,7 @@ class KivyRecipe(CythonRecipe):
Automate the installation of a Python package into the target Automate the installation of a Python package into the target
site-packages. site-packages.
""" """
# arch = self.filtered_archs[0] arch = self.filtered_archs[0]
for arch in self.filtered_archs:
if name is None: if name is None:
name = self.name name = self.name
if env is None: if env is None:
@ -61,7 +63,9 @@ class KivyRecipe(CythonRecipe):
hostpython, hostpython,
"setup.py", "setup.py",
"bdist_egg", "bdist_egg",
"--plat-name={}".format(arch.arch), "--exclude-source-files",
"--plat-name=",
# "--plat-name={}".format(arch.arch),
_env=env, _env=env,
) )
for file in listdir("./dist"): for file in listdir("./dist"):
@ -78,5 +82,16 @@ class KivyRecipe(CythonRecipe):
_env=env, _env=env,
) )
# clean
oldpwd = getcwd()
try:
logger.info("Remove files unlikely to be used")
chdir(join(self.ctx.site_packages_dir, egg_name))
sh.rm("-rf", "share")
sh.rm("-rf", "kivy/tools")
sh.rm("-rf", "kivy/tests")
finally:
chdir(oldpwd)
recipe = KivyRecipe() recipe = KivyRecipe()