Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-09-08  7:26 hamish at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: hamish at uclibc.org @ 2008-09-08  7:26 UTC (permalink / raw)
  To: buildroot

Author: hamish
Date: 2008-09-08 00:26:12 -0700 (Mon, 08 Sep 2008)
New Revision: 23359

Log:
Keep /usr/bin/python2.4 and make /usr/bin/python a link to it



Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-09-07 23:22:08 UTC (rev 23358)
+++ trunk/buildroot/package/python/python.mk	2008-09-08 07:26:12 UTC (rev 23359)
@@ -132,7 +132,8 @@
 		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
 		PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen && \
-	rm $(TARGET_DIR)/usr/bin/python?.? && \
+	rm $(TARGET_DIR)/usr/bin/python && \
+	ln -s python$(PYTHON_VERSION_SHORT) $(TARGET_DIR)/usr/bin/python && \
 	rm $(TARGET_DIR)/usr/bin/idle && \
 	rm $(TARGET_DIR)/usr/bin/pydoc && \
 	find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \; && \

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2009-01-15  6:28 ulf at uclibc.org
  2009-01-15  8:57 ` Peter Korsgaard
  0 siblings, 1 reply; 17+ messages in thread
From: ulf at uclibc.org @ 2009-01-15  6:28 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-15 06:28:05 +0000 (Thu, 15 Jan 2009)
New Revision: 24852

Log:
Always create shared python library, if python is created, needed by multiple packages

Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2009-01-14 23:54:02 UTC (rev 24851)
+++ trunk/buildroot/package/python/python.mk	2009-01-15 06:28:05 UTC (rev 24852)
@@ -106,6 +106,7 @@
 		--prefix=/usr \
 		--sysconfdir=/etc \
 		--with-cxx=no \
+		--enable-shared \
 		$(DISABLE_IPV6) \
 		$(DISABLE_NLS) \
 	)
@@ -166,8 +167,18 @@
 	rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/lib-tk
 endif
 
-python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
+$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so: $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
+		cp -dpr $(PYTHON_DIR)/libpython*.so.* $(STAGING_DIR)/usr/lib
+		(\
+		cd $(STAGING_DIR)/usr/lib ; \
+		rm -f libpython$(PYTHON_VERSION_MAJOR).so ; \
+		ln -s `basename  \`ls libpython*.so.*\`` libpython$(PYTHON_VERSION_MAJOR).so \
+		)
 
+libpython:	$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so
+
+python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY) libpython
+
 python-clean:
 	-$(MAKE) -C $(PYTHON_DIR) distclean
 	rm -f $(PYTHON_DIR)/.configured $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-10-30 17:21 wberrier at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: wberrier at uclibc.org @ 2008-10-30 17:21 UTC (permalink / raw)
  To: buildroot

Author: wberrier
Date: 2008-10-30 10:21:18 -0700 (Thu, 30 Oct 2008)
New Revision: 23863

Log:
python: add $(STAGING_DIR)/usr/lib to PYTHON_MODULES_LIB so that
 modules build correctly (particularly readline)

Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-10-30 16:45:55 UTC (rev 23862)
+++ trunk/buildroot/package/python/python.mk	2008-10-30 17:21:18 UTC (rev 23863)
@@ -117,7 +117,7 @@
 endif
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) DESTDIR=$(TARGET_DIR) \
 		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \
-		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
+		PYTHON_MODULES_LIB="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
 		PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
 
@@ -130,7 +130,7 @@
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) install \
 		DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \
 		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \
-		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
+		PYTHON_MODULES_LIB="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
 		PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen && \
 	rm $(TARGET_DIR)/usr/bin/python && \

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-10-08  5:03 hamish at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: hamish at uclibc.org @ 2008-10-08  5:03 UTC (permalink / raw)
  To: buildroot

Author: hamish
Date: 2008-10-07 22:02:59 -0700 (Tue, 07 Oct 2008)
New Revision: 23622

Log:
Rename patches to include Python 2.4 version, in preparation for adding 2.5


Added:
   trunk/buildroot/package/python/python-2.4-001-cross-compile.patch
   trunk/buildroot/package/python/python-2.4-002-cross-compile.patch
   trunk/buildroot/package/python/python-2.4-010-disable_modules_and_ssl.patch
   trunk/buildroot/package/python/python-2.4-020-gentoo_py_dontcompile.patch

