From cc42267ba8f2c00231d5e76389623e13f73fa847 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 May 2016 15:51:20 +0530 Subject: [PATCH] Do not add IM to the calibre builds --- setup/installer/linux/freeze2.py | 10 ++-------- setup/installer/linux/launcher.c | 5 ----- setup/installer/osx/app/main.py | 21 --------------------- setup/installer/windows/freeze.py | 17 ----------------- setup/installer/windows/notes.rst | 24 ------------------------ setup/installer/windows/util.c | 4 ---- 6 files changed, 2 insertions(+), 79 deletions(-) diff --git a/setup/installer/linux/freeze2.py b/setup/installer/linux/freeze2.py index e6067afdbc..bb71e9053e 100644 --- a/setup/installer/linux/freeze2.py +++ b/setup/installer/linux/freeze2.py @@ -76,8 +76,7 @@ def binary_includes(): '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', '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', - 'crypto.so.1.0.0', 'readline.so.6', 'chm.so.0', 'icudata.so.53', + 'ssl.so.1.0.0', '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, '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', @@ -198,11 +197,6 @@ class LinuxFreeze(Command): for x in QT_PLUGINS: 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): self.info('Copying python...') @@ -328,7 +322,7 @@ class LinuxFreeze(Command): functions['console'].append('main') c_launcher = '/tmp/calibre-c-launcher' 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.run_builder(cmd, verbose=False) diff --git a/setup/installer/linux/launcher.c b/setup/installer/linux/launcher.c index 7ff0b14763..fdcfa67543 100644 --- a/setup/installer/linux/launcher.c +++ b/setup/installer/linux/launcher.c @@ -36,11 +36,6 @@ int main(int argc, char **argv) { else snprintf(buf, PATHLEN, "%s/qt_plugins:%s", lib, ldp); 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); ldp = getenv("LD_LIBRARY_PATH"); if (ldp == NULL) strncpy(buf, lib, PATHLEN); diff --git a/setup/installer/osx/app/main.py b/setup/installer/osx/app/main.py index 7c79636c9b..101ffe0efd 100644 --- a/setup/installer/osx/app/main.py +++ b/setup/installer/osx/app/main.py @@ -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 LICENSE = open('LICENSE', 'rb').read() -MAGICK_HOME='@executable_path/../Frameworks/ImageMagick' ENV = dict( FONTCONFIG_PATH='@executable_path/../Resources/fonts', 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', PYTHONIOENCODING='UTF-8', SSL_CERT_FILE='@executable_path/../Resources/resources/mozilla-ca-certs.pem', @@ -199,7 +195,6 @@ class Py2App(object): self.add_poppler() self.add_imaging_libs() self.add_fontconfig() - self.add_imagemagick() self.add_misc_libraries() self.add_resources() @@ -454,22 +449,6 @@ class Py2App(object): ''') 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 def add_misc_libraries(self): for x in ( diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index 8085ba419d..8971e3675c 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -17,7 +17,6 @@ from setup.installer.windows.wix import WixMixIn OPENSSL_DIR = os.environ.get('OPENSSL_DIR', os.path.join(SW, 'private', 'openssl')) SW = r'C:\cygwin64\home\kovid\sw' -IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-*\\VisualMagick\\bin') CRT = r'C:\Microsoft.VC90.CRT' 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() @@ -338,18 +337,6 @@ class Win32Freeze(Command, WixMixIn): if os.path.exists(msrc): 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): self.info('Embedding remaining manifests...') for x in os.walk(self.base): @@ -685,10 +672,6 @@ class Win32Freeze(Command, WixMixIn): # from files 'unrar.pyd', 'wpd.pyd', 'podofo.pyd', 'imageops.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 'dukpy.pyd', }: diff --git a/setup/installer/windows/notes.rst b/setup/installer/windows/notes.rst index efa81d7a3e..fd1dc36734 100644 --- a/setup/installer/windows/notes.rst +++ b/setup/installer/windows/notes.rst @@ -405,30 +405,6 @@ Run:: 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 ------------ diff --git a/setup/installer/windows/util.c b/setup/installer/windows/util.c index 86a9d22c30..ce22d6b47b 100644 --- a/setup/installer/windows/util.c +++ b/setup/installer/windows/util.c @@ -223,10 +223,6 @@ void load_python_dll() { _snprintf_s(qt_plugin_dir, l, _TRUNCATE, "%sqt_plugins", 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); if (!SetDllDirectoryA(dll_dir)) ExitProcess(show_last_error(L"Failed to set DLL directory."));