more updates for python
authorMike Frysinger <vapier@gentoo.org>
Tue, 12 Oct 2004 00:06:48 +0000 (00:06 -0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 12 Oct 2004 00:06:48 +0000 (00:06 -0000)
package/python/python-cross-compile.patch
package/python/python-disable_modules_and_ssl.patch [new file with mode: 0644]
package/python/python-gentoo_py_dontcompile.patch [new file with mode: 0644]
package/python/python.mk

index f7465cc3c7fc5c5f120a7490cc1c213bd7d35061..4f3c298eef063664226f122dfbe7b68c552459ac 100644 (file)
@@ -97,9 +97,9 @@
          # 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_dir_to_list(self.compiler.library_dirs, os.getenv('DESTDIR') + '/lib')
-+        add_dir_to_list(self.compiler.library_dirs, os.getenv('DESTDIR') + '/usr/lib')
-+        add_dir_to_list(self.compiler.include_dirs, os.getenv('DESTDIR') + '/usr/include')
++        #add_dir_to_list(self.compiler.library_dirs, os.getenv('DESTDIR') + '/lib')
++        #add_dir_to_list(self.compiler.library_dirs, os.getenv('DESTDIR') + '/usr/lib')
++        #add_dir_to_list(self.compiler.include_dirs, os.getenv('DESTDIR') + '/usr/include')
  
          # fink installs lots of goodies in /sw/... - make sure we
          # check there
diff --git a/package/python/python-disable_modules_and_ssl.patch b/package/python/python-disable_modules_and_ssl.patch
new file mode 100644 (file)
index 0000000..073296c
--- /dev/null
@@ -0,0 +1,36 @@
+--- 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,
diff --git a/package/python/python-gentoo_py_dontcompile.patch b/package/python/python-gentoo_py_dontcompile.patch
new file mode 100644 (file)
index 0000000..22ecd0e
--- /dev/null
@@ -0,0 +1,17 @@
+--- 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(
index e49e2de874525b76cc9655fa06709139ba6e6481..32222198961abba3fdd554ec05f6c72731e1b818 100644 (file)
@@ -53,13 +53,17 @@ $(PYTHON_DIR)/.configured: $(PYTHON_DIR)/.hostpython
        touch $(PYTHON_DIR)/.configured
 
 $(PYTHON_DIR)/$(PYTHON_BINARY): $(PYTHON_DIR)/.configured
+       export PYTHON_DISABLE_SSL=1
        $(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) DESTDIR=$(TARGET_DIR) \
+               PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
                HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
 
 $(TARGET_DIR)/$(PYTHON_TARGET_BINARY): $(PYTHON_DIR)/$(PYTHON_BINARY)
+       export PYTHON_DISABLE_SSL=1
        LD_LIBRARY_PATH=$(STAGING_DIR)/lib
        $(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) install \
                DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \
+               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