Removed:
   trunk/buildroot/package/python/python-001-cross-compile.patch
   trunk/buildroot/package/python/python-002-cross-compile.patch
   trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch
   trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch

Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Deleted: trunk/buildroot/package/python/python-001-cross-compile.patch
===================================================================
--- trunk/buildroot/package/python/python-001-cross-compile.patch	2008-10-07 20:29:27 UTC (rev 23621)
+++ trunk/buildroot/package/python/python-001-cross-compile.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -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:

Deleted: trunk/buildroot/package/python/python-002-cross-compile.patch
===================================================================
--- trunk/buildroot/package/python/python-002-cross-compile.patch	2008-10-07 20:29:27 UTC (rev 23621)
+++ trunk/buildroot/package/python/python-002-cross-compile.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -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()

Deleted: trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch
===================================================================
--- trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch	2008-10-07 20:29:27 UTC (rev 23621)
+++ trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -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,

Deleted: trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch
===================================================================
--- trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch	2008-10-07 20:29:27 UTC (rev 23621)
+++ trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -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(

Copied: trunk/buildroot/package/python/python-2.4-001-cross-compile.patch (from rev 23621, trunk/buildroot/package/python/python-001-cross-compile.patch)
===================================================================
--- trunk/buildroot/package/python/python-2.4-001-cross-compile.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-2.4-001-cross-compile.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -0,0 +1,106 @@
+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:


Property changes on: trunk/buildroot/package/python/python-2.4-001-cross-compile.patch
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/buildroot/package/python/python-2.4-002-cross-compile.patch (from rev 23621, trunk/buildroot/package/python/python-002-cross-compile.patch)
===================================================================
--- trunk/buildroot/package/python/python-2.4-002-cross-compile.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-2.4-002-cross-compile.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -0,0 +1,36 @@
+--- 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()


Property changes on: trunk/buildroot/package/python/python-2.4-002-cross-compile.patch
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/buildroot/package/python/python-2.4-010-disable_modules_and_ssl.patch (from rev 23621, trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch)
===================================================================
--- trunk/buildroot/package/python/python-2.4-010-disable_modules_and_ssl.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-2.4-010-disable_modules_and_ssl.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -0,0 +1,37 @@
+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,


Property changes on: trunk/buildroot/package/python/python-2.4-010-disable_modules_and_ssl.patch
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/buildroot/package/python/python-2.4-020-gentoo_py_dontcompile.patch (from rev 23621, trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch)
===================================================================
--- trunk/buildroot/package/python/python-2.4-020-gentoo_py_dontcompile.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-2.4-020-gentoo_py_dontcompile.patch	2008-10-08 05:02:59 UTC (rev 23622)
@@ -0,0 +1,18 @@
+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(


Property changes on: trunk/buildroot/package/python/python-2.4-020-gentoo_py_dontcompile.patch
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-10-07 20:29:27 UTC (rev 23621)
+++ trunk/buildroot/package/python/python.mk	2008-10-08 05:02:59 UTC (rev 23622)
@@ -78,7 +78,7 @@
 	touch $@
 
 $(PYTHON_DIR)/.patched: $(PYTHON_DIR)/.unpacked
-	toolchain/patch-kernel.sh $(PYTHON_DIR) package/python/ python\*.patch
+	toolchain/patch-kernel.sh $(PYTHON_DIR) package/python/ python-$(PYTHON_VERSION_SHORT)-\*.patch
 	touch $@
 
 $(PYTHON_DIR)/.hostpython: $(PYTHON_DIR)/.patched

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-09-11  1:59 hamish at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: hamish at uclibc.org @ 2008-09-11  1:59 UTC (permalink / raw)
  To: buildroot

Author: hamish
Date: 2008-09-10 18:59:04 -0700 (Wed, 10 Sep 2008)
New Revision: 23372

Log:
Export site package directory location for use by other packages

Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-09-10 13:16:23 UTC (rev 23371)
+++ trunk/buildroot/package/python/python.mk	2008-09-11 01:59:04 UTC (rev 23372)
@@ -12,6 +12,7 @@
 PYTHON_BINARY:=python
 PYTHON_TARGET_BINARY:=usr/bin/python
 PYTHON_DEPS:=
+PYTHON_SITE_PACKAGE_DIR=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/site-packages
 
 BR2_PYTHON_DISABLED_MODULES=dbm zipfile
 

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-09-02  0:54 hamish at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: hamish at uclibc.org @ 2008-09-02  0:54 UTC (permalink / raw)
  To: buildroot

Author: hamish
Date: 2008-09-01 17:54:49 -0700 (Mon, 01 Sep 2008)
New Revision: 23300

Log:
Update to Python 2.4.5 (latest patch rev of 2.4)
Remove the test suite before building, else it will fail to compile depending on what modules have been configured.


Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-09-01 21:16:35 UTC (rev 23299)
+++ trunk/buildroot/package/python/python.mk	2008-09-02 00:54:49 UTC (rev 23300)
@@ -3,7 +3,7 @@
 # python
 #
 #############################################################
-PYTHON_VERSION=2.4.2
+PYTHON_VERSION=2.4.5
 PYTHON_VERSION_SHORT=2.4
 PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2
 PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION)
@@ -124,6 +124,7 @@
 ifneq ($(BR2_PACKAGE_PYTHON_SSL),y)
 	export PYTHON_DISABLE_SSL=1
 endif
+	rm -rf $(PYTHON_DIR)/Lib/test
 	LD_LIBRARY_PATH=$(STAGING_DIR)/lib
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) install \
 		DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-06-16 11:15 jacmet at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: jacmet at uclibc.org @ 2008-06-16 11:15 UTC (permalink / raw)
  To: buildroot

