Bug 558109 – _g_typelib_init fails to find shared libraries
authorColin Walters <walters@src.gnome.org>
Fri, 31 Oct 2008 19:42:33 +0000 (19:42 +0000)
committerColin Walters <walters@src.gnome.org>
Fri, 31 Oct 2008 19:42:33 +0000 (19:42 +0000)
svn path=/trunk/; revision=852

ChangeLog
giscanner/girwriter.py

index 92d0af25f65ebbde2f6f8ca577c90fe9f9aad180..20f443088404903cdf7d4f44838e2e3ab17d798a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-31  Colin Walters  <walters@verbum.org>
+
+       Bug 558109 – _g_typelib_init fails to find shared libraries
+
+       * transformer/glibtransformer.py: Use ctypes' find_library
+       on passed libraries and write that for the shared-library
+       entry.  We want to avoid depending on -devel packages.
+
 2008-10-31  Johan Dahlin  <jdahlin@async.com.br>
 
        * docs/g-ir-scanner.1:
index 3de71bcd58b1f3e9cc0986bbca402ea4944dbe70..67aa141287e4431f05f6727119ebfca8a58c0d73 100644 (file)
@@ -21,6 +21,7 @@
 from __future__ import with_statement
 
 import os
+from ctypes.util import find_library
 
 from .ast import (Callback, Class, Constant, Enum, Function, Interface, Member,
                   Array, Struct, Alias, Union, List, Map, Varargs)
@@ -54,7 +55,10 @@ class GIRWriter(XMLWriter):
     def _write_namespace(self, namespace, shlibs):
         libraries = []
         for l in shlibs:
-            libraries.append(os.path.basename(l))
+            found_libname = find_library(l)
+            if not found_libname:
+                found_libname = l
+            libraries.append(os.path.basename(found_libname))
 
         attrs = [('name', namespace.name),
                  ('version', namespace.version),