From a9b85cfe786b79dafe96989ddfb419705ceeb642 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 30 Apr 2015 19:51:01 +0200 Subject: [PATCH] few fixes to prevent rejection from the app store. Closes #133 --- recipes/python/__init__.py | 1 + toolchain.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/recipes/python/__init__.py b/recipes/python/__init__.py index 0c40576..b200a28 100644 --- a/recipes/python/__init__.py +++ b/recipes/python/__init__.py @@ -131,6 +131,7 @@ class PythonRecipe(Recipe): sh.rm("config/python.o") sh.rm("config/config.c.in") sh.rm("config/makesetup") + sh.rm("config/install-sh") sh.mv("config", "..") sh.mv("site-packages", "..") sh.zip("-r", "../python27.zip", sh.glob("*")) diff --git a/toolchain.py b/toolchain.py index 38920d2..a79a2e9 100755 --- a/toolchain.py +++ b/toolchain.py @@ -789,6 +789,14 @@ class PythonRecipe(Recipe): self.install_python_package() self.reduce_python_package() + def remove_junk(self, d): + exts = ["pyc", "py", "so.lib", "so.o", "sh"] + for root, dirnames, filenames in walk(d): + for fn in filenames: + ext = fn.rsplit(".", 1)[-1] + if ext in exts: + unlink(join(root, fn)) + def install_python_package(self, name=None, env=None, is_dir=True): """Automate the installation of a Python package into the target site-packages. @@ -809,6 +817,7 @@ class PythonRecipe(Recipe): "--prefix", iosbuild, _env=env) dest_dir = join(self.ctx.site_packages_dir, name) + self.remove_junk(ios_build) if is_dir: if exists(dest_dir): shutil.rmtree(dest_dir)