Pull request for branch for-2011.02/python-bump
Hello,
Here is a set of patches that improve Python support in Buildroot:
Python is bumped to 2.7.1, the package is converted to the autotargets infrastructure, some third-party Python modules are introduced as examples, many minor issues were fixed.
The patch set is composed of the following changes :
* Four initial patches from Maxime Ripard that bump Python to 2.7 and update the patches accordingly. Even though those four patches from Maxime Ripaard are heavily reworked and modified in the later commit that converts the python package to the autotargets infrastructure and rewrites all the patches, I have choosen to keep Maxime's patches in order to preserve authorship.
* A patch to add a package for the libffi library (needed by the Python interpreter to build its ctype extension).
* A patch that adjusts the autotools infrastructure to allow host packages to use <pkg>_MAKE_ENV and <pkg>_MAKE. The <pkg>_MAKE_ENV thing will be used by the converted python package.
* A patch that bumps Python to 2.7.1, converts it to autotargets, rewrites all the patches to clarify their intent, clean up their implementation and add new features (options to enable/disable the compilation of certain extensions).
* A patch that does the removing of .py or .pyc files globally (in target-finalize) and no longer at the level of the python package. This is necessary since the python package is not the only one that can install .py or .pyc files.
* Two patches that add the python-serial and python-mad packages. Those have been used to test that our Python infrastructure works properly to build a pure Python module (python-serial) and a Python module that relies on C code, linked to a C library (python-mad). For the moment, those packages use the gentargets infrastructure, but once we have a better understanding of the Python distutils cross-compilation details, we may want to write a pythondistutilstargets infrastructure.
Those changes have been runtime tested with various simple Python examples in a Qemu ARM target.
Regards,
Thomas
The following changes since commit 34acba1b3ef4ea874a1793f0f36a6b49abbb37ff:
Peter Korsgaard (1):
gdb: fixup symlink handling now tolchain gets installed into HOST_DIR
are available in the git repository at:
git://git.busybox.net/~tpetazzoni/git/buildroot for-2011.02/python-bump
Maxime Ripard (4):
python: Move to version 2.7
python: Port the python2.4 patches to 2.7
python: Add the needed patches to compile python2.7 in buildroot.
python: Fix make install (Workaround python's bug #1669349)
Thomas Petazzoni (6):
libffi: new package
autotools: allow host package to use <pkg>_MAKE_ENV and <pkg>_MAKE
python: convert to autotargets, bump to 2.7.1, many improvements Remove .py or .pyc depending on Python configuration
python-serial: new package
python-mad: new package
Makefile | 8 + package/Config.in | 2 + package/Makefile.autotools.in | 2 +- package/libffi/Config.in | 9 + package/libffi/libffi.mk | 33 +++ package/multimedia/Config.in | 1 + package/multimedia/python-mad/Config.in | 7 + package/multimedia/python-mad/python-mad.mk | 41 +++ package/python-serial/Config.in | 5 + package/python-serial/python-serial.mk | 21 ++ package/python/Config.in | 65 ++--- package/python/python-2.4-001-cross-compile.patch | 106 -------- package/python/python-2.4-002-cross-compile.patch | 36 --- .../python-2.4-010-disable_modules_and_ssl.patch | 37 --- .../python-2.4-020-gentoo_py_dontcompile.patch | 18 -- .../python/python-2.7-001-support-for-build.patch | 153 +++++++++++ .../python-2.7-002-cross-compile-variable.patch | 55 ++++ ...on-2.7-003-no-import-when-cross-compiling.patch | 26 ++ .../python-2.7-004-no-host-headers-libs.patch | 97 +++++++ .../python-2.7-005-staging-headers-libs.patch | 38 +++ .../python/python-2.7-006-disable-extensions.patch | 102 +++++++ .../python-2.7-007-do-not-generate-pyo-files.patch | 40 +++ .../python/python-2.7-008-reread-environment.patch | 65 +++++ package/python/python-2.7-009-python-symlink.patch | 25 ++ ...python-2.7-010-change-pyconfig-h-location.patch | 76 ++++++ package/python/python-2.7-011-no-rpath.patch | 75 ++++++ .../python-2.7-012-correct-32bit-64bit-check.patch | 55 ++++ .../python-2.7-100-optional-test-modules.patch | 84 ++++++ package/python/python-2.7-101-optional-pydoc.patch | 81 ++++++ package/python/python-2.7-102-optional-2to3.patch | 99 +++++++ .../python/python-2.7-103-optional-sqlite.patch | 28 ++ package/python/python-2.7-104-optional-tk.patch | 68 +++++ .../python/python-2.7-105-optional-curses.patch | 53 ++++ package/python/python-2.7-106-optional-expat.patch | 84 ++++++ .../python-2.7-107-optional-codecs-cjk.patch | 25 ++ package/python/python-2.7-108-optional-nis.patch | 28 ++ .../python-2.7-109-optional-unicodedata.patch | 25 ++ package/python/python-2.7-110-optional-db.patch | 81 ++++++ package/python/python-2.7-111-optional-ssl.patch | 25 ++ package/python/python-2.7-112-optional-bzip2.patch | 24 ++ package/python/python-2.7-113-optional-zlib.patch | 24 ++ package/python/python.mk | 278 ++++++++------------ 42 files changed, 1799 insertions(+), 406 deletions(-) create mode 100644 package/libffi/Config.in create mode 100644 package/libffi/libffi.mk create mode 100644 package/multimedia/python-mad/Config.in create mode 100644 package/multimedia/python-mad/python-mad.mk create mode 100644 package/python-serial/Config.in create mode 100644 package/python-serial/python-serial.mk delete mode 100644 package/python/python-2.4-001-cross-compile.patch delete mode 100644 package/python/python-2.4-002-cross-compile.patch delete mode 100644 package/python/python-2.4-010-disable_modules_and_ssl.patch delete mode 100644 package/python/python-2.4-020-gentoo_py_dontcompile.patch create mode 100644 package/python/python-2.7-001-support-for-build.patch create mode 100644 package/python/python-2.7-002-cross-compile-variable.patch create mode 100644 package/python/python-2.7-003-no-import-when-cross-compiling.patch create mode 100644 package/python/python-2.7-004-no-host-headers-libs.patch create mode 100644 package/python/python-2.7-005-staging-headers-libs.patch create mode 100644 package/python/python-2.7-006-disable-extensions.patch create mode 100644 package/python/python-2.7-007-do-not-generate-pyo-files.patch create mode 100644 package/python/python-2.7-008-reread-environment.patch create mode 100644 package/python/python-2.7-009-python-symlink.patch create mode 100644 package/python/python-2.7-010-change-pyconfig-h-location.patch create mode 100644 package/python/python-2.7-011-no-rpath.patch create mode 100644 package/python/python-2.7-012-correct-32bit-64bit-check.patch create mode 100644 package/python/python-2.7-100-optional-test-modules.patch create mode 100644 package/python/python-2.7-101-optional-pydoc.patch create mode 100644 package/python/python-2.7-102-optional-2to3.patch create mode 100644 package/python/python-2.7-103-optional-sqlite.patch create mode 100644 package/python/python-2.7-104-optional-tk.patch create mode 100644 package/python/python-2.7-105-optional-curses.patch create mode 100644 package/python/python-2.7-106-optional-expat.patch create mode 100644 package/python/python-2.7-107-optional-codecs-cjk.patch create mode 100644 package/python/python-2.7-108-optional-nis.patch create mode 100644 package/python/python-2.7-109-optional-unicodedata.patch create mode 100644 package/python/python-2.7-110-optional-db.patch create mode 100644 package/python/python-2.7-111-optional-ssl.patch create mode 100644 package/python/python-2.7-112-optional-bzip2.patch create mode 100644 package/python/python-2.7-113-optional-zlib.patch
Thanks,
Signature · 1 line
Thomas Petazzoni
PATCH 1/10 python: Move to version 2.7
From: Maxime Ripard <[email protected]>
--- package/python/python.mk | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
package/python/python.mk +2 -2
@@ -3,8 +3,8 @@ # python # ############################################################# -PYTHON_VERSION=2.4.5 -PYTHON_VERSION_MAJOR=2.4 +PYTHON_VERSION=2.7 +PYTHON_VERSION_MAJOR=2.7 PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2 PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION) PYTHON_DIR:=$(BUILD_DIR)/Python-$(PYTHON_VERSION)
Signature · 1 line
1.7.0.4
PATCH 2/10 python: Port the python2.4 patches to 2.7
In reply to Thomas PetazzoniFrom: Maxime Ripard <[email protected]>
--- package/python/python-2.4-001-cross-compile.patch | 106 ------------------ package/python/python-2.4-002-cross-compile.patch | 36 ------ .../python-2.4-010-disable_modules_and_ssl.patch | 37 ------- .../python-2.4-020-gentoo_py_dontcompile.patch | 18 --- package/python/python-2.7-001-cross-compile.patch | 114 ++++++++++++++++++++ package/python/python-2.7-002-cross-compile.patch | 47 ++++++++ .../python-2.7-010-disable_modules_and_ssl.patch | 49 +++++++++ .../python-2.7-020-gentoo_py_dontcompile.patch | 27 +++++ 8 files changed, 237 insertions(+), 197 deletions(-) delete mode 100644 package/python/python-2.4-001-cross-compile.patch delete mode 100644 package/python/python-2.4-002-cross-compile.patch delete mode 100644 package/python/python-2.4-010-disable_modules_and_ssl.patch delete mode 100644 package/python/python-2.4-020-gentoo_py_dontcompile.patch create mode 100644 package/python/python-2.7-001-cross-compile.patch create mode 100644 package/python/python-2.7-002-cross-compile.patch create mode 100644 package/python/python-2.7-010-disable_modules_and_ssl.patch create mode 100644 package/python/python-2.7-020-gentoo_py_dontcompile.patch
package/python/python-2.4-001-cross-compile.patch deleted +0 -106
@@ -1,106 +0,0 @@ -diff -rduNp Python-2.4.2.orig/Makefile.pre.in Python-2.4.2/Makefile.pre.in ---- Python-2.4.2.orig/Makefile.pre.in 2005-03-29 01:23:01.000000000 +0200 -+++ Python-2.4.2/Makefile.pre.in 2007-01-22 19:37:08.000000000 +0100 -@@ -162,6 +162,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ - - PYTHON= python$(EXE) - BUILDPYTHON= python$(BUILDEXE) -+HOSTPYTHON= $(BUILDPYTHON) - - # === Definitions added by makesetup === - -@@ -188,7 +189,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar - ########################################################################## - # Parser - PGEN= Parser/pgen$(EXE) -- -+HOSTPGEN= $(PGEN)$(EXE) - POBJS= \ - Parser/acceler.o \ - Parser/grammar1.o \ -@@ -320,8 +321,8 @@ platform: $(BUILDPYTHON) - # Build the shared modules - sharedmods: $(BUILDPYTHON) - case $$MAKEFLAGS in \ -- *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ -- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ -+ *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ -+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ - esac - - # buildno should really depend on something like LIBRARY_SRC -@@ -442,7 +443,7 @@ Modules/ccpython.o: $(srcdir)/Modules/cc - - - $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) -- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) - - $(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) -@@ -719,19 +720,19 @@ libinstall: $(BUILDPYTHON) $(srcdir)/Lib - done - $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ -+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST) -f \ - -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ -+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST) -f \ - -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ -+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -@@ -826,7 +827,7 @@ libainstall: all - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: -- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ -+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -diff -rduNp Python-2.4.2.orig/setup.py Python-2.4.2/setup.py ---- Python-2.4.2.orig/setup.py 2005-03-09 23:27:24.000000000 +0100 -+++ Python-2.4.2/setup.py 2007-01-22 19:37:08.000000000 +0100 -@@ -204,6 +204,7 @@ class PyBuildExt(build_ext): - try: - imp.load_dynamic(ext.name, ext_filename) - except ImportError, why: -+ return - self.announce('*** WARNING: renaming "%s" since importing it' - ' failed: %s' % (ext.name, why), level=3) - assert not self.inplace -@@ -239,8 +240,6 @@ class PyBuildExt(build_ext): - - def detect_modules(self): - # Ensure that /usr/local is always used -- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') - - # Add paths to popular package managers on OS X/darwin - if sys.platform == "darwin": -@@ -251,12 +250,6 @@ class PyBuildExt(build_ext): - add_dir_to_list(self.compiler.library_dirs, '/opt/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/opt/local/include') - -- if os.path.normpath(sys.prefix) != '/usr': -- 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")) -- - try: - have_unicode = unicode - except NameError:
package/python/python-2.4-002-cross-compile.patch deleted +0 -36
@@ -1,36 +0,0 @@ ---- Python-2.4.2-001/setup.py 2007-01-23 16:18:37.000000000 +0100 -+++ Python-2.4.2/setup.py 2007-01-23 16:26:43.000000000 +0100 -@@ -239,7 +239,18 @@ - return sys.platform - - def detect_modules(self): -- # Ensure that /usr/local is always used -+ try: -+ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split() -+ except KeyError: -+ modules_include_dirs = ['/usr/include'] -+ try: -+ modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split() -+ except KeyError: -+ modules_lib_dirs = ['/usr/lib'] -+ for dir in modules_include_dirs: -+ add_dir_to_list(self.compiler.include_dirs, dir) -+ for dir in modules_lib_dirs: -+ add_dir_to_list(self.compiler.library_dirs, dir) - - # Add paths to popular package managers on OS X/darwin - if sys.platform == "darwin": -@@ -258,11 +269,8 @@ - # 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. -- lib_dirs = self.compiler.library_dirs + [ -- '/lib64', '/usr/lib64', -- '/lib', '/usr/lib', -- ] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] -+ lib_dirs = self.compiler.library_dirs -+ inc_dirs = self.compiler.include_dirs - exts = [] - - platform = self.get_platform()
package/python/python-2.4-010-disable_modules_and_ssl.patch deleted +0 -37
@@ -1,37 +0,0 @@ -diff -rduNp Python-2.4.2-002/setup.py Python-2.4.2/setup.py ---- Python-2.4.2-002/setup.py 2007-01-22 19:41:47.000000000 +0100 -+++ Python-2.4.2/setup.py 2007-01-22 19:47:25.000000000 +0100 -@@ -15,7 +15,14 @@ from distutils.command.install import in - from distutils.command.install_lib import install_lib - - # This global variable is used to hold the list of modules to be disabled. --disabled_module_list = [] -+try: -+ disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split() -+except KeyError: -+ disabled_module_list = [] -+try: -+ disable_ssl = os.environ["PYTHON_DISABLE_SSL"] -+except KeyError: -+ disable_ssl = 0 - - def add_dir_to_list(dirlist, dir): - """Add the directory 'dir' to the list 'dirlist' (at the front) if -@@ -247,6 +254,7 @@ class PyBuildExt(build_ext): - return sys.platform - - def detect_modules(self): -+ global disable_ssl - try: - modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split() - except KeyError: -@@ -468,7 +476,8 @@ class PyBuildExt(build_ext): - ] ) - - if (ssl_incs is not None and -- ssl_libs is not None): -+ ssl_libs is not None and -+ not disable_ssl): - exts.append( Extension('_ssl', ['_ssl.c'], - include_dirs = ssl_incs, - library_dirs = ssl_libs,
package/python/python-2.4-020-gentoo_py_dontcompile.patch deleted +0 -18
@@ -1,18 +0,0 @@ -diff -rduNp Python-2.4.2-010/Python/import.c Python-2.4.2/Python/import.c ---- Python-2.4.2-010/Python/import.c 2005-09-14 20:15:03.000000000 +0200 -+++ Python-2.4.2/Python/import.c 2007-01-22 19:49:18.000000000 +0100 -@@ -822,8 +822,12 @@ static void - write_compiled_module(PyCodeObject *co, char *cpathname, long mtime) - { - FILE *fp; -- -- fp = open_exclusive(cpathname); -+ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE"); -+ -+ if (!py_dontcompile) -+ fp = open_exclusive(cpathname); -+ else -+ fp = NULL; - if (fp == NULL) { - if (Py_VerboseFlag) - PySys_WriteStderr(
package/python/python-2.7-001-cross-compile.patch new file +114 -0
114 lines not on this page · raw message
package/python/python-2.7-002-cross-compile.patch new file +47 -0
47 lines not on this page · raw message
package/python/python-2.7-010-disable_modules_and_ssl.patch new file +49 -0
49 lines not on this page · raw message
package/python/python-2.7-020-gentoo_py_dontcompile.patch new file +27 -0
@@ -0,0 +1,27 @@ +This patch purpose is to allow not to save the generated python bytecode in +a file for later use through the PYTHON_DONTCOMPILE environment variable. + +I do not see the use of it, because you can choose if you want but it seems +somewhat related to gentoo. + +Maybe useful when the generated rootfs is mounted on read-only on the target. + +Patch ported to python2.7 by Maxime Ripard <[email protected]> + +diff -rduNp Python-2.7.orig/Python/import.c Python-2.7/Python/import.c +--- Python-2.7.orig/Python/import.c 2010-09-30 12:05:53.000000000 +0200 ++++ Python-2.7/Python/import.c 2010-09-30 12:20:38.000000000 +0200 +@@ -886,7 +886,12 @@ write_compiled_module(PyCodeObject *co, + mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH; + #endif + +- fp = open_exclusive(cpathname, mode); ++ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE"); ++ ++ if (!py_dontcompile) ++ fp = open_exclusive(cpathname, mode); ++ else ++ fp = NULL; + if (fp == NULL) { + if (Py_VerboseFlag) + PySys_WriteStderr(
Signature · 1 line
1.7.0.4
PATCH 3/10 python: Add the needed patches to compile python2.7 in buildroot.
In reply to Thomas PetazzoniFrom: Maxime Ripard <[email protected]>
--- .../python-2.7-030-fix-long-long-format.patch | 19 ++++++++++ .../python-2.7-040-bytecode-generation-fix.patch | 38 ++++++++++++++++++++ 2 files changed, 57 insertions(+), 0 deletions(-) create mode 100644 package/python/python-2.7-030-fix-long-long-format.patch create mode 100644 package/python/python-2.7-040-bytecode-generation-fix.patch
package/python/python-2.7-030-fix-long-long-format.patch new file +19 -0
@@ -0,0 +1,19 @@ +Python's configure assume than when cross-compiling the target has no +support for long long int. This assumption breaks compilation later in the +process. Since gcc handles long long support, we can change the value to +assume that there is such support. + +Patch by Maxime Ripard <[email protected]> + +diff -rduNp Python-2.7.orig/configure Python-2.7/configure +--- Python-2.7.orig/configure 2010-09-30 12:05:54.000000000 +0200 ++++ Python-2.7/configure 2010-09-30 12:12:30.000000000 +0200 +@@ -13517,7 +13517,7 @@ $as_echo_n "checking for %lld and %llu p + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +- ac_cv_have_long_long_format=no ++ ac_cv_have_long_long_format=yes + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */
package/python/python-2.7-040-bytecode-generation-fix.patch new file +38 -0
@@ -0,0 +1,38 @@ +The compileall script is used to compile to python bytecode all the modules. +However, it relies on the struct package that is not built for the host +python, thus crashing at execution when compiling the target python. +When compiling, the removed code block is never executed, so we can safely +remove it, removing in the same time the dependency on struct. + +Patch by Maxime Ripard <[email protected]> + +Index: Python-2.7/Lib/compileall.py +=================================================================== +--- Python-2.7.orig/Lib/compileall.py (r??vision 84276) ++++ Python-2.7/Lib/compileall.py (copie de travail) +@@ -14,7 +14,6 @@ + import os + import sys + import py_compile +-import struct + import imp + + __all__ = ["compile_dir","compile_file","compile_path"] +@@ -83,17 +82,6 @@ + if os.path.isfile(fullname): + head, tail = name[:-3], name[-3:] + if tail == '.py': +- if not force: +- try: +- mtime = int(os.stat(fullname).st_mtime) +- expect = struct.pack('<4sl', imp.get_magic(), mtime) +- cfile = fullname + (__debug__ and 'c' or 'o') +- with open(cfile, 'rb') as chandle: +- actual = chandle.read(8) +- if expect == actual: +- return success +- except IOError: +- pass + if not quiet: + print 'Compiling', fullname, '...' + try:
Signature · 1 line
1.7.0.4
PATCH 4/10 python: Fix make install (Workaround python's bug #1669349)
In reply to Thomas PetazzoniFrom: Maxime Ripard <[email protected]>
--- package/python/python.mk | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
package/python/python.mk +9 -1
@@ -128,7 +128,15 @@ ifneq ($(BR2_PACKAGE_PYTHON_SSL),y) endif rm -rf $(PYTHON_DIR)/Lib/test LD_LIBRARY_PATH=$(STAGING_DIR)/lib - $(MAKE) CC="$(TARGET_CC)" -C $(PYTHON_DIR) install \ + # FIXME: The make -i just below is to work around python's bug + # #1669349 (http://bugs.python.org/issue1669349) which is introducing + # a failure at make install on a python-free system. Since none of + # the other the provided workaround work, the make -i is the only + # solution. The failing lib is install later in the process, so + # even if the compilation is failing without the patch, with it, the + # target python is fully functionnal. + # The "-i" will have to be removed when the bug will be solved. + $(MAKE) CC="$(TARGET_CC)" -C $(PYTHON_DIR) -i install \ DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \ PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \ PYTHON_MODULES_LIB="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
Signature · 1 line
1.7.0.4
PATCH 5/10 libffi: new package
In reply to Thomas Petazzonilibffi is needed by the Python interpreter.
The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run-time.
--- package/Config.in | 1 + package/libffi/Config.in | 9 +++++++++ package/libffi/libffi.mk | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 package/libffi/Config.in create mode 100644 package/libffi/libffi.mk
package/Config.in +1 -0
@@ -326,6 +326,7 @@ source "package/libcap/Config.in" source "package/libdaemon/Config.in" source "package/libelf/Config.in" source "package/libevent/Config.in" +source "package/libffi/Config.in" source "package/libglib2/Config.in" source "package/liboil/Config.in" source "package/startup-notification/Config.in"
package/libffi/Config.in new file +9 -0
@@ -0,0 +1,9 @@ +config BR2_PACKAGE_LIBFFI + bool "libffi" + help + The libffi library provides a portable, high level + programming interface to various calling conventions. This + allows a programmer to call any function specified by a call + interface description at run-time. + + http://sourceware.org/libffi/
package/libffi/libffi.mk new file +33 -0
@@ -0,0 +1,33 @@ +############################################################# +# +# libffi +# +############################################################# + +LIBFFI_VERSION = 3.0.9 +LIBFFI_SITE = ftp://sources.redhat.com/pub/libffi/ + +LIBFFI_INSTALL_STAGING = YES + +# Move the headers to the usual location, and adjust the .pc file +# accordingly +define LIBFFI_MOVE_STAGING_HEADERS + mv $(STAGING_DIR)/usr/lib/libffi-*/include/*.h $(STAGING_DIR)/usr/include/ + sed -i '/^includedir.*/d' $(STAGING_DIR)/usr/lib/pkgconfig/libffi.pc + rm -rf $(TARGET_DIR)/usr/lib/libffi-* +endef + +LIBFFI_POST_INSTALL_STAGING_HOOKS += LIBFFI_MOVE_STAGING_HEADERS + +# Similar for target headers +define LIBFFI_MOVE_TARGET_HEADERS + install -d $(TARGET_DIR)/usr/include/ + mv $(TARGET_DIR)/usr/lib/libffi-*/include/*.h $(TARGET_DIR)/usr/include/ + sed -i '/^includedir.*/d' $(TARGET_DIR)/usr/lib/pkgconfig/libffi.pc + rm -rf $(TARGET_DIR)/usr/lib/libffi-* +endef + +LIBFFI_POST_INSTALL_TARGET_HOOKS += LIBFFI_MOVE_TARGET_HEADERS + +$(eval $(call AUTOTARGETS,package,libffi)) +
Signature · 1 line
1.7.0.4
PATCH 6/10 autotools: allow host package to use <pkg>_MAKE_ENV and <pkg>_MAKE
In reply to Thomas PetazzoniThis will be needed by the Python interpreter package.
--- package/Makefile.autotools.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
package/Makefile.autotools.in +1 -1
@@ -200,7 +200,7 @@ endif # ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $$($$(PKG)_SRCDIR) install + $(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) -C $$($$(PKG)_SRCDIR) install endef endif
Signature · 1 line
1.7.0.4
PATCH 7/10 python: convert to autotargets, bump to 2.7.1, many improvements
In reply to Thomas PetazzoniThis commit does a number of changes and improvements to the Python interpreter package :
* It converts the .mk file to the AUTOTARGETS infrastructure. Even though Python uses only autoconf and not automake, the AUTOTARGETS is a fairly good fit for the Python interpreter, so we make use of it.
* It bumps the version to 2.7.1. As this is a minor release compared to 2.7, there are no particular changes needed because of this bump. All changes done to the package are cleanups and improvements unrelated to the version bump.
* It uses the system libffi. Until now, Python was building its own libffi (a library used by interprets to build code that makes function call at runtime). Using the Python internal libffi was not working as Python was not passing the appropriate arguments down to libffi ./configure script. And it sounded better to use a system-wide libffi, that could potentially be used by other packages as well. This libffi is needed for the ctypes Python module.
* Remove all "depends on BR2_PACKAGE_PYTHON" by moving all Python-related options under a "if BR2_PACKAGE_PYTHON ... endif" condition.
* Make the installation of pre-compiled Python modules (.pyc) the default, since they are smaller and do not need to be compiled on the target. It is still possible to install uncompiled modules, or both the uncompiled and pre-compiled versions.
* The options to select the set of Python modules to compile has been moved to a submenu.
* The codecscjk (Japanese, Korean and Chinese codecs) module is no longer enabled by default.
* The commented options for gdbm and nis in Python have been removed. Those were not supported, so let's get rid of unused code.
* The option for the tkinker module in Python has been removed, since we don't have a package for Tk in Buildroot.
* Options for the bzip2, sqlite and zlib modules have been added, since those modules have external dependencies.
* The set of patches has been completely reworked and extended, with more fine-grained patches and newer functionalities. The patches are split in two categories:
- Patches that make various modifications to the Python build system to support cross-compilation or make some minor modifications. Those patches are numbered from 0 to 100.
- Patches that add configuration options to the Python build system in order to enable/disable the compilation of Python extensions or modules (test modules, pydoc, lib2to3, sqlite, tk, curses, expat, codecs-cjk, nis, unicodedata, database modules, ssl, bzip2, zlib). These patches are numbered from 100 to 200.
All features of the previous four patches are preserved, but they are organized differently and the patches have been renamed. This makes it difficult to see the differences from the existing patches.
* The host Python interpreter is now installed in $(HOST_DIR), since it is used to build third party Python modules.
* The BR2_PACKAGE_PYTHON_DEV option is removed since BR2_HAVE_DEVFILES already does the necessary work.
* The "make -i install" workaround introduced by Maxime Ripard is no longer needed. It was caused by the compilation of the tests that required the unicodedata module (which wasn't built in the host Python interpreter). Since we no longer compile the Python tests, the problem doesn't exist anymore and we can avoid this "-i" option.
--- package/python/Config.in | 65 ++--- package/python/python-2.7-001-cross-compile.patch | 114 -------- .../python/python-2.7-001-support-for-build.patch | 153 +++++++++++ .../python-2.7-002-cross-compile-variable.patch | 55 ++++ package/python/python-2.7-002-cross-compile.patch | 47 ---- ...on-2.7-003-no-import-when-cross-compiling.patch | 26 ++ .../python-2.7-004-no-host-headers-libs.patch | 97 +++++++ .../python-2.7-005-staging-headers-libs.patch | 38 +++ .../python/python-2.7-006-disable-extensions.patch | 102 +++++++ .../python-2.7-007-do-not-generate-pyo-files.patch | 40 +++ .../python/python-2.7-008-reread-environment.patch | 65 +++++ package/python/python-2.7-009-python-symlink.patch | 25 ++ ...python-2.7-010-change-pyconfig-h-location.patch | 76 ++++++ .../python-2.7-010-disable_modules_and_ssl.patch | 49 ---- package/python/python-2.7-011-no-rpath.patch | 75 +++++ .../python-2.7-012-correct-32bit-64bit-check.patch | 55 ++++ .../python-2.7-020-gentoo_py_dontcompile.patch | 27 -- .../python-2.7-030-fix-long-long-format.patch | 19 -- .../python-2.7-040-bytecode-generation-fix.patch | 38 --- .../python-2.7-100-optional-test-modules.patch | 84 ++++++ package/python/python-2.7-101-optional-pydoc.patch | 81 ++++++ package/python/python-2.7-102-optional-2to3.patch | 99 +++++++ .../python/python-2.7-103-optional-sqlite.patch | 28 ++ package/python/python-2.7-104-optional-tk.patch | 68 +++++ .../python/python-2.7-105-optional-curses.patch | 53 ++++ package/python/python-2.7-106-optional-expat.patch | 84 ++++++ .../python-2.7-107-optional-codecs-cjk.patch | 25 ++ package/python/python-2.7-108-optional-nis.patch | 28 ++ .../python-2.7-109-optional-unicodedata.patch | 25 ++ package/python/python-2.7-110-optional-db.patch | 81 ++++++ package/python/python-2.7-111-optional-ssl.patch | 25 ++ package/python/python-2.7-112-optional-bzip2.patch | 24 ++ package/python/python-2.7-113-optional-zlib.patch | 24 ++ package/python/python.mk | 286 ++++++++------------ 34 files changed, 1671 insertions(+), 510 deletions(-) delete mode 100644 package/python/python-2.7-001-cross-compile.patch create mode 100644 package/python/python-2.7-001-support-for-build.patch create mode 100644 package/python/python-2.7-002-cross-compile-variable.patch delete mode 100644 package/python/python-2.7-002-cross-compile.patch create mode 100644 package/python/python-2.7-003-no-import-when-cross-compiling.patch create mode 100644 package/python/python-2.7-004-no-host-headers-libs.patch create mode 100644 package/python/python-2.7-005-staging-headers-libs.patch create mode 100644 package/python/python-2.7-006-disable-extensions.patch create mode 100644 package/python/python-2.7-007-do-not-generate-pyo-files.patch create mode 100644 package/python/python-2.7-008-reread-environment.patch create mode 100644 package/python/python-2.7-009-python-symlink.patch create mode 100644 package/python/python-2.7-010-change-pyconfig-h-location.patch delete mode 100644 package/python/python-2.7-010-disable_modules_and_ssl.patch create mode 100644 package/python/python-2.7-011-no-rpath.patch create mode 100644 package/python/python-2.7-012-correct-32bit-64bit-check.patch delete mode 100644 package/python/python-2.7-020-gentoo_py_dontcompile.patch delete mode 100644 package/python/python-2.7-030-fix-long-long-format.patch delete mode 100644 package/python/python-2.7-040-bytecode-generation-fix.patch create mode 100644 package/python/python-2.7-100-optional-test-modules.patch create mode 100644 package/python/python-2.7-101-optional-pydoc.patch create mode 100644 package/python/python-2.7-102-optional-2to3.patch create mode 100644 package/python/python-2.7-103-optional-sqlite.patch create mode 100644 package/python/python-2.7-104-optional-tk.patch create mode 100644 package/python/python-2.7-105-optional-curses.patch create mode 100644 package/python/python-2.7-106-optional-expat.patch create mode 100644 package/python/python-2.7-107-optional-codecs-cjk.patch create mode 100644 package/python/python-2.7-108-optional-nis.patch create mode 100644 package/python/python-2.7-109-optional-unicodedata.patch create mode 100644 package/python/python-2.7-110-optional-db.patch create mode 100644 package/python/python-2.7-111-optional-ssl.patch create mode 100644 package/python/python-2.7-112-optional-bzip2.patch create mode 100644 package/python/python-2.7-113-optional-zlib.patch
package/python/Config.in +28 -37
@@ -1,6 +1,7 @@ config BR2_PACKAGE_PYTHON bool "python" depends on BR2_USE_WCHAR + select BR2_PACKAGE_LIBFFI help The python language interpreter.
@@ -9,17 +10,11 @@ config BR2_PACKAGE_PYTHON comment "python requires a toolchain with WCHAR support" depends on !BR2_USE_WCHAR -config BR2_PACKAGE_PYTHON_DEV - depends on BR2_PACKAGE_PYTHON - bool "development files on target" - help - If enabled, development files (headers and static libpython) will be - installed on the target. +if BR2_PACKAGE_PYTHON choice - prompt "Module format to install" - depends on BR2_PACKAGE_PYTHON - default BR2_PACKAGE_PYTHON_PY_ONLY + prompt "python module format to install" + default BR2_PACKAGE_PYTHON_PYC_ONLY help Select Python module format to install on target (py, pyc or both)
@@ -34,51 +29,40 @@ config BR2_PACKAGE_PYTHON_PY_PYC endchoice +menu "core python modules" + comment "The following modules are unusual or require extra libraries" - depends on BR2_PACKAGE_PYTHON + +config BR2_PACKAGE_PYTHON_BZIP2 + select BR2_PACKAGE_BZIP2 + bool "bzip2 module" + help + bzip2 module for Python config BR2_PACKAGE_PYTHON_BSDDB - depends on BR2_PACKAGE_PYTHON select BR2_PACKAGE_BERKELEYDB bool "bsddb module" help bsddb module for Python. config BR2_PACKAGE_PYTHON_CODECSCJK - depends on BR2_PACKAGE_PYTHON bool "codecscjk module" - default y help Chinese/Japanese/Korean codecs module for Python (large). config BR2_PACKAGE_PYTHON_CURSES - depends on BR2_PACKAGE_PYTHON select BR2_PACKAGE_NCURSES bool "curses module" help curses module for Python. -# config BR2_PACKAGE_PYTHON_GDBM -# depends on BR2_PACKAGE_PYTHON -# bool "gdbm module" -# help -# gdbm module for Python. - -# config BR2_PACKAGE_PYTHON_NIS -# depends on BR2_PACKAGE_PYTHON -# bool "nis module" -# help -# nis module for Python. - config BR2_PACKAGE_PYTHON_PYEXPAT - depends on BR2_PACKAGE_PYTHON select BR2_PACKAGE_EXPAT bool "pyexpat" help pyexpat module for Python. config BR2_PACKAGE_PYTHON_READLINE - depends on BR2_PACKAGE_PYTHON select BR2_PACKAGE_READLINE bool "readline" help
@@ -86,22 +70,29 @@ config BR2_PACKAGE_PYTHON_READLINE editing in the Python shell). config BR2_PACKAGE_PYTHON_SSL - depends on BR2_PACKAGE_PYTHON select BR2_PACKAGE_OPENSSL bool "ssl" help _ssl module for Python (required for https in urllib etc). -config BR2_PACKAGE_PYTHON_TKINTER - depends on BR2_PACKAGE_PYTHON - select BR2_PACKAGE_TCL - bool "tkinter module" - help - tkinter module for Python. - config BR2_PACKAGE_PYTHON_UNICODEDATA - depends on BR2_PACKAGE_PYTHON bool "unicodedata module" default y help Unicode character database (used by stringprep module) (large). + +config BR2_PACKAGE_PYTHON_SQLITE + bool "sqlite module" + select BR2_PACKAGE_SQLITE + help + SQLite database support + +config BR2_PACKAGE_PYTHON_ZLIB + bool "zlib module" + select BR2_PACKAGE_ZLIB + help + zlib support in Python + +endmenu + +endif
package/python/python-2.7-001-cross-compile.patch deleted +0 -114
114 lines not on this page · raw message
package/python/python-2.7-001-support-for-build.patch new file +153 -0
153 lines not on this page · raw message
package/python/python-2.7-002-cross-compile-variable.patch new file +55 -0
55 lines not on this page · raw message
package/python/python-2.7-002-cross-compile.patch deleted +0 -47
47 lines not on this page · raw message
package/python/python-2.7-003-no-import-when-cross-compiling.patch new file +26 -0
@@ -0,0 +1,26 @@ +Disable import check when cross-compiling + +Once Python has compiled an extension (i.e some C code, potentially +linked to a library), it tries to import it. This cannot work in +cross-compilation mode, so we just disable this check. + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + setup.py | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: Python-2.7.1/setup.py +=================================================================== +--- Python-2.7.1.orig/setup.py ++++ Python-2.7.1/setup.py +@@ -304,6 +304,10 @@ + self.announce('WARNING: skipping import check for Cygwin-based "%s"' + % ext.name) + return ++ if os.environ.get('CROSS_COMPILING') == 'yes': ++ self.announce('WARNING: skipping import check for cross compiled "%s"' ++ % ext.name) ++ return + ext_filename = os.path.join( + self.build_lib, + self.get_ext_filename(self.get_ext_fullname(ext.name)))
package/python/python-2.7-004-no-host-headers-libs.patch new file +97 -0
97 lines not on this page · raw message
package/python/python-2.7-005-staging-headers-libs.patch new file +38 -0
@@ -0,0 +1,38 @@ +Tell setup.py the location of headers/libraries + +Allow the libraries detection routine to look for headers and libs in +other directories than /usr/include or /usr/lib through the +environment variables PYTHON_MODULES_INCLUDE and PYTHON_MODULES_LIB. + +We can then use it to look for libraries in the buildroot staging +directory. + +Patch ported to python2.7 by Maxime Ripard <[email protected]> +--- + setup.py | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +Index: Python-2.7.1/setup.py +=================================================================== +--- Python-2.7.1.orig/setup.py ++++ Python-2.7.1/setup.py +@@ -350,6 +350,19 @@ + return sys.platform + + def detect_modules(self): ++ try: ++ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split() ++ except KeyError: ++ modules_include_dirs = ['/usr/include'] ++ try: ++ modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split() ++ except KeyError: ++ modules_include_dirs = ['/usr/lib'] ++ for dir in modules_include_dirs: ++ add_dir_to_list(self.compiler.include_dirs, dir) ++ for dir in modules_lib_dirs: ++ add_dir_to_list(self.compiler.library_dirs, dir) ++ + # Ensure that /usr/local is always used + if os.environ.get('CROSS_COMPILING') != 'yes': + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
package/python/python-2.7-006-disable-extensions.patch new file +102 -0
102 lines not on this page · raw message
package/python/python-2.7-007-do-not-generate-pyo-files.patch new file +40 -0
@@ -0,0 +1,40 @@ +Do not generate .pyo files + +By default, the Python installation byte-compiles all modules in two +forms: the normal bytecode (.pyc) and an optimized bytecode (.pyo). + +According to +http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html, +the optimization do not do anything useful, and generating both the +"non-optimized" and "optimized" bytecode variants takes time. + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + Makefile.pre.in | 9 --------- + 1 file changed, 9 deletions(-) + +Index: Python-2.7.1/Makefile.pre.in +=================================================================== +--- Python-2.7.1.orig/Makefile.pre.in ++++ Python-2.7.1/Makefile.pre.in +@@ -929,20 +929,11 @@ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + + # Create the PLATDIR source directory, if one wasn't distributed..
package/python/python-2.7-008-reread-environment.patch new file +65 -0
65 lines not on this page · raw message
package/python/python-2.7-009-python-symlink.patch new file +25 -0
@@ -0,0 +1,25 @@ +Use a symlink between python and pythonVERSION + +By default, a hard link is used between /usr/bin/python and +/usr/bin/pythonVERSION. Using hard links for such things is fairly +uncommon, so let's make a symbolic link instead. + +Signed-off-by: Thomas Petazzoni <[email protected]> + +--- + Makefile.pre.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: Python-2.7.1/Makefile.pre.in +=================================================================== +--- Python-2.7.1.orig/Makefile.pre.in ++++ Python-2.7.1/Makefile.pre.in +@@ -791,7 +791,7 @@ + then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \ + else true; \ + fi +- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) ++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) $(PYTHON)) + -rm -f $(DESTDIR)$(BINDIR)/python-config + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config) + -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
package/python/python-2.7-010-change-pyconfig-h-location.patch new file +76 -0
76 lines not on this page · raw message
package/python/python-2.7-010-disable_modules_and_ssl.patch deleted +0 -49
49 lines not on this page · raw message
package/python/python-2.7-011-no-rpath.patch new file +75 -0
75 lines not on this page · raw message
package/python/python-2.7-012-correct-32bit-64bit-check.patch new file +55 -0
55 lines not on this page · raw message
package/python/python-2.7-020-gentoo_py_dontcompile.patch deleted +0 -27
@@ -1,27 +0,0 @@ -This patch purpose is to allow not to save the generated python bytecode in -a file for later use through the PYTHON_DONTCOMPILE environment variable. - -I do not see the use of it, because you can choose if you want but it seems -somewhat related to gentoo. - -Maybe useful when the generated rootfs is mounted on read-only on the target. - -Patch ported to python2.7 by Maxime Ripard <[email protected]> - -diff -rduNp Python-2.7.orig/Python/import.c Python-2.7/Python/import.c ---- Python-2.7.orig/Python/import.c 2010-09-30 12:05:53.000000000 +0200 -+++ Python-2.7/Python/import.c 2010-09-30 12:20:38.000000000 +0200 -@@ -886,7 +886,12 @@ write_compiled_module(PyCodeObject *co, - mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH; - #endif - -- fp = open_exclusive(cpathname, mode); -+ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE"); -+ -+ if (!py_dontcompile) -+ fp = open_exclusive(cpathname, mode); -+ else -+ fp = NULL; - if (fp == NULL) { - if (Py_VerboseFlag) - PySys_WriteStderr(
package/python/python-2.7-030-fix-long-long-format.patch deleted +0 -19
@@ -1,19 +0,0 @@ -Python's configure assume than when cross-compiling the target has no -support for long long int. This assumption breaks compilation later in the -process. Since gcc handles long long support, we can change the value to -assume that there is such support. - -Patch by Maxime Ripard <[email protected]> - -diff -rduNp Python-2.7.orig/configure Python-2.7/configure ---- Python-2.7.orig/configure 2010-09-30 12:05:54.000000000 +0200 -+++ Python-2.7/configure 2010-09-30 12:12:30.000000000 +0200 -@@ -13517,7 +13517,7 @@ $as_echo_n "checking for %lld and %llu p - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -- ac_cv_have_long_long_format=no -+ ac_cv_have_long_long_format=yes - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */
package/python/python-2.7-040-bytecode-generation-fix.patch deleted +0 -38
@@ -1,38 +0,0 @@ -The compileall script is used to compile to python bytecode all the modules. -However, it relies on the struct package that is not built for the host -python, thus crashing at execution when compiling the target python. -When compiling, the removed code block is never executed, so we can safely -remove it, removing in the same time the dependency on struct. - -Patch by Maxime Ripard <[email protected]> - -Index: Python-2.7/Lib/compileall.py -=================================================================== ---- Python-2.7.orig/Lib/compileall.py (r??vision 84276) -+++ Python-2.7/Lib/compileall.py (copie de travail) -@@ -14,7 +14,6 @@ - import os - import sys - import py_compile --import struct - import imp - - __all__ = ["compile_dir","compile_file","compile_path"] -@@ -83,17 +82,6 @@ - if os.path.isfile(fullname): - head, tail = name[:-3], name[-3:] - if tail == '.py': -- if not force: -- try: -- mtime = int(os.stat(fullname).st_mtime) -- expect = struct.pack('<4sl', imp.get_magic(), mtime) -- cfile = fullname + (__debug__ and 'c' or 'o') -- with open(cfile, 'rb') as chandle: -- actual = chandle.read(8) -- if expect == actual: -- return success -- except IOError: -- pass - if not quiet: - print 'Compiling', fullname, '...' - try:
package/python/python-2.7-100-optional-test-modules.patch new file +84 -0
84 lines not on this page · raw message
package/python/python-2.7-101-optional-pydoc.patch new file +81 -0
81 lines not on this page · raw message
package/python/python-2.7-102-optional-2to3.patch new file +99 -0
99 lines not on this page · raw message
package/python/python-2.7-103-optional-sqlite.patch new file +28 -0
@@ -0,0 +1,28 @@ +Add option to disable the sqlite3 module + +Signed-off-by: Thomas Petazzoni <[email protected]> + +--- + configure.in | 9 +++++++++ + 1 file changed, 9 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2392,6 +2392,15 @@ + esac]) + fi + ++AC_SUBST(SQLITE3) ++AC_ARG_ENABLE(sqlite3, ++ AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]), ++ [ SQLITE3="${enableval}" ], [ SQLITE3=yes ]) ++ ++if test "$SQLITE3" = "no" ; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc,
package/python/python-2.7-104-optional-tk.patch new file +68 -0
68 lines not on this page · raw message
package/python/python-2.7-105-optional-curses.patch new file +53 -0
53 lines not on this page · raw message
package/python/python-2.7-106-optional-expat.patch new file +84 -0
84 lines not on this page · raw message
package/python/python-2.7-107-optional-codecs-cjk.patch new file +25 -0
@@ -0,0 +1,25 @@ +Add an option to disable CJK codecs + +Signed-off-by: Thomas Petazzoni <[email protected]> + +--- + configure.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2409,6 +2409,12 @@ + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" + fi + ++AC_ARG_ENABLE(codecs-cjk, ++ AS_HELP_STRING([--disable-codecs-cjk], [disable CJK codecs]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]),
package/python/python-2.7-108-optional-nis.patch new file +28 -0
@@ -0,0 +1,28 @@ +Add an option to disable NIS + +NIS is not necessarily available in uClibc, so we need an option to +not compile support for it. + +Signed-off-by: Thomas Petazzoni <[email protected]> + +--- + configure.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2415,6 +2415,12 @@ + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk" + fi]) + ++AC_ARG_ENABLE(nis, ++ AS_HELP_STRING([--disable-nis], [disable NIS]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]),
package/python/python-2.7-109-optional-unicodedata.patch new file +25 -0
@@ -0,0 +1,25 @@ +Add an option to disable unicodedata + +Signed-off-by: Thomas Petazzoni <[email protected]> + +--- + configure.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2421,6 +2421,12 @@ + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" + fi]) + ++AC_ARG_ENABLE(unicodedata, ++ AS_HELP_STRING([--disable-unicodedata], [disable unicodedata]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]),
package/python/python-2.7-110-optional-db.patch new file +81 -0
81 lines not on this page · raw message
package/python/python-2.7-111-optional-ssl.patch new file +25 -0
@@ -0,0 +1,25 @@ +Add an option to disable the ssl module + +Signed-off-by: Thomas Petazzoni <[email protected]> + +--- + configure.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2421,6 +2421,12 @@ + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" + fi]) + ++AC_ARG_ENABLE(ssl, ++ AS_HELP_STRING([--disable-ssl], [disable SSL]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl" ++ fi]) ++ + AC_ARG_ENABLE(dbm, + AS_HELP_STRING([--disable-dbm], [disable DBM]), + [ if test "$enableval" = "no"; then
package/python/python-2.7-112-optional-bzip2.patch new file +24 -0
@@ -0,0 +1,24 @@ +Add an option to disable the bz2 module + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + configure.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2427,6 +2427,12 @@ + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl" + fi]) + ++AC_ARG_ENABLE(bz2, ++ AS_HELP_STRING([--disable-bz2], [disable BZIP2]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} bz2" ++ fi]) ++ + AC_ARG_ENABLE(dbm, + AS_HELP_STRING([--disable-dbm], [disable DBM]), + [ if test "$enableval" = "no"; then
package/python/python-2.7-113-optional-zlib.patch new file +24 -0
@@ -0,0 +1,24 @@ +Add an option to disable the zlib module + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + configure.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: Python-2.7.1/configure.in +=================================================================== +--- Python-2.7.1.orig/configure.in ++++ Python-2.7.1/configure.in +@@ -2433,6 +2433,12 @@ + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} bz2" + fi]) + ++AC_ARG_ENABLE(zlib, ++ AS_HELP_STRING([--disable-zlib], [disable ZLIB]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} zlib" ++ fi]) ++ + AC_ARG_ENABLE(dbm, + AS_HELP_STRING([--disable-dbm], [disable DBM]), + [ if test "$enableval" = "no"; then
package/python/python.mk +107 -179
326 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 8/10 Remove .py or .pyc depending on Python configuration
In reply to Thomas PetazzoniWe do this at a global level since several packages can install Python modules.
--- Makefile | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
Makefile +8 -0
@@ -438,6 +438,14 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y) rm -rf $(TARGET_DIR)/usr/share/gtk-doc -rmdir $(TARGET_DIR)/usr/share 2>/dev/null endif +ifeq ($(BR2_PACKAGE_PYTHON),y) +ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y) + find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -print0 | xargs -0 rm -f +endif +ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) + find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f +endif +endif find $(TARGET_DIR) -type f -perm +111 '!' -name 'libthread_db*.so*' | \ xargs $(STRIPCMD) 2>/dev/null || true find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
Signature · 1 line
1.7.0.4
PATCH 9/10 python-serial: new package
In reply to Thomas Petazzonipython-serial is a Python library to access serial ports.
This package has originally been introduced to test that third-party pure Python modules (that do not use C extensions) build properly against the Buildroot Python infrastructure.
--- package/Config.in | 1 + package/python-serial/Config.in | 5 +++++ package/python-serial/python-serial.mk | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 package/python-serial/Config.in create mode 100644 package/python-serial/python-serial.mk
package/Config.in +1 -0
@@ -293,6 +293,7 @@ source "package/libraw1394/Config.in" source "package/tslib/Config.in" source "package/libusb/Config.in" source "package/libusb-compat/Config.in" +source "package/python-serial/Config.in" endmenu if BROKEN
package/python-serial/Config.in new file +5 -0
@@ -0,0 +1,5 @@ +config BR2_PACKAGE_PYTHON_SERIAL + bool "python-serial" + depends on BR2_PACKAGE_PYTHON + help + python-serial is a Python library to access serial ports.
package/python-serial/python-serial.mk new file +21 -0
@@ -0,0 +1,21 @@ +############################################################# +# +# python-serial +# +############################################################# + +PYTHON_SERIAL_VERSION = 2.5 +PYTHON_SERIAL_SOURCE = pyserial-$(PYTHON_SERIAL_VERSION).tar.gz +PYTHON_SERIAL_SITE = http://pypi.python.org/packages/source/p/pyserial/ + +PYTHON_SERIAL_DEPENDENCIES = python + +define PYTHON_SERIAL_BUILD_CMDS + (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build) +endef + +define PYTHON_SERIAL_INSTALL_TARGET_CMDS + (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr) +endef + +$(eval $(call GENTARGETS,package,python-serial))
Signature · 1 line
1.7.0.4
PATCH 10/10 python-mad: new package
In reply to Thomas Petazzonipython-mad is a Python binding for the MAD library, a high-quality integer-only MPEG decoder.
This package has been introduced as a test to make sure that third-party Python modules that rely on a C extension can properly be built against the Python infrastructure of Buildroot.
--- package/multimedia/Config.in | 1 + package/multimedia/python-mad/Config.in | 7 ++++ package/multimedia/python-mad/python-mad.mk | 41 +++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 0 deletions(-) create mode 100644 package/multimedia/python-mad/Config.in create mode 100644 package/multimedia/python-mad/python-mad.mk
package/multimedia/Config.in +1 -0
@@ -25,6 +25,7 @@ source "package/multimedia/libvorbis/Config.in" source "package/multimedia/madplay/Config.in" source "package/multimedia/mpg123/Config.in" source "package/multimedia/mplayer/Config.in" +source "package/multimedia/python-mad/Config.in" source "package/multimedia/speex/Config.in" source "package/multimedia/swfdec/Config.in" source "package/multimedia/festival/Config.in"
package/multimedia/python-mad/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_PYTHON_MAD + bool "python-mad" + depends on BR2_PACKAGE_PYTHON + select BR2_PACKAGE_LIBMAD + help + python-mad is a Python binding for the MAD library, a + high-quality integer-only MPEG decoder.
package/multimedia/python-mad/python-mad.mk new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 6/10 autotools: allow host package to use <pkg>_MAKE_ENV and <pkg>_MAKE
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> This will be needed by the Python interpreter package. Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---
Thomas> package/Makefile.autotools.in | 2 +-
Thomas> 1 files changed, 1 insertions(+), 1 deletions(-)
Thomas> diff --git a/package/Makefile.autotools.in b/package/Makefile.autotools.in Thomas> index de0a355..d445348 100644
Thomas> --- a/package/Makefile.autotools.in
Thomas> +++ b/package/Makefile.autotools.in
Thomas> @@ -200,7 +200,7 @@ endif
Thomas> # Thomas> ifndef $(2)_INSTALL_CMDS Thomas> define $(2)_INSTALL_CMDS
Thomas> - $(HOST_MAKE_ENV) $(MAKE) -C $$($$(PKG)_SRCDIR) install
Thomas> + $(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) -C $$($$(PKG)_SRCDIR) install
Hmm, I don't really like this. Packages might be adding target specific stuff to their $PKG_MAKE_ENV - E.G.:
lvm2/lvm2.mk:LVM2_MAKE_ENV = CC="$(TARGET_CC)"
Wouldn't it make more sense to add a HOST_$PKG_MAKE_ENV and use it just like we do for $PKG_MAKE_ENV (E.G. at build and install time)?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 8/10 Remove .py or .pyc depending on Python configuration
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> We do this at a global level since several packages can install Thomas> Python modules.
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---
Thomas> Makefile | 8 ++++++++
Thomas> 1 files changed, 8 insertions(+), 0 deletions(-)
Thomas> diff --git a/Makefile b/Makefile
Thomas> index 7e08cf3..1f37a1f 100644
Thomas> --- a/Makefile
Thomas> +++ b/Makefile
Thomas> @@ -438,6 +438,14 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
Thomas> rm -rf $(TARGET_DIR)/usr/share/gtk-doc Thomas> -rmdir $(TARGET_DIR)/usr/share 2>/dev/null Thomas> endif
Thomas> +ifeq ($(BR2_PACKAGE_PYTHON),y)
Thomas> +ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y)
Thomas> + find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -print0 | xargs -0 rm -f
Thomas> +endif
Thomas> +ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
Thomas> + find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f
Thomas> +endif
Thomas> +endif
The outermost conditional is not really needed.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 9/10 python-serial: new package
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> python-serial is a Python library to access serial ports. Thomas> This package has originally been introduced to test that third-party Thomas> pure Python modules (that do not use C extensions) build properly Thomas> against the Buildroot Python infrastructure.
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---
Thomas> package/Config.in | 1 + Thomas> package/python-serial/Config.in | 5 +++++ Thomas> package/python-serial/python-serial.mk | 21 +++++++++++++++++++++ Thomas> 3 files changed, 27 insertions(+), 0 deletions(-) Thomas> create mode 100644 package/python-serial/Config.in Thomas> create mode 100644 package/python-serial/python-serial.mk
Thomas> diff --git a/package/Config.in b/package/Config.in Thomas> index 438e1b4..d437dc4 100644
Thomas> --- a/package/Config.in
Thomas> +++ b/package/Config.in
Thomas> @@ -293,6 +293,7 @@ source "package/libraw1394/Config.in"
Thomas> source "package/tslib/Config.in" Thomas> source "package/libusb/Config.in" Thomas> source "package/libusb-compat/Config.in"
Thomas> +source "package/python-serial/Config.in" Thomas> endmenu
Thomas> if BROKEN
Thomas> diff --git a/package/python-serial/Config.in b/package/python-serial/Config.in Thomas> new file mode 100644
Thomas> index 0000000..06866db
Thomas> --- /dev/null
Thomas> +++ b/package/python-serial/Config.in
Thomas> @@ -0,0 +1,5 @@
Thomas> +config BR2_PACKAGE_PYTHON_SERIAL
Thomas> + bool "python-serial"
Thomas> + depends on BR2_PACKAGE_PYTHON
Thomas> + help
Thomas> + python-serial is a Python library to access serial ports.
Please add a link to http://pyserial.sf.net here.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 10/10 python-mad: new package
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> python-mad is a Python binding for the MAD library, a high-quality Thomas> integer-only MPEG decoder.
Thomas> This package has been introduced as a test to make sure that Thomas> third-party Python modules that rely on a C extension can properly be Thomas> built against the Python infrastructure of Buildroot.
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---
Thomas> package/multimedia/Config.in | 1 + Thomas> package/multimedia/python-mad/Config.in | 7 ++++ Thomas> package/multimedia/python-mad/python-mad.mk | 41 +++++++++++++++++++++++++++ Thomas> 3 files changed, 49 insertions(+), 0 deletions(-) Thomas> create mode 100644 package/multimedia/python-mad/Config.in Thomas> create mode 100644 package/multimedia/python-mad/python-mad.mk
Thomas> diff --git a/package/multimedia/Config.in b/package/multimedia/Config.in Thomas> index da50dbb..ae685cf 100644
Thomas> --- a/package/multimedia/Config.in
Thomas> +++ b/package/multimedia/Config.in
Thomas> @@ -25,6 +25,7 @@ source "package/multimedia/libvorbis/Config.in"
Thomas> source "package/multimedia/madplay/Config.in" Thomas> source "package/multimedia/mpg123/Config.in" Thomas> source "package/multimedia/mplayer/Config.in" Thomas> +source "package/multimedia/python-mad/Config.in" Thomas> source "package/multimedia/speex/Config.in" Thomas> source "package/multimedia/swfdec/Config.in" Thomas> source "package/multimedia/festival/Config.in"
Thomas> diff --git a/package/multimedia/python-mad/Config.in b/package/multimedia/python-mad/Config.in Thomas> new file mode 100644
Thomas> index 0000000..d25f2b8
Thomas> --- /dev/null
Thomas> +++ b/package/multimedia/python-mad/Config.in
Thomas> @@ -0,0 +1,7 @@
Thomas> +config BR2_PACKAGE_PYTHON_MAD
Thomas> + bool "python-mad"
Thomas> + depends on BR2_PACKAGE_PYTHON
Thomas> + select BR2_PACKAGE_LIBMAD
Thomas> + help
Thomas> + python-mad is a Python binding for the MAD library, a
Thomas> + high-quality integer-only MPEG decoder.
Thomas> \ No newline at end of file
Please add the newline (here and elsewhere) and add a link to
http://spacepants.org/src/pymad/
Signature · 1 line
Bye, Peter Korsgaard
PATCH 6/10 autotools: allow host package to use <pkg>_MAKE_ENV and <pkg>_MAKE
In reply to Peter KorsgaardQuoted 7 lines · On Mon, 24 Jan 2011 22:04:35 +0100 Peter Korsgaard <[email protected]> wrote:
Hmm, I don't really like this. Packages might be adding target specific stuff to their $PKG_MAKE_ENV - E.G.:
lvm2/lvm2.mk:LVM2_MAKE_ENV = CC="$(TARGET_CC)"
Wouldn't it make more sense to add a HOST_$PKG_MAKE_ENV and use it just like we do for $PKG_MAKE_ENV (E.G. at build and install time)?
$$(PKG) is already HOST_FOOBAR. So, when I do:
$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) -C $$($$(PKG)_SRCDIR) install
it gets expanded to
$(HOST_MAKE_ENV) $(HOST_<pkg>_MAKE_ENV) $(HOST_<pkg>_MAKE) -C $(HOST_<pkg>_SRCDIR) install
See how $(PKG) is defined:
$$($(2)_TARGET_INSTALL_HOST): PKG=$(2)
And $(2) is :
# argument 2 is the uppercase package name, including an HOST_ prefix
# for host packages
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Hello,
Quoted 4 lines · On Mon, 24 Jan 2011 12:01:28 +0100 Thomas Petazzoni…
Here is a set of patches that improve Python support in Buildroot:
Python is bumped to 2.7.1, the package is converted to the autotargets infrastructure, some third-party Python modules are introduced as examples, many minor issues were fixed.
I have pushed a new version, with the following changes :
* Rebased on latest master (involved fixing a trivial conflict in package/multimedia/Config.in)
* Remove the outermost BR2_PACKAGE_PYTHON condition from the py/pyc removal patch (8/10)
* Added link in the python-serial package description in Config.in (9/10)
* Added link in the python-mad package description in Config.in (10/10).
* Added some missing final new lines here and there (python-mad, libffi, etc.)
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 6/10 autotools: allow host package to use <pkg>_MAKE_ENV and <pkg>_MAKE
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> On Mon, 24 Jan 2011 22:04:35 +0100
Quoted 7 lines · Thomas> Peter Korsgaard <[email protected]> wrote:
Quoted 7 lines
Hmm, I don't really like this. Packages might be adding target specific stuff to their $PKG_MAKE_ENV - E.G.:
lvm2/lvm2.mk:LVM2_MAKE_ENV = CC="$(TARGET_CC)"
Wouldn't it make more sense to add a HOST_$PKG_MAKE_ENV and use it just like we do for $PKG_MAKE_ENV (E.G. at build and install time)?
Thomas> $$(PKG) is already HOST_FOOBAR. So, when I do:
Ahh yes, true - Thanks.
Signature · 1 line
Bye, Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> Hello,
Thomas> On Mon, 24 Jan 2011 12:01:28 +0100
Quoted 4 lines · Thomas> Thomas Petazzoni <[email protected]> wrote:
Quoted 4 lines
Here is a set of patches that improve Python support in Buildroot:
Python is bumped to 2.7.1, the package is converted to the autotargets infrastructure, some third-party Python modules are introduced as examples, many minor issues were fixed.
Thomas> I have pushed a new version, with the following changes :
Thanks, commmitted.
Signature · 1 line
Bye, Peter Korsgaard