From e6ad3acb2069e35236c87f9d1df1651152889145 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Nov 2012 17:21:11 +0530 Subject: [PATCH] ... --- setup/installer/windows/freeze.py | 7 ++++--- setup/installer/windows/notes.rst | 8 ++++---- src/calibre/test_build.py | 6 +++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index ce07205e09..73d9f0e38d 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -19,8 +19,8 @@ QT_DIR = os.environ.get('QT_DIR', 'Q:\\Qt\\4.8.2') QT_DLLS = ['Core', 'Gui', 'Network', 'Svg', 'WebKit', 'Xml', 'XmlPatterns'] LIBUNRAR = os.environ.get('UNRARDLL', 'C:\\Program Files\\UnrarDLL\\unrar.dll') SW = r'C:\cygwin\home\kovid\sw' -IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-6.7.6', - 'VisualMagick', 'bin') +IMAGEMAGICK = os.path.join(SW, 'build', + 'ImageMagick-*\\VisualMagick\\bin') CRT = r'C:\Microsoft.VC90.CRT' LZMA = r'Q:\easylzma\build\easylzma-0.0.8' @@ -283,8 +283,9 @@ class Win32Freeze(Command, WixMixIn): 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(IMAGEMAGICK, pat)): + 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 diff --git a/setup/installer/windows/notes.rst b/setup/installer/windows/notes.rst index eaebef5a11..eee14151c1 100644 --- a/setup/installer/windows/notes.rst +++ b/setup/installer/windows/notes.rst @@ -514,7 +514,7 @@ Undefine ProvideDllMain and MAGICKCORE_X11_DELEGATE Now open VisualMagick/VisualDynamicMT.sln set to Release Remove the CORE_xlib, UTIL_Imdisplay and CORE_Magick++ projects. -F7 for build project, you will get one error due to the removal of xlib, ignore +F7 for build solution, you will get one error due to the removal of xlib, ignore it. netifaces @@ -524,10 +524,10 @@ Download the source tarball from http://alastairs-place.net/projects/netifaces/ Rename netifaces.c to netifaces.cpp and make the same change in setup.py -Run +Run:: + python setup.py build + cp `find build/ -name *.pyd` /cygdrive/c/Python27/Lib/site-packages/ -python setup.py build -cp build/lib.win32-2.7/netifaces.pyd /cygdrive/c/Python27/Lib/site-packages/ psutil -------- diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index d328026ea3..f8a5a9286b 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -75,7 +75,11 @@ def test_imaging(): else: raise RuntimeError('ImageMagick choked!') from PIL import Image - import _imaging, _imagingmath, _imagingft + try: + import _imaging, _imagingmath, _imagingft + _imaging, _imagingmath, _imagingft + except ImportError: + from PIL import _imaging, _imagingmath, _imagingft _imaging, _imagingmath, _imagingft i = Image.open(cStringIO.StringIO(data)) if i.size < (20, 20):