summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-01-28 14:02:06 +0100
committerraveit65 <[email protected]>2020-02-04 23:00:30 +0100
commit43c2d257abf33d402bf6e219a0a5362db7b9ba64 (patch)
treebafaff02b0e3e17803c2ad3c9652c2f46d10411a
parentb8914e016c2e5b62f0583aaa742d36e0a3423161 (diff)
downloadeom-43c2d257abf33d402bf6e219a0a5362db7b9ba64.tar.bz2
eom-43c2d257abf33d402bf6e219a0a5362db7b9ba64.tar.xz
thumbnailer: add --with-gdk-pixbuf-thumbnailer option
Let user choose gdk-pixbuf-thumbnailer or eom-thumbnailer for making webp thumbnails.
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac74
-rw-r--r--thumbnailer/Makefile.am10
-rw-r--r--thumbnailer/eom-thumbnailer.thumbnailer.in4
4 files changed, 64 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am
index d9e2d75..f52e167 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,11 @@ if ENABLE_JPEG
jpeg_DIRS = jpegutils
endif
-SUBDIRS = po $(jpeg_DIRS) cut-n-paste src man plugins help data doc thumbnailer
+SUBDIRS = po $(jpeg_DIRS) cut-n-paste src man plugins help data doc
+
+if ENABLE_THUMBNAILER
+SUBDIRS += thumbnailer
+endif
EXTRA_DIST = \
AUTHORS \
diff --git a/configure.ac b/configure.ac
index 8da0751..2c480c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,29 +290,59 @@ AM_CONDITIONAL([HAVE_RSVG], [test "x$have_rsvg" = "xyes"])
# THUMBNAILER CFLAGS/LIBS
# ***********************
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
-PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
-PKG_CHECK_MODULES(MAGICK, MagickWand >= $MAGICK_REQUIRED)
-
-CPPFLAGS_save="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $MAGICK_CFLAGS"
-AC_CHECK_HEADER([wand/MagickWand.h],
- [have_im6="yes"],
- [AC_CHECK_HEADER([MagickWand/MagickWand.h], [have_im7="yes"])])
-CPPFLAGS="$CPPFLAGS_save"
-
-if test "x$have_im6" = "xyes"; then
- AC_DEFINE(HAVE_IMAGEMAGICK6,1, [Have ImageMagick 6])
-fi
-if test "x$have_im7" = "xyes"; then
- AC_DEFINE(HAVE_IMAGEMAGICK7,1, [Have ImageMagick 7])
-fi
+AC_ARG_ENABLE(thumbnailer,
+ [AS_HELP_STRING([--enable-thumbnailer],
+ [Enable thumbnailer])],
+ [enable_thumbnailer=$enableval],
+ [enable_thumbnailer=no])
+AM_CONDITIONAL(ENABLE_THUMBNAILER, test x$enable_thumbnailer != xno)
+
+AC_ARG_WITH(gdk-pixbuf-thumbnailer,
+ [AS_HELP_STRING([--without-gdk-pixbuf-thumbnailer],
+ [Disable the use of gdk-pixbuf-thumbnailer])],
+ [],
+ [with_gdk_pixbuf_thumbnailer=yes])
+AM_CONDITIONAL(USE_INTERNAL_THUMBNAILER, test x$with_gdk_pixbuf_thumbnailer != xyes)
+
+if test "x$enable_thumbnailer" != "xno"; then
+ if test "x$with_gdk_pixbuf_thumbnailer" = "xyes"; then
+ AC_PATH_PROG([GDK_PIXBUF_THUMBNAILER],[gdk-pixbuf-thumbnailer],[])
+ if test -z "$GDK_PIXBUF_THUMBNAILER"; then
+ AC_MSG_ERROR([gdk-pixbuf-thumbnailer not found])
+ fi
+ eom_thumbnailer="$GDK_PIXBUF_THUMBNAILER"
+ else
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
+ PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
+ PKG_CHECK_MODULES(MAGICK, MagickWand >= $MAGICK_REQUIRED)
+
+ CPPFLAGS_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $MAGICK_CFLAGS"
+ AC_CHECK_HEADER([wand/MagickWand.h],
+ [have_im6="yes"],
+ [AC_CHECK_HEADER([MagickWand/MagickWand.h], [have_im7="yes"])])
+ CPPFLAGS="$CPPFLAGS_save"
+
+ if test "x$have_im6" = "xyes"; then
+ AC_DEFINE(HAVE_IMAGEMAGICK6,1, [Have ImageMagick 6])
+ fi
+ if test "x$have_im7" = "xyes"; then
+ AC_DEFINE(HAVE_IMAGEMAGICK7,1, [Have ImageMagick 7])
+ fi
-THUMBNAILER_CFLAGS="$CFLAGS $GLIB_CFLAGS $GIO_CFLAGS $MAGICK_CFLAGS"
-AC_SUBST(THUMBNAILER_CFLAGS)
+ THUMBNAILER_CFLAGS="$CFLAGS $GLIB_CFLAGS $GIO_CFLAGS $MAGICK_CFLAGS"
+ AC_SUBST(THUMBNAILER_CFLAGS)
-THUMBNAILER_LIBS="$LIBS $GLIB_LIBS $GIO_LIBS $MAGICK_LIBS"
-AC_SUBST(THUMBNAILER_LIBS)
+ THUMBNAILER_LIBS="$LIBS $GLIB_LIBS $GIO_LIBS $MAGICK_LIBS"
+ AC_SUBST(THUMBNAILER_LIBS)
+ eom_thumbnailer="eom-thumbnailer"
+ fi
+
+ EOM_THUMBNAILER="$eom_thumbnailer"
+ AC_SUBST(EOM_THUMBNAILER)
+else
+ eom_thumbnailer="no"
+fi
# ****************
# CFLAGS/LIBS init
@@ -374,6 +404,7 @@ doc/reference/version.xml
doc/reference/eom-docs.sgml
plugins/Makefile
thumbnailer/Makefile
+thumbnailer/eom-thumbnailer.thumbnailer
])
AC_OUTPUT
@@ -391,4 +422,5 @@ Configure summary:
RSVG support ...............: ${have_rsvg}
Colour management support ..: ${have_lcms}
GObject Introspection.......: ${have_introspection}
+ Thumbnailer.................: ${eom_thumbnailer}
"
diff --git a/thumbnailer/Makefile.am b/thumbnailer/Makefile.am
index 4501ba7..04b56a7 100644
--- a/thumbnailer/Makefile.am
+++ b/thumbnailer/Makefile.am
@@ -1,34 +1,32 @@
NULL =
-bin_PROGRAMS = eom-thumbnailer
+if USE_INTERNAL_THUMBNAILER
+bin_PROGRAMS = eom-thumbnailer
eom_thumbnailer_SOURCES = \
eom-thumbnailer.c \
$(NULL)
-
eom_thumbnailer_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(AM_CPPFLAGS) \
$(NULL)
-
eom_thumbnailer_CFLAGS = \
$(THUMBNAILER_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(WARN_CFLAGS) \
$(AM_CFLAGS) \
$(NULL)
-
eom_thumbnailer_LDFLAGS = \
$(AM_LDFLAGS) \
-lm \
$(THUMBNAILER_LIBS) \
$(NULL)
+endif
+
thumbnailerdir = $(datadir)/thumbnailers
thumbnailer_DATA = eom-thumbnailer.thumbnailer
-%.thumbnailer: %.thumbnailer.in
- $(AM_V_GEN) sed -e 's|@bindir[@]|$(bindir)|g' $< > [email protected]
EXTRA_DIST = \
eom-thumbnailer.thumbnailer.in \
diff --git a/thumbnailer/eom-thumbnailer.thumbnailer.in b/thumbnailer/eom-thumbnailer.thumbnailer.in
index 1583b4f..b6412b2 100644
--- a/thumbnailer/eom-thumbnailer.thumbnailer.in
+++ b/thumbnailer/eom-thumbnailer.thumbnailer.in
@@ -1,4 +1,4 @@
[Thumbnailer Entry]
[email protected]@/eom-thumbnailer
[email protected]@/eom-thumbnailer -s %s %u %o
MimeType=image/webp;