Author: jacmet
Date: 2008-06-16 04:15:51 -0700 (Mon, 16 Jun 2008)
New Revision: 22369

Log:
python: fix hostpython target.

Remove invalid hyphen in front of -$(MAKE) in the middle of a subshell

Patch by Conrad Parker.


Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-06-16 11:15:31 UTC (rev 22368)
+++ trunk/buildroot/package/python/python.mk	2008-06-16 11:15:51 UTC (rev 22369)
@@ -89,7 +89,7 @@
 		$(MAKE) python Parser/pgen && \
 		mv python hostpython && \
 		mv Parser/pgen Parser/hostpgen && \
-		-$(MAKE) distclean \
+		$(MAKE) distclean \
 	) && \
 	touch $@
 

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-02-06  0:55 hamish at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: hamish at uclibc.org @ 2008-02-06  0:55 UTC (permalink / raw)
  To: buildroot

Author: hamish
Date: 2008-02-05 16:55:05 -0800 (Tue, 05 Feb 2008)
New Revision: 20947

Log:
Added configuration item to control whether development headers and libraries are installed on the target
Removed some additional files if optional modules are disabled


Modified:
   trunk/buildroot/package/python/Config.in
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/Config.in
===================================================================
--- trunk/buildroot/package/python/Config.in	2008-02-05 23:04:09 UTC (rev 20946)
+++ trunk/buildroot/package/python/Config.in	2008-02-06 00:55:05 UTC (rev 20947)
@@ -6,6 +6,14 @@
 
 	  http://www.python.org/
 
+config BR2_PACKAGE_PYTHON_DEV
+	depends on BR2_PACKAGE_PYTHON
+	bool "development files on target"
+	default n
+	help
+	  If enabled, development files (headers and static libpython) will be
+	  installed on the target.
+
 choice
 	prompt "Module format to install"
 	depends on BR2_PACKAGE_PYTHON

Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-02-05 23:04:09 UTC (rev 20946)
+++ trunk/buildroot/package/python/python.mk	2008-02-06 00:55:05 UTC (rev 20947)
@@ -4,6 +4,7 @@
 #
 #############################################################
 PYTHON_VERSION=2.4.2
+PYTHON_VERSION_SHORT=2.4
 PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2
 PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION)
 PYTHON_DIR:=$(BUILD_DIR)/Python-$(PYTHON_VERSION)
@@ -136,13 +137,31 @@
 	find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \; && \
 	rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
 		$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \
-		$(TARGET_DIR)/usr/lib/python*/test
+		$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/test
+	cp -dpr $(TARGET_DIR)/usr/include/python$(PYTHON_VERSION_SHORT) $(STAGING_DIR)/usr/include/
+	mkdir -p $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)
+	cp -dpr $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/config $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/
+
 ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y)
 	find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \;
 endif
 ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
 	find $(TARGET_DIR)/usr/lib/ -name '*.py' -exec rm {} \;
 endif
+ifneq ($(BR2_PACKAGE_PYTHON_DEV),y)
+	rm -rf $(TARGET_DIR)/usr/include/python$(PYTHON_VERSION_SHORT)
+	rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/config
+	find $(TARGET_DIR)/usr/lib/ -name '*.py' -exec rm {} \;
+endif
+ifneq ($(BR2_PACKAGE_PYTHON_BSDDB),y)
+	rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/bsddb
+endif
+ifneq ($(BR2_PACKAGE_PYTHON_CURSES),y)
+	rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/curses
+endif
+ifneq ($(BR2_PACKAGE_PYTHON_TKINTER),y)
+	rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/lib-tk
+endif
 
 python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
 

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2008-01-17 12:42 vanokuten at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: vanokuten at uclibc.org @ 2008-01-17 12:42 UTC (permalink / raw)
  To: buildroot

