adding osx application bundler scripts
[pspp] / utilities / osxbundler / macports-custom-packages / gtk-mac-bundler / files / patch-0.7.4-to-24Feb2016.diff
1 diff --git Changelog Changelog
2 index 07dfe16..47bbfef 100644
3 --- Changelog
4 +++ Changelog
5 @@ -1,5 +1,21 @@
6  Changes in version 0.7.4:
7  
8 + - Release gtk-mac-bundler 0.7.4 (John Ralls)
9 + - Make sure to check for .symbolic icon extension (Jesse van den Kieboom)
10 + - Fix pixbuf loader cache path (Jesse van den Kieboom)
11 + - Make sure that libraries are writeable before using otool. (Julien Woillez)
12 + - Update doap to reflect correct bug tracker. (John Ralls)
13 + - Bug 698196: Fix typo (John Ralls)
14 + - Bug #698916: Update versions, fix pixbuf (John Ralls)
15 + - Update all launchers to reflect new pango environment variables (John Ralls)
16 + - launcher: Update for pango changes (Dave Vasilevsky)
17 + - Correct gdk-pixbuf path in the pygtk example (John Ralls)
18 + - Bring example bundle files and launchers up to date (John Ralls)
19 + - The *correct* fix for pango modules. (John Ralls)
20 + - Fix another typo in pango module path (John Ralls)
21 +
22 +Changes in version 0.7.4:
23 +
24   - Make sure to check for .symbolic icon extension (Jesse van den Kieboom)
25   - Fix pixbuf loader cache path (Jesse van den Kieboom)
26   - Make sure that libraries are writeable before using otool. (Julien Woillez)
27 diff --git bundler/bundler.py bundler/bundler.py
28 index 8061ac1..65b8cc0 100644
29 --- bundler/bundler.py
30 +++ bundler/bundler.py
31 @@ -1,12 +1,12 @@
32  import sys
33  import os, errno, glob
34 -import dircache, shutil
35 +import shutil
36  import re
37  from plistlib import Plist
38  from distutils import dir_util, file_util
39  
40 -from project import *
41 -import utils
42 +from .project import *
43 +from . import utils
44  
45  class Bundler:
46      def __init__(self, project):
47 @@ -32,13 +32,13 @@ class Bundler:
48      def recursive_rm(self, dirname):
49          # Extra safety ;)
50          if dirname in [ "/", os.getenv("HOME"), os.path.join(os.getenv("HOME"), "Desktop"), self.meta.dest ]:
51 -            print "Eek, trying to remove a bit much, eh? (%s)" % (dirname)
52 +            print("Eek, trying to remove a bit much, eh? (%s)" % (dirname))
53              sys.exit(1)
54  
55          if not os.path.exists(dirname):
56              return
57          
58 -        files = dircache.listdir(dirname)
59 +        files = os.listdir(dirname)
60          for file in files:
61              path = os.path.join (dirname, file)
62              if os.path.isdir(path):
63 @@ -68,6 +68,12 @@ class Bundler:
64          self.copy_path(path)
65  
66      def create_pango_setup(self):
67 +        if utils.has_pkgconfig_module("pango") and \
68 +                not utils.has_pkgconfig_variable("pango", "pango_module_version"):
69 +            # Newer pango (>= 1.38) no longer has modules, skip this
70 +            # step in that case.
71 +            return
72 +
73          # Create a temporary pangorc file just for creating the
74          # modules file with the right modules.
75          module_version = utils.evaluate_pkgconfig_variables("${pkg:pango:pango_module_version}")
76 @@ -227,7 +233,7 @@ class Bundler:
77              # Clean out any libtool (*.la) files and static libraries
78              if os.path.isdir(dest):
79                  for root, dirs, files in os.walk(dest):
80 -                    for name in filter(lambda l: l.endswith(".la") or l.endswith(".a"), files):
81 +                    for name in [l for l in files if l.endswith(".la") or l.endswith(".a")]:
82                          os.remove(os.path.join(root, name))
83  
84      # Copies from Path.source to Path.dest, evaluating any variables
85 @@ -247,7 +253,7 @@ class Bundler:
86                  relative_dest = self.project.evaluate_path(Path.source[m.end():])
87                  dest = self.project.get_bundle_path("Contents/Resources", relative_dest)
88              else:
89 -                print "Invalid bundle file, missing or invalid 'dest' property: " + Path.dest
90 +                print("Invalid bundle file, missing or invalid 'dest' property: " + Path.dest)
91                  sys.exit(1)
92  
93          (dest_parent, dest_tail) = os.path.split(dest)
94 @@ -257,7 +263,7 @@ class Bundler:
95          p = re.compile("[\*\?]")
96          (source_parent, source_tail) = os.path.split(source)
97          if p.search(source_parent):
98 -            print "Can't have wildcards except in the last path component: " + source
99 +            print("Can't have wildcards except in the last path component: " + source)
100              sys.exit(1)
101  
102          if p.search(source_tail):
103 @@ -267,7 +273,7 @@ class Bundler:
104          else:
105              source_check = source
106          if not os.path.exists(source_check):
107 -            print "Cannot find source to copy: " + source
108 +            print("Cannot find source to copy: " + source)
109              sys.exit(1)
110  
111          # If the destination has a wildcard as last component (copied
112 @@ -285,13 +291,13 @@ class Bundler:
113                      try:
114  #                        print "Copying %s to %s" % (globbed_source, destdir)
115                          shutil.copy(globbed_source, destdir)
116 -                    except EnvironmentError, e:
117 +                    except EnvironmentError as e:
118                          if e.errno == errno.ENOENT:
119 -                            print "Warning, source file missing: " + globbed_source
120 +                            print("Warning, source file missing: " + globbed_source)
121                          elif e.errno == errno.EEXIST:
122 -                            print "Warning, path already exits: " + dest
123 +                            print("Warning, path already exits: " + dest)
124                          else:
125 -                            print "Error %s when copying file: %s" % ( str(e), globbed_source )
126 +                            print("Error %s when copying file: %s" % ( str(e), globbed_source ))
127                              sys.exit(1)
128  
129          else:
130 @@ -315,13 +321,13 @@ class Bundler:
131                                              link=None,
132                                              verbose=1,
133                                              dry_run=0)
134 -                except EnvironmentError, e:
135 +                except EnvironmentError as e:
136                      if e.errno == errno.ENOENT:
137 -                        print "Warning, source file missing: " + globbed_source
138 +                        print("Warning, source file missing: " + globbed_source)
139                      elif e.errno == errno.EEXIST:
140 -                        print "Warning, path already exits: " + dest
141 +                        print("Warning, path already exits: " + dest)
142                      else:
143 -                        print "Error %s when copying file: %s" %( str(e), globbed_source )
144 +                        print("Error %s when copying file: %s" %( str(e), globbed_source ))
145                          sys.exit(1)
146          return dest
147  
148 @@ -338,11 +344,11 @@ class Bundler:
149          for path in self.binary_paths:
150              if os.path.isdir(path):
151                  for root, dirs, files in os.walk(path):
152 -                    paths.extend(map(lambda l: os.path.join(root, l), files))
153 +                    paths.extend([os.path.join(root, l) for l in files])
154              else:
155                  paths.append(path)
156  
157 -        paths = filter(filter_path, paths)
158 +        paths = list(filter(filter_path, paths))
159          return list(set(paths))
160  
161      def resolve_library_dependencies(self):
162 @@ -366,11 +372,11 @@ class Bundler:
163  
164              def relative_path_map(line):
165                  if not os.path.isabs(line):
166 -                    for prefix in prefixes.values():
167 +                    for prefix in list(prefixes.values()):
168                          path = os.path.join(prefix, "lib", line)
169                          if os.path.exists(path):
170                              return path
171 -                    print "Cannot find a matching prefix for %s" % (line)
172 +                    print("Cannot find a matching prefix for %s" % (line))
173                  return line
174  
175              def prefix_filter(line):
176 @@ -378,24 +384,24 @@ class Bundler:
177                      return False
178  
179                  if line.startswith("/usr/X11"):
180 -                    print "Warning, found X11 library dependency, you most likely don't want that:", line.strip().split()[0]
181 +                    print("Warning, found X11 library dependency, you most likely don't want that:", line.strip().split()[0])
182  
183                  if os.path.isabs(line):
184 -                    for prefix in prefixes.values():
185 +                    for prefix in list(prefixes.values()):
186                          if prefix in line:
187                              return True
188                      
189                      if not line.startswith("/usr/lib") and not line.startswith("/System/Library"):
190 -                        print "Warning, library not available in any prefix:", line.strip().split()[0]
191 +                        print("Warning, library not available in any prefix:", line.strip().split()[0])
192  
193                      return False
194  
195                  return True
196  
197 -            lines = filter(prefix_filter, [line.strip() for line in f])
198 +            lines = list(filter(prefix_filter, [line.strip() for line in f]))
199              p = re.compile("(.*\.dylib\.?.*)\s\(compatibility.*$")
200              lines = utils.filterlines(p, lines)
201 -            lines = map(relative_path_map, lines)
202 +            lines = list(map(relative_path_map, lines))
203  #When you need to track down errors, uncomment this blocK
204  #            for path in paths:
205  #                cmd = "otool -L %s" % path
206 @@ -407,7 +413,7 @@ class Bundler:
207              for library in set(lines):
208                  # Replace the real path with the right prefix so we can
209                  # create a Path object.
210 -                for (key, value) in prefixes.items():
211 +                for (key, value) in list(prefixes.items()):
212                      if library.startswith(value):
213                          path = Path("${prefix:" + key + "}" + library[len(value):])
214                          new_libraries.append(path)
215 @@ -415,14 +421,14 @@ class Bundler:
216              n_paths = len(paths)
217              n_iterations += 1
218              if n_iterations > 10:
219 -                print "Too many tries to resolve library dependencies"
220 +                print("Too many tries to resolve library dependencies")
221                  sys.exit(1)
222              
223              self.copy_binaries(new_libraries)
224              paths = self.list_copied_binaries()
225  
226      def run_install_name_tool(self):
227 -        print "Running install name tool"
228 +        print("Running install name tool")
229  
230          paths = self.list_copied_binaries()
231          prefixes = self.meta.prefixes
232 @@ -430,12 +436,12 @@ class Bundler:
233          # First change all references in libraries.
234          for prefix in prefixes:
235              prefix_path = self.project.get_prefix(prefix)
236 -            print "Going through prefix: " + prefix_path
237 +            print("Going through prefix: " + prefix_path)
238              for path in paths:
239                  cmd = os.path.join(os.path.dirname(__file__), "run-install-name-tool-change.sh") + " " + path + " " + prefix_path + " Resources" + " change"
240                  f = os.popen(cmd)
241                  for line in f:
242 -                    print line
243 +                    print(line)
244  
245          # Then change the id of all libraries. Skipping this part for now
246          #for path in paths:
247 @@ -448,18 +454,18 @@ class Bundler:
248          for framework in self.frameworks:
249              fw_name, ext = os.path.splitext(os.path.basename(framework))
250              fwl = os.path.join(framework, fw_name)
251 -            print "Importing Framework: " + fwl
252 +            print("Importing Framework: " + fwl)
253  # Fix the framework IDs
254              cmd = os.path.join(os.path.dirname(__file__), "run-install-name-tool-change.sh") + " " + fwl + " " + fw_name + " Frameworks" + " id"
255              f = os.popen(cmd)
256              for line in f:
257 -                print line
258 +                print(line)
259  # Fix the dependencies in other libraries
260              for path in paths:
261                  cmd = os.path.join(os.path.dirname(__file__), "run-install-name-tool-change.sh") + " " + path + " " + fw_name + " Frameworks/" + fw_name + " change"
262                  f = os.popen(cmd)
263                  for line in f:
264 -                    print line
265 +                    print(line)
266  #fix the dependencies in frameworks
267              for ufw in self.frameworks:
268                  ufw_name, ext = os.path.splitext(os.path.basename(ufw))
269 @@ -469,20 +475,20 @@ class Bundler:
270                  cmd = os.path.join(os.path.dirname(__file__), "run-install-name-tool-change.sh") + " " + ufwl + " " + fw_name + " Frameworks/" + fw_name + " change"
271                  f = os.popen(cmd)
272                  for line in f:
273 -                    print line
274 +                    print(line)
275  
276  
277      def strip_debugging(self):
278          paths = self.list_copied_binaries()
279          for path in paths:
280              if path.endswith(".dylib") or path.endswith(".so"):
281 -                os.chmod(path, 0644)
282 +                os.chmod(path, 0o644)
283                  os.system("strip -x " + path + " 2>/dev/null")
284 -                os.chmod(path, 0444)
285 +                os.chmod(path, 0o444)
286              else:
287 -                os.chmod(path, 0755)
288 +                os.chmod(path, 0o755)
289                  os.system("strip -ur " + path + " 2>/dev/null")
290 -                os.chmod(path, 0555)
291 +                os.chmod(path, 0o555)
292  
293  #
294  # If you want to sign your application, set $APPLICATION_CERT with the
295 @@ -491,7 +497,7 @@ class Bundler:
296  # bundle's id string.
297  #
298      def sign_binaries(self):
299 -        if not os.environ.has_key("APPLICATION_CERT"):
300 +        if "APPLICATION_CERT" not in os.environ:
301              return
302          cert = os.getenv("APPLICATION_CERT")
303          paths = self.list_copied_binaries()
304 @@ -501,7 +507,7 @@ class Bundler:
305              result = os.spawnvp(os.P_WAIT, 'codesign', cmdargs)
306  
307              if result:
308 -                raise OSError, '"' + " ".join(cmdargs) + '" failed %d' % result
309 +                raise OSError('"' + " ".join(cmdargs) + '" failed %d' % result)
310  
311      def copy_icon_themes(self):
312          all_icons = set()
313 @@ -604,7 +610,7 @@ class Bundler:
314          final_path = self.project.evaluate_path(final_path)
315  
316          if not self.meta.overwrite and os.path.exists(final_path):
317 -            print "Bundle already exists: " + final_path
318 +            print("Bundle already exists: " + final_path)
319              sys.exit(1)
320  
321          self.create_skeleton()
322 @@ -618,7 +624,7 @@ class Bundler:
323          path = self.project.get_main_binary()
324          source = self.project.evaluate_path(path.source)
325          if not os.path.exists(source):
326 -            print "Cannot find main binary: " + source
327 +            print("Cannot find main binary: " + source)
328              sys.exit(1)
329  
330          dest = self.copy_path(path)
331 @@ -658,24 +664,24 @@ class Bundler:
332          launcher_script = self.project.get_launcher_script()
333          if launcher_script:
334              path = self.copy_path(launcher_script)
335 -            if os.environ.has_key("APPLICATION_CERT"):
336 +            if "APPLICATION_CERT" in os.environ:
337                  cert = os.environ["APPLICATION_CERT"]
338                  ident = self.project.get_bundle_id()
339                  cmdargs = ['codesign', '-s', cert, '-i', ident, "-f", path]
340                  result = os.spawnvp(os.P_WAIT, 'codesign', cmdargs)
341                  if result:
342 -                    raise OSError, '"'+ " ".join(cmdargs) + '" failed %d' % result
343 +                    raise OSError('"'+ " ".join(cmdargs) + '" failed %d' % result)
344          if self.meta.overwrite:
345              self.recursive_rm(final_path)
346          shutil.move(self.project.get_bundle_path(), final_path)
347  
348  if __name__ == '__main__':
349      if len(sys.argv) != 2:
350 -        print "Usage: %s <bundle descriptopn file>" % (sys.argv[0])
351 +        print("Usage: %s <bundle descriptopn file>" % (sys.argv[0]))
352          sys.exit(2)
353  
354      if not os.path.exists(sys.argv[1]):
355 -        print "File %s does not exist" % (sys.argv[1])
356 +        print("File %s does not exist" % (sys.argv[1]))
357          sys.exit(2)
358  
359      project = Project(sys.argv[1])
360 diff --git bundler/main.py bundler/main.py
361 index bcd7dda..b9b2fc5 100644
362 --- bundler/main.py
363 +++ bundler/main.py
364 @@ -1,18 +1,20 @@
365  import sys, os
366  
367 -from project import *
368 -from bundler import *
369 +from .project import *
370 +from .bundler import *
371  
372  def main(argv):
373      if len(argv) != 1:
374 -        print "Usage: %s <bundle descriptopn file>" % (sys.argv[0])
375 +        print("Usage: %s <bundle descriptopn file>" % (sys.argv[0]))
376          sys.exit(2)
377  
378      if not os.path.exists(argv[0]):
379 -        print "File %s does not exist" % (argv[0])
380 +        print("File %s does not exist" % (argv[0]))
381          sys.exit(2)
382  
383      project = Project(argv[0])
384      bundler = Bundler(project)
385 -
386 -    bundler.run()
387 +    try:
388 +        bundler.run()
389 +    except Exception as err:
390 +        print("Bundler encountered an error %s" % str(err))
391 diff --git bundler/project.py bundler/project.py
392 index c98b65a..60f0541 100644
393 --- bundler/project.py
394 +++ bundler/project.py
395 @@ -5,7 +5,7 @@ import os
396  import xml.dom.minidom
397  from xml.dom.minidom import Node
398  from plistlib import Plist
399 -import utils
400 +from . import utils
401  
402  # Base class for anything that can be copied into a bundle with a
403  # source and dest.
404 @@ -184,7 +184,7 @@ class Data(Path):
405      pass
406  
407  class IconTheme:
408 -    ICONS_NONE, ICONS_ALL, ICONS_AUTO = range(3)
409 +    ICONS_NONE, ICONS_ALL, ICONS_AUTO = list(range(3))
410      
411      def __init__(self, name, icons=ICONS_AUTO):
412          self.name = name
413 @@ -221,7 +221,7 @@ class Project:
414                  # Get the first app-bundle tag and ignore any others.
415                  self.root = utils.node_get_element_by_tag_name(doc, "app-bundle")
416              except:
417 -                print "Could not load project %s:" % (project_path)
418 +                print("Could not load project %s:" % (project_path))
419                  raise
420  
421          # The directory the project file is in (as opposed to
422 @@ -232,14 +232,14 @@ class Project:
423          plist_path = self.get_plist_path()
424          try:
425              plist = Plist.fromFile(plist_path)
426 -        except EnvironmentError, e:
427 +        except EnvironmentError as e:
428              if e.errno == errno.ENOENT:
429 -                print "Info.plist file not found: " + plist_path
430 +                print("Info.plist file not found: " + plist_path)
431                  sys.exit(1)
432              else:
433                  raise
434          self.name = plist.CFBundleExecutable
435 -        if plist.has_key("CFBundleName"):
436 +        if "CFBundleName" in plist:
437              self.bundle_name = plist.CFBundleName
438          else:
439              self.bundle_name = plist.CFBundleExecutable
440 @@ -340,7 +340,7 @@ class Project:
441              themes.append(IconTheme.from_node(node))
442  
443          # The hicolor theme is mandatory.
444 -        if not filter(lambda l: l.name == "hicolor", themes):
445 +        if not [l for l in themes if l.name == "hicolor"]:
446              themes.append(IconTheme("hicolor"))
447  
448          return themes
449 @@ -412,33 +412,33 @@ class Project:
450  if __name__ == '__main__':
451      project = Project(os.path.join(os.getcwd(), 'giggle.bundle'))
452  
453 -    print "General:"
454 -    print "  Project path: %s" % (project.get_project_path())
455 -    print "  Plist path: %s" % (project.get_plist_path())
456 -    print "  App name: %s" % (project.name)
457 -    print "  Destination: %s" % (project.get_meta().dest)
458 -    print "  Overwrite: %s" % (str(project.get_meta().overwrite))
459 +    print("General:")
460 +    print("  Project path: %s" % (project.get_project_path()))
461 +    print("  Plist path: %s" % (project.get_plist_path()))
462 +    print("  App name: %s" % (project.name))
463 +    print("  Destination: %s" % (project.get_meta().dest))
464 +    print("  Overwrite: %s" % (str(project.get_meta().overwrite)))
465  
466      environment = project.get_environment()
467 -    print "Environment:"
468 +    print("Environment:")
469      for variable in environment.runtime_variables:
470 -        print "  %s=%s" % (variable.name, variable.value)
471 +        print("  %s=%s" % (variable.name, variable.value))
472      for script in environment.scripts:
473 -        print "  %s => %s" % (script.source, script.dest)
474 +        print("  %s => %s" % (script.source, script.dest))
475  
476 -    print "Frameworks:"
477 +    print("Frameworks:")
478      for framework in project.get_frameworks():
479 -        print " ", framework
480 +        print(" ", framework)
481  
482 -    print "Main binary:"
483 +    print("Main binary:")
484      binary = project.get_main_binary()
485 -    print "  %s => %s" % (binary.source, binary.dest)
486 +    print("  %s => %s" % (binary.source, binary.dest))
487  
488 -    print "Launcher:"
489 +    print("Launcher:")
490      launcher_script = project.get_launcher_script()
491 -    print "  %s => %s" % (launcher_script.source, launcher_script.dest)
492 +    print("  %s => %s" % (launcher_script.source, launcher_script.dest))
493  
494 -    print "Binaries:"
495 +    print("Binaries:")
496      for binary in project.get_binaries():
497 -        print "  %s => %s" % (binary.source, binary.dest)
498 +        print("  %s => %s" % (binary.source, binary.dest))
499  
500 diff --git bundler/project_test.py bundler/project_test.py
501 index 4c3d583..0ff9179 100644
502 --- bundler/project_test.py
503 +++ bundler/project_test.py
504 @@ -5,8 +5,8 @@ import unittest
505  import xml.dom.minidom
506  from xml.dom.minidom import Node
507  from plistlib import Plist
508 -from project import Project
509 -import utils
510 +from .project import Project
511 +from . import utils
512  
513  class Mock_Project(Project):
514  
515 @@ -20,9 +20,9 @@ class Mock_Project(Project):
516          try:
517              plist_path = os.path.join(self.project_dir, "test.plist")
518              plist = Plist.fromFile(plist_path)
519 -        except EnvironmentError, e:
520 +        except EnvironmentError as e:
521              if e.errno == errno.ENOENT:
522 -                print "Info.plist file not found: " + plist_path
523 +                print("Info.plist file not found: " + plist_path)
524                  sys.exit(1)
525              else:
526                  raise
527 diff --git bundler/runtest.py bundler/runtest.py
528 index 309643a..2450f2d 100755
529 --- bundler/runtest.py
530 +++ bundler/runtest.py
531 @@ -1,7 +1,7 @@
532  #!/usr/bin/python
533  import unittest
534  import os
535 -from project_test import Project_Test
536 +from .project_test import Project_Test
537  
538  def setProjects( goodpath, badpath):
539      if not os.path.isabs(goodpath):
540 diff --git bundler/utils.py bundler/utils.py
541 index 78d4c47..76c83d1 100644
542 --- bundler/utils.py
543 +++ bundler/utils.py
544 @@ -15,6 +15,21 @@ def evaluate_environment_variables(string):
545  
546      return string
547  
548 +def has_pkgconfig_module(module):
549 +    """Returns True if the pkg-config module exists"""
550 +    f = os.popen("pkg-config --exists " + module)
551 +    f.read().strip()
552 +    return f.close() is None
553 +
554 +def has_pkgconfig_variable(module, key):
555 +    """Returns True if the pkg-config variable exists for the given
556 +    module
557 +    """
558 +    f = os.popen("pkg-config --variable=" + key + " " + module)
559 +    status = bool(f.read().strip())
560 +    f.close()
561 +    return status
562 +
563  def evaluate_pkgconfig_variables(string):
564      p = re.compile("\${pkg:(.*?):(.*?)}")
565      m = p.search(string)
566 @@ -24,6 +39,17 @@ def evaluate_pkgconfig_variables(string):
567          f = os.popen("pkg-config --variable=" + key + " " + module)
568          value = f.read().strip()
569          if not value:
570 +            # pango 1.38 removed modules, try to give a helpful
571 +            # message in case something tries to reference the no
572 +            # longer existing variable (most likely from old bundle
573 +            # xml files) when using a newer pango build.
574 +            if module == "pango" and key == "pango_module_version":
575 +                if has_pkgconfig_module("pango"):
576 +                    raise Exception(
577 +                        "'%s' got removed in '%s' "
578 +                        "1.38. Remove any reference to pango "
579 +                        "modules in your bundle xml." % (
580 +                            key, module))
581              raise Exception("pkg-config variable '%s %s' is undefined" % (key, module))
582          string = p.sub(value, string, 1)
583          m = p.search(string)
584 @@ -33,7 +59,7 @@ def evaluate_pkgconfig_variables(string):
585  def makedirs(path):
586      try:
587          os.makedirs(path)
588 -    except EnvironmentError, e:
589 +    except EnvironmentError as e:
590          if e.errno != errno.EEXIST:
591              raise
592  
593 diff --git examples/gtk-demo.bundle examples/gtk-demo.bundle
594 index 4b32d6b..422126e 100644
595 --- examples/gtk-demo.bundle
596 +++ examples/gtk-demo.bundle
597 @@ -79,9 +79,11 @@
598      ${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so
599    </binary>
600  
601 +<!-- No longer needed for pango >= 1.38
602     <binary>
603      ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
604    </binary>
605 +-->
606  
607    <data>
608      ${prefix}/etc/pango/
609 diff --git examples/gtk3-demo.bundle examples/gtk3-demo.bundle
610 index ba15cd3..ec0eb4c 100644
611 --- examples/gtk3-demo.bundle
612 +++ examples/gtk3-demo.bundle
613 @@ -69,13 +69,11 @@
614      ${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so
615    </binary>
616  
617 +<!-- No longer needed for pango >= 1.38
618    <binary>
619      ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
620    </binary>
621 -
622 -  <data>
623 -    ${prefix}/etc/pango/
624 -  </data>
625 +-->
626  
627    <!-- Translation filenames, one for each program or library that you
628         want to copy in to the bundle. The "dest" attribute is
629 @@ -102,6 +100,10 @@
630      ${prefix}/share/themes
631    </data>
632  
633 +  <data>
634 +    ${prefix}/share/icons
635 +  </data>
636 +
637    <!-- Copy icons. Note that the .icns file is an Apple format which
638         contains up to 4 sizes of icon. You can use
639         /Developer/Applications/Utilities/Icon Composer.app to import
640 @@ -110,25 +112,4 @@
641      ${project}/Giggle.icns
642    </data -->
643  
644 -  <!-- This is where theme commands go. You can copy them in from your
645 -       theme of choice if they provide and example, or you can just
646 -       change the source path. -->
647 -
648 -  <data dest="${bundle}/Contents/Resources/etc/${gtk}/gtkrc">
649 -    ${project}/gtkrc
650 -  </data>
651 -
652 -  <!-- Icon themes to copy. The "icons" property can be either of
653 -       "auto", "all", or "none". All or none should be
654 -       self-explanatory, while auto means that the script will try to
655 -       figure out which icons are needed. This is done by getting all
656 -       the strings from all copied binaries, and matching them against
657 -       icon names. To be safe, you should use "all". "none" is useful
658 -       if you want just the index.theme file but no icons, mostly
659 -       needed for the "hicolor" base theme.
660 -  >
661 -  <icon-theme icons="auto">
662 -    Tango
663 -  </icon-theme -->
664 -
665 -</app-bundle>
666 +  </app-bundle>
667 diff --git examples/gtk3-launcher.sh examples/gtk3-launcher.sh
668 index 4aed833..9137ccb 100755
669 --- examples/gtk3-launcher.sh
670 +++ examples/gtk3-launcher.sh
671 @@ -29,11 +29,15 @@ export GTK_DATA_PREFIX="$bundle_res"
672  export GTK_EXE_PREFIX="$bundle_res"
673  export GTK_PATH="$bundle_res"
674  
675 -export GTK2_RC_FILES="$bundle_etc/gtk-3.0/gtkrc"
676 -export GTK_IM_MODULE_FILE="$bundle_etc/gtk-3.0/gtk.immodules"
677 -export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-3.0/gdk-pixbuf.loaders"
678 -export PANGO_LIBDIR="$bundle_lib"
679 +# PANGO_* is no longer needed for pango >= 1.38
680 +export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
681  export PANGO_SYSCONFDIR="$bundle_etc"
682 +export PANGO_LIBDIR="$bundle_lib"
683 +
684 +export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
685 +if [ `uname -r | cut -d . -f 1` -ge 10 ]; then
686 +    export GTK_IM_MODULE_FILE="$bundle_etc/gtk-3.0/gtk.immodules"
687 +fi
688  
689  
690  APP=name
691 diff --git examples/launcher.sh examples/launcher.sh
692 index a1dfd1b..11cd019 100755
693 --- examples/launcher.sh
694 +++ examples/launcher.sh
695 @@ -31,7 +31,11 @@ export GTK_PATH="$bundle_res"
696  
697  export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
698  export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
699 -export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
700 +#N.B. When gdk-pixbuf was separated from Gtk+ the location of the
701 +#loaders cache changed as well. Depending on the version of Gtk+ that
702 +#you built with you may still need to use the old location:
703 +#export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
704 +export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
705  export PANGO_LIBDIR="$bundle_lib"
706  export PANGO_SYSCONFDIR="$bundle_etc"
707