[sushi] evince: detect the unoconv presence at buildtime
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] evince: detect the unoconv presence at buildtime
- Date: Tue, 19 Apr 2011 21:14:58 +0000 (UTC)
commit 20373408847dc35c06140c39caed55e2f275ddb9
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Apr 19 17:14:37 2011 -0400
evince: detect the unoconv presence at buildtime
configure.ac | 9 +++++++++
src/Makefile-js.am | 4 ++++
src/Makefile.am | 5 +++--
src/js/util/features.js.in | 1 +
src/js/viewers/evince.js | 16 ++++++++++------
5 files changed, 27 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7bc4c44..cf2cda2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,6 +75,15 @@ PKG_CHECK_MODULES(SUSHI,
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_MKENUMS)
+AC_PATH_PROG(UNOCONV, unoconv, 0)
+if test x$UNOCONV = x0; then
+ HAVE_UNOCONV=0
+else
+ HAVE_UNOCONV=1
+fi
+
+AC_SUBST(HAVE_UNOCONV)
+
AC_CONFIG_FILES([
Makefile
src/Makefile
diff --git a/src/Makefile-js.am b/src/Makefile-js.am
index 30ba604..4aa87d7 100644
--- a/src/Makefile-js.am
+++ b/src/Makefile-js.am
@@ -19,6 +19,7 @@ dist_jsutil_DATA = \
js/util/constants.js
jsutil_built_sources = \
+ $(srcdir)/js/util/features.js \
$(srcdir)/js/util/path.js
BUILT_SOURCES += $(jsutil_built_sources)
@@ -26,6 +27,9 @@ BUILT_SOURCES += $(jsutil_built_sources)
js/util/path.js: Makefile js/util/path.js.in
$(AM_V_GEN) $(do_subst) $(srcdir)/js/util/path.js.in > $@
+js/util/features.js: Makefile js/util/features.js.in
+ $(AM_V_GEN) $(do_subst) $(srcdir)/js/util/features.js.in > $@
+
nodist_jsutil_DATA = \
$(jsutil_built_sources)
diff --git a/src/Makefile.am b/src/Makefile.am
index 4f7833d..e981764 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,8 +26,9 @@ do_subst = sed -e 's|@abs_top_srcdir[ ]|$(abs_top_srcdir)|g' \
-e 's|@localedir[ ]|$(localedir)|g' \
-e 's|@bindir[ ]|$(bindir)|g' \
-e 's|@libexecdir[ ]|$(libexecdir)|g' \
- -e 's|@pkglibdir[ ]|$(pkglibdir)|g' \
- -e 's|@pkgdatadir[ ]|$(pkgdatadir)|g'
+ -e 's|@pkglibdir[ ]|$(pkglibdir)|g' \
+ -e 's|@pkgdatadir[ ]|$(pkgdatadir)|g' \
+ -e 's|@have_unoconv[ ]|$(HAVE_UNOCONV)|g'
include $(INTROSPECTION_MAKEFILE)
diff --git a/src/js/util/features.js.in b/src/js/util/features.js.in
new file mode 100644
index 0000000..527cada
--- /dev/null
+++ b/src/js/util/features.js.in
@@ -0,0 +1 @@
+let HAVE_UNOCONV = @have_unoconv@
\ No newline at end of file
diff --git a/src/js/viewers/evince.js b/src/js/viewers/evince.js
index 657afa0..b28668c 100644
--- a/src/js/viewers/evince.js
+++ b/src/js/viewers/evince.js
@@ -5,6 +5,7 @@ const EvView = imports.gi.EvinceView;
let Gettext = imports.gettext.domain("sushi");
let Utils = imports.ui.utils;
+let Features = imports.util.features;
let PDF_X_PADDING = 40;
let SPINBOX_SIZE = 150;
@@ -120,9 +121,12 @@ let handler = new MimeHandler.MimeHandler();
let renderer = new EvinceRenderer();
handler.registerMime("application/pdf", renderer);
-handler.registerMime("application/vnd.oasis.opendocument.text", renderer);
-handler.registerMime("application/vnd.oasis.opendocument.presentation", renderer);
-handler.registerMime("application/vnd.oasis.opendocument.spreadsheet", renderer);
-handler.registerMime("application/msword", renderer);
-handler.registerMime("application/vnd.ms-excel", renderer);
-handler.registerMime("application/vnd.ms-powerpoint", renderer);
+
+if (Features.HAVE_UNOCONV) {
+ handler.registerMime("application/vnd.oasis.opendocument.text", renderer);
+ handler.registerMime("application/vnd.oasis.opendocument.presentation", renderer);
+ handler.registerMime("application/vnd.oasis.opendocument.spreadsheet", renderer);
+ handler.registerMime("application/msword", renderer);
+ handler.registerMime("application/vnd.ms-excel", renderer);
+ handler.registerMime("application/vnd.ms-powerpoint", renderer);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]