summaryrefslogtreecommitdiff
path: root/package/python2/patches
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-09-25 22:23:10 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-09-25 22:23:10 +0200
commitd48b7c670c65ccdf858abcdd695c1bb67d5f61b4 (patch)
treedd1904e961a1400a809cbe3999e7d3aef4223ecb /package/python2/patches
parent8b32eefb9caa9e2ac30505510b588ff02f6c87b8 (diff)
fix packaging bug, reported by joerg
loading of python modules must be disabled, otherwise they are renamed/disabled. To disable modules we need to patch setup.py, PYTHON_DIABLED_MODULES are no longer recognized.
Diffstat (limited to 'package/python2/patches')
-rw-r--r--package/python2/patches/patch-Makefile_pre_in13
-rw-r--r--package/python2/patches/patch-setup_py48
2 files changed, 55 insertions, 6 deletions
diff --git a/package/python2/patches/patch-Makefile_pre_in b/package/python2/patches/patch-Makefile_pre_in
index b91d05919..de21cdef0 100644
--- a/package/python2/patches/patch-Makefile_pre_in
+++ b/package/python2/patches/patch-Makefile_pre_in
@@ -1,5 +1,5 @@
--- Python-2.7.orig/Makefile.pre.in 2010-04-12 02:10:46.000000000 +0200
-+++ Python-2.7/Makefile.pre.in 2010-09-20 02:37:52.537806065 +0200
++++ Python-2.7/Makefile.pre.in 2010-09-25 21:11:15.584089025 +0200
@@ -179,6 +179,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
PYTHON= python$(EXE)
@@ -104,16 +104,17 @@
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
-@@ -1043,7 +1045,7 @@ libainstall: all python-config
+@@ -1043,7 +1045,8 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall:
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
++ CROSS_COMPILE='$(CROSS_COMPILE)' \
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
-@@ -1081,7 +1083,7 @@ frameworkinstallstructure: $(LDLIBRARY)
+@@ -1081,7 +1084,7 @@ frameworkinstallstructure: $(LDLIBRARY)
fi; \
done
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
@@ -122,7 +123,7 @@
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
-@@ -1116,7 +1118,7 @@ frameworkinstallextras:
+@@ -1116,7 +1119,7 @@ frameworkinstallextras:
# This installs a few of the useful scripts in Tools/scripts
scriptsinstall:
SRCDIR=$(srcdir) $(RUNSHARED) \
@@ -131,7 +132,7 @@
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--root=/$(DESTDIR)
-@@ -1138,7 +1140,7 @@ config.status: $(srcdir)/configure
+@@ -1138,7 +1141,7 @@ config.status: $(srcdir)/configure
# Run reindent on the library
reindent:
@@ -140,7 +141,7 @@
# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
-@@ -1238,7 +1240,7 @@ funny:
+@@ -1238,7 +1241,7 @@ funny:
# Perform some verification checks on any modified files.
patchcheck:
diff --git a/package/python2/patches/patch-setup_py b/package/python2/patches/patch-setup_py
new file mode 100644
index 000000000..c0806af13
--- /dev/null
+++ b/package/python2/patches/patch-setup_py
@@ -0,0 +1,48 @@
+--- Python-2.7.orig/setup.py 2010-06-27 14:36:16.000000000 +0200
++++ Python-2.7/setup.py 2010-09-25 22:04:01.234088816 +0200
+@@ -21,7 +21,7 @@ from distutils.spawn import find_executa
+ COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
+
+ # This global variable is used to hold the list of modules to be disabled.
+-disabled_module_list = []
++disabled_module_list = ['nis', 'bz2']
+
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
+@@ -307,36 +307,6 @@ class PyBuildExt(build_ext):
+ ext_filename = os.path.join(
+ self.build_lib,
+ self.get_ext_filename(self.get_ext_fullname(ext.name)))
+- try:
+- imp.load_dynamic(ext.name, ext_filename)
+- except ImportError, why:
+- self.failed.append(ext.name)
+- self.announce('*** WARNING: renaming "%s" since importing it'
+- ' failed: %s' % (ext.name, why), level=3)
+- assert not self.inplace
+- basename, tail = os.path.splitext(ext_filename)
+- newname = basename + "_failed" + tail
+- if os.path.exists(newname):
+- os.remove(newname)
+- os.rename(ext_filename, newname)
+-
+- # XXX -- This relies on a Vile HACK in
+- # distutils.command.build_ext.build_extension(). The
+- # _built_objects attribute is stored there strictly for
+- # use here.
+- # If there is a failure, _built_objects may not be there,
+- # so catch the AttributeError and move on.
+- try:
+- for filename in self._built_objects:
+- os.remove(filename)
+- except AttributeError:
+- self.announce('unable to remove files (ignored)')
+- except:
+- exc_type, why, tb = sys.exc_info()
+- self.announce('*** WARNING: importing extension "%s" '
+- 'failed with %s: %s' % (ext.name, exc_type, why),
+- level=3)
+- self.failed.append(ext.name)
+
+ def get_platform(self):
+ # Get value of sys.platform