[dev-lang/python] add gdbm-1.9 patch, fixes bug 3159
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
http://hg.python.org/cpython/rev/c816479f6aaf/
|
||||
diff --git a/configure.in b/configure.in
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -293,6 +293,7 @@ then
|
||||
MACHDEP="$ac_md_system$ac_md_release"
|
||||
|
||||
case $MACHDEP in
|
||||
+ linux*) MACHDEP="linux2";;
|
||||
cygwin*) MACHDEP="cygwin";;
|
||||
darwin*) MACHDEP="darwin";;
|
||||
atheos*) MACHDEP="atheos";;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# /etc/init.d/pydoc.conf
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.conf,v 1.3 2011/10/27 13:56:55 neurogeek Exp $
|
||||
|
||||
# This file contains the configuration for pydoc's internal webserver.
|
||||
|
||||
# Default port for Python's pydoc server.
|
||||
@PYDOC_PORT_VARIABLE@="7464"
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2011 Gentoo Technologies, Inc.
|
||||
# Distributed under the terms of the GNU General Public Licence v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.init,v 1.4 2011/10/27 13:56:55 neurogeek Exp $
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start() {
|
||||
local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}"
|
||||
|
||||
if [ -z "${pydoc_port}" ]; then
|
||||
eerror "Port not set"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ebegin "Starting pydoc server on port ${pydoc_port}"
|
||||
start-stop-daemon --start --background --make-pidfile \
|
||||
--pidfile /var/run/@PYDOC@.pid \
|
||||
--exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping pydoc server"
|
||||
start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid
|
||||
eend $?
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
--- Python-2.4.4/Lib/test/test_multibytecodec.py.orig 2007-09-10 14:52:34.424592960 -0400
|
||||
+++ Python-2.4.4/Lib/test/test_multibytecodec.py 2007-09-10 14:53:30.646201491 -0400
|
||||
@@ -81,11 +81,11 @@ class Test_ISO2022(unittest.TestCase):
|
||||
uni = u':hu4:unit\xe9 de famille'
|
||||
self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
|
||||
|
||||
- def test_iso2022_jp_g0(self):
|
||||
- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
|
||||
- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
|
||||
- e = u'\u3406'.encode(encoding)
|
||||
- self.failIf(filter(lambda x: x >= '\x80', e))
|
||||
+# def test_iso2022_jp_g0(self):
|
||||
+# self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
|
||||
+# for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
|
||||
+# e = u'\u3406'.encode(encoding)
|
||||
+# self.failIf(filter(lambda x: x >= '\x80', e))
|
||||
|
||||
def test_bug1572832(self):
|
||||
if sys.maxunicode >= 0x10000:
|
||||
@@ -0,0 +1,34 @@
|
||||
http://bugs.gentoo.org/239110
|
||||
|
||||
assume %zd is supported when cross-compiling. any target we care about
|
||||
supports it, so ...
|
||||
|
||||
--- configure.in
|
||||
+++ configure.in
|
||||
@@ -3417,7 +3417,7 @@
|
||||
|
||||
|
||||
|
||||
-AC_MSG_CHECKING(for %zd printf() format support)
|
||||
+AC_CACHE_CHECK([for %zd printf() format support], [py_cv_has_zd_printf], [dnl
|
||||
AC_TRY_RUN([#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -3451,10 +3451,13 @@
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
-}],
|
||||
-[AC_MSG_RESULT(yes)
|
||||
- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
|
||||
- AC_MSG_RESULT(no))
|
||||
+}], [py_cv_has_zd_printf="yes"],
|
||||
+ [py_cv_has_zd_printf="no"],
|
||||
+ [py_cv_has_zd_printf="cross -- assuming yes"]
|
||||
+)])
|
||||
+if test "$py_cv_has_zd_printf" != "no" ; then
|
||||
+ AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])
|
||||
+fi
|
||||
|
||||
AC_CHECK_TYPE(socklen_t,,
|
||||
AC_DEFINE(socklen_t,int,
|
||||
@@ -0,0 +1,59 @@
|
||||
if we're cross-compiling, fall back to a link-only test rather than trying
|
||||
to run a program for the chflags functions
|
||||
|
||||
--- python-2.6/configure.in
|
||||
+++ python-2.6/configure.in
|
||||
@@ -2565,7 +2565,7 @@
|
||||
|
||||
# On Tru64, chflags seems to be present, but calling it will
|
||||
# exit Python
|
||||
-AC_MSG_CHECKING(for chflags)
|
||||
+AC_CACHE_CHECK([for chflags], [py_cv_has_chflags], [dnl
|
||||
AC_TRY_RUN([
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -2575,12 +2575,18 @@
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
-],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
|
||||
- AC_MSG_RESULT(yes),
|
||||
- AC_MSG_RESULT(no)
|
||||
-)
|
||||
+], [py_cv_has_chflags="yes"],
|
||||
+ [py_cv_has_chflags="no"],
|
||||
+ [py_cv_has_chflags="cross"])
|
||||
+])
|
||||
+if test "$py_cv_has_chflags" = "cross" ; then
|
||||
+ AC_CHECK_FUNC([chflags], [py_cv_has_chflags="yes"], [py_cv_has_chflags="no"])
|
||||
+fi
|
||||
+if test "$py_cv_has_chflags" = "yes" ; then
|
||||
+ AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
|
||||
+fi
|
||||
|
||||
-AC_MSG_CHECKING(for lchflags)
|
||||
+AC_CACHE_CHECK([for lchflags], [py_cv_has_lchflags], [dnl
|
||||
AC_TRY_RUN([
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -2590,10 +2596,16 @@
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
-],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
|
||||
- AC_MSG_RESULT(yes),
|
||||
- AC_MSG_RESULT(no)
|
||||
-)
|
||||
+], [py_cv_has_lchflags="yes"],
|
||||
+ [py_cv_has_lchflags="no"],
|
||||
+ [py_cv_has_lchflags="cross"])
|
||||
+])
|
||||
+if test "$py_cv_has_lchflags" = "cross" ; then
|
||||
+ AC_CHECK_FUNC([lchflags], [py_cv_has_lchflags="yes"], [py_cv_has_lchflags="no"])
|
||||
+fi
|
||||
+if test "$py_cv_has_lchflags" = "yes" ; then
|
||||
+ AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
|
||||
+fi
|
||||
|
||||
dnl Check if system zlib has *Copy() functions
|
||||
dnl
|
||||
@@ -0,0 +1,19 @@
|
||||
--- Lib/test/test_multibytecodec.py.orig 2008-04-19 18:48:59.000000000 +0300
|
||||
+++ Lib/test/test_multibytecodec.py 2008-04-19 18:49:44.000000000 +0300
|
||||
@@ -212,11 +212,11 @@
|
||||
uni = u':hu4:unit\xe9 de famille'
|
||||
self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
|
||||
|
||||
- def test_iso2022_jp_g0(self):
|
||||
- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
|
||||
- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
|
||||
- e = u'\u3406'.encode(encoding)
|
||||
- self.failIf(filter(lambda x: x >= '\x80', e))
|
||||
+ #def test_iso2022_jp_g0(self):
|
||||
+ # self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
|
||||
+ # for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
|
||||
+ # e = u'\u3406'.encode(encoding)
|
||||
+ # self.failIf(filter(lambda x: x >= '\x80', e))
|
||||
|
||||
def test_bug1572832(self):
|
||||
if sys.maxunicode >= 0x10000:
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/Lib/whichdb.py
|
||||
+++ b/Lib/whichdb.py
|
||||
@@ -91,7 +91,7 @@ def whichdb(filename):
|
||||
return ""
|
||||
|
||||
# Check for GNU dbm
|
||||
- if magic == 0x13579ace:
|
||||
+ if magic == (0x13579ace, 0x13579acd, 0x13579acf):
|
||||
return "gdbm"
|
||||
|
||||
# Check for old Berkeley db hash file format v2
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Victor Stinner <victor.stinner@haypocalc.com>
|
||||
# Date 1315259096 -7200
|
||||
# Node ID fb4d2e6d393e96baac13c4efc216e361bf12c293
|
||||
# Parent cb47cf5138a4567718a25d69a79d1c62d13f187c
|
||||
Issue #9561: distutils now reads and writes egg-info files using UTF-8
|
||||
|
||||
instead of the locale encoding.
|
||||
|
||||
diff --git a/Lib/distutils/command/install_egg_info.py b/Lib/distutils/command/install_egg_info.py
|
||||
--- a/Lib/distutils/command/install_egg_info.py
|
||||
+++ b/Lib/distutils/command/install_egg_info.py
|
||||
@@ -40,9 +40,8 @@ class install_egg_info(Command):
|
||||
"Creating "+self.install_dir)
|
||||
log.info("Writing %s", target)
|
||||
if not self.dry_run:
|
||||
- f = open(target, 'w')
|
||||
- self.distribution.metadata.write_pkg_file(f)
|
||||
- f.close()
|
||||
+ with open(target, 'w', encoding='UTF-8') as f:
|
||||
+ self.distribution.metadata.write_pkg_file(f)
|
||||
|
||||
def get_outputs(self):
|
||||
return self.outputs
|
||||
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
|
||||
--- a/Lib/distutils/dist.py
|
||||
+++ b/Lib/distutils/dist.py
|
||||
@@ -1010,11 +1010,9 @@ class DistributionMetadata:
|
||||
def write_pkg_info(self, base_dir):
|
||||
"""Write the PKG-INFO file into the release tree.
|
||||
"""
|
||||
- pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w')
|
||||
- try:
|
||||
+ with open(os.path.join(base_dir, 'PKG-INFO'), 'w',
|
||||
+ encoding='UTF-8') as pkg_info:
|
||||
self.write_pkg_file(pkg_info)
|
||||
- finally:
|
||||
- pkg_info.close()
|
||||
|
||||
def write_pkg_file(self, file):
|
||||
"""Write the PKG-INFO format data to a file object.
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# HG changeset patch
|
||||
# User Martin v. Löwis <martin@v.loewis.de>
|
||||
# Date 1304919465 -7200
|
||||
# Node ID 749686064642118c5ccc8ad28105472321931353
|
||||
# Parent 4f3f67a595fb05f04d89ed906df911b743e47463
|
||||
Use --as-needed when linking libpython3.so. Closes #11347.
|
||||
Patch by Arfrever Frehtes Taifersar Arahesis.
|
||||
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -76,6 +76,7 @@ PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIG
|
||||
# environment variables
|
||||
PY_CPPFLAGS= -I. -IInclude -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
|
||||
PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
|
||||
+NO_AS_NEEDED= @NO_AS_NEEDED@
|
||||
LDLAST= @LDLAST@
|
||||
SGI_ABI= @SGI_ABI@
|
||||
CCSHARED= @CCSHARED@
|
||||
@@ -459,7 +460,7 @@ libpython$(LDVERSION).so: $(LIBRARY_OBJS
|
||||
fi
|
||||
|
||||
libpython3.so: libpython$(LDVERSION).so
|
||||
- $(BLDSHARED) -o $@ -Wl,-hl$@ $^
|
||||
+ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
|
||||
|
||||
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
|
||||
$(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
||||
diff --git a/configure.in b/configure.in
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -525,6 +525,18 @@ then
|
||||
fi
|
||||
|
||||
|
||||
+AC_MSG_CHECKING([for -Wl,--no-as-needed])
|
||||
+save_LDFLAGS="$LDFLAGS"
|
||||
+LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
|
||||
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
+ [NO_AS_NEEDED="-Wl,--no-as-needed"
|
||||
+ AC_MSG_RESULT([yes])],
|
||||
+ [NO_AS_NEEDED=""
|
||||
+ AC_MSG_RESULT([no])])
|
||||
+LDFLAGS="$save_LDFLAGS"
|
||||
+AC_SUBST(NO_AS_NEEDED)
|
||||
+
|
||||
+
|
||||
# checks for UNIX variants that set C preprocessor variables
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#! /usr/bin/python2.4
|
||||
|
||||
import sys
|
||||
import os
|
||||
import getopt
|
||||
from distutils import sysconfig
|
||||
|
||||
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
|
||||
'ldflags', 'help']
|
||||
|
||||
def exit_with_usage(code=1):
|
||||
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
|
||||
'|'.join('--'+opt for opt in valid_opts))
|
||||
sys.exit(code)
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
|
||||
except getopt.error:
|
||||
exit_with_usage()
|
||||
|
||||
if not opts:
|
||||
#exit_with_usage()
|
||||
#be compatible with our old python-config-2.4
|
||||
import string
|
||||
print "-lpython2.4 -lm -L/usr/lib/python2.4/config",string.join(string.split(sysconfig.get_config_var("MODLIBS")))
|
||||
sys.exit(0)
|
||||
|
||||
opt = opts[0][0]
|
||||
|
||||
pyver = sysconfig.get_config_var('VERSION')
|
||||
getvar = sysconfig.get_config_var
|
||||
|
||||
if opt == '--help':
|
||||
exit_with_usage(0)
|
||||
|
||||
elif opt == '--prefix':
|
||||
print sysconfig.PREFIX
|
||||
|
||||
elif opt == '--exec-prefix':
|
||||
print sysconfig.EXEC_PREFIX
|
||||
|
||||
elif opt in ('--includes', '--cflags'):
|
||||
flags = ['-I' + sysconfig.get_python_inc(),
|
||||
'-I' + sysconfig.get_python_inc(plat_specific=True)]
|
||||
if opt == '--cflags':
|
||||
flags.extend(getvar('CFLAGS').split())
|
||||
print ' '.join(flags)
|
||||
|
||||
elif opt in ('--libs', '--ldflags'):
|
||||
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
|
||||
libs.append('-lpython'+pyver)
|
||||
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
||||
# shared library in prefix/lib/.
|
||||
if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
|
||||
libs.insert(0, '-L' + getvar('LIBPL'))
|
||||
print ' '.join(libs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user