Author: vanokuten
Date: 2008-01-17 04:42:53 -0800 (Thu, 17 Jan 2008)
New Revision: 20862

Log:
enhancements for the python package, patch by Hamish Moffatt

Modified:
   trunk/buildroot/package/python/Config.in
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/Config.in
===================================================================
--- trunk/buildroot/package/python/Config.in	2008-01-17 11:09:45 UTC (rev 20861)
+++ trunk/buildroot/package/python/Config.in	2008-01-17 12:42:53 UTC (rev 20862)
@@ -5,3 +5,96 @@
 	  The python language interpreter.
 
 	  http://www.python.org/
+
+choice
+	prompt "Module format to install"
+	depends on BR2_PACKAGE_PYTHON
+	default BR2_PACKAGE_PYTHON_PY_ONLY
+	help
+	  Select Python module format to install on target (py, pyc or both)
+
+config BR2_PACKAGE_PYTHON_PY_ONLY
+	bool ".py sources only"
+
+config BR2_PACKAGE_PYTHON_PYC_ONLY
+	bool ".pyc compiled sources only"
+
+config BR2_PACKAGE_PYTHON_PY_PYC
+	bool ".py sources and .pyc compiled"
+
+endchoice
+
+comment "The following modules are unusual or require extra libraries"
+	depends on BR2_PACKAGE_PYTHON
+
+config BR2_PACKAGE_PYTHON_BSDDB
+	depends on BR2_PACKAGE_PYTHON
+	bool "bsddb module"
+	default n
+	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
+	bool "curses module"
+	default n
+	help
+	  curses module for Python.
+
+config BR2_PACKAGE_PYTHON_GDBM
+	depends on BR2_PACKAGE_PYTHON
+	bool "gdbm module"
+	default n
+	help
+	  gdbm module for Python.
+
+config BR2_PACKAGE_PYTHON_NIS
+	depends on BR2_PACKAGE_PYTHON
+	bool "nis module"
+	default n
+	help
+	  nis module for Python.
+
+config BR2_PACKAGE_PYTHON_PYEXPAT
+	depends on BR2_PACKAGE_PYTHON
+	bool "pyexpat"
+	default n
+	help
+	  pyexpat module for Python.
+
+config BR2_PACKAGE_PYTHON_READLINE
+	depends on BR2_PACKAGE_PYTHON
+	bool "readline"
+	default n
+	help
+	  readline module for Python (required for command-line 
+	  editing in the Python shell).
+
+config BR2_PACKAGE_PYTHON_SSL
+	depends on BR2_PACKAGE_PYTHON
+	bool "ssl"
+	default n
+	help
+	  _ssl module for Python (required for https in urllib etc).
+
+config BR2_PACKAGE_PYTHON_TKINTER
+	depends on BR2_PACKAGE_PYTHON
+	bool "tkinter module"
+	default n
+	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).
+

Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2008-01-17 11:09:45 UTC (rev 20861)
+++ trunk/buildroot/package/python/python.mk	2008-01-17 12:42:53 UTC (rev 20862)
@@ -10,11 +10,62 @@
 PYTHON_CAT:=$(BZCAT)
 PYTHON_BINARY:=python
 PYTHON_TARGET_BINARY:=usr/bin/python
+PYTHON_DEPS:=
 
-# these could use checks for some BR2_PACKAGE_foo,y
-BR2_PYTHON_DISABLED_MODULES=readline pyexpat dbm gdbm bsddb \
-	_curses _curses_panel _tkinter nis zipfile
+BR2_PYTHON_DISABLED_MODULES=dbm zipfile
 
