mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
121 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71e4b7b2ef | |||
| 418d8f74cf | |||
| 92f7db0a50 | |||
| e93317ebb2 | |||
| d922e03c95 | |||
| cedb7af539 | |||
| f8091afb69 | |||
| 0a41abdff7 | |||
| 8de2dec4e1 | |||
| fc3013a066 | |||
| dfcde3fef9 | |||
| 278bcb6136 | |||
| 9a69116d8f | |||
| d5bf7cff40 | |||
| a00f198a33 | |||
| 3d9870e8a3 | |||
| 070c77f11a | |||
| b34e11cfdf | |||
| 25a453fa1e | |||
| 830b01114a | |||
| 48f2d54676 | |||
| c3ab2959bd | |||
| 4e5fe85e6d | |||
| 730b2e5adb | |||
| c28c329085 | |||
| 1e933cefcb | |||
| 5217b7c342 | |||
| ee22cbca1b | |||
| c1e21f9884 | |||
| 74a6da2f57 | |||
| c25c28333a | |||
| fc80745b8d | |||
| b361128ec4 | |||
| fa7dfa2e96 | |||
| f4d6c67431 | |||
| 8fe758e14a | |||
| bb58688b49 | |||
| 676b519f46 | |||
| 626a121eb0 | |||
| c89a54ccf4 | |||
| 23a7b9cc87 | |||
| 351192378d | |||
| aa978f56d1 | |||
| df98984a40 | |||
| 661041b1df | |||
| 1af7d31285 | |||
| 1fd9566702 | |||
| dd3f9410cb | |||
| 3942c2f69a | |||
| 8c93a0ebae | |||
| e9359c86d2 | |||
| 0519981d24 | |||
| d9df09ceec | |||
| afde46bbae | |||
| ee9fed8fe8 | |||
| d26eee685a | |||
| 68a2eb8742 | |||
| d582343874 | |||
| a6c4dcaad3 | |||
| ac071bd62b | |||
| b6260f100a | |||
| 61ac320826 | |||
| 64dce5a060 | |||
| c895e4da83 | |||
| 98f211bd4b | |||
| b41a1b8a67 | |||
| 4aef611665 | |||
| da28605e63 | |||
| 2a6c42eb1f | |||
| c20656897d | |||
| 1540675db7 | |||
| 0fb4a31c3c | |||
| 407db1a1ae | |||
| 345af89c97 | |||
| 9cb14b295b | |||
| 686b576588 | |||
| 00cad780a9 | |||
| 1f4748afc4 | |||
| 2abdf201df | |||
| 8a61529d41 | |||
| 46202ce1c7 | |||
| 1cf2095e98 | |||
| faf5d1904f | |||
| cf5b322852 | |||
| 42ac2b9907 | |||
| 917165cc86 | |||
| 12c18895e9 | |||
| 832147f4d2 | |||
| a9ad740efe | |||
| 0b33ff68bf | |||
| d685720dd6 | |||
| c305cf4684 | |||
| f254b46efc | |||
| b627457c98 | |||
| a739db1854 | |||
| 5631c9825e | |||
| 11487b4fd2 | |||
| 7bb5eba0ea | |||
| 284b7e2f90 | |||
| b3b23e4d47 | |||
| f09cd28ba3 | |||
| 7cd507d023 | |||
| 68cfbf067d | |||
| 9538741b11 | |||
| 7219c65dcb | |||
| 938019d26f | |||
| c4b81dc438 | |||
| 46bbbd1bc0 | |||
| bb690328a8 | |||
| 5e7b22b6d7 | |||
| 4a4e8b7568 | |||
| 26ce05f76c | |||
| 1f3f801124 | |||
| 63a6ecd17f | |||
| 55448fcb73 | |||
| 6364de594f | |||
| dd8145083e | |||
| d17eec062c | |||
| 22d8c377df | |||
| ad12cc9a54 | |||
| baee5f58b8 |
@ -4,9 +4,10 @@ ENV TZ=Etc/UTC
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get -y update && \
|
||||
apt-get -y install python3 \
|
||||
apt-get -y install python \
|
||||
python3 \
|
||||
sudo
|
||||
|
||||
RUN rm /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python
|
||||
ADD . /build_tools
|
||||
WORKDIR /build_tools
|
||||
|
||||
|
||||
15
README.md
15
README.md
@ -167,10 +167,6 @@ LD_LIBRARY_PATH=./ ./DesktopEditors
|
||||
proxy_pass http://localhost:8000;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
location /spellchecker/ {
|
||||
proxy_pass http://localhost:8080/;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@ -261,16 +257,7 @@ allow to run foreground processes in background mode.
|
||||
./converter
|
||||
```
|
||||
|
||||
2. Start the **SpellChecker** service:
|
||||
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/SpellChecker
|
||||
NODE_ENV=development-linux \
|
||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||
./spellchecker
|
||||
```
|
||||
|
||||
3. Start the **DocService** service:
|
||||
2. Start the **DocService** service:
|
||||
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/DocService
|
||||
|
||||
3
Rakefile
3
Rakefile
@ -2,8 +2,9 @@
|
||||
|
||||
desc 'Cleanup old build files'
|
||||
task :clean do
|
||||
archive_name_pattern = 'build_tools*.tar.gz'
|
||||
sh('sudo rm -rf out')
|
||||
sh('rm build_tools*.tar.gz')
|
||||
sh("rm #{archive_name_pattern}") unless Dir.glob(archive_name_pattern).empty?
|
||||
end
|
||||
|
||||
desc 'Build version anew'
|
||||
|
||||
377
build.pro
377
build.pro
@ -4,27 +4,7 @@ ROOT_DIR=$$PWD/..
|
||||
DEPLOY_DIR=$$PWD/deploy
|
||||
CORE_ROOT_DIR=$$ROOT_DIR/core
|
||||
|
||||
include($$CORE_ROOT_DIR/Common/base.pri)
|
||||
|
||||
MAKEFILE=makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
PRO_SUFFIX=$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
|
||||
core_debug {
|
||||
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "_debug_")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "_debug_")
|
||||
}
|
||||
build_xp {
|
||||
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "_xp")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "_xp")
|
||||
}
|
||||
OO_BRANDING_SUFFIX = $$(OO_BRANDING)
|
||||
!isEmpty(OO_BRANDING_SUFFIX) {
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "$$OO_BRANDING_SUFFIX")
|
||||
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "$$OO_BRANDING_SUFFIX")
|
||||
}
|
||||
|
||||
message(current_makefile)
|
||||
message($$MAKEFILE)
|
||||
include($$PWD/common.pri)
|
||||
|
||||
CONFIG += ordered
|
||||
|
||||
@ -40,317 +20,88 @@ core_mac {
|
||||
core_ios {
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_tests
|
||||
}
|
||||
core_android {
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_tests
|
||||
}
|
||||
|
||||
SUBDIRS = \
|
||||
cryptopp \
|
||||
\
|
||||
kernel \
|
||||
unicodeconverter \
|
||||
graphics \
|
||||
pdfwriter \
|
||||
djvufile \
|
||||
xpsfile \
|
||||
htmlrenderer \
|
||||
pdfreader \
|
||||
htmlfile2 \
|
||||
doctrenderer \
|
||||
fb2file \
|
||||
epubfile
|
||||
|
||||
addSubProject(cryptopp, $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro)
|
||||
addSubProject(kernel, $$CORE_ROOT_DIR/Common/kernel.pro,\
|
||||
cryptopp)
|
||||
addSubProject(unicodeconverter, $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro,\
|
||||
kernel)
|
||||
addSubProject(graphics, $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro,\
|
||||
kernel unicodeconverter)
|
||||
addSubProject(pdfwriter, $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(djvufile, $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro,\
|
||||
kernel unicodeconverter graphics pdfwriter)
|
||||
addSubProject(xpsfile, $$CORE_ROOT_DIR/XpsFile/XpsFile.pro,\
|
||||
kernel unicodeconverter graphics pdfwriter)
|
||||
addSubProject(htmlrenderer, $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro,\
|
||||
kernel unicodeconverter graphics pdfwriter)
|
||||
addSubProject(pdfreader, $$CORE_ROOT_DIR/PdfReader/PdfReader.pro,\
|
||||
kernel unicodeconverter graphics pdfwriter htmlrenderer)
|
||||
addSubProject(htmlfile2, $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(doctrenderer, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(fb2file, $$CORE_ROOT_DIR/Fb2File/Fb2File.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
|
||||
kernel unicodeconverter graphics htmlfile2)
|
||||
!no_x2t {
|
||||
SUBDIRS += \
|
||||
docxformat \
|
||||
pptxformat \
|
||||
docxfile \
|
||||
txtxmlformat \
|
||||
rtfformat \
|
||||
pptformat \
|
||||
docformat \
|
||||
odffilereader \
|
||||
odffilewriter \
|
||||
xlsformat \
|
||||
x2t
|
||||
addSubProject(docxformat, $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro)
|
||||
addSubProject(pptxformat, $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro)
|
||||
addSubProject(docxfile, $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro)
|
||||
addSubProject(txtxmlformat, $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro)
|
||||
addSubProject(rtfformat, $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro)
|
||||
addSubProject(pptformat, $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro)
|
||||
addSubProject(docformat, $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro)
|
||||
addSubProject(odffilereader, $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro)
|
||||
addSubProject(odffilewriter, $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro)
|
||||
addSubProject(xlsformat, $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro)
|
||||
addSubProject(x2t, $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro,\
|
||||
docxformat pptxformat docxfile txtxmlformat rtfformat pptformat docformat odffilereader odffilewriter xlsformat fb2file epubfile)
|
||||
}
|
||||
|
||||
!no_use_common_binary {
|
||||
SUBDIRS += \
|
||||
allfontsgen \
|
||||
allthemesgen \
|
||||
docbuilder
|
||||
addSubProject(allfontsgen, $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(allthemesgen, $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(docbuilder, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro,\
|
||||
kernel unicodeconverter graphics doctrenderer)
|
||||
}
|
||||
|
||||
core_ios:CONFIG += no_tests
|
||||
core_android:CONFIG += no_tests
|
||||
!no_tests {
|
||||
SUBDIRS += standardtester
|
||||
addSubProject(standardtester, $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro)
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
SUBDIRS += \
|
||||
videoplayer
|
||||
addSubProject(videoplayer, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
}
|
||||
|
||||
desktop {
|
||||
message(desktop)
|
||||
|
||||
SUBDIRS += \
|
||||
hunspell \
|
||||
ooxmlsignature \
|
||||
documentscore \
|
||||
documentscore_helper
|
||||
|
||||
!core_mac {
|
||||
SUBDIRS += qtdocumentscore
|
||||
}
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows:SUBDIRS += projicons
|
||||
SUBDIRS += desktopapp
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ordered {
|
||||
# remove all makefiles
|
||||
|
||||
defineTest(removeFile) {
|
||||
file = $$1
|
||||
win32:file ~= s,/,\\,g
|
||||
core_windows {
|
||||
system(if exist $$shell_quote($$file) $$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
} else {
|
||||
system($$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
}
|
||||
}
|
||||
defineTest(qmakeClear) {
|
||||
dir = $$1
|
||||
name = $$2
|
||||
removeFile($$1/Makefile.$$2$$PRO_SUFFIX)
|
||||
removeFile($$1/.qmake.stash)
|
||||
}
|
||||
|
||||
qmakeClear($$CORE_ROOT_DIR/Common/3dParty/cryptopp/project, cryptopp)
|
||||
qmakeClear($$CORE_ROOT_DIR/Common, kernel)
|
||||
qmakeClear($$CORE_ROOT_DIR/UnicodeConverter, UnicodeConverter)
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/graphics/pro, graphics)
|
||||
qmakeClear($$CORE_ROOT_DIR/PdfWriter, PdfWriter)
|
||||
qmakeClear($$CORE_ROOT_DIR/DjVuFile, DjVuFile)
|
||||
qmakeClear($$CORE_ROOT_DIR/XpsFile, XpsFile)
|
||||
qmakeClear($$CORE_ROOT_DIR/HtmlRenderer, htmlrenderer)
|
||||
qmakeClear($$CORE_ROOT_DIR/PdfReader, PdfReader)
|
||||
qmakeClear($$CORE_ROOT_DIR/HtmlFile2, HtmlFile2)
|
||||
qmakeClear($$CORE_ROOT_DIR/EpubFile, EpubFile)
|
||||
qmakeClear($$CORE_ROOT_DIR/Fb2File, Fb2File)
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/doctrenderer, doctrenderer)
|
||||
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/AllFontsGen, AllFontsGen)
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/allthemesgen, allthemesgen)
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder, docbuilder)
|
||||
qmakeClear($$CORE_ROOT_DIR/Test/Applications/StandardTester, standardtester)
|
||||
|
||||
qmakeClear($$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib, DocxFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib, PPTXFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux, ASCOfficeDocxFile2Lib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux, TxtXmlFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux, RtfFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux, PPTFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux, DocFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeOdfFile/linux, OdfFileReaderLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux, OdfFileWriterLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux, XlsFormatLib)
|
||||
qmakeClear($$CORE_ROOT_DIR/X2tConverter/build/Qt, X2tConverter)
|
||||
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt, hunspell)
|
||||
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/xmlsec/src, ooxmlsignature)
|
||||
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib, ascdocumentscore)
|
||||
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib, ascdocumentscore_helper)
|
||||
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper, qtascdocumentscore)
|
||||
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib, videoplayerlib)
|
||||
qmakeClear($$ROOT_DIR/desktop-apps/win-linux/extras/projicons, ProjIcons)
|
||||
qmakeClear($$ROOT_DIR/desktop-apps/win-linux, ASCDocumentEditor)
|
||||
}
|
||||
|
||||
# PROJECTS
|
||||
cryptopp.file = $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro
|
||||
cryptopp.makefile = $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/Makefile.cryptopp$$PRO_SUFFIX
|
||||
|
||||
kernel.file = $$CORE_ROOT_DIR/Common/kernel.pro
|
||||
kernel.makefile = $$CORE_ROOT_DIR/Common/Makefile.kernel$$PRO_SUFFIX
|
||||
|
||||
unicodeconverter.file = $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro
|
||||
unicodeconverter.makefile = $$CORE_ROOT_DIR/UnicodeConverter/Makefile.UnicodeConverter$$PRO_SUFFIX
|
||||
|
||||
graphics.file = $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro
|
||||
graphics.makefile = $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/Makefile.graphics$$PRO_SUFFIX
|
||||
|
||||
pdfwriter.file = $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro
|
||||
pdfwriter.makefile = $$CORE_ROOT_DIR/PdfWriter/Makefile.PdfWriter$$PRO_SUFFIX
|
||||
|
||||
djvufile.file = $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro
|
||||
djvufile.makefile = $$CORE_ROOT_DIR/DjVuFile/Makefile.DjVuFile$$PRO_SUFFIX
|
||||
|
||||
xpsfile.file = $$CORE_ROOT_DIR/XpsFile/XpsFile.pro
|
||||
xpsfile.makefile = $$CORE_ROOT_DIR/XpsFile/Makefile.XpsFile$$PRO_SUFFIX
|
||||
|
||||
htmlrenderer.file = $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro
|
||||
htmlrenderer.makefile = $$CORE_ROOT_DIR/HtmlRenderer/Makefile.htmlrenderer$$PRO_SUFFIX
|
||||
|
||||
pdfreader.file = $$CORE_ROOT_DIR/PdfReader/PdfReader.pro
|
||||
pdfreader.makefile = $$CORE_ROOT_DIR/PdfReader/Makefile.PdfReader$$PRO_SUFFIX
|
||||
|
||||
htmlfile2.file = $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro
|
||||
htmlfile2.makefile = $$CORE_ROOT_DIR/HtmlFile2/Makefile.HtmlFile2$$PRO_SUFFIX
|
||||
|
||||
doctrenderer.file = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro
|
||||
doctrenderer.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/Makefile.doctrenderer$$PRO_SUFFIX
|
||||
|
||||
fb2file.file = $$CORE_ROOT_DIR/Fb2File/Fb2File.pro
|
||||
fb2file.makefile = $$CORE_ROOT_DIR/Fb2File/Makefile.Fb2File$$PRO_SUFFIX
|
||||
|
||||
epubfile.file = $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro
|
||||
epubfile.makefile = $$CORE_ROOT_DIR/EpubFile/Makefile.EpubFile$$PRO_SUFFIX
|
||||
|
||||
!no_use_common_binary {
|
||||
allfontsgen.file = $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro
|
||||
allfontsgen.makefile = $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/Makefile.AllFontsGen$$PRO_SUFFIX
|
||||
|
||||
allthemesgen.file = $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro
|
||||
allthemesgen.makefile = $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/Makefile.allthemesgen$$PRO_SUFFIX
|
||||
|
||||
docbuilder.file = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro
|
||||
docbuilder.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/Makefile.docbuilder$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
!no_tests {
|
||||
standardtester.file = $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro
|
||||
standardtester.makefile = $$CORE_ROOT_DIR/Test/Applications/StandardTester/Makefile.standardtester$$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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
hunspell.makefile = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/Makefile.hunspell$$PRO_SUFFIX
|
||||
|
||||
ooxmlsignature.file = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro
|
||||
ooxmlsignature.makefile = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/Makefile.ooxmlsignature$$PRO_SUFFIX
|
||||
|
||||
documentscore.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro
|
||||
documentscore.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore$$PRO_SUFFIX
|
||||
|
||||
documentscore_helper.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro
|
||||
documentscore_helper.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore_helper$$PRO_SUFFIX
|
||||
|
||||
message(desktop)
|
||||
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
|
||||
addSubProject(ooxmlsignature, $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(documentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro,\
|
||||
kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdfwriter pdfreader djvufile xpsfile)
|
||||
addSubProject(documentscore_helper, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro,\
|
||||
documentscore)
|
||||
!core_mac {
|
||||
qtdocumentscore.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro
|
||||
qtdocumentscore.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/Makefile.qtascdocumentscore$$PRO_SUFFIX
|
||||
addSubProject(qtdocumentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro,\
|
||||
documentscore)
|
||||
}
|
||||
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows {
|
||||
projicons.file = $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro
|
||||
projicons.makefile = $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/Makefile.ProjIcons$$PRO_SUFFIX
|
||||
}
|
||||
desktopapp.file = $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro
|
||||
desktopapp.makefile = $$ROOT_DIR/desktop-apps/win-linux/Makefile.ASCDocumentEditor$$PRO_SUFFIX
|
||||
core_windows:addSubProject(projicons, $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro,\
|
||||
documentscore videoplayer)
|
||||
addSubProject(desktopapp, $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro,\
|
||||
documentscore videoplayer)
|
||||
}
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
videoplayer.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro
|
||||
videoplayer.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/Makefile.videoplayerlib$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
# DEPENDS
|
||||
kernel.depends = cryptopp
|
||||
unicodeconverter.depends = kernel
|
||||
graphics.depends = kernel unicodeconverter
|
||||
pdfwriter.depends = kernel unicodeconverter graphics
|
||||
djvufile.depends = kernel unicodeconverter graphics pdfwriter
|
||||
xpsfile.depends = kernel unicodeconverter graphics pdfwriter
|
||||
htmlrenderer.depends = kernel unicodeconverter graphics pdfwriter
|
||||
pdfreader.depends = kernel unicodeconverter graphics pdfwriter htmlrenderer
|
||||
htmlfile2.depends = kernel unicodeconverter graphics
|
||||
doctrenderer.depends = kernel unicodeconverter graphics
|
||||
fb2file.depends = kernel unicodeconverter graphics
|
||||
epubfile.depends = kernel unicodeconverter graphics htmlfile2
|
||||
|
||||
!no_use_common_binary {
|
||||
allfontsgen.depends = kernel unicodeconverter graphics
|
||||
allthemesgen.depends = kernel unicodeconverter graphics
|
||||
|
||||
docbuilder.depends = kernel unicodeconverter graphics doctrenderer
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
videoplayer.depends = kernel unicodeconverter graphics
|
||||
}
|
||||
|
||||
desktop {
|
||||
ooxmlsignature.depends = kernel unicodeconverter graphics
|
||||
documentscore.depends = kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdfwriter pdfreader djvufile xpsfile
|
||||
documentscore_helper.depends = documentscore
|
||||
|
||||
!core_mac {
|
||||
qtdocumentscore.depends = documentscore
|
||||
}
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows:projicons.depends = documentscore videoplayer
|
||||
desktopapp.depends = documentscore videoplayer
|
||||
}
|
||||
}
|
||||
|
||||
!no_x2t {
|
||||
x2t.depends = \
|
||||
docxformat \
|
||||
pptxformat \
|
||||
docxfile \
|
||||
txtxmlformat \
|
||||
rtfformat \
|
||||
pptformat \
|
||||
docformat \
|
||||
odffilereader \
|
||||
odffilewriter \
|
||||
xlsformat \
|
||||
fb2file \
|
||||
epubfile
|
||||
}
|
||||
69
common.pri
Normal file
69
common.pri
Normal file
@ -0,0 +1,69 @@
|
||||
# must setup CORE_ROOT_DIR before including
|
||||
|
||||
include($$CORE_ROOT_DIR/Common/base.pri)
|
||||
|
||||
MAKEFILE=makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
PRO_SUFFIX=$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
|
||||
core_debug {
|
||||
MAKEFILE=$$join(MAKEFILE, , , "_debug_")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "_debug_")
|
||||
}
|
||||
build_xp {
|
||||
MAKEFILE=$$join(MAKEFILE, , , "_xp")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "_xp")
|
||||
}
|
||||
OO_BRANDING_SUFFIX = $$(OO_BRANDING)
|
||||
!isEmpty(OO_BRANDING_SUFFIX) {
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "$$OO_BRANDING_SUFFIX")
|
||||
MAKEFILE=$$join(MAKEFILE, , , "$$OO_BRANDING_SUFFIX")
|
||||
}
|
||||
|
||||
message(current_makefile)
|
||||
message($$MAKEFILE)
|
||||
|
||||
CONFIG += ordered
|
||||
|
||||
defineTest(removeFile) {
|
||||
file = $$1
|
||||
win32:file ~= s,/,\\,g
|
||||
core_windows {
|
||||
system(if exist $$shell_quote($$file) $$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
} else {
|
||||
system($$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
}
|
||||
}
|
||||
defineTest(qmakeClear) {
|
||||
dir = $$1
|
||||
name = $$2
|
||||
removeFile($$1/Makefile.$$2$$PRO_SUFFIX)
|
||||
removeFile($$1/.qmake.stash)
|
||||
}
|
||||
|
||||
# addSubProject() - adds project to SUBDIRS, creates variables associated with the project(file, makefile, depends)
|
||||
# Arg1 - Project name
|
||||
# Arg2 - Qmake file of project
|
||||
# Arg3(optional) - Project dependencies
|
||||
defineTest(addSubProject) {
|
||||
pro_name = $$1
|
||||
pro_file = $$2
|
||||
pro_depends = $$3
|
||||
isEmpty(pro_name):error(Sub-project name is not defined.)
|
||||
isEmpty(pro_file):error(Qmake file of sub-project \'$$pro_name\' is not defined.)
|
||||
!exists($$pro_file):error(Sub-project qmake file \'$$pro_file\' is not exists.)
|
||||
path = $$section(pro_file, /, 0, -2)
|
||||
ext_name = $$section(pro_file, /, -1, -1)
|
||||
name = $$section(ext_name, ., 0, 0)
|
||||
SUBDIRS += $$pro_name
|
||||
export(SUBDIRS)
|
||||
$${pro_name}.file = $$pro_file
|
||||
export($${pro_name}.file)
|
||||
$${pro_name}.makefile = $$path/Makefile.$$name$$PRO_SUFFIX
|
||||
export($${pro_name}.makefile)
|
||||
!isEmpty(pro_depends) {
|
||||
$${pro_name}.depends = $$pro_depends
|
||||
export($${pro_name}.depends)
|
||||
}
|
||||
# remove makefile
|
||||
qmakeClear($$path, $$name)
|
||||
}
|
||||
12
make.py
12
make.py
@ -13,13 +13,13 @@ import build_js
|
||||
import build_server
|
||||
import deploy
|
||||
import make_common
|
||||
import config_server as develop_config_server
|
||||
import dependence
|
||||
import develop
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
base.set_env("BUILD_PLATFORM", config.option("platform"))
|
||||
|
||||
# branding
|
||||
@ -59,13 +59,7 @@ if ("1" == config.option("update")):
|
||||
base.configure_common_apps()
|
||||
|
||||
# developing...
|
||||
if ("1" == config.option("develop")):
|
||||
if not dependence.check_dependencies():
|
||||
exit(1)
|
||||
build_server.build_server_develop()
|
||||
build_js.build_js_develop(base_dir + "/..")
|
||||
develop_config_server.make()
|
||||
exit(0)
|
||||
develop.make();
|
||||
|
||||
# check only js builds
|
||||
if ("1" == base.get_env("OO_ONLY_BUILD_JS")):
|
||||
|
||||
34
make_packages.py
Executable file
34
make_packages.py
Executable file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/develop')
|
||||
sys.path.append('scripts/develop/vendor')
|
||||
sys.path.append('scripts/core_common')
|
||||
sys.path.append('scripts/core_common/modules')
|
||||
import config
|
||||
import base
|
||||
import packages
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
base.set_env("BUILD_PLATFORM", config.option("platform"))
|
||||
|
||||
# branding
|
||||
if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("branding")):
|
||||
branding_dir = base_dir + "/../" + config.option("branding")
|
||||
|
||||
if base.is_file(branding_dir + "/build_tools/make_packages.py"):
|
||||
base.check_build_version(branding_dir + "/build_tools")
|
||||
base.set_env("OO_RUNNING_BRANDING", "1")
|
||||
base.set_env("OO_BRANDING", config.option("branding"))
|
||||
base.cmd_in_dir(branding_dir + "/build_tools", "python", ["make_packages.py"])
|
||||
exit(0)
|
||||
|
||||
base.check_build_version(base_dir)
|
||||
|
||||
# build packages
|
||||
packages.make()
|
||||
120
scripts/base.py
120
scripts/base.py
@ -97,6 +97,14 @@ def copy_file(src, dst):
|
||||
return
|
||||
return shutil.copy2(get_path(src), get_path(dst))
|
||||
|
||||
def move_file(src, dst):
|
||||
if is_file(dst):
|
||||
delete_file(dst)
|
||||
if not is_file(src):
|
||||
print("move warning [file not exist]: " + src)
|
||||
return
|
||||
return shutil.move(get_path(src), get_path(dst))
|
||||
|
||||
def copy_files(src, dst, override=True):
|
||||
for file in glob.glob(src):
|
||||
file_name = os.path.basename(file)
|
||||
@ -111,6 +119,20 @@ def copy_files(src, dst, override=True):
|
||||
copy_files(file + "/*", dst + "/" + file_name, override)
|
||||
return
|
||||
|
||||
def move_files(src, dst, override=True):
|
||||
for file in glob.glob(src):
|
||||
file_name = os.path.basename(file)
|
||||
if is_file(file):
|
||||
if override and is_file(dst + "/" + file_name):
|
||||
delete_file(dst + "/" + file_name)
|
||||
if not is_file(dst + "/" + file_name):
|
||||
move_file(file, dst)
|
||||
elif is_dir(file):
|
||||
if not is_dir(dst + "/" + file_name):
|
||||
create_dir(dst + "/" + file_name)
|
||||
move_files(file + "/*", dst + "/" + file_name, override)
|
||||
return
|
||||
|
||||
def copy_dir_content(src, dst, filterInclude = "", filterExclude = ""):
|
||||
src_folder = src
|
||||
if ("/" != src[-1:]):
|
||||
@ -328,11 +350,29 @@ def run_command(sCommand):
|
||||
return result
|
||||
|
||||
def run_command_in_dir(directory, sCommand):
|
||||
dir = get_path(directory)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
host = host_platform()
|
||||
if (host == 'windows'):
|
||||
dir = get_path(directory)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
|
||||
ret = run_command(sCommand)
|
||||
os.chdir(cur_dir)
|
||||
|
||||
if (host == 'windows'):
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def exec_command_in_dir(directory, sCommand):
|
||||
host = host_platform()
|
||||
if (host == 'windows'):
|
||||
dir = get_path(directory)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
|
||||
ret = os.system(sCommand)
|
||||
|
||||
if (host == 'windows'):
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def run_process(args=[]):
|
||||
@ -390,8 +430,10 @@ def git_update(repo, is_no_errors=False, is_current_dir=False):
|
||||
print("branch does not exist...")
|
||||
print("switching to master...")
|
||||
cmd("git", ["checkout", "-f", "master"])
|
||||
cmd("git", ["submodule", "update", "--init", "--recursive"], True)
|
||||
if (0 != config.option("branch").find("tags/")):
|
||||
cmd("git", ["pull"], False if ("1" != config.option("update-light")) else True)
|
||||
cmd("git", ["submodule", "update", "--recursive", "--remote"], True)
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -412,6 +454,7 @@ def get_repositories():
|
||||
if config.check_option("module", "desktop"):
|
||||
result["desktop-sdk"] = [False, False]
|
||||
result["desktop-apps"] = [False, False]
|
||||
result["document-templates"] = [False, False]
|
||||
|
||||
if (config.check_option("module", "server")):
|
||||
result["server"] = [False, False]
|
||||
@ -420,8 +463,22 @@ def get_repositories():
|
||||
|
||||
if (config.check_option("module", "server") or config.check_option("platform", "ios")):
|
||||
result["core-fonts"] = [False, False]
|
||||
|
||||
get_branding_repositories(result)
|
||||
return result
|
||||
|
||||
def get_branding_repositories(checker):
|
||||
modules = ["core", "server", "mobile", "desktop", "builder"]
|
||||
for mod in modules:
|
||||
if not config.check_option("module", mod):
|
||||
continue
|
||||
name = "repositories_" + mod
|
||||
repos = config.option(name).rsplit(", ")
|
||||
for repo in repos:
|
||||
if (repo != ""):
|
||||
checker[repo] = [False, False]
|
||||
return
|
||||
|
||||
def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=False):
|
||||
print("[git] create pull request: " + repo)
|
||||
url = "https://github.com/ONLYOFFICE/" + repo + ".git"
|
||||
@ -445,7 +502,7 @@ def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=Fa
|
||||
if "" != run_command("git log origin/" + branch_to + "..origin/" + branch_from)["stdout"]:
|
||||
cmd("git", ["checkout", "-f", branch_to], is_no_errors)
|
||||
cmd("git", ["pull"], is_no_errors)
|
||||
cmd("hub", ["pull-request", "--force", "--base", branch_to, "--head", branch_from, "--message", "Merge from " + branch_from + " to " + branch_to], is_no_errors)
|
||||
cmd("gh", ["pr", "create", "--base", branch_to, "--head", branch_from, "--title", "Merge branch " + branch_from + " to " + branch_to, "--body", ""], is_no_errors)
|
||||
if 0 != cmd("git", ["merge", "origin/" + branch_from, "--no-ff", "--no-edit"], is_no_errors):
|
||||
print_error("[git] Conflicts merge " + "origin/" + branch_from + " to " + branch_to + " in repo " + url)
|
||||
cmd("git", ["merge", "--abort"], is_no_errors)
|
||||
@ -501,6 +558,8 @@ def qt_config(platform):
|
||||
config_param += " iphoneos device"
|
||||
if (-1 == config_param_lower.find("debug")):
|
||||
config_param += " release"
|
||||
if ("mac_arm64" == platform):
|
||||
config_param += " apple_silicon use_javascript_core"
|
||||
return config_param
|
||||
|
||||
def qt_major_version():
|
||||
@ -510,9 +569,21 @@ def qt_major_version():
|
||||
def qt_copy_lib(lib, dir):
|
||||
qt_dir = get_env("QT_DEPLOY")
|
||||
if ("windows" == host_platform()):
|
||||
copy_lib(qt_dir, dir, lib)
|
||||
if ("" == qt_dst_postfix()):
|
||||
copy_lib(qt_dir, dir, lib)
|
||||
else:
|
||||
copy_lib(qt_dir, dir, lib + "d")
|
||||
else:
|
||||
copy_file(qt_dir + "/../lib/lib" + lib + ".so." + qt_version(), dir + "/lib" + lib + ".so." + qt_major_version())
|
||||
src_file = qt_dir + "/../lib/lib" + lib + ".so." + qt_version()
|
||||
if (is_file(src_file)):
|
||||
copy_file(src_file, dir + "/lib" + lib + ".so." + qt_major_version())
|
||||
else:
|
||||
libFramework = lib
|
||||
libFramework = libFramework.replace("Qt5", "Qt")
|
||||
libFramework = libFramework.replace("Qt6", "Qt")
|
||||
libFramework += ".framework"
|
||||
if (is_dir(qt_dir + "/../lib/" + libFramework)):
|
||||
copy_dir(qt_dir + "/../lib/" + libFramework, dir + "/" + libFramework)
|
||||
return
|
||||
|
||||
def _check_icu_common(dir, out):
|
||||
@ -550,8 +621,12 @@ def qt_copy_plugin(name, out):
|
||||
for file in glob.glob(out + "/" + name + "/*d.dll"):
|
||||
fileCheck = file[0:-5] + ".dll"
|
||||
if is_file(fileCheck):
|
||||
delete_file(file)
|
||||
|
||||
if ("" == qt_dst_postfix()):
|
||||
delete_file(file)
|
||||
else:
|
||||
delete_file(fileCheck)
|
||||
for file in glob.glob(out + "/" + name + "/*.pdb"):
|
||||
delete_file(file)
|
||||
return
|
||||
|
||||
def qt_dst_postfix():
|
||||
@ -822,13 +897,16 @@ def vcvarsall_end():
|
||||
return
|
||||
|
||||
def run_as_bat(lines, is_no_errors=False):
|
||||
name = "tmp.bat"
|
||||
name = "tmp.bat" if ("windows" == host_platform()) else "./tmp.sh"
|
||||
content = "\n".join(lines)
|
||||
|
||||
file = codecs.open(name, "w", "utf-8")
|
||||
file.write(content)
|
||||
file.close()
|
||||
|
||||
if ("windows" != host_platform()):
|
||||
os.system("chmod +x " + name)
|
||||
|
||||
cmd(name, [], is_no_errors)
|
||||
delete_file(name)
|
||||
return
|
||||
@ -886,7 +964,7 @@ def mac_correct_rpath_x2t(dir):
|
||||
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2"])
|
||||
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2", "graphics"])
|
||||
mac_correct_rpath_library("Fb2File", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("HtmlRenderer", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("PdfWriter", ["UnicodeConverter", "kernel", "graphics"])
|
||||
@ -1049,3 +1127,23 @@ def hack_xcode_ios():
|
||||
with open(get_path(qmake_spec_file), "w") as file:
|
||||
file.write(filedata)
|
||||
return
|
||||
|
||||
def find_mac_sdk_version():
|
||||
sdk_dir = run_command("xcode-select -print-path")['stdout']
|
||||
sdk_dir = os.path.join(sdk_dir, "Platforms/MacOSX.platform/Developer/SDKs")
|
||||
sdks = [re.findall('^MacOSX(1\d\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
|
||||
sdks = [s[0] for s in sdks if s]
|
||||
return sdks[0]
|
||||
|
||||
def find_mac_sdk():
|
||||
return run_command("xcrun --sdk macosx --show-sdk-path")['stdout']
|
||||
|
||||
def get_mac_sdk_version_number():
|
||||
ver = find_mac_sdk_version()
|
||||
ver_arr = ver.split(".")
|
||||
if 0 == len(ver_arr):
|
||||
return 0
|
||||
if 1 == len(ver_arr):
|
||||
return 1000 * int(ver_arr[0])
|
||||
return 1000 * int(ver_arr[0]) + int(ver_arr[1])
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import multiprocessing
|
||||
|
||||
def make_pro_file(makefiles_dir, pro_file):
|
||||
platforms = config.option("platform").split()
|
||||
@ -66,7 +67,10 @@ def make_pro_file(makefiles_dir, pro_file):
|
||||
base.cmd_and_return_cwd(base.app_make(), ["clean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
|
||||
base.cmd_and_return_cwd(base.app_make(), ["distclean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
|
||||
base.cmd(qt_dir + "/bin/qmake", ["-nocache", pro_file, "CONFIG+=" + config_param] + qmake_addon)
|
||||
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff])
|
||||
if ("0" != config.option("multiprocess")):
|
||||
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff, "-j" + str(multiprocessing.cpu_count())])
|
||||
else:
|
||||
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff])
|
||||
else:
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
|
||||
@ -78,6 +82,8 @@ def make_pro_file(makefiles_dir, pro_file):
|
||||
if ("1" == config.option("clean")):
|
||||
qmake_bat.append("call nmake clean -f " + makefiles_dir + "/build.makefile_" + file_suff)
|
||||
qmake_bat.append("call nmake distclean -f " + makefiles_dir + "/build.makefile_" + file_suff)
|
||||
if ("0" != config.option("multiprocess")):
|
||||
qmake_bat.append("set CL=/MP")
|
||||
qmake_bat.append("call nmake -f " + makefiles_dir + "/build.makefile_" + file_suff)
|
||||
base.run_as_bat(qmake_bat)
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@ def make():
|
||||
if ("1" == base.get_env("OO_NO_BUILD_JS")):
|
||||
return
|
||||
|
||||
base.set_env('NODE_ENV', 'production')
|
||||
|
||||
base_dir = base.get_script_dir() + "/.."
|
||||
out_dir = base_dir + "/out/js/";
|
||||
branding = config.option("branding-name")
|
||||
@ -49,21 +51,41 @@ def make():
|
||||
base.create_dir(out_dir + "/mobile/sdkjs")
|
||||
vendor_dir_src = base_dir + "/../web-apps/vendor/"
|
||||
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
|
||||
# banners
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners_word.js")
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
|
||||
sdk_dir_src + "common/Native/native.js",
|
||||
sdk_dir_src + "../../common/Native/Wrappers/common.js",
|
||||
sdk_dir_src + "common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners.js")
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/cell/native/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners_cell.js")
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners_slide.js")
|
||||
|
||||
base.create_dir(out_dir + "/mobile/sdkjs/word")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/mobile/sdkjs/word/script.bin")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners_word.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/mobile/sdkjs/word/script.bin")
|
||||
base.create_dir(out_dir + "/mobile/sdkjs/cell")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/mobile/sdkjs/cell/script.bin")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners_cell.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/mobile/sdkjs/cell/script.bin")
|
||||
base.create_dir(out_dir + "/mobile/sdkjs/slide")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/mobile/sdkjs/slide/script.bin")
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners.js")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners_slide.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/mobile/sdkjs/slide/script.bin")
|
||||
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners_word.js")
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners_cell.js")
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners_slide.js")
|
||||
return
|
||||
|
||||
# JS build
|
||||
@ -82,9 +104,12 @@ def build_interface(directory):
|
||||
return
|
||||
|
||||
def get_build_param(minimize=True):
|
||||
minimize_scripts = minimize
|
||||
if config.check_option("jsminimize", "0"):
|
||||
minimize_scripts = False
|
||||
beta = "true" if config.check_option("beta", "1") else "false"
|
||||
params = ["--beta=" + beta]
|
||||
return params + (["--level=ADVANCED"] if minimize else ["--level=WHITESPACE_ONLY", "--formatting=PRETTY_PRINT"])
|
||||
return params + (["--level=ADVANCED"] if minimize_scripts else ["--level=WHITESPACE_ONLY", "--formatting=PRETTY_PRINT"])
|
||||
|
||||
def build_sdk_desktop(directory):
|
||||
#_run_npm_cli(directory)
|
||||
|
||||
@ -52,7 +52,6 @@ def make():
|
||||
base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
|
||||
base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
|
||||
base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
|
||||
base.cmd_in_dir(server_build_dir + "/SpellChecker", "pkg", [".", "-t", pkg_target, "-o", "spellchecker"])
|
||||
|
||||
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
|
||||
base.delete_dir(example_dir + "/node_modules")
|
||||
|
||||
@ -26,7 +26,7 @@ def parse():
|
||||
global platforms
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
|
||||
"linux_64", "linux_32",
|
||||
"mac_64",
|
||||
"mac_64", "mac_arm64",
|
||||
"ios",
|
||||
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@ import icu
|
||||
import openssl
|
||||
import v8
|
||||
import html2
|
||||
import hunspell
|
||||
import glew
|
||||
|
||||
def make():
|
||||
boost.make()
|
||||
@ -21,4 +23,6 @@ def make():
|
||||
openssl.make()
|
||||
v8.make()
|
||||
html2.make()
|
||||
hunspell.make(False)
|
||||
glew.make()
|
||||
return
|
||||
|
||||
@ -68,12 +68,12 @@ def make():
|
||||
if ("windows" == base.host_platform()):
|
||||
win_toolset = "msvc-14.0"
|
||||
if (-1 != config.option("platform").find("win_64")) and not base.is_dir("../build/win_64"):
|
||||
base.cmd("bootstrap.bat")
|
||||
base.cmd("bootstrap.bat", ["vc14"])
|
||||
base.cmd("b2.exe", ["headers"])
|
||||
base.cmd("b2.exe", ["--clean"])
|
||||
base.cmd("b2.exe", ["--prefix=./../build/win_64", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=64", "install"])
|
||||
if (-1 != config.option("platform").find("win_32")) and not base.is_dir("../build/win_32"):
|
||||
base.cmd("bootstrap.bat")
|
||||
base.cmd("bootstrap.bat", ["vc14"])
|
||||
base.cmd("b2.exe", ["headers"])
|
||||
base.cmd("b2.exe", ["--clean"])
|
||||
base.cmd("b2.exe", ["--prefix=./../build/win_32", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=32", "install"])
|
||||
@ -87,13 +87,6 @@ def make():
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC", "install"])
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
clang_correct()
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/mac_64", "link=static", "install"])
|
||||
|
||||
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios"):
|
||||
clang_correct()
|
||||
os.chdir("../")
|
||||
@ -102,6 +95,20 @@ def make():
|
||||
if (-1 != config.option("platform").find("android")) and not base.is_dir("../build/android"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"])
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_64")
|
||||
directory_build = base_dir + "/build/mac_64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/mac_64/*.a", directory_build)
|
||||
|
||||
if (-1 != config.option("platform").find("mac_arm64")) and not base.is_dir("../build/mac_arm64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_arm64")
|
||||
directory_build = base_dir + "/build/mac_arm64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/mac_arm64/*.a", directory_build)
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
|
||||
@ -7,12 +7,12 @@ import base
|
||||
import os
|
||||
import build
|
||||
|
||||
def make(src_dir, modules):
|
||||
def make(src_dir, modules, build_platform="android"):
|
||||
old_cur = os.getcwd()
|
||||
|
||||
print("boost-headers...")
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
|
||||
base.cmd("./b2", ["--prefix=./../build/android", "headers", "install"])
|
||||
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install"])
|
||||
|
||||
for module in modules:
|
||||
print("boost-module: " + module + " ...")
|
||||
@ -40,7 +40,7 @@ def make(src_dir, modules):
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("SOURCES += $$files($$PWD/src/*.cpp, true)")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/" + build_platform + "/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content)
|
||||
build.make_pro_file(module_dir + "/makefiles", module_dir + "/" + module + ".pro")
|
||||
|
||||
|
||||
31
scripts/core_common/modules/glew.py
Normal file
31
scripts/core_common/modules/glew.py
Normal file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def clean():
|
||||
if base.is_dir("glew-2.1.0"):
|
||||
base.delete_dir("glew-2.1.0");
|
||||
return
|
||||
|
||||
def make():
|
||||
if ("windows" != base.host_platform()):
|
||||
return
|
||||
|
||||
if not config.check_option("module", "mobile"):
|
||||
return;
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/glew"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.common_check_version("glew", "1", clean)
|
||||
base.download("https://deac-ams.dl.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip", "./archive.zip")
|
||||
base.extract("./archive.zip", "./")
|
||||
base.delete_file("./archive.zip")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
171
scripts/core_common/modules/hunspell.py
Normal file
171
scripts/core_common/modules/hunspell.py
Normal file
@ -0,0 +1,171 @@
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
def make(build_js = True):
|
||||
|
||||
old_cur_dir = os.getcwd()
|
||||
#fetch libhunspell
|
||||
print("[fetch & build]: hunspell")
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/hunspell"
|
||||
os.chdir(base_dir)
|
||||
if not base.is_dir("hunspell"):
|
||||
last_stable_commit = "8a2fdfe5a6bb1cbafc04b0c8486abcefd17ad903"
|
||||
repo_path = "https://github.com/hunspell/hunspell.git"
|
||||
base.cmd("git", ["clone", repo_path])
|
||||
os.chdir("hunspell")
|
||||
base.cmd("git", ["checkout", last_stable_commit])
|
||||
base.replaceInFile("./src/hunspell/filemgr.hxx", "FileMgr& operator=(const FileMgr&);", "FileMgr& operator=(const FileMgr&); \n"
|
||||
+" #ifdef HUNSPELL_WASM_MODULE \n char* memory;size_t index;size_t size; \n #endif") #custon filemgr support watch filemgr_wrapper_new.cxx
|
||||
os.chdir("../")
|
||||
|
||||
if not build_js:
|
||||
os.chdir(old_cur_dir)
|
||||
return
|
||||
base.configure_common_apps()
|
||||
|
||||
# remove previous version
|
||||
if base.is_dir("./deploy"):
|
||||
base.delete_dir("./deploy")
|
||||
base.create_dir("./deploy")
|
||||
base.create_dir("./deploy/spell")
|
||||
|
||||
# fetch emsdk
|
||||
command_prefix = "" if ("windows" == base.host_platform()) else "./"
|
||||
if not base.is_dir("emsdk"):
|
||||
base.cmd("git", ["clone", "https://github.com/emscripten-core/emsdk.git"])
|
||||
os.chdir("emsdk")
|
||||
base.cmd(command_prefix + "emsdk", ["install", "latest"])
|
||||
base.cmd(command_prefix + "emsdk", ["activate", "latest"])
|
||||
os.chdir("../")
|
||||
|
||||
# compile
|
||||
compiler_flags = ["-o spell.js",
|
||||
"-O3",
|
||||
"-fno-exceptions",
|
||||
"-fno-rtti",
|
||||
"-s WASM=1",
|
||||
"-s ALLOW_MEMORY_GROWTH=1",
|
||||
"-s FILESYSTEM=0",
|
||||
"-s ENVIRONMENT='web,worker'"]
|
||||
|
||||
exported_functions = ["_malloc",
|
||||
"_free",
|
||||
"_Spellchecker_Malloc",
|
||||
"_Spellchecker_Free",
|
||||
"_Spellchecker_Create",
|
||||
"_Spellchecker_Destroy",
|
||||
"_Spellchecker_AddDictionary",
|
||||
"_Spellchecker_RemoveDicrionary",
|
||||
"_Spellchecker_Load",
|
||||
"_Spellchecker_Spell",
|
||||
"_Spellchecker_Suggest",
|
||||
"_Spellchecker_RemoveEngine",
|
||||
"_Spellchecker_TotalAllocatedMemory"]
|
||||
|
||||
version_hunspell = 17
|
||||
libhunspell_src_path = "./hunspell/src/hunspell"
|
||||
|
||||
input_sources = ["affentry.cxx",
|
||||
"affixmgr.cxx",
|
||||
"csutil.cxx",
|
||||
"dictmgr.cxx",
|
||||
"hashmgr.cxx",
|
||||
"hunspell.cxx",
|
||||
"hunzip.cxx",
|
||||
"phonet.cxx",
|
||||
"replist.cxx",
|
||||
"suggestmgr.cxx"]
|
||||
|
||||
sources = []
|
||||
for item in input_sources:
|
||||
if base.is_file(libhunspell_src_path + "/" + item):
|
||||
sources.append(libhunspell_src_path + "/" + item)
|
||||
|
||||
if (13 == version_hunspell):
|
||||
sources.append("./wasm/src/filemgr_wrapper.cxx")
|
||||
else:
|
||||
sources.append("./wasm/src/filemgr_wrapper_new.cxx")
|
||||
|
||||
sources.append("./wasm/src/base.cpp")
|
||||
|
||||
compiler_flags.append("-I" + libhunspell_src_path)
|
||||
compiler_flags.append("-DWIN32 -DNDEBUG -DHUNSPELL_STATIC -DBUILDING_LIBHUNSPELL -DHUNSPELL_WASM_MODULE")
|
||||
|
||||
# arguments
|
||||
arguments = ""
|
||||
for item in compiler_flags:
|
||||
arguments += (item + " ")
|
||||
|
||||
arguments += "-s EXPORTED_FUNCTIONS=\"["
|
||||
for item in exported_functions:
|
||||
arguments += ("'" + item + "',")
|
||||
arguments = arguments[:-1]
|
||||
arguments += "]\" "
|
||||
|
||||
for item in sources:
|
||||
arguments += (item + " ")
|
||||
|
||||
|
||||
# command
|
||||
windows_bat = []
|
||||
if (base.host_platform() == "windows"):
|
||||
windows_bat.append("call emsdk/emsdk_env.bat")
|
||||
windows_bat.append("call emcc " + arguments)
|
||||
else:
|
||||
windows_bat.append("#!/bin/bash")
|
||||
windows_bat.append("source ./emsdk/emsdk_env.sh")
|
||||
windows_bat.append("emcc " + arguments)
|
||||
base.run_as_bat(windows_bat)
|
||||
|
||||
# finalize
|
||||
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
|
||||
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
|
||||
|
||||
spell_js_content = base.readFile("./spell.js")
|
||||
engine_base_js_content = base.readFile("./wasm/js/spell.js")
|
||||
engine_js_content = engine_base_js_content.replace("//module", spell_js_content)
|
||||
|
||||
# write new version
|
||||
base.writeFile("./deploy/spell/spell.js", engine_js_content)
|
||||
base.copy_file("spell.wasm", "./deploy/spell/spell.wasm")
|
||||
|
||||
# ie asm version
|
||||
arguments = arguments.replace("WASM=1", "WASM=0")
|
||||
|
||||
# command
|
||||
windows_bat = []
|
||||
if (base.host_platform() == "windows"):
|
||||
windows_bat.append("call emsdk/emsdk_env.bat")
|
||||
windows_bat.append("call emcc " + arguments)
|
||||
else:
|
||||
windows_bat.append("#!/bin/bash")
|
||||
windows_bat.append("source ./emsdk/emsdk_env.sh")
|
||||
windows_bat.append("emcc " + arguments)
|
||||
base.run_as_bat(windows_bat)
|
||||
|
||||
# finalize
|
||||
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
|
||||
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
|
||||
|
||||
spell_js_content = base.readFile("./spell.js")
|
||||
engine_base_js_content = base.readFile("./wasm/js/spell.js")
|
||||
engine_base_js_polyfill = base.readFile("./wasm/js/polyfill.js")
|
||||
engine_js_content = engine_base_js_polyfill + "\n\n" + engine_base_js_content.replace("//module", spell_js_content)
|
||||
|
||||
# write new version
|
||||
base.writeFile("./deploy/spell/spell_ie.js", engine_js_content)
|
||||
base.copy_file("spell.js.mem", "./deploy/spell/spell.js.mem")
|
||||
|
||||
base.copy_file("./wasm/js/code.js", "./deploy/spell.js")
|
||||
base.copy_file("./wasm/js/index.html", "./deploy/index.html")
|
||||
|
||||
base.delete_file("spell.js")
|
||||
base.delete_file("spell.js.mem")
|
||||
os.chdir(old_cur_dir)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make(True)
|
||||
@ -67,10 +67,12 @@ def make():
|
||||
if (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir("build"):
|
||||
base.bash("./icu_ios")
|
||||
elif (platform == "mac_64") and not base.is_dir(platform + "/build"):
|
||||
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
|
||||
elif ("" != platform) and not base.is_dir(platform + "/build"):
|
||||
base.create_dir(platform)
|
||||
os.chdir("icu/source")
|
||||
base.cmd("./runConfigureICU", ["Linux" if "linux" == base.host_platform() else "MacOSX"])
|
||||
base.cmd("./runConfigureICU", ["Linux"])
|
||||
old_dest_dir = base.get_env("DESTDIR")
|
||||
base.set_env("DESTDIR", base_dir + "/" + platform)
|
||||
base.cmd("make", ["install"])
|
||||
@ -83,9 +85,6 @@ def make():
|
||||
if ("linux_64" == platform):
|
||||
base.copy_file("icu/source/lib/libicudata.so." + icu_major + "." + icu_minor, platform + "/build/libicudata.so." + icu_major)
|
||||
base.copy_file("icu/source/lib/libicuuc.so." + icu_major + "." + icu_minor, platform + "/build/libicuuc.so." + icu_major)
|
||||
elif ("mac_64" == platform):
|
||||
base.copy_file("icu/source/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file("icu/source/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
96
scripts/core_common/modules/icu_mac.py
Executable file
96
scripts/core_common/modules/icu_mac.py
Executable file
@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def change_icu_defs(current_dir, arch):
|
||||
icudef_file = current_dir + "/icudefs.mk"
|
||||
icudef_file_old = current_dir + "/icudefs.mk.back"
|
||||
|
||||
param = "-arch x86_64"
|
||||
if arch == "arm64":
|
||||
param = "-arch arm64 -isysroot " + base.find_mac_sdk()
|
||||
|
||||
base.copy_file(icudef_file, icudef_file_old)
|
||||
|
||||
base.replaceInFile(icudef_file, "CFLAGS = ", "CFLAGS = " + param + " ")
|
||||
base.replaceInFile(icudef_file, "CXXFLAGS = ", "CXXFLAGS = " + param + " ")
|
||||
base.replaceInFile(icudef_file, "RPATHLDFLAGS =", "RPATHLDFLAGS2 =")
|
||||
base.replaceInFile(icudef_file, "LDFLAGS = ", "LDFLAGS = " + param + " ")
|
||||
base.replaceInFile(icudef_file, "RPATHLDFLAGS2 =", "RPATHLDFLAGS =")
|
||||
|
||||
return
|
||||
|
||||
def restore_icu_defs(current_dir):
|
||||
icudef_file = current_dir + "/icudefs.mk"
|
||||
icudef_file_old = current_dir + "/icudefs.mk.back"
|
||||
|
||||
base.delete_file(icudef_file)
|
||||
base.copy_file(icudef_file_old, icudef_file)
|
||||
base.delete_file(icudef_file_old)
|
||||
return
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "2"
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if not base.is_dir(current_dir + "/mac_cross_64"):
|
||||
base.create_dir(current_dir + "/mac_cross_64")
|
||||
os.chdir(current_dir + "/mac_cross_64")
|
||||
|
||||
base.cmd("../icu/source/runConfigureICU", ["MacOSX",
|
||||
"--prefix=" + current_dir + "/mac_cross_64", "CFLAGS=-Os CXXFLAGS=--std=c++11"])
|
||||
|
||||
change_icu_defs(current_dir + "/mac_cross_64", "x86_64")
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
|
||||
restore_icu_defs(current_dir + "/mac_cross_64")
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
os.chdir(current_dir + "/icu/source")
|
||||
|
||||
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm_64",
|
||||
"--with-cross-build=" + current_dir + "/mac_cross_64", "VERBOSE=1"])
|
||||
|
||||
change_icu_defs(current_dir + "/icu/source", "arm64")
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"])
|
||||
|
||||
restore_icu_defs(current_dir + "/icu/source")
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if base.is_dir(current_dir + "/mac_64"):
|
||||
base.delete_dir(current_dir + "/mac_64")
|
||||
|
||||
if base.is_dir(current_dir + "/mac_arm64"):
|
||||
base.delete_dir(current_dir + "/mac_arm64")
|
||||
|
||||
base.create_dir(current_dir + "/mac_64")
|
||||
base.create_dir(current_dir + "/mac_64/build")
|
||||
|
||||
base.create_dir(current_dir + "/mac_arm64")
|
||||
base.create_dir(current_dir + "/mac_arm64/build")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_cross_64/include", current_dir + "/mac_64/build/include")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_arm_64/include", current_dir + "/mac_arm64/build/include")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
base.delete_dir(current_dir + "/mac_cross_64")
|
||||
base.delete_dir(current_dir + "/mac_arm_64")
|
||||
|
||||
os.chdir(current_dir_old)
|
||||
@ -83,7 +83,25 @@ def make():
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
base.cmd("./config", ["no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
|
||||
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-x86_64-cc", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
|
||||
base.cmd("make", ["build_libs", "install"])
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_arm64"):
|
||||
os.chdir(base_dir)
|
||||
base.cmd("git", ["clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git", "openssl2"])
|
||||
os.chdir(base_dir + "/openssl2")
|
||||
replace1 = "\"darwin64-x86_64-cc\" => {"
|
||||
replace2 = "\"darwin64-arm64-cc\" => {\n\
|
||||
inherit_from => [ \"darwin-common\", asm(\"aarch64_asm\") ],\n\
|
||||
CFLAGS => add(\"-Wall\"),\n\
|
||||
cflags => add(\"-arch arm64 -isysroot " + base.find_mac_sdk() + "\"),\n\
|
||||
lib_cppflags => add(\"-DL_ENDIAN\"),\n\
|
||||
bn_ops => \"SIXTY_FOUR_BIT_LONG\",\n\
|
||||
perlasm_scheme => \"macosx\",\n\
|
||||
},\n\
|
||||
\"darwin64-x86_64-cc\" => {"
|
||||
base.replaceInFile(base_dir + "/openssl2/Configurations/10-main.conf", replace1, replace2)
|
||||
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-arm64-cc", "--prefix=" + old_cur_dir + "/build/mac_arm64", "--openssldir=" + old_cur_dir + "/build/mac_arm64"])
|
||||
base.cmd("make", ["build_libs", "install"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
|
||||
@ -67,6 +67,9 @@ def make():
|
||||
if (-1 == config.option("platform").find("linux")) and (-1 == config.option("platform").find("mac")) and (-1 == config.option("platform").find("win")):
|
||||
return
|
||||
|
||||
if ("mac" == base.host_platform()) and (-1 == config.option("config").find("use_v8")):
|
||||
return
|
||||
|
||||
print("[fetch & build]: v8")
|
||||
old_env = dict(os.environ)
|
||||
|
||||
@ -146,6 +149,11 @@ def make():
|
||||
base.replaceInFile("v8/build/config/mac/mac_sdk.gni", "if (mac_sdk_version != mac_sdk_min_build_override", "if (false && mac_sdk_version != mac_sdk_min_build_override")
|
||||
base.replaceInFile("v8/build/mac/find_sdk.py", "^MacOSX(10\\.\\d+)\\.sdk$", "^MacOSX(1\\d\\.\\d+)\\.sdk$")
|
||||
|
||||
if (11003 <= base.get_mac_sdk_version_number()):
|
||||
base.copy_dir("v8/third_party/llvm-build/Release+Asserts/include", "v8/third_party/llvm-build/Release+Asserts/__include")
|
||||
base.delete_dir("v8/third_party/llvm-build/Release+Asserts/include")
|
||||
base.replaceInFile("v8/build/config/mac/BUILD.gn", "\"-mmacosx-version-min=$mac_deployment_target\",", "\"-mmacosx-version-min=$mac_deployment_target\",\n \"-Wno-deprecated-declarations\",")
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# build
|
||||
os.chdir("v8")
|
||||
|
||||
@ -72,7 +72,7 @@ def make():
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/doctrenderer.lib", root_dir + "/doctrenderer.lib")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/")
|
||||
else:
|
||||
elif (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/icudtl.dat")
|
||||
|
||||
# app
|
||||
|
||||
@ -49,7 +49,8 @@ def make():
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", archive_dir + "/")
|
||||
else:
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
|
||||
if (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
|
||||
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allthemesgen")
|
||||
|
||||
@ -80,11 +80,11 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/converter/")
|
||||
else:
|
||||
elif (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat")
|
||||
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/converter/empty", root_dir + "/converter/empty")
|
||||
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
|
||||
|
||||
# dictionaries
|
||||
base.create_dir(root_dir + "/dictionaries")
|
||||
|
||||
@ -45,7 +45,11 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
|
||||
|
||||
if (0 == platform.find("win") or 0 == platform.find("linux") or 0 == platform.find("mac")):
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "x2t")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
|
||||
@ -32,7 +32,8 @@ def make():
|
||||
continue
|
||||
|
||||
root_dir = base_dir + ("/" + native_platform + "/" + branding + "/documentserver")
|
||||
root_dir_snap = root_dir + '-snap'
|
||||
root_dir_snap = root_dir + '-snap/var/www/onlyoffice/documentserver'
|
||||
root_dir_snap_example = root_dir_snap + '-example'
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
@ -57,11 +58,6 @@ def make():
|
||||
base.create_dir(build_server_dir + '/Metrics/node_modules/modern-syslog/build/Release')
|
||||
base.copy_file(bin_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node", build_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node")
|
||||
|
||||
base.create_dir(build_server_dir + '/SpellChecker')
|
||||
base.copy_exe(bin_server_dir + "/SpellChecker", build_server_dir + '/SpellChecker', "spellchecker")
|
||||
base.create_dir(build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release')
|
||||
base.copy_file(bin_server_dir + "/SpellChecker/node_modules/nodehun/build/Release/Nodehun.node", build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release/Nodehun.node')
|
||||
|
||||
|
||||
qt_dir = base.qt_setup(native_platform)
|
||||
platform = native_platform
|
||||
@ -106,7 +102,7 @@ def make():
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
|
||||
else:
|
||||
elif (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat")
|
||||
|
||||
# builder
|
||||
@ -139,7 +135,7 @@ def make():
|
||||
branding_dir = git_dir + '/' + config.option("branding") + '/server'
|
||||
|
||||
#dictionaries
|
||||
spellchecker_dictionaries = build_server_dir + '/SpellChecker/dictionaries'
|
||||
spellchecker_dictionaries = build_server_dir + '/dictionaries'
|
||||
spellchecker_dictionaries_files = server_dir + '/../dictionaries/*_*'
|
||||
base.create_dir(spellchecker_dictionaries)
|
||||
base.copy_files(spellchecker_dictionaries_files, spellchecker_dictionaries)
|
||||
@ -200,12 +196,10 @@ def make():
|
||||
base.copy_dir(bin_server_dir + '/FileConverter/node_modules', root_dir_snap + '/server/FileConverter/node_modules')
|
||||
base.copy_dir(bin_server_dir + '/FileConverter/sources', root_dir_snap + '/server/FileConverter/sources')
|
||||
base.delete_file(root_dir_snap + '/server/FileConverter/converter')
|
||||
base.copy_dir(bin_server_dir + '/SpellChecker/node_modules', root_dir_snap + '/server/SpellChecker/node_modules')
|
||||
base.copy_dir(bin_server_dir + '/SpellChecker/sources', root_dir_snap + '/server/SpellChecker/sources')
|
||||
base.delete_file(root_dir_snap + '/server/SpellChecker/spellchecker')
|
||||
base.copy_dir(bin_server_dir + '/Common/node_modules', root_dir_snap + '/server/Common/node_modules')
|
||||
base.copy_dir(bin_server_dir + '/Common/sources', root_dir_snap + '/server/Common/sources')
|
||||
base.copy_dir(bin_example_dir + '/..', root_dir_snap + '/example')
|
||||
base.create_dir(root_dir_snap_example)
|
||||
base.copy_dir(bin_example_dir + '/..', root_dir_snap_example)
|
||||
base.delete_file(root_dir_snap + '/example/nodejs/example')
|
||||
|
||||
return
|
||||
|
||||
@ -89,7 +89,7 @@ def make():
|
||||
#base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"", "--postfix=android", "--params=280,224"])
|
||||
|
||||
# add directories to open directories
|
||||
addon_base_path = "../../../"
|
||||
addon_base_path = "../../"
|
||||
server_config = {}
|
||||
static_content = {}
|
||||
sql = {}
|
||||
|
||||
@ -102,11 +102,11 @@ def check_dependencies():
|
||||
install_args += checksResult.get_uninstall()
|
||||
install_args += checksResult.get_removepath()
|
||||
install_args += checksResult.get_install()
|
||||
install_args[0] = './scripts/develop/' + install_args[0]
|
||||
if (host_platform == 'windows'):
|
||||
install_args[0] = './scripts/develop/' + install_args[0]
|
||||
code = libwindows.sudo(unicode(sys.executable), install_args)
|
||||
elif (host_platform == 'linux'):
|
||||
base.cmd_in_dir('./scripts/develop/', 'python', install_args)
|
||||
base.cmd('python', install_args, False)
|
||||
get_updates()
|
||||
|
||||
check_npmPath()
|
||||
@ -151,6 +151,7 @@ def check_git():
|
||||
def check_nodejs():
|
||||
dependence = CDependencies()
|
||||
|
||||
isNeedReinstall = False
|
||||
base.print_info('Check installed Node.js')
|
||||
nodejs_version = base.run_command('node -v')['stdout']
|
||||
if (nodejs_version == ''):
|
||||
@ -158,12 +159,34 @@ def check_nodejs():
|
||||
dependence.append_install('Node.js')
|
||||
return dependence
|
||||
|
||||
nodejs_cur_version = int(nodejs_version.split('.')[0][1:])
|
||||
print('Installed Node.js version: ' + str(nodejs_cur_version))
|
||||
nodejs_min_version = 8
|
||||
nodejs_max_version = 14
|
||||
if (nodejs_min_version > nodejs_cur_version or nodejs_cur_version > nodejs_max_version):
|
||||
print('Installed Node.js version must be 8.x to 14.x')
|
||||
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
|
||||
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
|
||||
print('Installed Node.js version: ' + nodejs_version[1:])
|
||||
nodejs_min_version = '10.20'
|
||||
nodejs_min_version_minor = 0
|
||||
major_minor_min_version = nodejs_min_version.split('.')
|
||||
nodejs_min_version_major = int(major_minor_min_version[0])
|
||||
if len(major_minor_min_version) > 1:
|
||||
nodejs_min_version_minor = int(major_minor_min_version[1])
|
||||
nodejs_max_version = '14'
|
||||
nodejs_max_version_minor = float("inf")
|
||||
major_minor_max_version = nodejs_max_version.split('.')
|
||||
nodejs_max_version_major = int(major_minor_max_version[0])
|
||||
if len(major_minor_max_version) > 1:
|
||||
nodejs_max_version_minor = int(major_minor_max_version[1])
|
||||
|
||||
if (nodejs_min_version_major > nodejs_cur_version_major or nodejs_cur_version_major > nodejs_max_version_major):
|
||||
print('Installed Node.js version must be 10.20 to 14.x')
|
||||
isNeedReinstall = True
|
||||
elif (nodejs_min_version_major == nodejs_cur_version_major):
|
||||
if (nodejs_min_version_minor > nodejs_cur_version_minor):
|
||||
isNeedReinstall = True
|
||||
elif (nodejs_cur_version_major == nodejs_max_version_major):
|
||||
if (nodejs_cur_version_minor > nodejs_max_version_minor):
|
||||
isNeedReinstall = True
|
||||
|
||||
if (True == isNeedReinstall):
|
||||
print('Installed Node.js version must be 10.20 to 14.x')
|
||||
if (host_platform == 'windows'):
|
||||
dependence.append_uninstall('Node.js')
|
||||
elif (host_platform == 'linux'):
|
||||
@ -195,16 +218,24 @@ def check_java():
|
||||
def get_erlang_path_to_bin():
|
||||
erlangPath = ''
|
||||
if (host_platform == 'windows'):
|
||||
erlangPath = os.getenv("ERLANG_HOME")
|
||||
if (erlangPath is not None):
|
||||
erlangPath += '\\bin'
|
||||
erlangPath = os.getenv("ERLANG_HOME", "")
|
||||
if (erlangPath != ""):
|
||||
erlangPath += "\\bin"
|
||||
return erlangPath
|
||||
def check_erlang():
|
||||
dependence = CDependencies()
|
||||
base.print_info('Check installed Erlang')
|
||||
|
||||
erlangBitness = base.run_command_in_dir(get_erlang_path_to_bin(), 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']
|
||||
|
||||
erlangBitness = ""
|
||||
erlang_path_home = get_erlang_path_to_bin()
|
||||
if base.is_exist(erlang_path_home) == False:
|
||||
dependence.append_uninstall('Erlang')
|
||||
dependence.append_uninstall('RabbitMQ')
|
||||
return dependence
|
||||
|
||||
if ("" != erlang_path_home or host_platform != 'windows'):
|
||||
erlangBitness = base.run_command_in_dir(erlang_path_home, 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']
|
||||
|
||||
if (erlangBitness == '8'):
|
||||
print("Installed Erlang is valid")
|
||||
return dependence
|
||||
@ -384,6 +415,31 @@ def check_7z():
|
||||
|
||||
return dependence
|
||||
|
||||
def check_gh():
|
||||
base.print_info('Check installed GitHub CLI')
|
||||
|
||||
result = base.run_command('gh --version')['stdout']
|
||||
|
||||
if (result == ''):
|
||||
base.print_info('GitHub CLI not found')
|
||||
# ToDo install
|
||||
return False
|
||||
|
||||
base.print_info('GitHub CLI is installed')
|
||||
return True
|
||||
|
||||
def check_gh_auth():
|
||||
base.print_info('Check auth for GitHub CLI')
|
||||
|
||||
result = base.run_command('gh auth status')['stderr']
|
||||
|
||||
if (result.find('not logged') != -1):
|
||||
base.print_info('GitHub CLI not logged in to github')
|
||||
return False
|
||||
|
||||
base.print_info('GitHub CLI logged in to github')
|
||||
return True
|
||||
|
||||
def get_mysql_path_to_bin(mysqlPath = ''):
|
||||
if (host_platform == 'windows'):
|
||||
if (mysqlPath == ''):
|
||||
@ -450,9 +506,14 @@ def check_mysqlServer():
|
||||
|
||||
print('Valid MySQL Server not found')
|
||||
dependence.append_uninstall('MySQL Server')
|
||||
dependence.append_uninstall('MySQL Installer')
|
||||
dependence.append_install('MySQLInstaller')
|
||||
dependence.append_install('MySQLServer')
|
||||
|
||||
MySQLData = os.environ['ProgramData'] + '\\MySQL\\'
|
||||
if base.is_exist(MySQLData) == False:
|
||||
return dependence
|
||||
|
||||
dir = os.listdir(MySQLData)
|
||||
for path in dir:
|
||||
if (path.find('MySQL Server') != -1) and (base.is_file(MySQLData + path) == False):
|
||||
@ -467,27 +528,26 @@ def check_MySQLConfig(mysqlPath = ''):
|
||||
if (base.run_command_in_dir(mysql_path_to_bin, mysqlLoginSrt + ' -e "SHOW DATABASES;"')['stdout'].find('onlyoffice') == -1):
|
||||
print('Database onlyoffice not found')
|
||||
creatdb_path = base.get_script_dir() + "/../../server/schema/mysql/createdb.sql"
|
||||
result = execMySQLScript(mysqlPath, creatdb_path)
|
||||
result = execMySQLScript(mysql_path_to_bin, creatdb_path)
|
||||
if (base.run_command_in_dir(mysql_path_to_bin, mysqlLoginSrt + ' -e "SELECT plugin from mysql.user where User=' + "'" + install_params['MySQLServer']['user'] + "';" + '"')['stdout'].find('mysql_native_password') == -1):
|
||||
print('Password encryption is not valid')
|
||||
result = set_MySQLEncrypt(mysqlPath, 'mysql_native_password') and result
|
||||
result = set_MySQLEncrypt(mysql_path_to_bin, 'mysql_native_password') and result
|
||||
|
||||
return result
|
||||
def execMySQLScript(mysqlPath, scriptPath):
|
||||
#ToDo check path to mysql
|
||||
def execMySQLScript(mysql_path_to_bin, scriptPath):
|
||||
print('Execution ' + scriptPath)
|
||||
|
||||
code = subprocess.call(get_mysqlLoginSrting() + ' < "' + scriptPath + '"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
mysqlLoginSrt = get_mysqlLoginSrting()
|
||||
|
||||
code = base.exec_command_in_dir(mysql_path_to_bin, get_mysqlLoginSrting() + ' < "' + scriptPath + '"')
|
||||
if (code != 0):
|
||||
print('Execution failed!')
|
||||
return False
|
||||
print('Execution completed')
|
||||
return True
|
||||
def set_MySQLEncrypt(mysqlPath, sEncrypt):
|
||||
#ToDo check path to mysql
|
||||
def set_MySQLEncrypt(mysql_path_to_bin, sEncrypt):
|
||||
print('Setting MySQL password encrypting...')
|
||||
|
||||
code = subprocess.call(get_mysqlLoginSrting() + ' -e "' + "ALTER USER '" + install_params['MySQLServer']['user'] + "'@'localhost' IDENTIFIED WITH " + sEncrypt + " BY '" + install_params['MySQLServer']['pass'] + "';" + '"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
code = base.exec_command_in_dir(mysql_path_to_bin, get_mysqlLoginSrting() + ' -e "' + "ALTER USER '" + install_params['MySQLServer']['user'] + "'@'localhost' IDENTIFIED WITH " + sEncrypt + " BY '" + install_params['MySQLServer']['pass'] + "';" + '"')
|
||||
if (code != 0):
|
||||
print('Setting password encryption failed!')
|
||||
return False
|
||||
@ -508,8 +568,8 @@ def uninstall_mysqlserver():
|
||||
def get_postrgre_path_to_bin(postgrePath = ''):
|
||||
if (host_platform == 'windows'):
|
||||
if (postgrePath == ''):
|
||||
postgrePath = os.environ['PROGRAMW6432'] + '\\PostgreSQL\\13\\'
|
||||
postgrePath += 'bin'
|
||||
postgrePath = os.environ['PROGRAMW6432'] + '\\PostgreSQL\\13'
|
||||
postgrePath += '\\bin'
|
||||
return postgrePath
|
||||
def get_postgreLoginSrting(userName):
|
||||
if (host_platform == 'windows'):
|
||||
@ -548,8 +608,9 @@ def check_postgreSQL():
|
||||
|
||||
if (host_platform == 'linux'):
|
||||
result = os.system(postgreLoginSrt + ' -c "\q"')
|
||||
connectionResult = base.run_command(connectionString)['stdout']
|
||||
|
||||
if (result != 0):
|
||||
if (result != 0 or connectionResult.find(install_params['PostgreSQL']['dbPort']) == -1):
|
||||
print('Valid PostgreSQL not found!')
|
||||
dependence.append_install('PostgreSQL')
|
||||
dependence.append_uninstall('PostgreSQL')
|
||||
@ -563,7 +624,7 @@ def check_postgreSQL():
|
||||
for info in arrInfo:
|
||||
if (base.is_dir(info['Location']) == False):
|
||||
continue
|
||||
|
||||
|
||||
postgre_full_name = 'PostgreSQL ' + info['Version'][:2] + ' '
|
||||
connectionResult = base.run_command_in_dir(get_postrgre_path_to_bin(info['Location']), connectionString)['stdout']
|
||||
|
||||
@ -601,60 +662,55 @@ def check_postgreConfig(postgrePath = ''):
|
||||
if (os.system(postgreLoginDbUser + '-c "\q"') != 0):
|
||||
print('Invalid user password!')
|
||||
base.print_info('Changing password...')
|
||||
result = change_userPass(dbUser, dbPass, postgrePath) and result
|
||||
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
else:
|
||||
print('User ' + dbUser + ' not exist!')
|
||||
base.print_info('Creating ' + dbName + ' user...')
|
||||
result = create_postgreUser(dbUser, dbPass, postgrePath) and result
|
||||
result = create_postgreUser(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"')['stdout'].find('onlyoffice') == -1):
|
||||
print('Database ' + dbName + ' not found')
|
||||
base.print_info('Creating ' + dbName + ' database...')
|
||||
result = create_postgreDb(dbName, postgrePath) and configureDb(dbUser, dbName, creatdb_path, postgrePath)
|
||||
result = create_postgreDb(dbName, postgre_path_to_bin) and configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
|
||||
else:
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT pg_size_pretty(pg_database_size(' + "'" + dbName + "'" + '));"')['stdout'].find('7559 kB') != -1):
|
||||
print('Database ' + dbName + ' not configured')
|
||||
base.print_info('Configuring ' + dbName + ' database...')
|
||||
result = configureDb(dbName, creatdb_path, postgrePath) and result
|
||||
result = configureDb(dbName, creatdb_path, postgre_path_to_bin) and result
|
||||
print('Database ' + dbName + ' is valid')
|
||||
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "\l+ ' + dbName + '"')['stdout'].find(dbUser +'=CTc/' + rootUser) == -1):
|
||||
print('User ' + dbUser + ' has no database privileges!')
|
||||
base.print_info('Setting database privileges for user ' + dbUser + '...')
|
||||
result = set_dbPrivilegesForUser(dbUser, dbName, postgrePath) and result
|
||||
result = set_dbPrivilegesForUser(dbUser, dbName, postgre_path_to_bin) and result
|
||||
print('User ' + dbUser + ' has database privileges')
|
||||
|
||||
return result
|
||||
def create_postgreDb(dbName, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def create_postgreDb(dbName, postgre_path_to_bin = ''):
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def set_dbPrivilegesForUser(userName, dbName, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def create_postgreUser(userName, userPass, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
|
||||
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def change_userPass(userName, userPass, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
|
||||
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginRoot + '-c "ALTER USER ' + userName + " WITH PASSWORD '" + userPass + "';" + '"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "ALTER USER ' + userName + " WITH PASSWORD '" + userPass + "';" + '"') != 0):
|
||||
return False
|
||||
return True
|
||||
def configureDb(userName, dbName, scriptPath, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def configureDb(userName, dbName, scriptPath, postgre_path_to_bin = ''):
|
||||
print('Execution ' + scriptPath)
|
||||
postgreLoginSrt = get_postgreLoginSrting(userName)
|
||||
|
||||
code = os.system(postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
|
||||
code = base.exec_command_in_dir(postgre_path_to_bin, postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
|
||||
if (code != 0):
|
||||
print('Execution failed!')
|
||||
return False
|
||||
@ -667,6 +723,7 @@ def uninstall_postgresql():
|
||||
code = os.system('sudo rm -rf /etc/postgresql/') and code
|
||||
code = os.system('sudo userdel -r postgres') and code
|
||||
code = os.system('sudo groupdel postgres') and code
|
||||
os.system('sudo kill ' + base.run_command('sudo fuser -vn tcp 5432')['stdout'])
|
||||
|
||||
return code
|
||||
|
||||
@ -724,12 +781,11 @@ def uninstallProgram(sName):
|
||||
if (code != 0):
|
||||
print("Uninstalling was failed!")
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
def installProgram(sName):
|
||||
base.print_info("Installing " + sName + "...")
|
||||
|
||||
if (host_platform == 'windows'):
|
||||
if (sName in install_special):
|
||||
code = install_special[sName]()
|
||||
@ -891,3 +947,4 @@ install_params = {
|
||||
uninstall_params = {
|
||||
'PostgreSQL': '--mode unattended --unattendedmodeui none'
|
||||
}
|
||||
|
||||
|
||||
22
scripts/develop/develop.py
Normal file
22
scripts/develop/develop.py
Normal file
@ -0,0 +1,22 @@
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/develop')
|
||||
import base
|
||||
import build_js
|
||||
import build_server
|
||||
import config
|
||||
import dependence
|
||||
import config_server as develop_config_server
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
def make():
|
||||
if ("1" != config.option("develop")):
|
||||
return
|
||||
if not dependence.check_dependencies():
|
||||
exit(1)
|
||||
build_server.build_server_develop()
|
||||
build_js.build_js_develop(base_dir + "/../../..")
|
||||
develop_config_server.make()
|
||||
exit(0)
|
||||
|
||||
@ -7,14 +7,26 @@ import base
|
||||
import dependence
|
||||
import config
|
||||
|
||||
branch_from = ''
|
||||
branches_to = []
|
||||
def protect_brunch(branch, repo, strict = False):
|
||||
team = '' if strict else 'dep-application-development-leads'
|
||||
command = 'echo {"required_status_checks": null,"enforce_admins":true,"required_pull_request_reviews": null,"restrictions": {"users":[],"teams":["'
|
||||
command += team + '"]}} | gh api -X PUT repos/ONLYOFFICE/' + repo + '/branches/' + branch + '/protection --input -'
|
||||
result = base.run_command(command)
|
||||
if ('' != result['stderr']):
|
||||
print(result['stderr'])
|
||||
return
|
||||
|
||||
branch_from = 'release/v6.2.0'
|
||||
branches_to = ['develop']
|
||||
|
||||
platform = base.host_platform()
|
||||
if ("windows" == platform):
|
||||
dependence.check_pythonPath()
|
||||
dependence.check_gitPath()
|
||||
|
||||
if (dependence.check_gh() != True or dependence.check_gh_auth() != True):
|
||||
sys.exit(0)
|
||||
|
||||
base.cmd_in_dir('../../', 'python', ['configure.py', '--branding', 'onlyoffice', '--branding-url', 'https://github.com/ONLYOFFICE/onlyoffice.git', '--branch', branch_from, '--module', 'core desktop builder server mobile', '--update', '1', '--update-light', '1', '--clean', '0'])
|
||||
|
||||
# parse configuration
|
||||
@ -37,6 +49,14 @@ base.update_repositories(repositories)
|
||||
repositories['onlyoffice'] = [True, False]
|
||||
|
||||
for repo in repositories:
|
||||
base.create_pull_request(branches_to, repo, True)
|
||||
current_dir = repositories[repo][1]
|
||||
if current_dir != False:
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(current_dir)
|
||||
|
||||
base.create_pull_request(branches_to, repo, True, current_dir)
|
||||
|
||||
if current_dir != False:
|
||||
os.chdir(cur_dir)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
@ -9,7 +9,7 @@ import traceback
|
||||
|
||||
def install_module(path):
|
||||
base.print_info('Install: ' + path)
|
||||
base.cmd_in_dir(path, 'npm', ['install'])
|
||||
base.cmd_in_dir(path, 'npm', ['ci'])
|
||||
|
||||
def run_module(directory, args=[]):
|
||||
base.run_nodejs_in_dir(directory, args)
|
||||
@ -31,12 +31,21 @@ def start_mac_services():
|
||||
base.run_process(['mysql.server', 'restart'])
|
||||
base.print_info('Start RabbitMQ Server')
|
||||
base.run_process(['rabbitmq-server'])
|
||||
base.print_info('Start Redis')
|
||||
base.run_process(['redis-server'])
|
||||
# base.print_info('Start Redis')
|
||||
# base.run_process(['redis-server'])
|
||||
|
||||
def start_linux_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
os.system('sudo service mysql restart')
|
||||
base.print_info('Restart RabbitMQ Server')
|
||||
os.system('sudo service rabbitmq-server restart')
|
||||
|
||||
def run_integration_example():
|
||||
base.cmd_in_dir('../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
|
||||
|
||||
def start_linux_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
|
||||
def make(args = []):
|
||||
try:
|
||||
base.configure_common_apps()
|
||||
@ -48,6 +57,9 @@ def make(args = []):
|
||||
restart_win_rabbit()
|
||||
elif ("mac" == platform):
|
||||
start_mac_services()
|
||||
elif ("linux" == platform):
|
||||
start_linux_services()
|
||||
|
||||
|
||||
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
|
||||
|
||||
@ -62,20 +74,19 @@ def make(args = []):
|
||||
install_module('../../../server/DocService')
|
||||
install_module('../../../server/Common')
|
||||
install_module('../../../server/FileConverter')
|
||||
install_module('../../../server/SpellChecker')
|
||||
|
||||
base.set_env('NODE_ENV', 'development-' + platform)
|
||||
base.set_env('NODE_CONFIG_DIR', '../../Common/config')
|
||||
base.set_env('NODE_CONFIG_DIR', '../Common/config')
|
||||
|
||||
if ("mac" == platform):
|
||||
base.set_env('DYLD_LIBRARY_PATH', '../../FileConverter/bin/')
|
||||
base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/')
|
||||
elif ("linux" == platform):
|
||||
base.set_env('LD_LIBRARY_PATH', '../../FileConverter/bin/')
|
||||
base.set_env('LD_LIBRARY_PATH', '../FileConverter/bin/')
|
||||
|
||||
run_module('../../../server/DocService/sources', ['server.js'])
|
||||
run_module('../../../server/DocService/sources', ['gc.js'])
|
||||
run_module('../../../server/FileConverter/sources', ['convertermaster.js'])
|
||||
run_module('../../../server/SpellChecker/sources', ['server.js'])
|
||||
run_module('../../../server/DocService', ['sources/server.js'])
|
||||
# run_module('../../../server/DocService', ['sources/gc.js'])
|
||||
run_module('../../../server/FileConverter', ['sources/convertermaster.js'])
|
||||
# run_module('../../../server/SpellChecker', ['sources/server.js'])
|
||||
except SystemExit:
|
||||
input("Ignoring SystemExit. Press Enter to continue...")
|
||||
exit(0)
|
||||
|
||||
16
scripts/packages.py
Normal file
16
scripts/packages.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import packages_desktop
|
||||
# import packages_server
|
||||
# import packages_builder
|
||||
|
||||
def make():
|
||||
if config.check_option("module", "desktop"):
|
||||
packages_desktop.make()
|
||||
# if config.check_option("module", "server"):
|
||||
# packages_server.make()
|
||||
# if config.check_option("module", "builder"):
|
||||
# packages_builder.make()
|
||||
return
|
||||
67
scripts/packages_desktop.py
Normal file
67
scripts/packages_desktop.py
Normal file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import re
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
branding = config.branding()
|
||||
|
||||
platforms = config.option("platform").split()
|
||||
for native_platform in platforms:
|
||||
if not native_platform in config.platforms:
|
||||
continue
|
||||
|
||||
isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
|
||||
platform = native_platform[0:-3] if isWindowsXP else native_platform
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
macos_dir = git_dir + "/desktop-apps/macos"
|
||||
update_dir = macos_dir + "/build/update"
|
||||
|
||||
isX86 = True if ("" != base.get_env("_X86")) else False
|
||||
|
||||
target = "release" if not isX86 else "release_x86"
|
||||
base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", target, "skip_git_bump:true"])
|
||||
|
||||
package = "ONLYOFFICE" if not isX86 else "ONLYOFFICE-x86"
|
||||
app_version = base.run_command("mdls -name kMDItemVersion -raw " +
|
||||
macos_dir + "/build/ONLYOFFICE.app")['stdout']
|
||||
macos_zip = macos_dir + "/build/" + package + "-" + app_version + ".zip"
|
||||
update_storage = base.get_env("ARCHIVES_DIR") + "/" + package + "/_updates"
|
||||
changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes/" + app_version
|
||||
base.delete_dir(update_dir)
|
||||
base.delete_dir(os.path.expanduser("~/Library/Caches/Sparkle_generate_appcast"))
|
||||
base.create_dir(update_dir)
|
||||
base.copy_dir_content(update_storage, update_dir, ".zip")
|
||||
base.copy_file(macos_zip, update_dir)
|
||||
for file in os.listdir(update_dir):
|
||||
if file.endswith(".zip"):
|
||||
base.copy_file(changes_dir + "/ReleaseNotes.html",
|
||||
update_dir + "/" + os.path.splitext(file)[0] + ".html")
|
||||
base.copy_file(changes_dir + "/ReleaseNotesRU.html",
|
||||
update_dir + "/" + os.path.splitext(file)[0] + ".ru.html")
|
||||
|
||||
base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast", [update_dir])
|
||||
|
||||
base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
|
||||
changes_url = base_url + "/updates/onlyoffice/changes"
|
||||
update_url = base_url + ("/updates/onlyoffice" if not isX86 else "/x86")
|
||||
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
|
||||
"\\1" + changes_url + "/\\2/ReleaseNotes.html\\3")
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
|
||||
"\\1" + changes_url + "/\\2/ReleaseNotesRU.html\\3")
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(url=\")(?:.+/)(ONLYOFFICE.+\")", "\\1" + update_url + "/\\2")
|
||||
|
||||
for file in os.listdir(update_dir):
|
||||
if -1 == file.find(app_version) and (file.endswith(".zip") or file.endswith(".html")):
|
||||
base.delete_dir(update_dir + "/" + file)
|
||||
|
||||
return
|
||||
176
scripts/sdkjs_common/generate_builder_intarface.py
Normal file
176
scripts/sdkjs_common/generate_builder_intarface.py
Normal file
@ -0,0 +1,176 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import shutil
|
||||
|
||||
def readFile(path):
|
||||
with open(path, "r") as file:
|
||||
filedata = file.read()
|
||||
return filedata
|
||||
|
||||
def writeFile(path, content):
|
||||
if (os.path.isfile(path)):
|
||||
os.remove(path)
|
||||
|
||||
with open(path, "w") as file:
|
||||
file.write(content)
|
||||
return
|
||||
|
||||
class EditorApi(object):
|
||||
def __init__(self):
|
||||
self.records = []
|
||||
self.init = False
|
||||
self.folder = "word"
|
||||
self.type = "CDE"
|
||||
self.numfile = 0
|
||||
self.files = []
|
||||
return
|
||||
|
||||
def initFiles(self, type, files):
|
||||
self.folder = type
|
||||
if "word" == self.folder:
|
||||
self.type = "CDE"
|
||||
elif "slide" == self.folder:
|
||||
self.type = "CPE"
|
||||
else:
|
||||
self.type = "CSE"
|
||||
self.files = files
|
||||
return
|
||||
|
||||
def getReturnValue(self, description):
|
||||
paramStart = description.find("@returns {")
|
||||
if -1 == paramStart:
|
||||
return "{}"
|
||||
paramEnd = description.find("}", paramStart)
|
||||
retParam = description[paramStart + 10:paramEnd]
|
||||
isArray = False
|
||||
if -1 != retParam.find("[]"):
|
||||
isArray = True
|
||||
retParam = retParam.replace("[]", "")
|
||||
retType = retParam.replace("|", " ").split(" ")[0]
|
||||
retTypeLower = retType.lower()
|
||||
retValue = ""
|
||||
if -1 != retType.find("\""):
|
||||
retValue = "\"\""
|
||||
elif "bool" == retTypeLower:
|
||||
retValue = "true"
|
||||
elif "string" == retTypeLower:
|
||||
retValue = "\"\""
|
||||
elif "number" == retTypeLower:
|
||||
retValue = "0"
|
||||
elif "undefined" == retTypeLower:
|
||||
retValue = "undefined"
|
||||
elif "null" == retTypeLower:
|
||||
retValue = "null"
|
||||
else:
|
||||
retValue = "new " + retType + "()"
|
||||
if isArray:
|
||||
retValue = "[" + retValue + "]"
|
||||
return "{ return " + retValue + "; }"
|
||||
|
||||
def check_record(self, recordData):
|
||||
rec = recordData
|
||||
rec = rec.replace("\t", "")
|
||||
rec = rec.replace('\n ', '\n')
|
||||
indexEndDecoration = rec.find("*/")
|
||||
decoration = "/**" + rec[0:indexEndDecoration + 2]
|
||||
decoration = decoration.replace("Api\n", "ApiInterface\n")
|
||||
decoration = decoration.replace("Api ", "ApiInterface ")
|
||||
decoration = decoration.replace("{Api}", "{ApiInterface}")
|
||||
decoration = decoration.replace("@return ", "@returns ")
|
||||
decoration = decoration.replace("@returns {?", "@returns {")
|
||||
if -1 != decoration.find("@name ApiInterface"):
|
||||
self.append_record(decoration, "var ApiInterface = function() {};\nvar Api = new ApiInterface();\n", True)
|
||||
return
|
||||
code = rec[indexEndDecoration + 2:]
|
||||
code = code.strip("\t\n\r ")
|
||||
lines = code.split("\n")
|
||||
codeCorrect = ""
|
||||
sFuncName = ""
|
||||
is_found_function = False
|
||||
addon_for_func = "{}"
|
||||
if -1 != decoration.find("@return"):
|
||||
addon_for_func = "{ return null; }"
|
||||
for line in lines:
|
||||
line = line.strip("\t\n\r ")
|
||||
line = line.replace("{", "")
|
||||
line = line.replace("}", "")
|
||||
lineWithoutSpaces = line.replace(" ", "")
|
||||
if not is_found_function and 0 == line.find("function "):
|
||||
codeCorrect += (line + addon_for_func + "\n")
|
||||
is_found_function = True
|
||||
if not is_found_function and -1 != line.find(".prototype."):
|
||||
codeCorrect += (line + self.getReturnValue(decoration) + ";\n")
|
||||
is_found_function = True
|
||||
if -1 != lineWithoutSpaces.find(".prototype="):
|
||||
codeCorrect += (line + "\n")
|
||||
if -1 != line.find(".prototype.constructor"):
|
||||
codeCorrect += (line + "\n")
|
||||
codeCorrect = codeCorrect.replace("Api.prototype", "ApiInterface.prototype")
|
||||
self.append_record(decoration, codeCorrect)
|
||||
return
|
||||
|
||||
def append_record(self, decoration, code, init=False):
|
||||
if init:
|
||||
if not self.init:
|
||||
self.init = True
|
||||
self.records.append(decoration + "\n" + code + "\n\n")
|
||||
return
|
||||
# check on private
|
||||
if -1 != code.find(".prototype.private_"):
|
||||
return
|
||||
# add records only for current editor
|
||||
index_type_editors = decoration.find("@typeofeditors")
|
||||
if -1 != index_type_editors:
|
||||
index_type_editors_end = decoration.find("]", index_type_editors)
|
||||
if -1 != index_type_editors_end:
|
||||
editors_support = decoration[index_type_editors:index_type_editors_end]
|
||||
if -1 == editors_support.find(self.type):
|
||||
return
|
||||
# optimizations for first file
|
||||
if 0 == self.numfile:
|
||||
self.records.append(decoration + "\n" + code + "\n")
|
||||
return
|
||||
# check override js classes
|
||||
if 0 == code.find("function "):
|
||||
index_end_name = code.find("(")
|
||||
function_name = code[9:index_end_name].strip(" ")
|
||||
for rec in range(len(self.records)):
|
||||
if -1 != self.records[rec].find("function " + function_name + "("):
|
||||
self.records[rec] = ""
|
||||
elif -1 != self.records[rec].find("function " + function_name + " ("):
|
||||
self.records[rec] = ""
|
||||
elif -1 != self.records[rec].find("\n" + function_name + ".prototype."):
|
||||
self.records[rec] = ""
|
||||
|
||||
self.records.append(decoration + "\n" + code + "\n")
|
||||
return
|
||||
|
||||
def generate(self):
|
||||
for file in self.files:
|
||||
file_content = readFile(file)
|
||||
arrRecords = file_content.split("/**")
|
||||
arrRecords = arrRecords[1:-1]
|
||||
for record in arrRecords:
|
||||
self.check_record(record)
|
||||
self.numfile += 1
|
||||
correctContent = ''.join(self.records)
|
||||
correctContent += "\n"
|
||||
os.mkdir('deploy/api_builder/' + self.folder)
|
||||
writeFile("deploy/api_builder/" + self.folder + "/api.js", correctContent)
|
||||
return
|
||||
|
||||
def convert_to_interface(arrFiles, sEditorType):
|
||||
editor = EditorApi()
|
||||
editor.initFiles(sEditorType, arrFiles)
|
||||
editor.generate()
|
||||
return
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir("../../../sdkjs")
|
||||
if True == os.path.isdir('deploy/api_builder'):
|
||||
shutil.rmtree('deploy/api_builder', ignore_errors=True)
|
||||
os.mkdir('deploy/api_builder')
|
||||
convert_to_interface(["word/apiBuilder.js"], "word")
|
||||
convert_to_interface(["word/apiBuilder.js", "slide/apiBuilder.js"], "slide")
|
||||
convert_to_interface(["word/apiBuilder.js", "slide/apiBuilder.js", "cell/apiBuilder.js"], "cell")
|
||||
os.chdir(old_cur)
|
||||
@ -17,6 +17,9 @@ def get_branch_name(directory):
|
||||
return current_branch
|
||||
|
||||
def install_deps():
|
||||
if base.is_file("./packages_complete"):
|
||||
return
|
||||
|
||||
# dependencies
|
||||
packages = ["apt-transport-https",
|
||||
"autoconf2.13",
|
||||
@ -51,28 +54,52 @@ def install_deps():
|
||||
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
|
||||
|
||||
# nodejs
|
||||
if not base.is_file("./node_js_setup_10.x"):
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
|
||||
nodejs_cur = 0
|
||||
try:
|
||||
nodejs_version = base.run_command('node -v')['stdout']
|
||||
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
|
||||
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
|
||||
nodejs_cur = nodejs_cur_version_major * 1000 + nodejs_cur_version_minor
|
||||
print("Installed Node.js version: " + str(nodejs_cur_version_major) + "." + str(nodejs_cur_version_minor))
|
||||
except:
|
||||
nodejs_cur = 1
|
||||
if (nodejs_cur < 10020):
|
||||
print("Node.js version cannot be less 10.20")
|
||||
print("Reinstall")
|
||||
if (base.is_dir("./node_js_setup_10.x")):
|
||||
base.delete_dir("./node_js_setup_10.x")
|
||||
base.cmd("sudo", ["apt-get", "remove", "--purge", "-y", "nodejs"])
|
||||
base.download("https://deb.nodesource.com/setup_10.x", "./node_js_setup_10.x")
|
||||
base.cmd('curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -')
|
||||
base.cmd("sudo", ["bash", "./node_js_setup_10.x"])
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
|
||||
else:
|
||||
print("OK")
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
|
||||
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
|
||||
|
||||
# java
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
|
||||
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
|
||||
base.cmd("sudo", ["apt-get", "update"])
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "java"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
|
||||
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True)
|
||||
if (0 != java_error):
|
||||
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"], True)
|
||||
if (0 != java_error):
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
|
||||
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
|
||||
base.cmd("sudo", ["apt-get", "update"])
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "java"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
|
||||
|
||||
base.writeFile("./packages_complete", "complete")
|
||||
return
|
||||
|
||||
def install_qt():
|
||||
# qt
|
||||
if not base.is_file("./qt_source_5.9.9.tar.xz"):
|
||||
base.download("http://download.qt.io/official_releases/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
|
||||
base.download("https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
|
||||
|
||||
if not base.is_dir("./qt-everywhere-opensource-src-5.9.9"):
|
||||
base.cmd("tar", ["-xf", "./qt_source_5.9.9.tar.xz"])
|
||||
|
||||
Reference in New Issue
Block a user