2009-02-18 Ke Wang <
[email protected]>
* patches/Python26-14-ctypes-util-find-library.diff: Added.
* SUNWPython26.spec: Add patch 14 to make ctypes.util.find_library use
crle instead of ldconfig
--- a/ChangeLog Wed Feb 18 09:36:51 2009 +0000
+++ b/ChangeLog Wed Feb 18 10:01:50 2009 +0000
@@ -1,3 +1,8 @@
+2009-02-18 Ke Wang <[email protected]>
+ * patches/Python26-14-ctypes-util-find-library.diff: Added.
+ * SUNWPython26.spec: Add patch 14 to make ctypes.util.find_library use
+ crle instead of ldconfig
+
2009-02-18 Dave Lin <[email protected]>
* patches/gedit-03-py_ssize_t.diff: Added.
--- a/SUNWPython26.spec Wed Feb 18 09:36:51 2009 +0000
+++ b/SUNWPython26.spec Wed Feb 18 10:01:50 2009 +0000
@@ -61,6 +61,8 @@
Patch12: Python26-12-encoding-alias.diff
# date:2009-01-23 owner:laca type:bug
Patch13: Python26-13-cflags.diff
+# date:2009-02-18 owner:wangke type:bug bugs.python.org 5289
+Patch14: Python26-14-ctypes-util-find-library.diff
%include default-depend.inc
BuildRequires: SUNWTk
@@ -359,6 +361,8 @@
%{_libdir}/python?.?/py[cC][cC]
%changelog
+* Wed Feb 18 2009 - [email protected]
+- add patch14 to make ctypes.util.find_library use crle instead of ldconfig
* Fri Jan 23 2009 - [email protected]
- add patch cflags.diff, fixes 6792612
* Tue Jan 06 2009 - [email protected]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/Python26-14-ctypes-util-find-library.diff Wed Feb 18 10:01:50 2009 +0000
@@ -0,0 +1,38 @@
+--- Python-2.6.1/Lib/ctypes/util.py.orig 2008-05-17 04:06:31.000000000 +0800
++++ Python-2.6.1/Lib/ctypes/util.py 2009-02-18 17:42:20.153456000 +0800
+@@ -156,6 +156,35 @@
+ res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
+ return res[-1]
+
++ elif sys.platform == "sunos5":
++
++ def _findLib_crle(name, is64):
++ if not os.path.exists('/usr/bin/crle'):
++ return None
++
++ if is64:
++ cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
++ else:
++ cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
++
++ for line in os.popen(cmd).readlines():
++ line = line.strip()
++ if (line.startswith('Default Library Path (ELF):')):
++ paths = line.split()[4]
++
++ if not paths:
++ return None
++
++ for dir in paths.split(":"):
++ libfile = os.path.join(dir, "lib%s.so" % name)
++ if os.path.exists(libfile):
++ return libfile
++
++ return None
++
++ def find_library(name, is64 = False):
++ return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
++
+ else:
+
+ def _findLib_ldconfig(name):