+ifeq ($(BR2_PACKAGE_PYTHON_READLINE),y)
+PYTHON_DEPS += readline-target
+else
+BR2_PYTHON_DISABLED_MODULES += readline
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_CURSES),y)
+PYTHON_DEPS += ncurses
+else
+BR2_PYTHON_DISABLED_MODULES += _curses _curses_panel
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PYEXPAT),y)
+PYTHON_DEPS += expat
+else
+BR2_PYTHON_DISABLED_MODULES += pyexpat
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_GDBM),y)
+PYTHON_DEPS += gdbm
+else
+BR2_PYTHON_DISABLED_MODULES += gdbm
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_BSDDB),y)
+PYTHON_DEPS += berkeleydb
+else
+BR2_PYTHON_DISABLED_MODULES += bsddb
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_TKINTER),y)
+PYTHON_DEPS += tcl
+else
+BR2_PYTHON_DISABLED_MODULES += _tkinter
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_SSL),y)
+PYTHON_DEPS += openssl
+endif
+
+ifneq ($(BR2_PACKAGE_PYTHON_NIS),y)
+BR2_PYTHON_DISABLED_MODULES += nis
+endif
+
+ifneq ($(BR2_PACKAGE_PYTHON_CODECSCJK),y)
+BR2_PYTHON_DISABLED_MODULES += _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk
+endif
+
+ifneq ($(BR2_PACKAGE_PYTHON_UNICODEDATA),y)
+BR2_PYTHON_DISABLED_MODULES += unicodedata
+endif
+
 $(DL_DIR)/$(PYTHON_SOURCE):
 	 $(WGET) -P $(DL_DIR) $(PYTHON_SITE)/$(PYTHON_SOURCE)
 
@@ -59,7 +110,9 @@
 	touch $@
 
 $(PYTHON_DIR)/$(PYTHON_BINARY): $(PYTHON_DIR)/.configured
+ifneq ($(BR2_PACKAGE_PYTHON_SSL),y)
 	export PYTHON_DISABLE_SSL=1
+endif
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) DESTDIR=$(TARGET_DIR) \
 		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \
 		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
@@ -67,7 +120,9 @@
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
 
 $(TARGET_DIR)/$(PYTHON_TARGET_BINARY): $(PYTHON_DIR)/$(PYTHON_BINARY)
+ifneq ($(BR2_PACKAGE_PYTHON_SSL),y)
 	export PYTHON_DISABLE_SSL=1
+endif
 	LD_LIBRARY_PATH=$(STAGING_DIR)/lib
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) install \
 		DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \
@@ -78,13 +133,18 @@
 	rm $(TARGET_DIR)/usr/bin/python?.? && \
 	rm $(TARGET_DIR)/usr/bin/idle && \
 	rm $(TARGET_DIR)/usr/bin/pydoc && \
-	find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \; && \
 	find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \; && \
 	rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
 		$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \
 		$(TARGET_DIR)/usr/lib/python*/test
+ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y)
+	find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \;
+endif
+ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
+	find $(TARGET_DIR)/usr/lib/ -name '*.py' -exec rm {} \;
+endif
 
-python: uclibc $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
+python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
 
 python-clean:
 	-$(MAKE) -C $(PYTHON_DIR) distclean

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2007-01-23 17:18 aldot at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: aldot at uclibc.org @ 2007-01-23 17:18 UTC (permalink / raw)
  To: buildroot

Author: aldot
Date: 2007-01-23 09:18:54 -0800 (Tue, 23 Jan 2007)
New Revision: 17489

Log:
- fix breakage that got introduced by a malformed context diff. Sorry..


Modified:
   trunk/buildroot/package/python/python-002-cross-compile.patch
   trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch
   trunk/buildroot/package/python/python.mk


Changeset:
Modified: trunk/buildroot/package/python/python-002-cross-compile.patch
===================================================================
--- trunk/buildroot/package/python/python-002-cross-compile.patch	2007-01-23 11:47:05 UTC (rev 17488)
+++ trunk/buildroot/package/python/python-002-cross-compile.patch	2007-01-23 17:18:54 UTC (rev 17489)
@@ -1,26 +1,18 @@
-diff -rduNp Python-2.4.2-001/setup.py Python-2.4.2/setup.py
---- Python-2.4.2-001/setup.py	2007-01-22 19:37:08.000000000 +0100
-+++ Python-2.4.2/setup.py	2007-01-22 19:41:47.000000000 +0100
-@@ -20,6 +20,14 @@ disabled_module_list = []
- def add_dir_to_list(dirlist, dir):
-     """Add the directory 'dir' to the list 'dirlist' (at the front) if
-     1) 'dir' is not already in 'dirlist'
-+	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']
-+try:
-     2) 'dir' actually exists, and is a directory."""
-     if dir is not None and os.path.isdir(dir) and dir not in dirlist:
-         dirlist.insert(0, dir)
-@@ -239,7 +247,10 @@ class PyBuildExt(build_ext):
+--- 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:
@@ -28,7 +20,7 @@
  
          # Add paths to popular package managers on OS X/darwin
          if sys.platform == "darwin":
