Hi, I tried to get rid of some copyleft dependencies. As I will leave for vacation on Wednesday, I now send my first patch to the list so that others already can have a look or even continue. I only did it on Linux so far, of course we will need adaptions for other platforms. I created the patch from the hg repository of OpenOffice.org, but the differences to our still not existing svn repository won't be huge, so it should bring us a little bit closer to a "clean" build.
I also added some more todos to the wiki page. Meanwhile the license information at http://wiki.services.openoffice.org/wiki/ApacheMigration about our external tarballs is nearly complete, so there might be some more modules that could be worked on before we will tackle the "internal" copyleft dependencies. As I see it, I already should have covered most dependencies on copyleft licensed external tarballs, with the exceptions of the modules for the svg import (Kai Ahrens announced to work on it) and linear solver (Niklas Nebel already created a first patch for it). Now some words about the patch. I wanted to have it lazy ;-), so I just added a single configure switch "--with-disable-copyleft" and did some quick and dirty changes to configure.in. If someone wants to make the name or the implementation nicer - please go for it. I never got when to use "yes/no" or "true/false" in our configure.in. :-) With the changes in the patch the following modules won't be built anymore when the switch is used: dictionaries epm gstreamer hunspell hyphen libwpd mozilla mythes neon nss saxon and some modules or module parts that depend on them. I didn't need to remove any sources, as all copyleft parts that I removed are external tar balls. The code using these parts is just "normal" OOo code that can stay in the repository, though should be left out in the standard build at Apache. The final installation set of the build on Linux currently ist just created as a tar.gz, native packages can't be created as epm is missing. (I already posted a question about epm to this list, hopefully someone will be able to answer it.) Thus the build currently finishes with an error message, nevertheless the tar.gz was created and the result basically runs fine. The patch contains some unfinished work in rhino that is still commented out. If someone knows how to add conditional compilation to a build.xml file (I don't): the module "scripting" has parts depending on rhino that need to be removed from the build.xml in case DISABLE_RHINO is set. Which parts these are can easily be "detected" (means: found by build breakages) by removing the comment signs from my changes in rhino before you start the build. If you want to try it yourself: get the source from http://hg.services.openoffice.org/OOO340, apply the patch, call autoconf and then do the build as usual, following the build instructions in the ooo wiki. On my Ubuntu 11.04 the new configure switch was the only one I needed. For those amongst us that are used to the OOo build system: I treated configure no longer as part of the build tree, so autoconf is required after applying the patch. Makes more sense that way, IMHO, and from what I already learned on this list, it is the preferred way at Apache. Regards, Mathias
diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -842,6 +842,9 @@ AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Disables generation of dependency information. ],,) +AC_ARG_WITH(disable-copyleft, +[ --with-disable-copyleft Whether to use provided NSS module +],,) BUILD_TYPE="OOo" @@ -1227,6 +1230,33 @@ dnl =================================================================== dnl Build options dnl =================================================================== + +AC_MSG_CHECKING([whether to disable copyleft components]) +if test "$with-disable-copyleft" != ""; then + + enable_mozilla="no" + enable_nss_module="no" + enable_gstreamer="no" + enable_epm="no" + with_myspell_dicts="no" + enable_neon="no" + + DISABLE_HUNSPELL="TRUE" + DISABLE_HYPHEN="TRUE" + DISABLE_LIBWPD="TRUE" + DISABLE_SAXON="TRUE" + BUILD_EPM="NO" + +AC_MSG_RESULT([yes]) + +AC_SUBST(DISABLE_HUNSPELL) +AC_SUBST(DISABLE_HYPHEN) +AC_SUBST(DISABLE_LIBWPD) +AC_SUBST(DISABLE_SAXON) +AC_SUBST(BUILD_EPM) + +fi + AC_MSG_CHECKING([whether to enable native CUPS support]) if test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then ENABLE_CUPS="TRUE" @@ -3622,6 +3652,7 @@ dnl =================================================================== dnl Check for system libwpd dnl =================================================================== +if test "with-disable-copyleft" == ""; then AC_MSG_CHECKING([which libwpd to use]) if test -n "$with_system_libwpd" -o -n "$with_system_libs" && \ test "$with_system_libwpd" != "no"; then @@ -3636,6 +3667,7 @@ AC_SUBST(SYSTEM_LIBWPD) AC_SUBST(LIBWPD_CFLAGS) AC_SUBST(LIBWPD_LIBS) +fi dnl =================================================================== dnl Check for system cppunit @@ -4093,6 +4125,7 @@ dnl =================================================================== dnl Check for system saxon dnl =================================================================== +if test "with-disable-copyleft" == ""; then AC_MSG_CHECKING([which saxon to use]) if test -n "$with_system_saxon" -o -n "$with_system_libs" && \ test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then @@ -4196,6 +4229,7 @@ if test -n "$NEED_SAXON"; then BUILD_TYPE="$BUILD_TYPE SAXON" fi +fi dnl =================================================================== dnl Check for system curl @@ -5094,6 +5128,9 @@ dnl =================================================================== dnl Check for system hunspell dnl =================================================================== + +if test "with-disable-copyleft" == ""; then + AC_MSG_CHECKING([which libhunspell to use]) if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \ test "$with_system_hunspell" != "no"; then @@ -5184,6 +5221,8 @@ AC_SUBST(MYTHES_CFLAGS) AC_SUBST(MYTHES_LIBS) +fi + dnl =================================================================== dnl Checking for lpsolve dnl =================================================================== diff --git a/filter/source/xsltfilter/makefile.mk b/filter/source/xsltfilter/makefile.mk --- a/filter/source/xsltfilter/makefile.mk +++ b/filter/source/xsltfilter/makefile.mk @@ -35,6 +35,8 @@ CLASSDIR!:=$(CLASSDIR)$/$(TARGET) .INCLUDE: settings.mk +.IF "$(DISABLE_SAXON)" == "" + SLOFILES=$(SLO)$/XSLTFilter.obj $(SLO)$/fla.obj LIBNAME=xsltfilter SHL1TARGETDEPN=makefile.mk @@ -101,3 +103,8 @@ $(XSLTPROC) --nonet --stringparam uri \ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ $(SOLARENV)/bin/createcomponent.xslt xsltfilter.component + +.ELSE +all: + @echo "saxon disabled" +.ENDIF diff --git a/hunspell/makefile.mk b/hunspell/makefile.mk --- a/hunspell/makefile.mk +++ b/hunspell/makefile.mk @@ -36,6 +36,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_HUNSPELL)" == "" + TARFILE_NAME=hunspell-1.2.9 TARFILE_MD5=68dd2e8253d9a7930e9fd50e2d7220d0 ADDITIONAL_FILES+=config.h @@ -96,3 +98,7 @@ .INCLUDE : target.mk .INCLUDE : tg_ext.mk +.ELSE +all: + @echo "hunspell disabled" +.ENDIF diff --git a/hyphen/makefile.mk b/hyphen/makefile.mk --- a/hyphen/makefile.mk +++ b/hyphen/makefile.mk @@ -36,6 +36,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_HYPHEN)" == "" + TARFILE_NAME=hyphen-2.7.1 TARFILE_MD5=48a9f787f43a09c0a9b7b00cd1fddbbf @@ -107,3 +109,8 @@ .INCLUDE : target.mk .INCLUDE : tg_ext.mk +.ELSE +all: + @echo "hyphen disabled" + +.ENDIF diff --git a/libwpd/makefile.mk b/libwpd/makefile.mk --- a/libwpd/makefile.mk +++ b/libwpd/makefile.mk @@ -36,6 +36,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_LIBWPD)" == "" + .IF "$(SYSTEM_LIBWPD)" == "YES" @all: @echo "Using system libwpd..." @@ -53,3 +55,7 @@ .INCLUDE : target.mk .INCLUDE : tg_ext.mk +.ELSE +all: + @echo "libwpd disabled" +.ENDIF diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk @@ -46,6 +46,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_HYPHEN)" == "" + .IF "$(SYSTEM_HUNSPELL)" != "YES" HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell .ENDIF @@ -99,3 +101,9 @@ $(XSLTPROC) --nonet --stringparam uri \ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ $(SOLARENV)/bin/createcomponent.xslt hyphen.component + +.ELSE +all: + @echo "hyphen disabled" + +.ENDIF diff --git a/lingucomponent/source/lingutil/makefile.mk b/lingucomponent/source/lingutil/makefile.mk --- a/lingucomponent/source/lingutil/makefile.mk +++ b/lingucomponent/source/lingutil/makefile.mk @@ -37,6 +37,8 @@ .INCLUDE : settings.mk +.IF "$(DISABLE_HUNSPELL)" == "" + .IF "$(SYSTEM_HUNSPELL)" != "YES" HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell .ENDIF @@ -61,3 +63,7 @@ # --- Targets ------------------------------------------------------ .INCLUDE : target.mk +.ELSE +all: + @echo "hunspell disabled" +.ENDIF diff --git a/lingucomponent/source/spellcheck/spell/makefile.mk b/lingucomponent/source/spellcheck/spell/makefile.mk --- a/lingucomponent/source/spellcheck/spell/makefile.mk +++ b/lingucomponent/source/spellcheck/spell/makefile.mk @@ -42,6 +42,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_HUNSPELL)" == "" + CXXFLAGS += -I$(PRJ)$/source$/lingutil $(HUNSPELL_CFLAGS) CFLAGSCXX += -I$(PRJ)$/source$/lingutil $(HUNSPELL_CFLAGS) CFLAGSCC += -I$(PRJ)$/source$/lingutil $(HUNSPELL_CFLAGS) @@ -93,3 +95,8 @@ $(XSLTPROC) --nonet --stringparam uri \ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ $(SOLARENV)/bin/createcomponent.xslt spell.component + +.ELSE +all: + @echo "hunspell disabled" +.ENDIF diff --git a/lingucomponent/source/thesaurus/libnth/makefile.mk b/lingucomponent/source/thesaurus/libnth/makefile.mk --- a/lingucomponent/source/thesaurus/libnth/makefile.mk +++ b/lingucomponent/source/thesaurus/libnth/makefile.mk @@ -51,6 +51,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_HUNSPELL)" == "" + .IF "$(SYSTEM_HUNSPELL)" != "YES" HUNSPELL_CFLAGS += -I$(SOLARINCDIR)$/hunspell .ENDIF @@ -113,3 +115,8 @@ $(XSLTPROC) --nonet --stringparam uri \ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ $(SOLARENV)/bin/createcomponent.xslt lnth.component + +.ELSE +all: + @echo "hunspell disabled" +.ENDIF diff --git a/mythes/makefile.mk b/mythes/makefile.mk --- a/mythes/makefile.mk +++ b/mythes/makefile.mk @@ -36,6 +36,8 @@ # --- Files -------------------------------------------------------- +.IF "$(DISABLE_HUNSPELL)" == "" + TARFILE_NAME=mythes-1.2.0 TARFILE_MD5=067201ea8b126597670b5eff72e1f66c @@ -112,3 +114,7 @@ .EXPORT: HUNSPELL_LIBS HUNSPELL_CFLAGS .ENDIF +.ELSE +all: + @echo "hunspell disabled" +.ENDIF diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk --- a/postprocess/packcomponents/makefile.mk +++ b/postprocess/packcomponents/makefile.mk @@ -106,11 +106,9 @@ frm \ guesslang \ hwp \ - hyphen \ i18npool \ i18nsearch \ lng \ - lnth \ localebe1 \ log \ mcnttype \ @@ -148,7 +146,6 @@ sm \ smd \ solver \ - spell \ spl \ srtrs1 \ stringresource \ @@ -173,14 +170,12 @@ vbaevents \ vbaobj \ vclcanvas \ - wpft \ writerfilter \ xcr \ xmlfa \ xmlfd \ xmx \ xsltdlg \ - xsltfilter \ xstor .IF "$(OS)" == "MACOSX" @@ -197,6 +192,25 @@ my_components += oooimprovement .END +.IF "$(DISABLE_SAXON)" == "" +my_components += XSLTFilter.jar \ + xsltfilter +.END + +.IF "$(DISABLE_HYPHEN)" == "" +my_components += hyphen +.END + +.IF "$(DISABLE_HUNSPELL)" == "" +my_components += \ + lnth \ + spell +.END + +.IF "$(DISABLE_LIBWPD)" == "" +my_components += wpft +.END + .IF "$(DISABLE_ATL)" == "" my_components += emboleobj .END @@ -249,7 +263,6 @@ ScriptProviderForJava \ ScriptProviderForJavaScript \ XMergeBridge \ - XSLTFilter.jar \ XSLTValidate \ agenda \ fax \ diff --git a/rhino/makefile.mk b/rhino/makefile.mk --- a/rhino/makefile.mk +++ b/rhino/makefile.mk @@ -38,6 +38,8 @@ # --- Files -------------------------------------------------------- +#.IF "$(DISABLE_RHINO)" == "" + TARFILE_NAME=rhino1_5R5 TARFILE_MD5=798b2ffdc8bcfe7bca2cf92b62caf685 TARFILE_ROOTDIR=rhino1_5R5 @@ -63,6 +65,11 @@ .INCLUDE : target.mk .INCLUDE : tg_ext.mk +#.ELSE +#all: +# @echo rhino disabled +#.ENDIF + .ELSE all: @echo java disabled diff --git a/saxon/makefile.mk b/saxon/makefile.mk --- a/saxon/makefile.mk +++ b/saxon/makefile.mk @@ -35,6 +35,8 @@ .INCLUDE : settings.mk .INCLUDE : antsettings.mk +.IF "$(DISABLE_SAXON)" == "" + .IF "$(SOLAR_JAVA)" != "" .IF "$(SYSTEM_SAXON)" == "YES" all: @@ -67,3 +69,8 @@ .INCLUDE : tg_ext.mk .ENDIF +.ELSE +all: + @echo "saxon disabled" +.ENDIF + diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -889,7 +889,9 @@ #endif +#ifndef DISABLE_LIBWPD STD_LIB_FILE(gid_File_Lib_Wpft,wpft) +#endif STD_LIB_FILE(gid_File_Lib_T602Filter,t602filter) @@ -1311,12 +1313,14 @@ #endif +#ifndef DISABLE_HUNSPELL File gid_File_Lib_Spell TXT_FILE_BODY; Styles = (PACKED); Name = LIBNAME(spell); Dir = SCP2_OOO_BIN_DIR; End +#endif STD_LIB_FILE( gid_File_Lib_Spl, spl) @@ -1429,19 +1433,23 @@ SPECIAL_COMPONENT_LIB_FILE(gid_File_Ucpexpand1, ucpexpand1.uno) +#ifndef DISABLE_HUNSPELL File gid_File_Lib_Lnth TXT_FILE_BODY; Styles = (PACKED); Name = LIBNAME(lnth); Dir = SCP2_OOO_BIN_DIR; End +#endif +#ifndef DISABLE_HYPHEN File gid_File_Lib_Hyph TXT_FILE_BODY; Styles = (PACKED); Name = LIBNAME(hyphen); Dir = SCP2_OOO_BIN_DIR; End +#endif STD_LIB_FILE( gid_File_Lib_Utl , utl) @@ -1481,12 +1489,16 @@ SPECIAL_LIB_FILE(gid_File_Lib_Xstor,xstor) STD_LIB_FILE( gid_File_Lib_Xsltdlg, xsltdlg ) +#ifndef DISABLE_SAXON STD_LIB_FILE( gid_File_Lib_Xsltfilter, xsltfilter ) +#endif STD_LIB_FILE( gid_File_Lib_Xmlfa, xmlfa ) STD_LIB_FILE( gid_File_Lib_Xmlfd, xmlfd ) #ifdef SOLAR_JAVA +#ifndef DISABLE_SAXON STD_JAR_FILE( gid_File_Jar_Xsltfilter, XSLTFilter ) +#endif STD_JAR_FILE( gid_File_Jar_Xsltvalidate, XSLTValidate ) #endif diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp --- a/scp2/source/ooo/file_ooo.scp +++ b/scp2/source/ooo/file_ooo.scp @@ -483,9 +483,11 @@ #ifdef SOLAR_JAVA #ifndef SYSTEM_SAXON +#ifndef DISABLE_SAXON STD_JAR_FILE( gid_File_Jar_Saxon, saxon9 ) #endif #endif +#endif #ifndef SYSTEM_LIBTEXTCAT_DATA // fingerprint files (lm) diff --git a/scp2/source/ooo/makefile.mk b/scp2/source/ooo/makefile.mk --- a/scp2/source/ooo/makefile.mk +++ b/scp2/source/ooo/makefile.mk @@ -182,6 +182,22 @@ SCPDEFS+=-DSYSTEM_SAXON -DSAXON_JAR=\""file://$(SAXON_JAR)"\" .ENDIF +.IF "$(DISABLE_SAXON)" == "TRUE" +SCPDEFS+=-DDISABLE_SAXON +.ENDIF + +.IF "$(DISABLE_LIBWPD)" == "TRUE" +SCPDEFS+=-DDISABLE_LIBWPD +.ENDIF + +.IF "$(DISABLE_HUNSPELL)" == "TRUE" +SCPDEFS+=-DDISABLE_HUNSPELL +.ENDIF + +.IF "$(DISABLE_HYPHEN)" == "TRUE" +SCPDEFS+=-DDISABLE_HYPHEN +.ENDIF + .IF "$(JDK)" == "gcj" SCPDEFS+=-DGCJ .ENDIF diff --git a/set_soenv.in b/set_soenv.in --- a/set_soenv.in +++ b/set_soenv.in @@ -90,6 +90,7 @@ $COMMON_BUILD_TOOLS, $WIN_GREP, $WIN_FIND, $WIN_LS, $WIN_GNUCOPY, $WIN_TOUCH, $STLPORT4, $MOZILLA_VERSION, $MOZILLA_TOOLKIT, $PREBUILD_MOZAB, $MOZILLABUILD, $PROEXT, $TARFILE_LOCATION, + $DISABLE_SAXON, $DISABLE_HUNSPELL, $DISABLE_HYPHEN, $DISABLE_LIBWPD, $SYSTEM_PYTHON, $SYSTEM_MOZILLA, $EPM_FLAGS); # #------------------------------------------- @@ -1743,6 +1744,12 @@ chomp($tmpdir); ToFile( "TMPDIR", $tmpdir, "e" ); } +ToFile( "DISABLE_SAXON", "@DISABLE_SAXON@", "e" ); +ToFile( "DISABLE_HUNSPELL", "@DISABLE_HUNSPELL@", "e" ); +ToFile( "DISABLE_HYPHEN", "@DISABLE_HYPHEN@", "e" ); +ToFile( "DISABLE_LIBWPD", "@DISABLE_LIBWPD@", "e" ); + + ToFile( "PERL", $PERL, "e" ); ToFile( "RPM", "@RPM@", "e" ); ToFile( "DPKG", "@DPKG@", "e" ); diff --git a/sw/prj/build.lst b/sw/prj/build.lst --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -1,2 +1,2 @@ -sw sw : filter L10N:l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter LIBXSLT:libxslt NULL +sw sw : filter L10N:l10n connectivity LIBWPD:writerperfect vbahelper svx stoc writerfilter LIBXSLT:libxslt NULL sw sw\prj nmake - all sw_prj NULL diff --git a/writerperfect/source/filter/makefile.mk b/writerperfect/source/filter/makefile.mk --- a/writerperfect/source/filter/makefile.mk +++ b/writerperfect/source/filter/makefile.mk @@ -6,6 +6,8 @@ .INCLUDE : settings.mk +.IF "$(DISABLE_LIBWPD)" == "" + .IF "$(SYSTEM_LIBWPD)" == "YES" INCPRE+=$(LIBWPD_CFLAGS) -I.. .ELSE @@ -25,3 +27,9 @@ $(SLO)$/DocumentCollector.obj .INCLUDE : target.mk + +.ELSE +all: + @echo "libwpd disabled" +.ENDIF + diff --git a/writerperfect/source/stream/makefile.mk b/writerperfect/source/stream/makefile.mk --- a/writerperfect/source/stream/makefile.mk +++ b/writerperfect/source/stream/makefile.mk @@ -6,6 +6,8 @@ .INCLUDE : settings.mk +.IF "$(DISABLE_LIBWPD)" == "" + .IF "$(SYSTEM_LIBWPD)" == "YES" INCPRE+=$(LIBWPD_CFLAGS) .ENDIF @@ -16,3 +18,10 @@ SLOFILES= $(SLO)$/WPXSvStream.obj .INCLUDE : target.mk + +.ELSE +all: + @echo "libwpd disabled" +.ENDIF + + diff --git a/writerperfect/source/wpdimp/makefile.mk b/writerperfect/source/wpdimp/makefile.mk --- a/writerperfect/source/wpdimp/makefile.mk +++ b/writerperfect/source/wpdimp/makefile.mk @@ -6,6 +6,8 @@ .INCLUDE : settings.mk +.IF "$(DISABLE_LIBWPD)" == "" + .IF "$(SYSTEM_LIBWPD)" == "YES" INCPRE+=$(LIBWPD_CFLAGS) -I.. .ELSE @@ -19,3 +21,9 @@ $(SLO)$/wpft_genericfilter.obj .INCLUDE : target.mk + +.ELSE +all: + @echo "libwpd disabled" +.ENDIF + diff --git a/writerperfect/util/makefile.mk b/writerperfect/util/makefile.mk --- a/writerperfect/util/makefile.mk +++ b/writerperfect/util/makefile.mk @@ -4,6 +4,8 @@ .INCLUDE : settings.mk +.IF "$(DISABLE_LIBWPD)" == "" + .IF "$(GUI)"=="UNX" .IF "$(SYSTEM_LIBWPD)" == "YES" LIBWPD=$(LIBWPD_LIBS) @@ -51,3 +53,9 @@ $(XSLTPROC) --nonet --stringparam uri \ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ $(SOLARENV)/bin/createcomponent.xslt wpft.component + +.ELSE +all: + @echo "libwpd disabled" +.ENDIF +