This patch to configure.in/set_soenv introduces the option
--enable-theme="theme1 theme2..." (with all available themes selected by
default).

set_soenv sets the environment variable ENABLE_THEME to the list of
themes. This part wrks (although configure could/should check against invalid
values being passed in).

THen packimages/makefile is modified in patch2, to use this passed in
list of themes to process rather than hardcoding a list of themes. This
should work but it untested so far.

The only piece missing is to get SCP2 to only install the selected
themes, I have not tackled this, but I might also not have time to do
so. So here you go for inclusion and further refinement.

>From cf3c35b5d76f2074b721dc6acfeb20662dec1f5a Mon Sep 17 00:00:00 2001
From: Sebastian Spaeth <[email protected]>
Date: Thu, 9 Dec 2010 12:23:55 +0100
Subject: [PATCH] Introduce an --enable-theme="theme1 theme2..." option

By default, we include all defaults as before, but if given, we can
limit the number of included themes with e.g. --enable-theme="oxygen
tango". This is passed through set_soenv and sets the environment
variable ENABLE_THEMES="...." which can be used by the packimages
makefile in the postprocess repository.

Signed-off-by: Sebastian Spaeth <[email protected]>
---
 configure.in |   28 +++++++++++++++++++++++++++-
 set_soenv.in |    1 +
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 7fe1e95..8671340 100755
--- a/configure.in
+++ b/configure.in
@@ -487,6 +487,12 @@ AC_ARG_ENABLE(extra-font,
 	[Add extra font content.]),
 ,)
 
+AC_ARG_ENABLE(theme,
+    AS_HELP_STRING([--enable-theme="theme1 theme2..."],
+	[Choose which themes to include. By default all available themes are included.
+         Possible choices: crystal, hicontrast, oxygen, tango.]),
+,)
+
 dnl ---------- Deprecated since 2010-11-05 ----------
 
 AC_ARG_ENABLE(mysql-connector,
@@ -7634,9 +7640,29 @@ else
   SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
 fi
 AC_SUBST(WITH_EXTRA_FONT)
-
 AC_SUBST(SCPDEFS)
 
+dnl ===================================================================
+dnl Test which themes to include
+dnl ===================================================================
+AC_MSG_CHECKING([which themes to include])
+ALL_THEMES="crystal hicontrast oxygen tango"
+if test "z$enable_theme" = "z"; then
+  ENABLE_THEMES=$ALL_THEMES
+  AC_MSG_RESULT([$ENABLE_THEMES])
+else
+  ENABLE_THEMES=""
+  for theme in $enable_theme
+  do
+    ENABLE_THEMES="$ENABLE_THEMES $theme"
+  done
+  AC_MSG_RESULT([$ENABLE_THEMES])
+fi
+AC_SUBST(ENABLE_THEMES)
+
+dnl ===================================================================
+dnl Test whether to enable ActiveX embedding
+dnl ===================================================================
 if test "$_os" = "WINNT"; then
   AC_MSG_CHECKING([whether to enable ActiveX embedding of LibO components])
   if test "$enable_activex_component" = "yes" -o "$enable_activex_component" = "TRUE" -o "$enable_activex_component" = ""; then
diff --git a/set_soenv.in b/set_soenv.in
index cc41e61..4985cb0 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1694,6 +1694,7 @@ ToFile( "ENABLE_MINIMIZER",   "@ENABLE_MINIMIZER@","e" );
 ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" );
 ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" );
 ToFile( "ENABLE_UNIX_QUICKSTARTER", "@ENABLE_UNIX_QUICKSTARTER@", "e" );
+ToFile( "ENABLE_THEMES",     "@ENABLE_THEMES@","e");
 ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" );
 ToFile( "OOO_JUNIT_JAR",     "@OOO_JUNIT_JAR@",    "e" );
 ToFile( "SAC_JAR",           "@SAC_JAR@",          "e" );
-- 
1.7.1

>From fdf9a873af71df8ed92b48ea329eb7494ea65852 Mon Sep 17 00:00:00 2001
From: Sebastian Spaeth <[email protected]>
Date: Thu, 9 Dec 2010 12:32:32 +0100
Subject: [PATCH] Don't harcode list of themes to process

Don't use a hardcoded list of themes to process but use the
ENABLE_THEMES environment variable which is defined during configure
time and set in set_soenv.

Signed-off-by: Sebastian Spaeth <[email protected]>
---
 packimages/pack/makefile.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/packimages/pack/makefile.mk b/packimages/pack/makefile.mk
index d8d75df..b21737c 100644
--- a/packimages/pack/makefile.mk
+++ b/packimages/pack/makefile.mk
@@ -38,7 +38,7 @@ IMAGES := $(COMMONBIN)$/images.zip
 SORTED_LIST=$(RES)$/img$/sorted.lst
 # Custom sets, at 24x24 & 16x16 fall-back to Tango preferentially
 # (Tango fallbacks to Industrial for the missing icons)
-CUSTOM_IMAGE_SETS=hicontrast crystal oxygen tango
+CUSTOM_IMAGE_SETS=$(ENABLE_THEMES)
 CUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
 CUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/tango
 CUSTOM_PREFERRED_FALLBACK_2*=-c $(SOLARSRC)$/ooo_custom_images$/industrial
-- 
1.7.1


Sebastian
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to