[geary] Conditionally disable generating help translations



commit 6ea56128639afc979c0123ad3718e4b027af55ba
Author: Charles Lindsay <chaz yorba org>
Date:   Mon Mar 17 17:09:55 2014 -0700

    Conditionally disable generating help translations
    
    The gnome-doc-utils dependency is problematic for gnome-continuous.
    This adds a configure switch --disable-documentation that turns off
    generating and installing the translated help, which is the only thing
    that requires xml2po and thus gnome-doc-utils.
    
    Closes: bgo #726585

 CMakeLists.txt      |    5 +++++
 configure           |    6 ++++++
 help/CMakeLists.txt |   15 ++++++++-------
 3 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0443c54..f38456c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,7 @@ option(DEBUG "Build for debugging." OFF)
 option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON)
 option(DESKTOP_UPDATE "Run update-desktop-database after the install." ON)
 option(DESKTOP_VALIDATE "Check generated desktop file for errors during build." ON)
+option(TRANSLATE_HELP "Generate and install translated help documentation." ON)
 
 if (DEBUG)
     message(STATUS "Debug build")
@@ -45,6 +46,10 @@ if (DESKTOP_VALIDATE)
     message(STATUS "Generated desktop file will be checked for errors")
 endif ()
 
+if (TRANSLATE_HELP)
+    message(STATUS "Help translations will be generated and installed")
+endif ()
+
 find_package(PkgConfig)
 pkg_check_modules(LIBUNITY QUIET unity>=5.12.0)
 pkg_check_modules(LIBMESSAGINGMENU QUIET messaging-menu>=12.10.2)
diff --git a/configure b/configure
index 8d69fe5..89fb4c7 100755
--- a/configure
+++ b/configure
@@ -34,6 +34,8 @@ configure_help() {
                                Disable checking for errors in generated desktop file.
          --disable-icon-update
                                Disable icon cache update.
+         --disable-documentation
+                               Disable generating and installing translated help documentation.
 
        Some influential environment variables:
          PKG_CONFIG_PATH       Adds directories to pkg-config's search path.
@@ -104,6 +106,10 @@ do
         --disable-desktop-validate)
                             CMDLINE="${CMDLINE} -DDESKTOP_VALIDATE=OFF"
                             ;;
+
+        --disable-documentation)
+                            CMDLINE="${CMDLINE} -DTRANSLATE_HELP=OFF"
+                            ;;
         
         VALAC)              [ ! $value ] && abort $1
                             VALAC=$value
diff --git a/help/CMakeLists.txt b/help/CMakeLists.txt
index f726d41..697f30a 100644
--- a/help/CMakeLists.txt
+++ b/help/CMakeLists.txt
@@ -29,12 +29,6 @@ endforeach()
 install(FILES ${HELP_SOURCE} DESTINATION ${HELP_DEST}/C)
 install(FILES C/figures/geary.svg DESTINATION ${HELP_DEST}/C/figures)
 
-
-FIND_PROGRAM(XML2PO_BIN xml2po)
-IF(NOT XML2PO_BIN)
-    MESSAGE(FATAL_ERROR "xml2po not found")
-ENDIF()
-
 # Hacked together from the similar macro in cmake/Gettext.cmake.
 MACRO(HELP_CREATE_TRANSLATIONS _firstLang)
     SET(_translatedPages)
@@ -78,4 +72,11 @@ MACRO(HELP_CREATE_TRANSLATIONS _firstLang)
     ENDIF()
 ENDMACRO()
 
-HELP_CREATE_TRANSLATIONS(ALL ${TRANSLATED} COMMENT "Translating help docs.")
+IF(TRANSLATE_HELP)
+    FIND_PROGRAM(XML2PO_BIN xml2po)
+    IF(NOT XML2PO_BIN)
+        MESSAGE(FATAL_ERROR "xml2po not found")
+    ENDIF()
+
+    HELP_CREATE_TRANSLATIONS(ALL ${TRANSLATED} COMMENT "Translating help docs.")
+ENDIF()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]