From feb24353f59e49ebcb5ad1dae3ef275ea75bb689 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 18 Jan 2021 20:14:54 +0100 Subject: add --disable-librelogo to disable LibreLogo at build time Annoyingly the packinfo_*.txt don't support conditionals but we can work-around that with a little duplication. Change-Id: Id00a6831effcc63a917fc21d2cd201474fdb559d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109569 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit c18d3f8823a00edcd3dacec4f2052302ab6a70ee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109764 Tested-by: Michael Stahl --- Repository.mk | 3 ++ RepositoryModule_host.mk | 2 +- config_host/config_python.h.in | 2 ++ configure.ac | 22 +++++++++++++ cui/inc/tipoftheday.hrc | 3 ++ officecfg/Configuration_officecfg.mk | 12 +++++-- postprocess/CustomTarget_registry.mk | 4 ++- scp2/InstallModule_python.mk | 7 ++-- scp2/source/python/module_python.scp | 4 +++ .../packinfo/packinfo_librelogo_disabled.txt | 37 ++++++++++++++++++++++ sw/Module_sw.mk | 2 +- 11 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 setup_native/source/packinfo/packinfo_librelogo_disabled.txt diff --git a/Repository.mk b/Repository.mk index 8f2614302be9..4b202cf61b57 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1076,10 +1076,13 @@ $(eval $(call gb_Helper_register_packages_for_install,python_scriptprovider, \ scripting_scriptproviderforpython \ )) +ifeq (LIBRELOGO,$(filter LIBRELOGO,$(BUILD_TYPE))) $(eval $(call gb_Helper_register_packages_for_install,python_librelogo, \ librelogo \ librelogo_properties \ )) +endif # LIBRELOGO + endif # DISABLE_PYTHON # External executables diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk index 80992dfed7e2..3f7c7a1edfbc 100644 --- a/RepositoryModule_host.mk +++ b/RepositoryModule_host.mk @@ -81,7 +81,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ jurt \ jvmaccess \ jvmfwk \ - librelogo \ + $(call gb_Helper_optional,LIBRELOGO,librelogo) \ libreofficekit \ lingucomponent \ linguistic \ diff --git a/config_host/config_python.h.in b/config_host/config_python.h.in index 3258205b29a8..8972fbd77310 100644 --- a/config_host/config_python.h.in +++ b/config_host/config_python.h.in @@ -5,4 +5,6 @@ #undef PYTHON_VERSION_STRING +#define ENABLE_LIBRELOGO 0 + #endif // CONFIG_PYTHON_H diff --git a/configure.ac b/configure.ac index 97e3f49efc9c..0b7415549198 100644 --- a/configure.ac +++ b/configure.ac @@ -1526,6 +1526,11 @@ AC_ARG_ENABLE(ldap, [Disable LDAP support.]), ,enable_ldap=yes) +libo_FUZZ_ARG_ENABLE(librelogo, + AS_HELP_STRING([--disable-librelogo], + [Do not build LibreLogo.]), +,enable_librelogo=yes) + dnl =================================================================== dnl Optional Packages (--with/without-) dnl =================================================================== @@ -8815,6 +8820,23 @@ AC_SUBST(PYTHON_VERSION) AC_SUBST(PYTHON_VERSION_MAJOR) AC_SUBST(PYTHON_VERSION_MINOR) +AC_MSG_CHECKING([whether to build LibreLogo]) +case "$enable_python" in +no|disable) + AC_MSG_RESULT([no; Python disabled]) + ;; +*) + if test "${enable_librelogo}" = "no"; then + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([yes]) + BUILD_TYPE="${BUILD_TYPE} LIBRELOGO" + AC_DEFINE([ENABLE_LIBRELOGO],1) + fi + ;; +esac +AC_SUBST(ENABLE_LIBRELOGO) + ENABLE_MARIADBC=TRUE if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then ENABLE_MARIADBC= diff --git a/cui/inc/tipoftheday.hrc b/cui/inc/tipoftheday.hrc index 348b04920ae7..7f2178354220 100644 --- a/cui/inc/tipoftheday.hrc +++ b/cui/inc/tipoftheday.hrc @@ -23,6 +23,7 @@ #define NC_(Context, String) reinterpret_cast(Context "\004" u8##String) #include +#include #include /* @@ -93,7 +94,9 @@ const std::tuple TIPOFTHEDAY_STRINGARRAY[] = { NC_("RID_CUI_TIPOFTHEDAY", "%PRODUCTNAME has great extensions to increase your productivity - check them out."), "https://extensions.libreoffice.org", ""}, { NC_("RID_CUI_TIPOFTHEDAY", "Want to count words for just one particular paragraph style? Use Edit > Find & Replace > Paragraph Styles, select the style > Find All and read the number from the status bar."), "", "tipoftheday_w.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Generate fully customized PDF documents with the exact format, image compression, comments, access rights, password, etc., via File > Export as PDF."), "", ""}, +#if ENABLE_LIBRELOGO { NC_("RID_CUI_TIPOFTHEDAY", "Writer includes LibreLogo: simple Logo-like programming environment with turtle vector graphics, DTP and graphic design."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/librelogo/LibreLogo.html", "tipoftheday_w.png"}, //local help missing +#endif { NC_("RID_CUI_TIPOFTHEDAY", "Construct your own 2D shapes in Draw. Select two or more objects, and explore possibilities with Shape > Combine, Shape > Merge, Shape > Subtract, and Shape > Intersect."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/sdraw/guide/combine_etc.html", "tipoftheday_d.png"}, { NC_("RID_CUI_TIPOFTHEDAY", "Do you plan to change your computer and want to recover your customizations? See:"), "https://wiki.documentfoundation.org/UserProfile", ""}, { NC_("RID_CUI_TIPOFTHEDAY", "You can toggle between the field names and the actual value with View > Fields Names (or Ctrl + F9)."), "", "tipoftheday_w.png"}, diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk index 9ce55fafcc4a..4fa356ea7caa 100644 --- a/officecfg/Configuration_officecfg.mk +++ b/officecfg/Configuration_officecfg.mk @@ -72,7 +72,9 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat org/openoffice/Office/Accelerators-macosx.xcu \ org/openoffice/Office/Accelerators-reportbuilder.xcu \ org/openoffice/Office/Accelerators-unxwnt.xcu \ - org/openoffice/Office/Addons-librelogo.xcu \ + $(call gb_Helper_optional,LIBRELOGO, \ + org/openoffice/Office/Addons-librelogo.xcu \ + ) \ org/openoffice/Office/Common-writer.xcu \ org/openoffice/Office/Common-calc.xcu \ org/openoffice/Office/Common-draw.xcu \ @@ -111,7 +113,9 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat org/openoffice/Office/Embedding-base.xcu \ org/openoffice/Office/Embedding-reportbuilder.xcu \ org/openoffice/Office/Embedding-writer.xcu \ - org/openoffice/Office/UI/WriterWindowState-librelogo.xcu \ + $(call gb_Helper_optional,LIBRELOGO, \ + org/openoffice/Office/UI/WriterWindowState-librelogo.xcu \ + ) \ org/openoffice/Office/UI/Controller-reportbuilder.xcu \ org/openoffice/TypeDetection/UISort-writer.xcu \ org/openoffice/TypeDetection/UISort-calc.xcu \ @@ -131,7 +135,9 @@ $(eval $(call gb_Configuration_add_spool_langpack,registry,officecfg/registry/da $(eval $(call gb_Configuration_add_localized_datas,registry,officecfg/registry/data,\ org/openoffice/Setup.xcu \ org/openoffice/Office/Accelerators.xcu \ - org/openoffice/Office/Addons.xcu \ + $(call gb_Helper_optional,LIBRELOGO, \ + org/openoffice/Office/Addons.xcu \ + ) \ org/openoffice/Office/Common.xcu \ org/openoffice/Office/DataAccess.xcu \ org/openoffice/Office/PresentationMinimizer.xcu \ diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk index c33417c6b2a7..77cf8c6421b7 100644 --- a/postprocess/CustomTarget_registry.mk +++ b/postprocess/CustomTarget_registry.mk @@ -27,7 +27,6 @@ postprocess_XCDS := \ draw.xcd \ graphicfilter.xcd \ impress.xcd \ - librelogo.xcd \ lingucomponent.xcd \ main.xcd \ math.xcd \ @@ -110,10 +109,13 @@ postprocess_FILES_impress := \ $(postprocess_MOD)/org/openoffice/Office/ProtocolHandler-impress.xcu \ $(postprocess_MOD)/org/openoffice/Setup-impress.xcu +ifeq (LIBRELOGO,$(filter LIBRELOGO,$(BUILD_TYPE))) +postprocess_XCDS += librelogo.xcd postprocess_DEPS_librelogo := main writer postprocess_FILES_librelogo := \ $(postprocess_MOD)/org/openoffice/Office/Addons-librelogo.xcu \ $(postprocess_MOD)/org/openoffice/Office/UI/WriterWindowState-librelogo.xcu +endif postprocess_DEPS_lingucomponent := main postprocess_FILES_lingucomponent := \ diff --git a/scp2/InstallModule_python.mk b/scp2/InstallModule_python.mk index e38d58a9b821..e4f3bd5f7db4 100644 --- a/scp2/InstallModule_python.mk +++ b/scp2/InstallModule_python.mk @@ -12,7 +12,7 @@ $(eval $(call gb_InstallModule_InstallModule,scp2/python)) $(eval $(call gb_InstallModule_use_auto_install_libs,scp2/python,\ python \ python_scriptprovider \ - python_librelogo \ + $(call gb_Helper_optional,LIBRELOGO,python_librelogo) \ )) ifeq ($(DISABLE_PYTHON),TRUE) @@ -32,17 +32,18 @@ $(eval $(call gb_InstallModule_define_if_set,scp2/python,\ $(eval $(call gb_InstallModule_add_defs,scp2/python,\ -DPYVERSION=$(PYTHON_VERSION) \ + $(call gb_Helper_optional,LIBRELOGO,-DENABLE_LIBRELOGO=1) \ )) endif $(eval $(call gb_InstallModule_add_scpfiles,scp2/python,\ scp2/source/python/file_python \ - scp2/source/python/file_python_librelogo \ + $(call gb_Helper_optional,LIBRELOGO,scp2/source/python/file_python_librelogo) \ scp2/source/python/module_python \ )) $(eval $(call gb_InstallModule_add_localized_scpfiles,scp2/python,\ - scp2/source/python/module_python_librelogo \ + $(call gb_Helper_optional,LIBRELOGO,scp2/source/python/module_python_librelogo) \ )) # vim: set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/scp2/source/python/module_python.scp b/scp2/source/python/module_python.scp index 1424409c1f9c..343ad94029fb 100644 --- a/scp2/source/python/module_python.scp +++ b/scp2/source/python/module_python.scp @@ -24,7 +24,11 @@ #include "AutoInstall/python_scriptprovider" Module gid_Module_Pyuno +#ifdef ENABLE_LIBRELOGO PackageInfo = "packinfo_office.txt"; +#else + PackageInfo = "packinfo_librelogo_disabled.txt"; +#endif ParentID = gid_Module_Root_Brand; Name = "PyUNO"; Description = "Python-UNO bridge"; diff --git a/setup_native/source/packinfo/packinfo_librelogo_disabled.txt b/setup_native/source/packinfo/packinfo_librelogo_disabled.txt new file mode 100644 index 000000000000..daa89a5605a4 --- /dev/null +++ b/setup_native/source/packinfo/packinfo_librelogo_disabled.txt @@ -0,0 +1,37 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# special file to conflict with any old -librelogo that may be installed + +Start +module = "gid_Module_Pyuno" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-pyuno" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core, SUNWPython" +packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-pyuno" +linuxreplaces = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo" +linuxincompat = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo" +freebsdrequires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core" +requires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core %PACKAGEVERSION %PACKAGEVERSION-%PACKAGEREVISION" +copyright = "2021 The Document Foundation" +solariscopyright = "solariscopyrightfile" +vendor = "The Document Foundation" +description = "Pyuno module for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index aa737173f861..45b28d52d841 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -164,7 +164,7 @@ $(eval $(call gb_Module_add_uicheck_targets,sw,\ UITest_sw_findReplace \ UITest_sw_findSimilarity \ UITest_chapterNumbering \ - UITest_librelogo \ + $(call gb_Helper_optional,LIBRELOGO,UITest_librelogo) \ UITest_options \ UITest_classification \ UITest_writer_macro_tests \ -- cgit