diff --git a/build.pro b/build.pro index b621973..875b5b0 100644 --- a/build.pro +++ b/build.pro @@ -54,8 +54,10 @@ SUBDIRS = \ htmlrenderer \ pdfreader \ htmlfile \ - doctrenderer \ - \ + doctrenderer + +!no_x2t { +SUBDIRS += \ docxformat \ pptxformat \ docxfile \ @@ -67,6 +69,7 @@ SUBDIRS = \ odffilewriter \ xlsformat \ x2t +} !no_use_htmlfileinternal { SUBDIRS += htmlfileinternal @@ -211,38 +214,40 @@ doctrenderer.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/Makefile standardtester.makefile = $$CORE_ROOT_DIR/Test/Applications/StandardTester/Makefile.standardtester$$PRO_SUFFIX } -docxformat.file = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro -docxformat.makefile = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/Makefile.DocxFormatLib$$PRO_SUFFIX +!no_x2t { + docxformat.file = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro + docxformat.makefile = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/Makefile.DocxFormatLib$$PRO_SUFFIX -pptxformat.file = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro -pptxformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile.PPTXFormatLib$$PRO_SUFFIX + pptxformat.file = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro + pptxformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile.PPTXFormatLib$$PRO_SUFFIX -docxfile.file = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro -docxfile.makefile = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/Makefile.ASCOfficeDocxFile2Lib$$PRO_SUFFIX + docxfile.file = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro + docxfile.makefile = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/Makefile.ASCOfficeDocxFile2Lib$$PRO_SUFFIX -txtxmlformat.file = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro -txtxmlformat.makefile = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/Makefile.TxtXmlFormatLib$$PRO_SUFFIX + txtxmlformat.file = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro + txtxmlformat.makefile = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/Makefile.TxtXmlFormatLib$$PRO_SUFFIX -rtfformat.file = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro -rtfformat.makefile = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/Makefile.RtfFormatLib$$PRO_SUFFIX + rtfformat.file = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro + rtfformat.makefile = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/Makefile.RtfFormatLib$$PRO_SUFFIX -pptformat.file = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro -pptformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/Makefile.PPTFormatLib$$PRO_SUFFIX + pptformat.file = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro + pptformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/Makefile.PPTFormatLib$$PRO_SUFFIX -docformat.file = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro -docformat.makefile = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/Makefile.DocFormatLib$$PRO_SUFFIX + docformat.file = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro + docformat.makefile = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/Makefile.DocFormatLib$$PRO_SUFFIX -odffilereader.file = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro -odffilereader.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/Makefile.OdfFileReaderLib$$PRO_SUFFIX + odffilereader.file = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro + odffilereader.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/Makefile.OdfFileReaderLib$$PRO_SUFFIX -odffilewriter.file = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro -odffilewriter.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/Makefile.OdfFileWriterLib$$PRO_SUFFIX + odffilewriter.file = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro + odffilewriter.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/Makefile.OdfFileWriterLib$$PRO_SUFFIX -xlsformat.file = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro -xlsformat.makefile = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/Makefile.XlsFormatLib$$PRO_SUFFIX + xlsformat.file = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro + xlsformat.makefile = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/Makefile.XlsFormatLib$$PRO_SUFFIX -x2t.file = $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro -x2t.makefile = $$CORE_ROOT_DIR/X2tConverter/build/Qt/Makefile.X2tConverter$$PRO_SUFFIX + x2t.file = $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro + x2t.makefile = $$CORE_ROOT_DIR/X2tConverter/build/Qt/Makefile.X2tConverter$$PRO_SUFFIX +} desktop { hunspell.file = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/hunspell.pro @@ -304,14 +309,16 @@ desktop { desktopapp.depends = documentscore videoplayer } -x2t.depends = \ - docxformat \ - pptxformat \ - docxfile \ - txtxmlformat \ - rtfformat \ - pptformat \ - docformat \ - odffilereader \ - odffilewriter \ - xlsformat +!no_x2t { + x2t.depends = \ + docxformat \ + pptxformat \ + docxfile \ + txtxmlformat \ + rtfformat \ + pptformat \ + docformat \ + odffilereader \ + odffilewriter \ + xlsformat +} \ No newline at end of file diff --git a/make.py b/make.py index 504f5c0..559d9e2 100755 --- a/make.py +++ b/make.py @@ -80,7 +80,7 @@ make_common.make() # build updmodule for desktop (only for windows version) if ("windows" == base.host_platform()) and (config.check_option("module", "desktop")): config.extend_option("config", "updmodule") - config.extend_option("config", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml") + config.extend_option("qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml") if not base.is_file(base_dir + "/tools/WinSparkle-0.7.0.zip"): base.cmd("curl.exe", ["https://d2ettrnqo7v976.cloudfront.net/winsparkle/WinSparkle-0.7.0.zip", "--output", base_dir + "/tools/WinSparkle-0.7.0.zip"]) @@ -89,7 +89,7 @@ if ("windows" == base.host_platform()) and (config.check_option("module", "deskt base.cmd("7z.exe", ["x", base_dir + "/tools/WinSparkle-0.7.0.zip", "-otools"]) base.create_dir(base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle") - base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include") + #base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include") base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_32") base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/x64/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_64") diff --git a/scripts/base.py b/scripts/base.py index 974dbd2..4dcc7e5 100644 --- a/scripts/base.py +++ b/scripts/base.py @@ -121,6 +121,10 @@ def copy_lib(src, dst, name): lib_dst = dst + "/" if not ("windows" == host_platform()): lib_dst += "lib" + + if not is_file(file_src + lib_ext) and is_dir(src + "/" + name + ".framework"): + copy_dir(src + "/" + name + ".framework", dst + "/" + name + ".framework") + copy_file(file_src + lib_ext, lib_dst + name + lib_ext) return diff --git a/scripts/build.py b/scripts/build.py index 2bfb937..e9ed5ec 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -2,6 +2,7 @@ import config import base +import os # make build.pro def make(): @@ -10,32 +11,52 @@ def make(): if not platform in config.platforms: continue + print("------------------------------------------") + print("BUILD_PLATFORM: " + platform) + print("------------------------------------------") + + # makefile suffix file_suff = platform if (config.check_option("config", "debug")): file_suff += "_debug_" file_suff += config.option("branding") - - if base.is_windows(): - base.vcvarsall_start("x86" if base.platform_is_32(platform) else "x64") - if ("1" == config.option("clean")): - base.cmd(base.app_make(), ["clean", "all", "-f", "makefiles/build.makefile_" + file_suff], True) - base.cmd(base.app_make(), ["distclean", "-f", "makefiles/build.makefile_" + file_suff], True) - - print("------------------------------------------") - print("BUILD_PLATFORM: " + platform) - print("------------------------------------------") + # setup qt qt_dir = base.qt_setup(platform) + base.set_env("OS_DEPLOY", platform) + + # qmake CONFIG+=... config_param = base.qt_config(platform) - base.set_env("OS_DEPLOY", platform) - base.cmd(qt_dir + "/bin/qmake", ["-nocache", "build.pro", "CONFIG+=" + config_param]) - - base.cmd(base.app_make(), ["-f", "makefiles/build.makefile_" + file_suff]) - base.delete_file(".qmake.stash") + # qmake ADDON + qmake_addon = [] + if ("" != config.option("qmake_addon")): + qmake_addon.append(config.option("qmake_addon")) - if base.is_windows(): - base.vcvarsall_end() + # non windows platform + if not base.is_windows(): + if ("1" == config.option("clean")): + base.cmd(base.app_make(), ["clean", "all", "-f", "makefiles/build.makefile_" + file_suff], True) + base.cmd(base.app_make(), ["distclean", "-f", "makefiles/build.makefile_" + file_suff], True) + + base.cmd(qt_dir + "/bin/qmake", ["-nocache", "build.pro", "CONFIG+=" + config_param] + qmake_addon) + base.cmd(base.app_make(), ["-f", "makefiles/build.makefile_" + file_suff]) + else: + old_env = os.environ.copy() + qmake_bat = [] + qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64")) + if ("1" == config.option("clean")): + qmake_bat.append("call nmake clean all -f makefiles/build.makefile_" + file_suff) + qmake_bat.append("call nmake distclean -f makefiles/build.makefile_" + file_suff) + qmake_addon_string = "" + if ("" != config.option("qmake_addon")): + qmake_addon_string = " \"" + config.option("qmake_addon") + "\"" + qmake_bat.append("call \"" + qt_dir + "/bin/qmake\" -nocache build.pro \"CONFIG+=" + config_param + "\"" + qmake_addon_string) + qmake_bat.append("call nmake -f makefiles/build.makefile_" + file_suff) + base.run_as_bat(qmake_bat) + os.environ = old_env.copy() + + base.delete_file(".qmake.stash") if ("mac_64" == platform): configuration = "Release" if (-1 == config_param.lower().find("debug")) else "Debug" diff --git a/scripts/core_common/modules/icu.py b/scripts/core_common/modules/icu.py index e376dc3..66c09c7 100644 --- a/scripts/core_common/modules/icu.py +++ b/scripts/core_common/modules/icu.py @@ -30,9 +30,7 @@ def make(): continue if not base.is_dir(platform + "/build"): base.create_dir(platform) - base.vcvarsall_start("x64" if ("win_64" == platform) else "x86") base.cmd("MSBuild.exe", ["icu/source/allinone/allinone.sln", "/p:Configuration=Release", "/p:PlatformToolset=v140", "/p:Platform=" + ("X64" if ("win_64" == platform) else "Win32")]) - base.vcvarsall_end() bin_dir = "icu/bin64/" if ("win_64" == platform) else "icu/bin/" lib_dir = "icu/lib64/" if ("win_64" == platform) else "icu/lib/" base.create_dir(platform + "/build")