mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Add WMF support to OS X build
This commit is contained in:
parent
238c82efa6
commit
3a43ab6992
@ -10,6 +10,8 @@ import sys, os, shutil, plistlib, subprocess, glob, zipfile, tempfile, \
|
||||
py_compile, stat, operator
|
||||
abspath, join, basename = os.path.abspath, os.path.join, os.path.basename
|
||||
|
||||
#TODO: WMF support in ImageMagick
|
||||
|
||||
l = {}
|
||||
exec open('setup.py').read() in l
|
||||
VERSION = l['VERSION']
|
||||
|
@ -188,6 +188,31 @@ os.execv(python, args)
|
||||
self.fix_python_dependencies(deps)
|
||||
self.fix_misc_dependencies(deps)
|
||||
|
||||
def fix_image_magick_deps(self, root):
|
||||
modules = []
|
||||
frameworks_dir = os.path.dirname(root)
|
||||
for x in os.walk(root):
|
||||
for f in x[-1]:
|
||||
if f.endswith('.so'):
|
||||
modules.append(os.path.join(x[0], f))
|
||||
deps = {}
|
||||
for x in ('Core.1', 'Wand.1'):
|
||||
modules.append(os.path.join(root, 'lib', 'libMagick%s.dylib'%x))
|
||||
x = modules[-1]
|
||||
deps[os.path.join('/Users/kovid/ImageMagick/lib',
|
||||
os.path.basename(x))] = '@executable_path/../Frameworks/ImageMagick/lib/'+os.path.basename(x)
|
||||
subprocess.check_call(['install_name_tool', '-id',
|
||||
'@executable_path/../Frameworks/ImageMagick/lib/'+os.path.basename(x),
|
||||
x])
|
||||
for x in ('/usr/local/lib/libfreetype.6.dylib',
|
||||
'/Volumes/sw/lib/libwmflite-0.2.7.dylib'):
|
||||
deps[x] = '@executable_path/../Frameworks/'+ os.path.basename(x)
|
||||
|
||||
for x in modules:
|
||||
print 'Fixing deps in', x
|
||||
for f, t in deps.items():
|
||||
subprocess.check_call(['install_name_tool', '-change', f, t, x])
|
||||
|
||||
|
||||
def run(self):
|
||||
py2app.run(self)
|
||||
@ -252,11 +277,17 @@ os.execv(python, args)
|
||||
|
||||
|
||||
info('Adding ImageMagick')
|
||||
libwmf = '/Volumes/sw/lib/libwmflite-0.2.7.dylib'
|
||||
dest = os.path.join(frameworks_dir, os.path.basename(libwmf))
|
||||
shutil.copy2(libwmf, frameworks_dir)
|
||||
nid = '@executable_path/../Frameworks/'+os.path.basename(dest)
|
||||
subprocess.check_call(['install_name_tool', '-id', nid, dest])
|
||||
dest = os.path.join(frameworks_dir, 'ImageMagick')
|
||||
if os.path.exists(dest):
|
||||
shutil.rmtree(dest)
|
||||
shutil.copytree(os.path.expanduser('~/ImageMagick'), dest, True)
|
||||
shutil.copyfile('/usr/local/lib/libpng12.0.dylib', os.path.join(dest, 'lib', 'libpng12.0.dylib'))
|
||||
self.fix_image_magick_deps(dest)
|
||||
|
||||
|
||||
info('Installing prescipt')
|
||||
|
@ -21,6 +21,7 @@ DEPENDENCIES = [
|
||||
('dnspython', '1.6.0', 'dnspython', 'dnspython', 'dnspython', 'dnspython'),
|
||||
('poppler-qt4', '0.10.6', 'poppler-qt4', 'poppler-qt4', 'poppler-qt4', 'poppler-qt4'),
|
||||
('podofo', '0.7', 'podofo', 'podofo', 'podofo', 'podofo'),
|
||||
('libwmf', '0.2.8', 'libwmf', 'libwmf', 'libwmf', 'libwmf'),
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user