[PATCH] selectively disable applications from the suite

David Ostrovsky (via Code Review) gerrit at gerrit.libreoffice.org
Sat Mar 16 17:23:40 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2778

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/78/2778/1

selectively disable applications from the suite

See how mozilla project handles it:
https://developer.mozilla.org/en-US/docs/Configuring_Build_Options
see "Choose an application" section (#Choose_an_Application)

--enable-application=mail
--enable-application=browser
--enable-application=suite

Start with calc (alphabetical order) and apply it for the whole suite.

Change-Id: I7141f0bdedb398eca7f31a1d5c66f009056f4d23
---
M config_host.mk.in
M configure.ac
M postprocess/CustomTarget_registry.mk
M postprocess/Rdb_services.mk
M sc/Module_sc.mk
M solenv/bin/modules/installer/scriptitems.pm
M solenv/bin/modules/installer/worker.pm
7 files changed, 54 insertions(+), 9 deletions(-)



diff --git a/config_host.mk.in b/config_host.mk.in
index 496097c..9266351 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -91,6 +91,7 @@
 export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@
 export DIRECTXSDK_LIB=@DIRECTXSDK_LIB@
 export DISABLE_ACTIVEX=@DISABLE_ACTIVEX@
+export DISABLED_APPS=@DISABLED_APPS@
 export DISABLE_ATL=@DISABLE_ATL@
 export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@
 export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@
diff --git a/configure.ac b/configure.ac
index 2c3d743..0b7b209 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1099,6 +1099,14 @@
 )
 
 dnl ===================================================================
+dnl Optional Enable/Dsiable Applications
+dnl ===================================================================
+AC_ARG_ENABLE(calc,
+    AS_HELP_STRING([--calc],
+        [Test if calc should be built]),
+)
+
+dnl ===================================================================
 dnl Optional Packages (--with/without-)
 dnl ===================================================================
 
@@ -11186,6 +11194,20 @@
 AC_SUBST(MD5SUM)
 
 dnl ===================================================================
+dnl Test which applications to build from the suite
+dnl ===================================================================
+DISABLED_APPS=
+AC_MSG_CHECKING([whether to build calc])
+if test "$enable_calc" = "" -o "$enable_calc" = "no"; then
+    DISABLED_APPS=CALC
+    AC_MSG_RESULT([no])
+else
+    AC_MSG_RESULT([yes])
+fi
+
+AC_SUBST(DISABLED_APPS)
+
+dnl ===================================================================
 dnl Product version
 dnl ===================================================================
 AC_MSG_CHECKING([for product version])
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index 181c782..26dc110 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -57,9 +57,12 @@
 	$(postprocess_MOD)/org/openoffice/Setup-calc.xcu
 
 ifeq (DBCONNECTIVITY,$(filter DBCONNECTIVITY,$(BUILD_TYPE)))
+# build calc app?
+ifeq ($(filter CALC,$(DISABLED_APPS)),)
 postprocess_FILES_calc += \
 	$(postprocess_MOD)/org/openoffice/Office/DataAccess/Drivers-calc.xcu
 postprocess_DRIVERS += calc
+endif
 ifeq (WNT,$(OS))
 ifeq ($(WITH_MOZAB4WIN),YES)
 postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/Office/DataAccess/Drivers-mozab.xcu
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 8693cd1..c91a9c8 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -59,9 +59,11 @@
 	package/util/package2 \
 	sax/source/expatwrap/expwrap \
 	sax/source/fastparser/fastsax \
-	sc/util/sc \
-	sc/util/scd \
-	sc/util/scfilt \
+	$(if $(filter-out CALC,$(DISABLED_APPS)), \
+		sc/util/sc \
+		sc/util/scd \
+		sc/util/scfilt \
+	) \
 	scaddins/source/analysis/analysis \
 	scaddins/source/datefunc/date \
 	scaddins/source/pricing/pricing \
@@ -161,7 +163,9 @@
 	$(if $(DISABLE_SCRIPTING),, \
 		basctl/util/basctl \
 		basic/util/sb \
-		sc/util/vbaobj \
+		$(if $(filter-out CALC,$(DISABLED_APPS)), \
+			sc/util/vbaobj \
+		) \
 		scripting/source/basprov/basprov \
 		scripting/source/dlgprov/dlgprov \
 		scripting/source/protocolhandler/protocolhandler \
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 4a4fc41..207ad15 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -23,6 +23,8 @@
 
 $(eval $(call gb_Module_Module,sc))
 
+ifeq ($(filter CALC,$(DISABLED_APPS)),)
+
 $(eval $(call gb_Module_add_targets,sc,\
 	AllLangResTarget_sc \
 	CustomTarget_uiconfig \
@@ -79,4 +81,6 @@
     CppunitTest_sc_modelobj \
 ))
 
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
index cd4b141..c463bd3 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -1274,10 +1274,14 @@
     $infoline = "\n";
     push( @installer::globals::logfileinfo, $infoline);
 
-    if ( $error_occurred )
+    # Only check if we are not in hackish mode ;-)
+    if (not defined $ENV{DISABLED_APPS})
     {
-        for ( my $i = 0; $i <= $#missingfiles; $i++ ) { print "$missingfiles[$i]"; }
-        installer::exiter::exit_program("ERROR: Missing files", "remove_Files_Without_Sourcedirectory");
+        if ( $error_occurred )
+        {
+            for ( my $i = 0; $i <= $#missingfiles; $i++ ) { print "$missingfiles[$i]"; }
+            installer::exiter::exit_program("ERROR: Missing files", "remove_Files_Without_Sourcedirectory");
+        }
     }
 
     return \@newfilesarray;
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index 9a122e4..b6b4cd8 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -170,8 +170,15 @@
     # This is important, to get an error code "-1", if an error was found in the log file,
     # that did not break the packaging process
 
-    if ( ! $is_success) { installer::exiter::exit_program("ERROR: Found an error in the logfile. Packaging failed.", "analyze_and_save_logfile"); }
-
+    # Only check if we are not in hackish mode ;-)
+    if (not defined $ENV{DISABLED_APPS})
+    {
+        if ( ! $is_success) { installer::exiter::exit_program("ERROR: Found an error in the logfile. Packaging failed.", "analyze_and_save_logfile"); }
+    }
+    else
+    {
+        $is_success = 1;
+    }
     return ($is_success, $finalinstalldir);
 }
 

-- 
To view, visit https://gerrit.libreoffice.org/2778
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7141f0bdedb398eca7f31a1d5c66f009056f4d23
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: David Ostrovsky <David.Ostrovsky at gmx.de>



More information about the LibreOffice mailing list