Do not add IM to the calibre builds

This commit is contained in:
Kovid Goyal 2016-05-10 15:51:20 +05:30
parent 828b684a2c
commit cc42267ba8
6 changed files with 2 additions and 79 deletions

View File

@ -76,8 +76,7 @@ def binary_includes():
'podofo.so.0.9.3', 'z.so.1', 'bz2.so.1.0', 'poppler.so.56', 'podofo.so.0.9.3', 'z.so.1', 'bz2.so.1.0', 'poppler.so.56',
'iconv.so.2', 'xml2.so.2', 'xslt.so.1', 'jpeg.so.8', 'png16.so.16', 'webp.so.5', 'iconv.so.2', 'xml2.so.2', 'xslt.so.1', 'jpeg.so.8', 'png16.so.16', 'webp.so.5',
'exslt.so.0', 'imobiledevice.so.5', 'usbmuxd.so.4', 'plist.so.3', 'exslt.so.0', 'imobiledevice.so.5', 'usbmuxd.so.4', 'plist.so.3',
'MagickCore-6.Q16.so.2', 'MagickWand-6.Q16.so.2', 'ssl.so.1.0.0', 'ssl.so.1.0.0', 'crypto.so.1.0.0', 'readline.so.6', 'chm.so.0', 'icudata.so.53',
'crypto.so.1.0.0', 'readline.so.6', 'chm.so.0', 'icudata.so.53',
'icui18n.so.53', 'icuuc.so.53', 'icuio.so.53', 'python%s.so.1.0' % py_ver, 'icui18n.so.53', 'icuuc.so.53', 'icuio.so.53', 'python%s.so.1.0' % py_ver,
'gcrypt.so.20', 'gpg-error.so.0', 'gobject-2.0.so.0', 'glib-2.0.so.0', 'gcrypt.so.20', 'gpg-error.so.0', 'gobject-2.0.so.0', 'glib-2.0.so.0',
'gthread-2.0.so.0', 'gmodule-2.0.so.0', 'gio-2.0.so.0', 'dbus-glib-1.so.2', 'gthread-2.0.so.0', 'gmodule-2.0.so.0', 'gio-2.0.so.0', 'dbus-glib-1.so.2',
@ -198,11 +197,6 @@ class LinuxFreeze(Command):
for x in QT_PLUGINS: for x in QT_PLUGINS:
shutil.copytree(self.j(base, x), self.j(dest, x)) shutil.copytree(self.j(base, x), self.j(dest, x))
im = glob.glob(SW + '/lib/ImageMagick-*')[-1]
self.magick_base = os.path.basename(im)
dest = self.j(self.lib_dir, self.magick_base)
shutil.copytree(im, dest, ignore=shutil.ignore_patterns('*.a'))
def copy_python(self): def copy_python(self):
self.info('Copying python...') self.info('Copying python...')
@ -328,7 +322,7 @@ class LinuxFreeze(Command):
functions['console'].append('main') functions['console'].append('main')
c_launcher = '/tmp/calibre-c-launcher' c_launcher = '/tmp/calibre-c-launcher'
lsrc = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'launcher.c') lsrc = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'launcher.c')
cmd = ['gcc', '-O2', '-DMAGICK_BASE="%s"' % self.magick_base, '-o', c_launcher, lsrc, ] cmd = ['gcc', '-O2', '-o', c_launcher, lsrc, ]
self.info('Compiling launcher') self.info('Compiling launcher')
self.run_builder(cmd, verbose=False) self.run_builder(cmd, verbose=False)

View File

