about summary refs log tree commit diff
path: root/pkgs/misc/drivers/utsushi/patches/absolute-path-to-convert.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc/drivers/utsushi/patches/absolute-path-to-convert.patch')
-rw-r--r--pkgs/misc/drivers/utsushi/patches/absolute-path-to-convert.patch166
1 files changed, 166 insertions, 0 deletions
diff --git a/pkgs/misc/drivers/utsushi/patches/absolute-path-to-convert.patch b/pkgs/misc/drivers/utsushi/patches/absolute-path-to-convert.patch
new file mode 100644
index 0000000000000..2bc9422b061e7
--- /dev/null
+++ b/pkgs/misc/drivers/utsushi/patches/absolute-path-to-convert.patch
@@ -0,0 +1,166 @@
+Index: utsushi-0.57.0/configure.ac
+===================================================================
+--- utsushi-0.57.0.orig/configure.ac
++++ utsushi-0.57.0/configure.ac
+@@ -221,6 +221,9 @@ AS_IF([test xno != x$enable_code_coverag
+      [AC_MSG_ERROR([code coverage support requires a GNU C/C++ compiler])])
+   ])
+ AM_PROG_AR
++AC_PATH_PROG([AWK],[awk])
++AC_DEFINE_UNQUOTED([AWK], ["$AWK"],
++  [Path to awk.])
+ 
+ PKG_PROG_PKG_CONFIG
+ 
+@@ -379,27 +382,31 @@ AM_CONDITIONAL([have_libmagick_pp], [tes
+ AS_IF([test xno != "x$with_magick"],
+    AS_CASE("x$with_magick",
+      [xGraphicsMagick],
+-       [AC_CHECK_PROGS([MAGICK_CONVERT], [gm])
+-        AS_IF([test xgm != x$MAGICK_CONVERT],
++       [[AC_PATH_PROG(MAGICK_CONVERT, gm)]
++        AS_IF([test x == x$MAGICK_CONVERT],
+           [AC_MSG_ERROR([$with_magick requested but not found])])
+         AC_DEFINE([HAVE_GRAPHICS_MAGICK], [1])
+-        MAGICK_CONVERT="gm convert"
++        HAVE_MAGICK=1
++        MAGICK_CONVERT="$MAGICK_CONVERT convert"
+        ],
+      [xImageMagick],
+-       [AC_CHECK_PROGS([MAGICK_CONVERT], [convert])
+-        AS_IF([test xconvert != x$MAGICK_CONVERT],
++       [[AC_PATH_PROG(MAGICK_CONVERT, convert)]
++        AS_IF([test x == x$MAGICK_CONVERT],
+           [AC_MSG_ERROR([$with_magick requested but not found])])
+         AC_DEFINE([HAVE_IMAGE_MAGICK], [1])
++        HAVE_MAGICK=1
+        ],
+      [xyes|xcheck],
+-       [AC_CHECK_PROGS([MAGICK_CONVERT], [gm convert])
++       [[AC_PATH_PROGS([MAGICK_CONVERT], [gm convert])]
+         AS_CASE(x$MAGICK_CONVERT,
+-          [xgm],
++          [x*gm],
+             [AC_DEFINE([HAVE_GRAPHICS_MAGICK], [1])
+-             MAGICK_CONVERT="gm convert"
++             HAVE_MAGICK=1
++             MAGICK_CONVERT="$MAGICK_CONVERT convert"
+             ],
+-          [xconvert],
++          [x*convert],
+             [AC_DEFINE([HAVE_IMAGE_MAGICK], [1])
++            HAVE_MAGICK=1
+             ],
+           [dnl default case
+            AS_IF([test xcheck != "x$with_magick"],
+@@ -410,7 +417,7 @@ AS_IF([test xno != "x$with_magick"],
+       AC_MSG_ERROR([unknown value: --with-magick=$with_magick])
+      ]))
+ AC_DEFINE_UNQUOTED([MAGICK_CONVERT], ["$MAGICK_CONVERT"])
+-AM_CONDITIONAL([have_magick], [test x != "x$MAGICK_CONVERT"])
++AM_CONDITIONAL([have_magick], [test x != "x$HAVE_MAGICK"])
+ 
+ AS_IF([test xno != "x$with_gtkmm"],
+   [PKG_CHECK_MODULES([LIBGTKMM], [gtkmm-2.4 >= 2.20],
+Index: utsushi-0.57.0/filters/magick.cpp
+===================================================================
+--- utsushi-0.57.0.orig/filters/magick.cpp
++++ utsushi-0.57.0/filters/magick.cpp
+@@ -81,19 +81,18 @@ chomp (char *str)
+ }
+ 
+ bool
+-magick_version_before_(const char *magick, const char *cutoff)
++magick_version_before_(const char *cutoff)
+ {
+   FILE *fp = NULL;
+   int errc = 0;
+ 
+-  if (0 == strcmp ("GraphicsMagick", magick))
+-    fp = popen ("gm convert -version"
+-                "| awk '/^GraphicsMagick/{print $2}'", "r");
+-  if (fp) errc = errno;
+-
+-  if (0 == strcmp ("ImageMagick", magick))
+-    fp  = popen ("convert -version"
+-                 "| awk '/^Version:/{print $3}'", "r");
++#if HAVE_GRAPHICS_MAGICK
++  fp = popen (MAGICK_CONVERT " -version"
++                "| " AWK " '/^GraphicsMagick/{print $2}'", "r");
++#elif HAVE_IMAGE_MAGICK
++  fp  = popen (MAGICK_CONVERT " -version"
++                 "| " AWK " '/^Version:/{print $3}'", "r");
++#endif
+   if (fp) errc = errno;
+ 
+   if (fp)
+@@ -106,42 +105,32 @@ magick_version_before_(const char *magic
+ 
+       if (version)
+         {
+-          log::debug ("found %1%-%2%") % magick % version;
++          log::debug ("found " MAGICK_CONVERT "version %1%") % version;
+           return (0 > strverscmp (version, cutoff));
+         }
+     }
+ 
+   if (errc)
+-    log::alert ("failure checking %1% version: %2%")
+-      % magick
++    log::alert ("failure checking " MAGICK_CONVERT " version: %1%")
+       % strerror (errc);
+ 
+   return false;
+ }
+ 
+ bool
+-graphics_magick_version_before_(const char *cutoff)
+-{
+-  return magick_version_before_("GraphicsMagick", cutoff);
+-}
+-
+-bool
+-image_magick_version_before_(const char *cutoff)
+-{
+-  return magick_version_before_("ImageMagick", cutoff);
+-}
+-
+-bool
+ auto_orient_is_usable ()
+ {
+   static int usable = -1;
+ 
+   if (-1 == usable)
+     {
+-      if (HAVE_GRAPHICS_MAGICK)         // version -auto-orient was added
+-        usable = !graphics_magick_version_before_("1.3.18");
+-      if (HAVE_IMAGE_MAGICK)            // version known to work
+-        usable = !image_magick_version_before_("6.7.8-9");
++#if HAVE_GRAPHICS_MAGICK
++      // version -auto-orient was added
++      usable = !magick_version_before_("1.3.18");
++#elif HAVE_IMAGE_MAGICK
++      // version known to work
++      usable = !magick_version_before_("6.7.8-9");
++#endif
+       if (-1 == usable)
+         usable = false;
+       usable = (usable ? 1 : 0);
+@@ -392,7 +381,7 @@ magick::arguments (const context& ctx)
+   if (color_correction_)
+     {
+       if (HAVE_IMAGE_MAGICK
+-          && !image_magick_version_before_("6.6.1-0"))
++          && !magick_version_before_("6.6.1-0"))
+         argv += " -color-matrix";
+       else
+         argv += " -recolor";
+@@ -416,7 +405,7 @@ magick::arguments (const context& ctx)
+       size_t mat_size = ((HAVE_IMAGE_MAGICK) ? 6 : 5);
+ 
+       if (HAVE_IMAGE_MAGICK
+-          && !image_magick_version_before_("6.6.1-0"))
++          && !magick_version_before_("6.6.1-0"))
+         argv += " -color-matrix";
+       else
+         argv += " -recolor";