From d1ece52b0cc66c59ba2549b9beba8d9176e9ef27 Mon Sep 17 00:00:00 2001 From: Mikhail Teterin Date: Fri, 5 Oct 2007 05:32:09 +0000 Subject: Explicitly disable support for OpenEXR and DjVu by default. These were never dependencies before, so official packages never contained the support, but if a local system had them installed, ImageMagick would try to use them -- and sometimes fail. Also add a patch, that modifies the module-searching algorithm from /always/ checking the compiled-in constant path, to only checking it, if an environment variable is not set. This fixes a problem with testing, where a module installed by an earlier version of the software could be used by the newly built version, that's being tested. This port has too many options -- perhaps, support for the most common things (like PNG, JPEG, and GIF) should be permanent... --- graphics/ImageMagick/Makefile | 29 ++++++++++++++++++++++++++ graphics/ImageMagick/files/patch-module-path | 31 ++++++++++++++++++++++++++++ graphics/ImageMagick/pkg-plist | 9 +++++--- 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 graphics/ImageMagick/files/patch-module-path (limited to 'graphics/ImageMagick') diff --git a/graphics/ImageMagick/Makefile b/graphics/ImageMagick/Makefile index 50131196dbfe..b501bac25174 100644 --- a/graphics/ImageMagick/Makefile +++ b/graphics/ImageMagick/Makefile @@ -55,10 +55,12 @@ OPTIONS= X11 "X11 support" on \ IMAGEMAGICK_MODULES "Modules support (broken)" off \ IMAGEMAGICK_BZLIB "Bzlib support" on \ IMAGEMAGICK_16BIT_PIXEL "16bit pixel support" on \ + IMAGEMAGICK_DJVU "DJVU format support (needs threads)" off \ IMAGEMAGICK_LCMS "LCMS support" on \ IMAGEMAGICK_TTF "Freetype support" on \ IMAGEMAGICK_FONTCONFIG "Fontconfig support" on \ IMAGEMAGICK_JPEG "JPG format support" on \ + IMAGEMAGICK_OPENEXR "OpenEXR support (needs threads)" off \ IMAGEMAGICK_PNG "PNG format support" on \ IMAGEMAGICK_TIFF "TIFF format support" on \ IMAGEMAGICK_FPX "FPX format support" off \ @@ -98,6 +100,13 @@ WITH_IMAGEMAGICK_THREADS=yes .else CONFIGURE_ARGS+= --without-threads .undef WITH_IMAGEMAGICK_THREADS +.if defined(WITH_IMAGEMAGICK_OPENEXR) && !defined(WITHOUT_IMAGEMAGICK_PERL) +. warning OpenEXR's libIlmThread may prevent PerlMagick from working +.endif +.if defined(WITH_IMAGEMAGICK_DJVU) +. warning DjVu requires threads and will not be supported +. undef WITH_IMAGEMAGICK_DJVU +.endif .endif # Faster, but poor quality @@ -122,6 +131,26 @@ CONFIGURE_ARGS+= --without-modules PLIST_SUB+= MODULES='@comment ' .endif +.if !defined(WITHOUT_IMAGEMAGICK_OPENEXR) +LIB_DEPENDS+= IlmImf:${PORTSDIR}/graphics/OpenEXR +PLIST_SUB+= OPENEXR="" +.else +CONFIGURE_ARGS+= --without-openexr +PLIST_SUB+= OPENEXR="@comment " +.endif + +.if !defined(WITHOUT_IMAGEMAGICK_DJVU) +. if defined(WITHOUT_X11) +LIB_DEPENDS+= djvulibre:${PORTSDIR}/graphics/djvulibre-nox11 +. else +LIB_DEPENDS+= djvulibre:${PORTSDIR}/graphics/djvulibre +. endif +PLIST_SUB+= DJVU="" +.else +CONFIGURE_ARGS+= --without-djvu +PLIST_SUB+= DJVU="@comment " +.endif + .if !defined(WITHOUT_IMAGEMAGICK_JPEG) LIB_DEPENDS+= jpeg:${PORTSDIR}/graphics/jpeg PLIST_SUB+= JPEG="" diff --git a/graphics/ImageMagick/files/patch-module-path b/graphics/ImageMagick/files/patch-module-path new file mode 100644 index 000000000000..65082dc41a7e --- /dev/null +++ b/graphics/ImageMagick/files/patch-module-path @@ -0,0 +1,31 @@ +Modify module-searching to only check the compiled-in location, +if the environment variables don't provide an override. The stock +code checks the compiled-in location if a particular module can't +be found at the environment-specified directory, which may lead +to wrong binaries being loaded, etc. + + -mi + +--- magick/module.c Sat Sep 8 16:44:05 2007 ++++ magick/module.c Thu Oct 4 23:30:26 2007 +@@ -589,4 +589,6 @@ + "Searching for coder module file \"%s\" ...",filename); + module_path=GetEnvironmentValue("MAGICK_CODER_MODULE_PATH"); ++ if (module_path == NULL) ++ module_path = MagickCoderModulesPath; + break; + } +@@ -596,4 +598,6 @@ + "Searching for filter module file \"%s\" ...",filename); + module_path=GetEnvironmentValue("MAGICK_CODER_FILTER_PATH"); ++ if (module_path == NULL) ++ module_path = MagickFilterModulesPath; + break; + } +@@ -624,5 +628,5 @@ + module_path=DestroyString(module_path); + } +-#if defined(UseInstalledMagick) ++#if defined(UseInstalledMagick) && 0 + #if defined(MagickCoderModulesPath) + { diff --git a/graphics/ImageMagick/pkg-plist b/graphics/ImageMagick/pkg-plist index 979b87d9c20f..1c43d748b777 100644 --- a/graphics/ImageMagick/pkg-plist +++ b/graphics/ImageMagick/pkg-plist @@ -310,9 +310,12 @@ lib/ImageMagick/modules-%%QBIT%%/coders/.keep %%PNG%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/png.a %%PNG%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/png.la %%PNG%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/png.so -%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/exr.a -%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/exr.la -%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/exr.so +%%OPENEXR%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/exr.a +%%OPENEXR%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/exr.la +%%OPENEXR%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/exr.so +%%DJVU%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/djvu.a +%%DJVU%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/djvu.la +%%DJVU%%%%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/djvu.so %%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/pnm.a %%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/pnm.la %%MODULES%%lib/ImageMagick/modules-%%QBIT%%/coders/pnm.so -- cgit v1.2.3