working python 2.5... no threading, yet.
git-svn-id: svn://svn.openwrt.org/openwrt/packages@7016 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
59ce7f4144
commit
e834eda3ba
@ -9,12 +9,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=python
|
PKG_NAME:=python
|
||||||
PKG_VERSION:=2.4.4
|
PKG_VERSION:=2.5
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_SOURCE:=Python-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=Python-$(PKG_VERSION).tar.bz2
|
||||||
PKG_SOURCE_URL:=http://www.python.org/ftp/python/2.4.4/
|
PKG_SOURCE_URL:=http://www.python.org/ftp/python/2.5/
|
||||||
PKG_MD5SUM:=0ba90c79175c017101100ebf5978e906
|
PKG_MD5SUM:=ddb7401e711354ca83b7842b733825a3
|
||||||
PKG_CAT:=bzcat
|
PKG_CAT:=bzcat
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
|
||||||
@ -22,11 +22,14 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
PY_DISABLED_MODULES=readline pyexpat dbm gdbm bsddb \
|
||||||
|
_curses _curses_panel _tkinter nis zipfile
|
||||||
|
|
||||||
define Package/python
|
define Package/python
|
||||||
SECTION:=lang
|
SECTION:=lang
|
||||||
CATEGORY:=Languages
|
CATEGORY:=Languages
|
||||||
DEPENDS:=+uclibcxx
|
DEPENDS:=+uclibcxx
|
||||||
TITLE:=Python programming language
|
TITLE:=Python 2.5 programming language
|
||||||
URL:=http://www.python.org/
|
URL:=http://www.python.org/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -43,21 +46,20 @@ endef
|
|||||||
|
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
(cd $(PKG_BUILD_DIR); \
|
(cd $(PKG_BUILD_DIR); \
|
||||||
|
rm -rf config.cache; \
|
||||||
CONFIG_SITE= \
|
CONFIG_SITE= \
|
||||||
./configure --with-threads=no; \
|
./configure --with-threads=no --with-cxx=no; \
|
||||||
$(MAKE) python Parser/pgen; \
|
$(MAKE) python Parser/pgen; \
|
||||||
mv python hostpython; \
|
mv python hostpython; \
|
||||||
mv Parser/pgen Parser/hostpgen; \
|
mv Parser/pgen Parser/hostpgen; \
|
||||||
make distclean; \
|
make distclean; \
|
||||||
echo "import sys" > $(PKG_BUILD_DIR)/setup.py.new; \
|
|
||||||
echo "sys.path.append('$(PKG_BUILD_DIR)/Lib')" >> $(PKG_BUILD_DIR)/setup.py.new; \
|
|
||||||
cat $(PKG_BUILD_DIR)/setup.py >> $(PKG_BUILD_DIR)/setup.py.new; \
|
|
||||||
mv $(PKG_BUILD_DIR)/setup.py.new $(PKG_BUILD_DIR)/setup.py; \
|
|
||||||
);
|
);
|
||||||
$(call Build/Configure/Default, \
|
$(call Build/Configure/Default, \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
|
--with-cxx=no \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
--with-threads=no, \
|
--with-threads=no \
|
||||||
|
--disable-ipv6 \
|
||||||
HOSTPYTHON=./hostpython \
|
HOSTPYTHON=./hostpython \
|
||||||
HOSTPGEN=./Parser/hostpgen \
|
HOSTPGEN=./Parser/hostpgen \
|
||||||
)
|
)
|
||||||
@ -65,17 +67,22 @@ endef
|
|||||||
|
|
||||||
MAKE_OPTS:=\
|
MAKE_OPTS:=\
|
||||||
$(TARGET_CONFIGURE_OPTS) \
|
$(TARGET_CONFIGURE_OPTS) \
|
||||||
CFLAGS="$(TARGET_CFLAGS)" \
|
PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
|
||||||
CROSS_COMPILE=yes \
|
PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
|
||||||
|
PYTHON_DISABLE_MODULES="$(PY_DISABLED_MODULES)" \
|
||||||
|
CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
|
||||||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||||
LD="$(TARGET_CC)" \
|
LD="$(TARGET_CC)" \
|
||||||
BLDSHARED="$(TARGET_CC) -shared -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
|
|
||||||
HOSTPYTHON=./hostpython \
|
HOSTPYTHON=./hostpython \
|
||||||
HOSTPGEN=./Parser/hostpgen
|
HOSTPGEN=./Parser/hostpgen
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
|
export PYTHON_DISABLE_SSL=1
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
$(MAKE_OPTS) \
|
$(MAKE_OPTS) \
|
||||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||||
|
EXTRA_CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
|
||||||
|
CROSS_COMPILE=yes \
|
||||||
all install
|
all install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -83,29 +90,29 @@ define Build/InstallDev
|
|||||||
mkdir -p $(STAGING_DIR)/usr/bin
|
mkdir -p $(STAGING_DIR)/usr/bin
|
||||||
$(CP) $(PKG_BUILD_DIR)/hostpython $(STAGING_DIR)/usr/bin/
|
$(CP) $(PKG_BUILD_DIR)/hostpython $(STAGING_DIR)/usr/bin/
|
||||||
mkdir -p $(STAGING_DIR)/usr/include
|
mkdir -p $(STAGING_DIR)/usr/include
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/python2.4 $(STAGING_DIR)/usr/include/
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/python2.5 $(STAGING_DIR)/usr/include/
|
||||||
mkdir -p $(STAGING_DIR)/usr/lib
|
mkdir -p $(STAGING_DIR)/usr/lib
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.4 $(STAGING_DIR)/usr/lib/
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.5 $(STAGING_DIR)/usr/lib/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/UninstallDev
|
define Build/UninstallDev
|
||||||
rm -rf \
|
rm -rf \
|
||||||
$(STAGING_DIR)/usr/{include,lib}/python2.4
|
$(STAGING_DIR)/usr/{include,lib}/python2.5
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/python/install
|
define Package/python/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/python2.4 $(1)/usr/bin/
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/python2.5 $(1)/usr/bin/
|
||||||
ln -sf python2.4 $(1)/usr/bin/python
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/python $(1)/usr/bin/
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.4 $(1)/usr/lib/
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.5 $(1)/usr/lib/
|
||||||
rm -rf \
|
rm -rf \
|
||||||
$(1)/usr/lib/python2.4/bsddb/test \
|
$(1)/usr/lib/python2.5/bsddb/test \
|
||||||
$(1)/usr/lib/python2.4/distutils/tests \
|
$(1)/usr/lib/python2.5/distutils/tests \
|
||||||
$(1)/usr/lib/python2.4/email/test \
|
$(1)/usr/lib/python2.5/email/test \
|
||||||
$(1)/usr/lib/python2.4/idlelib \
|
$(1)/usr/lib/python2.5/idlelib \
|
||||||
$(1)/usr/lib/python2.4/lib-tk \
|
$(1)/usr/lib/python2.5/lib-tk \
|
||||||
$(1)/usr/lib/python2.4/test \
|
$(1)/usr/lib/python2.5/test \
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -1,129 +1,82 @@
|
|||||||
diff -uN Python-2.4.3.orig/Makefile.pre.in Python-2.4.3.cc/Makefile.pre.in
|
diff -ruNb Python-2.5.pris/Makefile.pre.in Python-2.5/Makefile.pre.in
|
||||||
--- Python-2.4.3.orig/Makefile.pre.in 2006-03-13 07:08:41.000000000 -0600
|
--- Python-2.5.pris/Makefile.pre.in 2006-07-30 11:20:10.000000000 -0500
|
||||||
+++ Python-2.4.3.cc/Makefile.pre.in 2006-10-13 14:47:12.000000000 -0500
|
+++ Python-2.5/Makefile.pre.in 2007-04-19 17:02:07.078288000 -0500
|
||||||
@@ -162,6 +162,7 @@
|
@@ -170,6 +170,7 @@
|
||||||
|
|
||||||
PYTHON= python$(EXE)
|
PYTHON= python$(EXE)
|
||||||
BUILDPYTHON= python$(BUILDEXE)
|
BUILDPYTHON= python$(BUILDEXE)
|
||||||
+HOSTPYTHON= ./$(BUILDPYTHON)
|
+HOSTPYTHON= $(BUILDPYTHON)
|
||||||
|
|
||||||
# === Definitions added by makesetup ===
|
# === Definitions added by makesetup ===
|
||||||
|
|
||||||
@@ -189,6 +190,8 @@
|
@@ -196,7 +197,7 @@
|
||||||
|
##########################################################################
|
||||||
# Parser
|
# Parser
|
||||||
PGEN= Parser/pgen$(EXE)
|
PGEN= Parser/pgen$(EXE)
|
||||||
|
-
|
||||||
+HOSTPGEN= $(PGEN)
|
+HOSTPGEN= $(PGEN)$(EXE)
|
||||||
+
|
|
||||||
POBJS= \
|
POBJS= \
|
||||||
Parser/acceler.o \
|
Parser/acceler.o \
|
||||||
Parser/grammar1.o \
|
Parser/grammar1.o \
|
||||||
@@ -320,8 +323,8 @@
|
@@ -345,8 +346,8 @@
|
||||||
# Build the shared modules
|
# Build the shared modules
|
||||||
sharedmods: $(BUILDPYTHON)
|
sharedmods: $(BUILDPYTHON)
|
||||||
case $$MAKEFLAGS in \
|
case $$MAKEFLAGS in \
|
||||||
- *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
|
- *-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;; \
|
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
|
||||||
+ *-s*) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
|
+ *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
|
||||||
+ *) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
|
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# buildno should really depend on something like LIBRARY_SRC
|
# Build static library
|
||||||
@@ -442,8 +445,7 @@
|
@@ -470,7 +471,7 @@
|
||||||
|
|
||||||
|
|
||||||
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
|
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
|
||||||
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||||
-
|
|
||||||
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||||
|
|
||||||
$(PGEN): $(PGENOBJS)
|
$(PGEN): $(PGENOBJS)
|
||||||
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
|
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
|
||||||
|
@@ -885,7 +886,7 @@
|
||||||
@@ -723,19 +725,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
|
|
||||||
|
|
||||||
@@ -830,7 +832,8 @@
|
|
||||||
# Install the dynamically loadable modules
|
# Install the dynamically loadable modules
|
||||||
# This goes into $(exec_prefix)
|
# This goes into $(exec_prefix)
|
||||||
sharedinstall:
|
sharedinstall:
|
||||||
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
|
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
|
||||||
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
|
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
|
||||||
+ $(HOSTPYTHON) -E $(srcdir)/setup.py install \
|
|
||||||
--prefix=$(prefix) \
|
--prefix=$(prefix) \
|
||||||
--install-scripts=$(BINDIR) \
|
--install-scripts=$(BINDIR) \
|
||||||
--install-platlib=$(DESTSHARED) \
|
--install-platlib=$(DESTSHARED) \
|
||||||
diff -uN Python-2.4.3.orig/setup.py Python-2.4.3.cc/setup.py
|
diff -ruNb Python-2.5.pris/setup.py Python-2.5/setup.py
|
||||||
--- Python-2.4.3.orig/setup.py 2006-03-23 13:07:46.000000000 -0600
|
--- Python-2.5.pris/setup.py 2006-08-09 18:42:18.000000000 -0500
|
||||||
+++ Python-2.4.3.cc/setup.py 2006-10-13 15:36:01.000000000 -0500
|
+++ Python-2.5/setup.py 2007-04-19 16:58:15.395808750 -0500
|
||||||
@@ -205,26 +205,30 @@
|
@@ -209,6 +209,7 @@
|
||||||
try:
|
try:
|
||||||
imp.load_dynamic(ext.name, ext_filename)
|
imp.load_dynamic(ext.name, ext_filename)
|
||||||
except ImportError, why:
|
except ImportError, why:
|
||||||
- self.announce('*** WARNING: renaming "%s" since importing it'
|
+ return
|
||||||
- ' failed: %s' % (ext.name, why), level=3)
|
self.announce('*** WARNING: renaming "%s" since importing it'
|
||||||
- assert not self.inplace
|
' failed: %s' % (ext.name, why), level=3)
|
||||||
- basename, tail = os.path.splitext(ext_filename)
|
assert not self.inplace
|
||||||
- newname = basename + "_failed" + tail
|
@@ -244,8 +245,6 @@
|
||||||
- if os.path.exists(newname):
|
|
||||||
- os.remove(newname)
|
def detect_modules(self):
|
||||||
- os.rename(ext_filename, newname)
|
# 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 specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -279,12 +278,6 @@
|
||||||
|
for directory in options.dirs:
|
||||||
|
add_dir_to_list(dir_list, directory)
|
||||||
|
|
||||||
|
- 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"))
|
||||||
-
|
-
|
||||||
- # XXX -- This relies on a Vile HACK in
|
try:
|
||||||
- # distutils.command.build_ext.build_extension(). The
|
have_unicode = unicode
|
||||||
- # _built_objects attribute is stored there strictly for
|
except NameError:
|
||||||
- # 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)')
|
|
||||||
+ if os.environ.get('CROSS_COMPILE') != "yes":
|
|
||||||
+ 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)')
|
|
||||||
+ else:
|
|
||||||
+ self.announce('WARNING: "%s" failed importing, but we leave it because we are cross-compiling' % ext.name)
|
|
||||||
+
|
|
||||||
except:
|
|
||||||
exc_type, why, tb = sys.exc_info()
|
|
||||||
self.announce('*** WARNING: importing extension "%s" '
|
|
||||||
|
37
lang/python/patches/001-cross-compile.patch
Normal file
37
lang/python/patches/001-cross-compile.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
diff -ruNb Python-2.5.pris/setup.py Python-2.5/setup.py
|
||||||
|
--- Python-2.5.pris/setup.py 2007-04-19 17:06:20.170105250 -0500
|
||||||
|
+++ Python-2.5/setup.py 2007-04-19 17:07:14.257485500 -0500
|
||||||
|
@@ -244,7 +244,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 specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -286,11 +297,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 = []
|
||||||
|
|
||||||
|
config_h = sysconfig.get_config_h_filename()
|
37
lang/python/patches/010-disable_modules_and_ssl.patch
Normal file
37
lang/python/patches/010-disable_modules_and_ssl.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
diff -ruNb Python-2.5.pris/setup.py Python-2.5/setup.py
|
||||||
|
--- Python-2.5.pris/setup.py 2007-04-19 17:08:06.740765500 -0500
|
||||||
|
+++ Python-2.5/setup.py 2007-04-19 17:08:23.121789250 -0500
|
||||||
|
@@ -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
|
||||||
|
@@ -244,6 +251,7 @@
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
def detect_modules(self):
|
||||||
|
+ global disable_ssl
|
||||||
|
try:
|
||||||
|
modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
|
||||||
|
except KeyError:
|
||||||
|
@@ -538,7 +546,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,
|
16
lang/python/patches/020-gentoo_py_dontcompile.patch
Normal file
16
lang/python/patches/020-gentoo_py_dontcompile.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
diff -ruNb Python-2.5.pris/Python/import.c Python-2.5/Python/import.c
|
||||||
|
--- Python-2.5.pris/Python/import.c 2006-09-10 23:06:23.000000000 -0500
|
||||||
|
+++ Python-2.5/Python/import.c 2007-04-19 17:09:30.209982000 -0500
|
||||||
|
@@ -853,8 +853,12 @@
|
||||||
|
write_compiled_module(PyCodeObject *co, char *cpathname, time_t mtime)
|
||||||
|
{
|
||||||
|
FILE *fp;
|
||||||
|
+ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE");
|
||||||
|
|
||||||
|
+ if (!py_dontcompile)
|
||||||
|
fp = open_exclusive(cpathname);
|
||||||
|
+ else
|
||||||
|
+ fp = NULL;
|
||||||
|
if (fp == NULL) {
|
||||||
|
if (Py_VerboseFlag)
|
||||||
|
PySys_WriteStderr(
|
2538
lang/python/patches/030-cant_check_files.patch
Normal file
2538
lang/python/patches/030-cant_check_files.patch
Normal file
File diff suppressed because it is too large
Load Diff
25
lang/python/patches/040-dont_make_pyc.patch
Normal file
25
lang/python/patches/040-dont_make_pyc.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
--- Python-2.5/Makefile.pre.in 2007-04-19 18:46:05.510965874 -0500
|
||||||
|
+++ Python-2.5.new/Makefile.pre.in 2007-04-19 18:44:45.650965874 -0500
|
||||||
|
@@ -773,22 +773,6 @@
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
||||||
|
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||||
|
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||||
|
- -d $(LIBDEST) -f \
|
||||||
|
- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
|
||||||
|
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||||
|
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||||
|
- -d $(LIBDEST) -f \
|
||||||
|
- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
|
||||||
|
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||||
|
- ./$(BUILDPYTHON) -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 \
|
||||||
|
- -d $(LIBDEST)/site-packages -f \
|
||||||
|
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
||||||
|
|
||||||
|
# Create the PLATDIR source directory, if one wasn't distributed..
|
||||||
|
$(srcdir)/Lib/$(PLATDIR):
|
@ -1,16 +0,0 @@
|
|||||||
--- python.old/Makefile.pre.in 2007-03-24 19:55:34.314582384 +0100
|
|
||||||
+++ python.dev/Makefile.pre.in 2007-03-24 19:57:05.385737464 +0100
|
|
||||||
@@ -750,11 +750,11 @@
|
|
||||||
done; \
|
|
||||||
done
|
|
||||||
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
|
||||||
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
|
||||||
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
|
||||||
$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
|
||||||
-d $(LIBDEST) -f \
|
|
||||||
-x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
|
|
||||||
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
|
||||||
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
|
||||||
$(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
|
||||||
-d $(LIBDEST) -f \
|
|
||||||
-x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
|
|
Loading…
x
Reference in New Issue
Block a user