kivy: remove unused files on iOS (examples, tools, tests)
This commit is contained in:
parent
3d76c34ec8
commit
0523593c0d
1 changed files with 47 additions and 32 deletions
|
@ -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,38 +48,50 @@ 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:
|
env = self.get_recipe_env(arch)
|
||||||
env = self.get_recipe_env(arch)
|
print("Install {} into the site-packages".format(name))
|
||||||
print("Install {} into the site-packages".format(name))
|
build_dir = self.get_build_dir(arch.arch)
|
||||||
build_dir = self.get_build_dir(arch.arch)
|
chdir(build_dir)
|
||||||
chdir(build_dir)
|
|
||||||
|
|
||||||
hostpython = sh.Command(self.ctx.hostpython)
|
hostpython = sh.Command(self.ctx.hostpython)
|
||||||
env["PYTHONPATH"] = self.ctx.site_packages_dir
|
env["PYTHONPATH"] = self.ctx.site_packages_dir
|
||||||
shprint(
|
shprint(
|
||||||
hostpython,
|
hostpython,
|
||||||
"setup.py",
|
"setup.py",
|
||||||
"bdist_egg",
|
"bdist_egg",
|
||||||
"--plat-name={}".format(arch.arch),
|
"--exclude-source-files",
|
||||||
_env=env,
|
"--plat-name=",
|
||||||
)
|
# "--plat-name={}".format(arch.arch),
|
||||||
for file in listdir("./dist"):
|
_env=env,
|
||||||
if file.endswith(".egg"):
|
)
|
||||||
egg_name = file
|
for file in listdir("./dist"):
|
||||||
shprint(
|
if file.endswith(".egg"):
|
||||||
hostpython,
|
egg_name = file
|
||||||
"setup.py",
|
shprint(
|
||||||
"easy_install",
|
hostpython,
|
||||||
"--no-deps",
|
"setup.py",
|
||||||
"--install-dir",
|
"easy_install",
|
||||||
self.ctx.site_packages_dir,
|
"--no-deps",
|
||||||
join("dist", egg_name),
|
"--install-dir",
|
||||||
_env=env,
|
self.ctx.site_packages_dir,
|
||||||
)
|
join("dist", egg_name),
|
||||||
|
_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()
|
||||||
|
|
Loading…
Add table
Reference in a new issue