@ -36,11 +36,6 @@ int main(int argc, char **argv) {
else snprintf(buf, PATHLEN, "%s/qt_plugins:%s", lib, ldp); else snprintf(buf, PATHLEN, "%s/qt_plugins:%s", lib, ldp);
SET("QT_PLUGIN_PATH", buf); SET("QT_PLUGIN_PATH", buf);
memset(buf, 0, PATHLEN); snprintf(buf, PATHLEN, "%s/%s/modules-Q16/coders", lib, MAGICK_BASE);
SET("MAGICK_CODER_MODULE_PATH", buf)
memset(buf, 0, PATHLEN); snprintf(buf, PATHLEN, "%s/%s/modules-Q16/filters", lib, MAGICK_BASE);
SET("MAGICK_CODER_FILTER_PATH", buf)
memset(buf, 0, PATHLEN); memset(buf, 0, PATHLEN);
ldp = getenv("LD_LIBRARY_PATH"); ldp = getenv("LD_LIBRARY_PATH");
if (ldp == NULL) strncpy(buf, lib, PATHLEN); if (ldp == NULL) strncpy(buf, lib, PATHLEN);

View File

@ -21,13 +21,9 @@ from setup.build_environment import sw as SW, QT_FRAMEWORKS, QT_PLUGINS, PYQT_MO
from setup.installer.osx.app.sign import current_dir, sign_app from setup.installer.osx.app.sign import current_dir, sign_app
LICENSE = open('LICENSE', 'rb').read() LICENSE = open('LICENSE', 'rb').read()
MAGICK_HOME='@executable_path/../Frameworks/ImageMagick'
ENV = dict( ENV = dict(
FONTCONFIG_PATH='@executable_path/../Resources/fonts', FONTCONFIG_PATH='@executable_path/../Resources/fonts',
FONTCONFIG_FILE='@executable_path/../Resources/fonts/fonts.conf', FONTCONFIG_FILE='@executable_path/../Resources/fonts/fonts.conf',
MAGICK_CONFIGURE_PATH=MAGICK_HOME+'/config-Q16',
MAGICK_CODER_MODULE_PATH=MAGICK_HOME+'/modules-Q16/coders',
MAGICK_CODER_FILTER_PATH=MAGICK_HOME+'/modules-Q16/filters',
QT_PLUGIN_PATH='@executable_path/../MacOS/qt-plugins', QT_PLUGIN_PATH='@executable_path/../MacOS/qt-plugins',
PYTHONIOENCODING='UTF-8', PYTHONIOENCODING='UTF-8',
SSL_CERT_FILE='@executable_path/../Resources/resources/mozilla-ca-certs.pem', SSL_CERT_FILE='@executable_path/../Resources/resources/mozilla-ca-certs.pem',
@ -199,7 +195,6 @@ class Py2App(object):
self.add_poppler() self.add_poppler()
self.add_imaging_libs() self.add_imaging_libs()
self.add_fontconfig() self.add_fontconfig()
self.add_imagemagick()
self.add_misc_libraries() self.add_misc_libraries()
self.add_resources() self.add_resources()
@ -454,22 +449,6 @@ class Py2App(object):
''') ''')
open(fc, 'wb').write(raw) open(fc, 'wb').write(raw)
@flush
def add_imagemagick(self):
info('\nAdding ImageMagick')
for x in ('Wand-6', 'Core-6'):
self.install_dylib(os.path.join(SW, 'lib', 'libMagick%s.Q16.2.dylib'%x))
idir = glob.glob(os.path.join(SW, 'lib', 'ImageMagick-*'))[-1]
dest = os.path.join(self.frameworks_dir, 'ImageMagick')
if os.path.exists(dest):
shutil.rmtree(dest)
shutil.copytree(idir, dest, True)
for x in os.walk(dest):
for f in x[-1]:
if f.endswith('.so'):
f = join(x[0], f)
self.fix_dependencies_in_lib(f)
@flush @flush
def add_misc_libraries(self): def add_misc_libraries(self):
for x in ( for x in (

View File

@ -17,7 +17,6 @@ from setup.installer.windows.wix import WixMixIn
OPENSSL_DIR = os.environ.get('OPENSSL_DIR', os.path.join(SW, 'private', 'openssl')) OPENSSL_DIR = os.environ.get('OPENSSL_DIR', os.path.join(SW, 'private', 'openssl'))
SW = r'C:\cygwin64\home\kovid\sw' SW = r'C:\cygwin64\home\kovid\sw'
IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-*\\VisualMagick\\bin')
CRT = r'C:\Microsoft.VC90.CRT' CRT = r'C:\Microsoft.VC90.CRT'
LZMA = os.path.join(SW, *('private/easylzma/build/easylzma-0.0.8'.split('/'))) LZMA = os.path.join(SW, *('private/easylzma/build/easylzma-0.0.8'.split('/')))
QT_DIR = subprocess.check_output([QMAKE, '-query', 'QT_INSTALL_PREFIX']).decode('utf-8').strip() QT_DIR = subprocess.check_output([QMAKE, '-query', 'QT_INSTALL_PREFIX']).decode('utf-8').strip()
@ -338,18 +337,6 @@ class Win32Freeze(Command, WixMixIn):
if os.path.exists(msrc): if os.path.exists(msrc):
shutil.copy2(msrc, self.dll_dir) shutil.copy2(msrc, self.dll_dir)
# Copy ImageMagick
impath = glob.glob(IMAGEMAGICK)[-1]
for pat in ('*.dll', '*.xml'):
for f in glob.glob(self.j(impath, pat)):
ok = True
for ex in ('magick++', 'x11.dll', 'xext.dll'):
if ex in f.lower():
ok = False
if not ok:
continue
shutil.copy2(f, self.dll_dir)
def embed_manifests(self): def embed_manifests(self):
self.info('Embedding remaining manifests...') self.info('Embedding remaining manifests...')
for x in os.walk(self.base): for x in os.walk(self.base):
@ -685,10 +672,6 @@ class Win32Freeze(Command, WixMixIn):
# from files # from files
'unrar.pyd', 'wpd.pyd', 'podofo.pyd', 'imageops.pyd', 'unrar.pyd', 'wpd.pyd', 'podofo.pyd', 'imageops.pyd',
'progress_indicator.pyd', 'hunspell.pyd', 'progress_indicator.pyd', 'hunspell.pyd',
# As per this https://bugs.launchpad.net/bugs/1087816
# on some systems magick.pyd fails to load from memory
# on 64 bit
'magick.pyd',
# dupypy crashes when loaded from the zip file # dupypy crashes when loaded from the zip file
'dukpy.pyd', 'dukpy.pyd',
}: }:

View File

@ -405,30 +405,6 @@ Run::
cp -r src/* ~/sw/include/podofo/ cp -r src/* ~/sw/include/podofo/
ImageMagick
--------------
Get the source from: http://www.imagemagick.org/download/windows/ImageMagick-windows.zip
Unzip it and then run::
chmod +x `find . -name '*.exe'`
Edit VisualMagick/configure/configure.cpp to set
int projectType = MULTITHREADEDDLL;
Open configure.sln and build it to create configure.exe
Run configure.exe set 32/64 bit disable X11 and OpenMP and click the Edit
magick-baseconfig.h button
Undefine ProvideDllMain
Now open VisualMagick/VisualDynamicMT.sln set to Release
Remove the UTIL_IMdisplay and CORE_Magick++ projects.
F7 for build solution.
netifaces netifaces
------------ ------------

View File

@ -223,10 +223,6 @@ void load_python_dll() {
_snprintf_s(qt_plugin_dir, l, _TRUNCATE, "%sqt_plugins", app_dir); _snprintf_s(qt_plugin_dir, l, _TRUNCATE, "%sqt_plugins", app_dir);
free(app_dir); free(app_dir);
_putenv_s("MAGICK_HOME", dll_dir);
_putenv_s("MAGICK_CONFIGURE_PATH", dll_dir);
_putenv_s("MAGICK_CODER_MODULE_PATH", dll_dir);
_putenv_s("MAGICK_FILTER_MODULE_PATH", dll_dir);
_putenv_s("QT_PLUGIN_PATH", qt_plugin_dir); _putenv_s("QT_PLUGIN_PATH", qt_plugin_dir);
if (!SetDllDirectoryA(dll_dir)) ExitProcess(show_last_error(L"Failed to set DLL directory.")); if (!SetDllDirectoryA(dll_dir)) ExitProcess(show_last_error(L"Failed to set DLL directory."));