notify-python-0.1.1-fix-GTK-symbols.patch 938 B

1234567891011121314151617181920212223242526
  1. diff -up notify-python-0.1.1/src/__init__.py.BAD notify-python-0.1.1/src/__init__.py
  2. --- notify-python-0.1.1/src/__init__.py.BAD 2010-08-31 09:04:45.353844005 -0400
  3. +++ notify-python-0.1.1/src/__init__.py 2010-08-31 09:04:49.281844300 -0400
  4. @@ -1 +1,21 @@
  5. +"""
  6. +Fedora's libnotify.so is not linked against GTK2 or GTK3. The idea
  7. +was to support being linked against different parallel-installable
  8. +GTK stacks.
  9. +
  10. +Unfortunately, python needs to jump through some special hoops in order
  11. +to share symbols with extension modules, specifically, pygtk, which does
  12. +link against GTK2.
  13. +
  14. +Without using sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL),
  15. +the result is:
  16. +libnotify-WARNING **: Missing symbol 'gdk_screen_make_display_name'
  17. +
  18. +Thanks to David Malcolm for figuring out the workaround.
  19. +"""
  20. +import ctypes
  21. +import sys
  22. +sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
  23. +import gtk
  24. +
  25. from _pynotify import *