-@@ -258,11 +269,8 @@ class PyBuildExt(build_ext):
+@@ -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.

Modified: trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch
===================================================================
--- trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch	2007-01-23 11:47:05 UTC (rev 17488)
+++ trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch	2007-01-23 17:18:54 UTC (rev 17489)
@@ -22,9 +22,9 @@
  
      def detect_modules(self):
 +        global disable_ssl
-         for dir in modules_include_dirs:
-                 add_dir_to_list(self.compiler.include_dirs, dir)
-         for dir in modules_lib_dirs:
+         try:
+             modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
+         except KeyError:
 @@ -468,7 +476,8 @@ class PyBuildExt(build_ext):
                                       ] )
  

Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2007-01-23 11:47:05 UTC (rev 17488)
+++ trunk/buildroot/package/python/python.mk	2007-01-23 17:18:54 UTC (rev 17489)
@@ -11,6 +11,16 @@
 PYTHON_BINARY:=python
 PYTHON_TARGET_BINARY:=usr/bin/python
 
+#ifndef BR2_SUPPORT_IPv6
+#PYTHON_DISABLE_IPv6=--disable-ipv6
+#else
+#PYTHON_DISABLE_IPv6=--enable-ipv6
+#endif
+
+# these could use checks for some BR2_PACKAGE_foo,y
+BR2_PYTHON_DISABLED_MODULES=readline pyexpat dbm gdbm bsddb \
+	_curses _curses_panel _tkinter nis zipfile
+
 $(DL_DIR)/$(PYTHON_SOURCE):
 	 $(WGET) -P $(DL_DIR) $(PYTHON_SITE)/$(PYTHON_SOURCE)
 
@@ -18,29 +28,29 @@
 
 $(PYTHON_DIR)/.unpacked: $(DL_DIR)/$(PYTHON_SOURCE)
 	$(PYTHON_CAT) $(DL_DIR)/$(PYTHON_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-	touch $(PYTHON_DIR)/.unpacked
+	touch $@
 
 $(PYTHON_DIR)/.patched: $(PYTHON_DIR)/.unpacked
 	toolchain/patch-kernel.sh $(PYTHON_DIR) package/python/ python\*.patch
-	touch $(PYTHON_DIR)/.patched
+	touch $@
 
 $(PYTHON_DIR)/.hostpython: $(PYTHON_DIR)/.patched
 	(cd $(PYTHON_DIR); rm -rf config.cache; \
-		OPT="-O1" \
+		CC="$(HOSTCC)" OPT="-O2" \
 		./configure \
 		--with-cxx=no \
-		$(DISABLE_NLS); \
-		$(MAKE) python Parser/pygen; \
-		mv python hostpython; \
-		mv Parser/pgen Parser/hostpgen; \
+		$(DISABLE_NLS) && \
+		$(MAKE) python Parser/pgen && \
+		mv python hostpython && \
+		mv Parser/pgen Parser/hostpgen && \
 		$(MAKE) distclean \
-	);
-	touch $(PYTHON_DIR)/.hostpython
+	) && \
+	touch $@
 
 $(PYTHON_DIR)/.configured: $(PYTHON_DIR)/.hostpython
 	(cd $(PYTHON_DIR); rm -rf config.cache; \
 		$(TARGET_CONFIGURE_OPTS) \
-		OPT="$(TARGET_OPTIMIZATION)" \
+		OPT="$(TARGET_CFLAGS)" \
 		./configure \
 		--target=$(GNU_TARGET_NAME) \
 		--host=$(GNU_TARGET_NAME) \
@@ -48,16 +58,17 @@
 		--prefix=/usr \
 		--sysconfdir=/etc \
 		--with-cxx=no \
+		$(PYTHON_DISABLE_IPv6) \
 		$(DISABLE_NLS) \
 	);
-	touch $(PYTHON_DIR)/.configured
+	touch $@
 
 $(PYTHON_DIR)/$(PYTHON_BINARY): $(PYTHON_DIR)/.configured
 	export PYTHON_DISABLE_SSL=1
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) DESTDIR=$(TARGET_DIR) \
 		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
 		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
-		PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
+		PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
 
 $(TARGET_DIR)/$(PYTHON_TARGET_BINARY): $(PYTHON_DIR)/$(PYTHON_BINARY)
@@ -67,13 +78,13 @@
 		DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \
 		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
 		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
