# HG changeset patch # User John Donoghue # Date 1531842099 14400 # Node ID 7c3e3151bf58ded36c0a196919c76c1fb3f13f8e # Parent 7d3a56e36206d14147b00dd13877f6a20a640691 graphicsmagic: enable modules, allow dynaic paths in windows * src/graphicsmagick-2-dynamicpath.patch: new file * dist-files.mk: ref graphicsmagick-2-dynamicpath.patch * src/graphicsmagick.mk; enable modules diff -r 7d3a56e36206 -r 7c3e3151bf58 dist-files.mk --- a/dist-files.mk Fri Jul 13 15:24:33 2018 -0400 +++ b/dist-files.mk Tue Jul 17 11:41:39 2018 -0400 @@ -148,6 +148,7 @@ gnutls-test.c \ gnutls.mk \ graphicsmagick-1-fix-xml2-config.patch \ + graphicsmagick-2-dynamicpath.patch \ graphicsmagick-test.cpp \ graphicsmagick.mk \ gsl-test.c \ diff -r 7d3a56e36206 -r 7c3e3151bf58 src/graphicsmagick-2-dynamicpath.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/graphicsmagick-2-dynamicpath.patch Tue Jul 17 11:41:39 2018 -0400 @@ -0,0 +1,71 @@ +diff -ur GraphicsMagick-1.3.30.orig/magick/blob.c GraphicsMagick-1.3.30/magick/blob.c +--- GraphicsMagick-1.3.30.orig/magick/blob.c 2018-07-16 08:55:01.552444311 -0400 ++++ GraphicsMagick-1.3.30/magick/blob.c 2018-07-17 09:27:05.584144673 -0400 +@@ -1955,6 +1955,29 @@ + AddConfigurePath(path_map,&path_index,MagickLibConfigPath,exception); + # endif /* defined(MagickLibConfigPath) */ + ++#if defined(MSWINDOWS) ++ { ++ char buf[FILENAME_MAX+100]; ++ if (GetModuleFileName(NULL, buf, FILENAME_MAX + 1)) ++ { ++ char *ptr = strrchr(buf, '\\'); ++ if(ptr) { ++ *(ptr+1) = 0; ++ strcat(buf, "..\\lib\\"); ++ strcat(buf, MagickShareConfigSubDir); ++ strcat(buf, "\\"); ++ AddConfigurePath(path_map,&path_index,buf,exception); ++ ++ *(ptr+1) = 0; ++ strcat(buf, "..\\share\\"); ++ strcat(buf, MagickLibConfigSubDir); ++ strcat(buf, "\\"); ++ AddConfigurePath(path_map,&path_index,buf,exception); ++ } ++ } ++ } ++#endif ++ + # if defined(MSWINDOWS) && !(defined(MagickLibConfigPath) || defined(MagickShareConfigPath)) + { + char +Only in GraphicsMagick-1.3.30/magick: .blob.c.swp +diff -ur GraphicsMagick-1.3.30.orig/magick/module.c GraphicsMagick-1.3.30/magick/module.c +--- GraphicsMagick-1.3.30.orig/magick/module.c 2018-07-16 08:55:01.539443999 -0400 ++++ GraphicsMagick-1.3.30/magick/module.c 2018-07-17 08:22:22.161123799 -0400 +@@ -1021,6 +1021,33 @@ + start += length+1; + } + } ++#if defined(MSWINDOWS) ++ { ++ char buf[FILENAME_MAX+100]; ++ if (GetModuleFileName(NULL, buf, FILENAME_MAX + 1)) ++ { ++ char *ptr = strrchr(buf, '\\'); ++ if(ptr) ++ { ++ *(ptr+1) = 0; ++ strcat(buf, "..\\lib\\"); ++ switch (module_type) ++ { ++ case MagickCoderModule: ++ default: ++ strcat(buf, MagickCoderModulesSubdir); ++ break; ++ case MagickFilterModule: ++ strcat(buf, MagickFilterModulesSubdir); ++ break; ++ } ++ strcat(buf, "\\"); ++ AddModulePath(path_map,&path_index,buf,exception); ++ } ++ } ++ } ++#endif ++ + + #if defined(UseInstalledMagick) + # if defined(MagickCoderModulesPath) diff -r 7d3a56e36206 -r 7c3e3151bf58 src/graphicsmagick.mk --- a/src/graphicsmagick.mk Fri Jul 13 15:24:33 2018 -0400 +++ b/src/graphicsmagick.mk Tue Jul 17 11:41:39 2018 -0400 @@ -35,7 +35,7 @@ $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \ --prefix='$(HOST_PREFIX)' \ --disable-openmp \ - --without-modules \ + --with-modules \ --with-threads \ --with-magick-plus-plus \ --without-perl \