From f1c092da8ba4d03125387a337ab45c9b5a1315dc Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 29 May 2013 10:36:57 +0200 Subject: python3: Port python2 patches to reduce the interpreter size Some of the python2 patches were left behind when doing the python3 package. This was because the python build system can now autodetect what packages can be built in the system. However, some of these patches are actually useful to reduce drastically the size of the interpreter. This patch ports the relevant patches to the python3 package, and adds a new patch to remove the idle3 IDE as well from the interpreter. Fixes #5696 Signed-off-by: Maxime Ripard Signed-off-by: Peter Korsgaard --- .../python3/python3-002-no-host-headers-libs.patch | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 package/python3/python3-002-no-host-headers-libs.patch (limited to 'package/python3/python3-002-no-host-headers-libs.patch') diff --git a/package/python3/python3-002-no-host-headers-libs.patch b/package/python3/python3-002-no-host-headers-libs.patch new file mode 100644 index 0000000000..9783f28ade --- /dev/null +++ b/package/python3/python3-002-no-host-headers-libs.patch @@ -0,0 +1,72 @@ +Do not look at host headers/libraries in cross-compile mode + +When we are cross-compiling, setup.py should never look in /usr or +/usr/local to find headers or libraries. A later patch adds a +mechanism to tell setup.py to look in a specific directory for headers +and libraries. + +Patch first written by Thomas Petazzoni + for python2.7, and then ported +to python3.3 by Maxime Ripard + +Signed-off-by: Maxime Ripard +--- + setup.py | 23 +++++------------------ + 1 file changed, 5 insertions(+), 18 deletions(-) + +Index: Python-3.3.0/setup.py +=================================================================== +--- Python-3.3.0.orig/setup.py ++++ Python-3.3.0/setup.py +@@ -447,10 +447,8 @@ + if not cross_compiling: + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') +- # only change this for cross builds for 3.3, issues on Mageia +- if cross_compiling: + self.add_gcc_paths() +- self.add_multiarch_paths() ++ self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. +@@ -458,10 +456,7 @@ + # directly since an inconsistently reproducible issue comes up where + # the environment variable is not set even though the value were passed + # into configure and stored in the Makefile (issue found on OS X 10.3). +- for env_var, arg_name, dir_list in ( +- ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), +- ('LDFLAGS', '-L', self.compiler.library_dirs), +- ('CPPFLAGS', '-I', self.compiler.include_dirs)): ++ for env_var, arg_name, dir_list in (): + env_val = sysconfig.get_config_var(env_var) + if env_val: + # To prevent optparse from raising an exception about any +@@ -486,17 +481,6 @@ + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.base_prefix) != '/usr' \ +- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): +- # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework +- # (PYTHONFRAMEWORK is set) to avoid # linking problems when +- # building a framework with different architectures than +- # the one that is currently installed (issue #7473) +- add_dir_to_list(self.compiler.library_dirs, +- sysconfig.get_config_var("LIBDIR")) +- add_dir_to_list(self.compiler.include_dirs, +- sysconfig.get_config_var("INCLUDEDIR")) +- + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. +@@ -506,6 +490,9 @@ + '/lib', '/usr/lib', + ] + inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ else: ++ lib_dirs = self.compiler.library_dirs ++ inc_dirs = self.compiler.include_dirs + exts = [] + missing = [] + -- cgit v1.2.3