-		PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
-		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
-	rm $(TARGET_DIR)/usr/bin/python?.?
-	rm $(TARGET_DIR)/usr/bin/idle
-	rm $(TARGET_DIR)/usr/bin/pydoc
-	-find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \;
-	-find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \;
+		PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
+		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen && \
+	rm $(TARGET_DIR)/usr/bin/python?.? && \
+	rm $(TARGET_DIR)/usr/bin/idle && \
+	rm $(TARGET_DIR)/usr/bin/pydoc && \
+	find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \; && \
+	find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \; && \
 	rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
 		$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \
 		$(TARGET_DIR)/usr/lib/python*/test
@@ -82,7 +93,7 @@
 
 python-clean:
 	-$(MAKE) -C $(PYTHON_DIR) distclean
-	rm $(PYTHON_DIR)/.configured
+	rm $(PYTHON_DIR)/.configured $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
 
 python-dirclean:
 	rm -rf $(PYTHON_DIR)

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Buildroot] svn commit: trunk/buildroot/package/python
@ 2007-01-22 18:48 aldot at uclibc.org
  0 siblings, 0 replies; 17+ messages in thread
From: aldot at uclibc.org @ 2007-01-22 18:48 UTC (permalink / raw)
  To: buildroot

Author: aldot
Date: 2007-01-22 10:48:48 -0800 (Mon, 22 Jan 2007)
New Revision: 17472

Log:
- fixup include- and libdirs. Closes #841
- rediff patches against 2.4.2


Added:
   trunk/buildroot/package/python/python-001-cross-compile.patch
   trunk/buildroot/package/python/python-002-cross-compile.patch
   trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch
   trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch

Removed:
   trunk/buildroot/package/python/python-cross-compile.patch
   trunk/buildroot/package/python/python-disable_modules_and_ssl.patch
   trunk/buildroot/package/python/python-gentoo_py_dontcompile.patch

Modified:
   trunk/buildroot/package/python/python.mk


Changeset:
Added: trunk/buildroot/package/python/python-001-cross-compile.patch
===================================================================
--- trunk/buildroot/package/python/python-001-cross-compile.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-001-cross-compile.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -0,0 +1,106 @@
+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:

Added: trunk/buildroot/package/python/python-002-cross-compile.patch
===================================================================
--- trunk/buildroot/package/python/python-002-cross-compile.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-002-cross-compile.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -0,0 +1,44 @@
+diff -rduNp Python-2.4.2-001/setup.py Python-2.4.2/setup.py
+--- Python-2.4.2-001/setup.py	2007-01-22 19:37:08.000000000 +0100
++++ Python-2.4.2/setup.py	2007-01-22 19:41:47.000000000 +0100
+@@ -20,6 +20,14 @@ disabled_module_list = []
+ def add_dir_to_list(dirlist, dir):
+     """Add the directory 'dir' to the list 'dirlist' (at the front) if
+     1) 'dir' is not already in 'dirlist'
++	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']
++try:
+     2) 'dir' actually exists, and is a directory."""
+     if dir is not None and os.path.isdir(dir) and dir not in dirlist:
+         dirlist.insert(0, dir)
+@@ -239,7 +247,10 @@ class PyBuildExt(build_ext):
+         return sys.platform
+ 
+     def detect_modules(self):
+-        # Ensure that /usr/local is always used
++        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 @@ class PyBuildExt(build_ext):
+         # 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()

Added: trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch
===================================================================
--- trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-010-disable_modules_and_ssl.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -0,0 +1,37 @@
+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
+         for dir in modules_include_dirs:
+                 add_dir_to_list(self.compiler.include_dirs, dir)
+         for dir in modules_lib_dirs:
+@@ -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,

