Fix discovery of gdk-pixbuf-loaders
gdk-pixbuf-loaders location has changed with recent builds of gtk, which breaks the build of binary client distributions. This changeset discovers their proper location by parsing output of gdk-pixbuf-query-loaders. issue1976 review176001
This commit is contained in:
1 parent
d27b023989
commit
07b705ffcb
1 file changed
+12
-6
@@ -6,6 +6,7 @@ from setuptools import setup, find_packages
|
||||
import os
|
||||
import glob
|
||||
import sys
|
||||
import re
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
@@ -269,7 +270,7 @@ elif os.name == 'mac' \
|
||||
'gtk+-2.0'], stdout=PIPE).stdout.read().strip()
|
||||
|
||||
dist_dir = dist.command_obj['py2app'].dist_dir
|
||||
resources_dir = os.path.join(dist_dir, 'tryton.app', 'Contents', 'Resources')
|
||||
resources_dir = os.path.join(dist_dir, 'Tryton.app', 'Contents', 'Resources')
|
||||
gtk_2_dist_dir = os.path.join(resources_dir, 'lib', 'gtk-2.0')
|
||||
pango_dist_dir = os.path.join(resources_dir, 'lib', 'pango')
|
||||
|
||||
@@ -288,10 +289,6 @@ elif os.name == 'mac' \
|
||||
pangorc.write('[Pango]\n')
|
||||
pangorc.write('ModuleFiles=./pango.modules\n')
|
||||
|
||||
if os.path.isdir(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'loaders')):
|
||||
shutil.rmtree(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'loaders'))
|
||||
shutil.copytree(os.path.join(gtk_dir, 'lib', 'gtk-2.0', gtk_binary_version,
|
||||
'loaders'), os.path.join(gtk_2_dist_dir, gtk_binary_version, 'loaders'))
|
||||
if not os.path.isdir(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'engines')):
|
||||
os.makedirs(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'engines'))
|
||||
shutil.copyfile(os.path.join(gtk_dir, 'lib', 'gtk-2.0', gtk_binary_version,
|
||||
@@ -300,6 +297,15 @@ elif os.name == 'mac' \
|
||||
|
||||
query_loaders = Popen(os.path.join(gtk_dir,'bin','gdk-pixbuf-query-loaders'),
|
||||
stdout=PIPE).stdout.read()
|
||||
loader_dir, = re.findall('# LoaderDir = (.*)', query_loaders)
|
||||
loader_pkg = (loader_dir.replace(os.path.join(gtk_dir,'lib'), '').
|
||||
split(os.path.sep)[-3])
|
||||
loader_dist_dir = os.path.join(resources_dir, 'lib', loader_pkg,
|
||||
gtk_binary_version, 'loaders')
|
||||
if os.path.isdir(loader_dist_dir):
|
||||
shutil.rmtree(loader_dist_dir)
|
||||
if os.path.isdir(loader_dir):
|
||||
shutil.copytree(loader_dir, loader_dist_dir)
|
||||
query_loaders = query_loaders.replace(gtk_dir, '@executable_path/../Resources')
|
||||
|
||||
loaders_path = os.path.join(resources_dir, 'gdk-pixbuf.loaders')
|
||||
@@ -330,7 +336,7 @@ elif os.name == 'mac' \
|
||||
|
||||
# fix pathes within shared libraries
|
||||
for library in chain(
|
||||
iglob(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'loaders', '*.so')),
|
||||
iglob(os.path.join(loader_dist_dir, '*.so')),
|
||||
iglob(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'engines', '*.so')),
|
||||
iglob(os.path.join(gtk_2_dist_dir, gtk_binary_version, 'immodules', '*.so')),
|
||||
iglob(os.path.join(pango_dist_dir,'*','modules','*.so'))):
|
||||
|
||||
Reference in new issue
Block a user