Added: trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch
===================================================================
--- trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch	                        (rev 0)
+++ trunk/buildroot/package/python/python-020-gentoo_py_dontcompile.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -0,0 +1,18 @@
+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(

Deleted: trunk/buildroot/package/python/python-cross-compile.patch
===================================================================
--- trunk/buildroot/package/python/python-cross-compile.patch	2007-01-22 18:16:04 UTC (rev 17471)
+++ trunk/buildroot/package/python/python-cross-compile.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -1,106 +0,0 @@
-Ripped from OpenEmbedded
-
---- Python-2.4c1/Makefile.pre.in
-+++ Python-2.4c1/Makefile.pre.in
-@@ -162,6 +162,7 @@
- 
- PYTHON=		python$(EXE)
- BUILDPYTHON=	python$(BUILDEXE)
-+HOSTPYTHON=	$(BUILDPYTHON)
- 
- # === Definitions added by makesetup ===
- 
-@@ -188,7 +189,7 @@
- ##########################################################################
- # Parser
- PGEN=		Parser/pgen$(EXE)
--
-+HOSTPGEN=	$(PGEN)$(EXE)
- POBJS=		\
- 		Parser/acceler.o \
- 		Parser/grammar1.o \
-@@ -320,8 +321,8 @@
- # 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 @@
- 
- 
- $(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)
-@@ -718,19 +719,19 @@
- 	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
- 
-@@ -825,7 +826,7 @@
- # 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) \
---- Python-2.4c1/setup.py
-+++ Python-2.4c1/setup.py
-@@ -206,6 +206,7 @@
-         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 @@
- 
-     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":
-@@ -260,12 +260,6 @@
-             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:

Deleted: trunk/buildroot/package/python/python-disable_modules_and_ssl.patch
===================================================================
--- trunk/buildroot/package/python/python-disable_modules_and_ssl.patch	2007-01-22 18:16:04 UTC (rev 17471)
+++ trunk/buildroot/package/python/python-disable_modules_and_ssl.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -1,36 +0,0 @@
---- python.old/setup.py	2003-11-01 19:23:48.495647848 +0000
-+++ python/setup.py	2003-11-01 19:24:16.044459792 +0000
-@@ -15,7 +15,14 @@
- 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
-@@ -240,6 +247,7 @@
-         return sys.platform
- 
-     def detect_modules(self):
-+        global disable_ssl
-         # 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')
-@@ -451,7 +459,8 @@
-                                      ] )
- 
-         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,

Deleted: trunk/buildroot/package/python/python-gentoo_py_dontcompile.patch
===================================================================
--- trunk/buildroot/package/python/python-gentoo_py_dontcompile.patch	2007-01-22 18:16:04 UTC (rev 17471)
+++ trunk/buildroot/package/python/python-gentoo_py_dontcompile.patch	2007-01-22 18:48:48 UTC (rev 17472)
@@ -1,17 +0,0 @@
---- Python-2.3.2/Python/import.c	2003-10-08 12:29:03.166032656 +0100
-+++ import.c	2003-10-08 12:32:57.423420120 +0100
-@@ -808,8 +808,12 @@
- 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(

Modified: trunk/buildroot/package/python/python.mk
===================================================================
--- trunk/buildroot/package/python/python.mk	2007-01-22 18:16:04 UTC (rev 17471)
+++ trunk/buildroot/package/python/python.mk	2007-01-22 18:48:48 UTC (rev 17472)
@@ -55,6 +55,8 @@
 $(PYTHON_DIR)/$(PYTHON_BINARY): $(PYTHON_DIR)/.configured
 	export PYTHON_DISABLE_SSL=1
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) DESTDIR=$(TARGET_DIR) \
+		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
+		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
 		PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
 
@@ -63,12 +65,15 @@
 	LD_LIBRARY_PATH=$(STAGING_DIR)/lib
 	$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) install \
 		DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \
+		PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
+		PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
 		PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
 		HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
 	rm $(TARGET_DIR)/usr/bin/python?.?
 	rm $(TARGET_DIR)/usr/bin/idle
 	rm $(TARGET_DIR)/usr/bin/pydoc
-	find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -o -name '*.pyo' -exec rm {} \;
+	-find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \;
+	-find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \;
 	rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
 		$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \
 		$(TARGET_DIR)/usr/lib/python*/test

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-01-16  6:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08  7:26 [Buildroot] svn commit: trunk/buildroot/package/python hamish at uclibc.org
  -- strict thread matches above, loose matches on Subject: below --
2009-01-15  6:28 ulf at uclibc.org
2009-01-15  8:57 ` Peter Korsgaard
2009-01-15 14:01   ` Hamish Moffatt
2009-01-15 20:11     ` Ulf Samuelsson
2009-01-15 23:10       ` Hamish Moffatt
2009-01-15 23:16         ` Markus Heidelberg
2009-01-16  6:45         ` Ulf Samuelsson
2008-10-30 17:21 wberrier at uclibc.org
2008-10-08  5:03 hamish at uclibc.org
2008-09-11  1:59 hamish at uclibc.org
2008-09-02  0:54 hamish at uclibc.org
2008-06-16 11:15 jacmet at uclibc.org
2008-02-06  0:55 hamish at uclibc.org
2008-01-17 12:42 vanokuten at uclibc.org
2007-01-23 17:18 aldot at uclibc.org
2007-01-22 18:48 aldot at uclibc.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox