mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
217 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1269d0234d | |||
| c1f7e8f471 | |||
| fe098a7ee7 | |||
| aced6c5119 | |||
| 94cd21189e | |||
| 4e07941e7a | |||
| a2fcf85e3b | |||
| e830cb9141 | |||
| 9bf3985fb2 | |||
| 59ad11b0f4 | |||
| ca7d92703e | |||
| cd040fc148 | |||
| 56c6ff289e | |||
| 7f41b96e07 | |||
| 41d2dfce6a | |||
| 0a712e3a68 | |||
| 0eca5a6fba | |||
| 8ab3f20eb8 | |||
| 634119f66a | |||
| 28718191d6 | |||
| f5f40c4746 | |||
| f6f832a7dd | |||
| e50882881d | |||
| 2937163371 | |||
| 0e6af8fc1b | |||
| 4da15cc3bd | |||
| 96312f29e3 | |||
| 32e2956346 | |||
| be820dc843 | |||
| 1a31d76034 | |||
| 73f0fb77bf | |||
| 263c857ca2 | |||
| 21e2a8f72e | |||
| 762eec7bf2 | |||
| ad388af712 | |||
| 9e6cd77650 | |||
| 101bbebbe6 | |||
| 2c27efe936 | |||
| 6404e71e22 | |||
| 575f835475 | |||
| ad2cdeebd8 | |||
| 66591ea617 | |||
| e5f4ee1555 | |||
| b1576abb74 | |||
| 35aa3e8ee2 | |||
| 9b0c7a1008 | |||
| ebccbfbbe2 | |||
| e921585baa | |||
| 9662f10652 | |||
| 9b374f2683 | |||
| a5eceac4c5 | |||
| 1d26beacfb | |||
| e0352bdc4a | |||
| 1d50755d9b | |||
| 200a3c698a | |||
| 3b3fa59307 | |||
| 9ac28dfb65 | |||
| 5b265245a4 | |||
| 9e974d30db | |||
| 7b8f8184b0 | |||
| 254b413617 | |||
| efdd2ce743 | |||
| b917e0b8d5 | |||
| 042bbb364f | |||
| d7b3d00e82 | |||
| 7116d8b916 | |||
| cc84676070 | |||
| 206c1da862 | |||
| e575effb05 | |||
| f01c20dee1 | |||
| 0f2a340c78 | |||
| be58f39505 | |||
| 9976df1185 | |||
| 6140cec905 | |||
| 53f5910f9b | |||
| 7db4a48565 | |||
| afbe93c5cb | |||
| 6c7b08606d | |||
| 75886ff835 | |||
| dfd74fbd72 | |||
| e0a597fc4c | |||
| ae28bd21d6 | |||
| e1ef29d9a6 | |||
| 554e6489e5 | |||
| 25030391ed | |||
| be06b3c2c8 | |||
| 5ab1995a23 | |||
| 287d0e3612 | |||
| 421ba72564 | |||
| bb6ad49a1c | |||
| aef52e14b5 | |||
| 582d8f54f4 | |||
| 9543f3fced | |||
| 6207b46e4f | |||
| c7ddae7a62 | |||
| 7e9823614f | |||
| e93ad56f5b | |||
| 2dc02a5bbf | |||
| bfcc577df1 | |||
| ae65dff284 | |||
| 773fca881b | |||
| a8a3487749 | |||
| 1505f17d6e | |||
| 874d749901 | |||
| b1a433f267 | |||
| e31c77d42c | |||
| c6e7679c63 | |||
| 4cb42515c7 | |||
| 43a5557200 | |||
| 1dec5f5b9a | |||
| 140b418b1e | |||
| e06a076e30 | |||
| e421a16469 | |||
| c01e200a89 | |||
| b339a50057 | |||
| 64425cc1e1 | |||
| 82187cf17b | |||
| bc3a6cd4e9 | |||
| 5b54f203b6 | |||
| 60a01bd455 | |||
| 623d1a7223 | |||
| d6facc48bf | |||
| 902505bf64 | |||
| d2a12e0445 | |||
| ca2c87f366 | |||
| fc4ffca529 | |||
| 9b8d7f94d5 | |||
| ad1c0d559f | |||
| 3d793be2a2 | |||
| 41122103ee | |||
| 6d1d674d5a | |||
| 89a5ad9498 | |||
| fb4f80589e | |||
| f3688dd303 | |||
| 0ba0f82141 | |||
| 0e876386e0 | |||
| 7a115ed3b4 | |||
| a497049352 | |||
| 43e0545287 | |||
| 4f7b992e64 | |||
| 83a842037b | |||
| c836ff9bd5 | |||
| 91e0b2089b | |||
| 11c80866c3 | |||
| 203fa4a554 | |||
| c8351fdb89 | |||
| 27ac97d2e0 | |||
| 0afe45b296 | |||
| 18f705ba7b | |||
| 77c25b06dc | |||
| fdcfc9f872 | |||
| bc005c4e5f | |||
| 1ae3df953c | |||
| 26f17b832a | |||
| 56cc1e505e | |||
| a06b1a3eae | |||
| 1008de5dcf | |||
| 7e5a509c32 | |||
| 927ed626a2 | |||
| 2dd8142b9d | |||
| 74c15af762 | |||
| 72ae1f18fd | |||
| f5dfc7f03b | |||
| 50b3fac2d2 | |||
| b5ad4ae8a7 | |||
| e1132269e5 | |||
| 2c43b6e49a | |||
| 2599806cb1 | |||
| 00d31b2354 | |||
| 9d1d24811b | |||
| cf4cac9482 | |||
| 3537d7c05d | |||
| f2022f2607 | |||
| e58fe4dfa1 | |||
| 3abd32c3db | |||
| 2a48cd4f0b | |||
| a77f59cb91 | |||
| fc4b093d9a | |||
| 4808e770d0 | |||
| 2a34edb488 | |||
| 67f356c388 | |||
| e57e8414ac | |||
| 104c02c61a | |||
| 747ed92e7f | |||
| 23d96dbd4d | |||
| a651981b61 | |||
| d162d24acd | |||
| fa0f24be09 | |||
| 6376218441 | |||
| cff2f7256a | |||
| a7c6f1f81a | |||
| fa23cb1efe | |||
| 74ecbb2bf0 | |||
| 5a32e54b4d | |||
| c090bb7c27 | |||
| 2c6a2e81ec | |||
| 084ca7db1e | |||
| a3da3c0e3b | |||
| 4ec18f6707 | |||
| cf0f2feb29 | |||
| 331291010a | |||
| b35ba7f6d5 | |||
| fefbca490f | |||
| 65eef0eda8 | |||
| 659ef4b804 | |||
| 1e922f0a57 | |||
| 610fb0e711 | |||
| 10b1e1e917 | |||
| d641c85aea | |||
| 0a4aaa0583 | |||
| 5b4ba91288 | |||
| d6e85aa352 | |||
| 156ede73c7 | |||
| 6e0908eb52 | |||
| 1ee486e7e6 | |||
| bdd4b7ee45 | |||
| 9924fa55dc |
33
.github/workflows/update-version.yml
vendored
Normal file
33
.github/workflows/update-version.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Update hard-coded version
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
|
||||
update-version:
|
||||
if: >-
|
||||
${{ contains(github.ref, 'refs/heads/hotfix/v') ||
|
||||
contains(github.ref, 'refs/heads/release/v') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.PUSH_TOKEN }}
|
||||
|
||||
- name: Set version
|
||||
run: >-
|
||||
echo "${{ github.ref_name }}" |
|
||||
awk '{gsub(/.+\/v/,"version=");print;}' >> $GITHUB_ENV
|
||||
|
||||
- name: Save version
|
||||
run: echo "${{ env.version }}" > version
|
||||
|
||||
- name: Commit & push changes
|
||||
uses: EndBug/add-and-commit@v8
|
||||
with:
|
||||
author_name: github-actions[bot]
|
||||
author_email: github-actions[bot]@users.noreply.github.com
|
||||
message: Update hard-coded version to v${{ env.version }}
|
||||
add: version
|
||||
@ -1,4 +1,4 @@
|
||||
FROM ubuntu:14.04
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ENV TZ=Etc/UTC
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
@ -13,7 +13,7 @@ the `master` branch.
|
||||
|
||||
## How to use - Linux
|
||||
|
||||
**Note**: The solution has been tested on **Ubuntu 14.04**.
|
||||
**Note**: The solution has been tested on **Ubuntu 16.04**.
|
||||
|
||||
### Installing dependencies
|
||||
|
||||
|
||||
40
build.pro
40
build.pro
@ -9,10 +9,10 @@ include($$PWD/common.pri)
|
||||
CONFIG += ordered
|
||||
|
||||
core_windows {
|
||||
CONFIG += core_and_multimedia
|
||||
desktop:CONFIG += core_and_multimedia
|
||||
}
|
||||
core_linux {
|
||||
CONFIG += core_and_multimedia
|
||||
desktop:CONFIG += core_and_multimedia
|
||||
}
|
||||
core_mac {
|
||||
CONFIG += no_desktop_apps
|
||||
@ -29,12 +29,12 @@ core_android {
|
||||
}
|
||||
|
||||
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)
|
||||
cryptopp)
|
||||
addSubProject(kernel, $$CORE_ROOT_DIR/Common/kernel.pro,\
|
||||
unicodeconverter)
|
||||
addSubProject(network, $$CORE_ROOT_DIR/Common/Network/network.pro,\
|
||||
kernel)
|
||||
kernel unicodeconverter)
|
||||
addSubProject(graphics, $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro,\
|
||||
kernel unicodeconverter)
|
||||
addSubProject(pdfwriter, $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro,\
|
||||
@ -47,6 +47,8 @@ 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(docxrenderer, $$CORE_ROOT_DIR/DocxRenderer/DocxRenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(htmlfile2, $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro,\
|
||||
kernel unicodeconverter graphics network)
|
||||
addSubProject(doctrenderer, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro,\
|
||||
@ -56,18 +58,20 @@ addSubProject(fb2file, $$CORE_ROOT_DIR/Fb2File/Fb2File.pro,\
|
||||
addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
|
||||
kernel unicodeconverter graphics htmlfile2)
|
||||
!no_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)
|
||||
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(xlsbformat, $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/XlsbFormatLib.pro)
|
||||
addSubProject(vbaformat, $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/VbaFormatLib.pro)
|
||||
addSubProject(x2t, $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro,\
|
||||
docxformat pptxformat docxfile txtxmlformat rtfformat pptformat docformat odffilereader odffilewriter xlsformat xlsbformat fb2file epubfile docxrenderer)
|
||||
}
|
||||
!no_use_common_binary {
|
||||
addSubProject(allfontsgen, $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro,\
|
||||
|
||||
10
configure.py
10
configure.py
@ -19,9 +19,9 @@ parser.add_option("--config", action="store", type="string", dest="config", defa
|
||||
parser.add_option("--qt-dir", action="store", type="string", dest="qt-dir", default="", help="defines qmake directory path. qmake can be found in qt-dir/compiler/bin directory")
|
||||
parser.add_option("--qt-dir-xp", action="store", type="string", dest="qt-dir-xp", default="", help="defines qmake directory path for Windows XP. qmake can be found in 'qt-dir/compiler/bin directory")
|
||||
parser.add_option("--external-folder", action="store", type="string", dest="external-folder", default="", help="defines a directory with external folder")
|
||||
parser.add_option("--sql-type", action="store", type="string", dest="sql-type", default="mysql", help="defines the sql type wich will be used")
|
||||
parser.add_option("--db-port", action="store", type="string", dest="db-port", default="3306", help="defines the sql db-port wich will be used")
|
||||
parser.add_option("--db-user", action="store", type="string", dest="db-user", default="root", help="defines the sql db-user wich will be used")
|
||||
parser.add_option("--sql-type", action="store", type="string", dest="sql-type", default="postgres", help="defines the sql type wich will be used")
|
||||
parser.add_option("--db-port", action="store", type="string", dest="db-port", default="5432", help="defines the sql db-port wich will be used")
|
||||
parser.add_option("--db-user", action="store", type="string", dest="db-user", default="onlyoffice", help="defines the sql db-user wich will be used")
|
||||
parser.add_option("--db-pass", action="store", type="string", dest="db-pass", default="onlyoffice", help="defines the sql db-pass wich will be used")
|
||||
parser.add_option("--compiler", action="store", type="string", dest="compiler", default="", help="defines compiler name. It is not recommended to use it as it's defined automatically (msvc2015, msvc2015_64, gcc, gcc_64, clang, clang_64, etc)")
|
||||
parser.add_option("--no-apps", action="store", type="string", dest="no-apps", default="0", help="disables building desktop apps that use qt")
|
||||
@ -37,6 +37,10 @@ parser.add_option("--web-apps-addon", action="append", type="string", dest="web-
|
||||
parser.add_option("--sdkjs-plugin", action="append", type="string", dest="sdkjs-plugin", default=["default"], help="provides plugins for server-based and desktop versions of the editors")
|
||||
parser.add_option("--sdkjs-plugin-server", action="append", type="string", dest="sdkjs-plugin-server", default=["default"], help="provides plugins for server-based version of the editors")
|
||||
parser.add_option("--features", action="store", type="string", dest="features", default="", help="native features (config addon)")
|
||||
parser.add_option("--vs-version", action="store", type="string", dest="vs-version", default="2015", help="version of visual studio")
|
||||
parser.add_option("--vs-path", action="store", type="string", dest="vs-path", default="", help="path to vcvarsall")
|
||||
parser.add_option("--siteUrl", action="store", type="string", dest="siteUrl", default="127.0.0.1", help="site url")
|
||||
parser.add_option("--multiprocess", action="store", type="string", dest="multiprocess", default="1", help="provides ability to specify single process for make")
|
||||
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
configOptions = vars(options)
|
||||
|
||||
1
defaults
1
defaults
@ -1,2 +1,3 @@
|
||||
sdkjs-plugin="photoeditor, macros, ocr, translator, thesaurus, youtube, highlightcode"
|
||||
sdkjs-plugin-server="speech, zotero, mendeley"
|
||||
sdkjs-addons="sdkjs-forms"
|
||||
|
||||
@ -6,7 +6,7 @@ but don't want to compile pretty compilcated core product to make those changes.
|
||||
|
||||
## Installing ONLYOFFICE Docs
|
||||
|
||||
## How to use - Linux
|
||||
## How to use - Linux or macOS
|
||||
|
||||
**Note**: You need the latest Docker version installed.
|
||||
|
||||
@ -23,9 +23,11 @@ docker pull onlyoffice/documentserver
|
||||
### Create develop image
|
||||
|
||||
To create a image with the ability to include external non-minified sdkjs code,
|
||||
use the following command from the dockerfile directory:
|
||||
use the following command:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
cd build_tools/develop
|
||||
docker build -t documentserver-develop .
|
||||
```
|
||||
|
||||
@ -35,9 +37,11 @@ docker build -t documentserver-develop .
|
||||
|
||||
To connect external folders to the container,
|
||||
you need to pass the "-v" parameter
|
||||
along with the relative paths to the required folders.
|
||||
along with the relative paths to the required folders.
|
||||
The folders `sdkjs` and `web-apps` are required for proper development workflow
|
||||
|
||||
**For example, let's connect the external folders "sdkjs" and "web-apps" to the container:**
|
||||
* `sdkjs` repo is located [here](https://github.com/ONLYOFFICE/sdkjs/)
|
||||
* `web-apps` repo is located [here](https://github.com/ONLYOFFICE/web-apps/)
|
||||
|
||||
```bash
|
||||
docker run -i -t -d -p 80:80 --restart=always \
|
||||
|
||||
30
make.py
30
make.py
@ -70,20 +70,26 @@ if ("1" == base.get_env("OO_ONLY_BUILD_JS")):
|
||||
make_common.make()
|
||||
|
||||
# build updmodule for desktop (only for windows version)
|
||||
if ("windows" == base.host_platform()) and (config.check_option("module", "desktop")):
|
||||
config.extend_option("config", "updmodule")
|
||||
config.extend_option("qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml")
|
||||
if config.check_option("module", "desktop"):
|
||||
config.extend_option("qmake_addon", "URL_WEBAPPS_HELP=https://download.onlyoffice.com/install/desktop/editors/help/v" + base.get_env('PRODUCT_VERSION') + "-1/apps")
|
||||
|
||||
if not base.is_file(base_dir + "/tools/WinSparkle-0.7.0.zip"):
|
||||
base.cmd("curl.exe", ["https://d2ettrnqo7v976.cloudfront.net/winsparkle/WinSparkle-0.7.0.zip", "--output", base_dir + "/tools/WinSparkle-0.7.0.zip"])
|
||||
|
||||
if not base.is_dir(base_dir + "/tools/WinSparkle-0.7.0"):
|
||||
base.cmd("7z.exe", ["x", base_dir + "/tools/WinSparkle-0.7.0.zip", "-otools"])
|
||||
if "windows" == base.host_platform():
|
||||
config.extend_option("config", "updmodule")
|
||||
config.extend_option("qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml")
|
||||
|
||||
base.create_dir(base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle")
|
||||
#base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include")
|
||||
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_32")
|
||||
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/x64/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_64")
|
||||
if not base.is_file(base_dir + "/tools/WinSparkle-0.7.0.zip"):
|
||||
base.cmd("curl.exe", ["https://d2ettrnqo7v976.cloudfront.net/winsparkle/WinSparkle-0.7.0.zip", "--output", base_dir + "/tools/WinSparkle-0.7.0.zip"])
|
||||
|
||||
if not base.is_dir(base_dir + "/tools/WinSparkle-0.7.0"):
|
||||
base.cmd("7z.exe", ["x", base_dir + "/tools/WinSparkle-0.7.0.zip", "-otools"])
|
||||
|
||||
base.create_dir(base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle")
|
||||
#base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include")
|
||||
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_32")
|
||||
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/x64/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_64")
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.set_env("VIDEO_PLAYER_VLC_DIR", base_dir + "/../desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc")
|
||||
|
||||
# build
|
||||
build.make()
|
||||
|
||||
18
make_package.py
Executable file
18
make_package.py
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
import package_utils as utils
|
||||
|
||||
# config
|
||||
utils.parse()
|
||||
|
||||
# branding
|
||||
if utils.branding is not None:
|
||||
branding_path = utils.get_path('..', utils.branding)
|
||||
sys.path.insert(-1, utils.get_path(branding_path, 'build_tools/scripts'))
|
||||
|
||||
# build
|
||||
import package
|
||||
package.make(utils.product)
|
||||
@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
import optparse
|
||||
import config
|
||||
import base
|
||||
import packages
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("--branding", action="store", type="string", dest="branding", default="", help="provides branding path")
|
||||
parser.add_option("--product", action="store", type="string", dest="product", default="", help="defines product")
|
||||
parser.add_option("--package", action="store", type="string", dest="package", default="", help="defines packages")
|
||||
|
||||
(options, args) = parser.parse_args(sys.argv[1:])
|
||||
configOptions = vars(options)
|
||||
|
||||
branding = configOptions["branding"]
|
||||
product = configOptions["product"]
|
||||
package_list = configOptions["package"]
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
# branding
|
||||
if ("" != branding):
|
||||
branding_dir = base_dir + "/../" + branding
|
||||
|
||||
if base.is_file(branding_dir + "/build_tools/make_packages.py"):
|
||||
base.check_build_version(branding_dir + "/build_tools")
|
||||
base.cmd_in_dir(branding_dir + "/build_tools",
|
||||
"python", ["make_packages.py",
|
||||
'--product', product,
|
||||
'--package', package_list
|
||||
])
|
||||
exit(0)
|
||||
|
||||
base.check_build_version(base_dir)
|
||||
|
||||
# build packages
|
||||
packages.make(product, package_list)
|
||||
296
scripts/base.py
296
scripts/base.py
@ -175,6 +175,14 @@ def create_dir(path):
|
||||
os.makedirs(path2)
|
||||
return
|
||||
|
||||
def move_dir(src, dst):
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
if is_dir(src):
|
||||
copy_dir(src, dst)
|
||||
delete_dir(src)
|
||||
return
|
||||
|
||||
def copy_dir(src, dst):
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
@ -240,6 +248,9 @@ def copy_exe(src, dst, name):
|
||||
return
|
||||
|
||||
def replaceInFile(path, text, textReplace):
|
||||
if not is_file(path):
|
||||
print("[replaceInFile] file not exist: " + path)
|
||||
return
|
||||
filedata = ""
|
||||
with open(get_path(path), "r") as file:
|
||||
filedata = file.read()
|
||||
@ -249,6 +260,9 @@ def replaceInFile(path, text, textReplace):
|
||||
file.write(filedata)
|
||||
return
|
||||
def replaceInFileRE(path, pattern, textReplace):
|
||||
if not is_file(path):
|
||||
print("[replaceInFile] file not exist: " + path)
|
||||
return
|
||||
filedata = ""
|
||||
with open(get_path(path), "r") as file:
|
||||
filedata = file.read()
|
||||
@ -447,14 +461,13 @@ def get_repositories():
|
||||
result["core"] = [False, False]
|
||||
result["sdkjs"] = [False, False]
|
||||
result.update(get_sdkjs_addons())
|
||||
result.update(get_sdkjs_plugins())
|
||||
result.update(get_sdkjs_plugins_server())
|
||||
result["onlyoffice.github.io"] = [False, False]
|
||||
result["web-apps"] = [False, False]
|
||||
result.update(get_web_apps_addons())
|
||||
result["dictionaries"] = [False, False]
|
||||
|
||||
if config.check_option("module", "builder"):
|
||||
result["DocumentBuilder"] = [False, False]
|
||||
result["document-templates"] = [False, False]
|
||||
|
||||
if config.check_option("module", "desktop"):
|
||||
result["desktop-sdk"] = [False, False]
|
||||
@ -539,12 +552,49 @@ def git_dir():
|
||||
if ("windows" == host_platform()):
|
||||
return run_command("git --info-path")['stdout'] + "/../../.."
|
||||
|
||||
def get_prefix_cross_compiler_arm64():
|
||||
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
|
||||
if is_file(cross_compiler_arm64 + "/aarch64-linux-gnu-g++") and is_file(cross_compiler_arm64 + "/aarch64-linux-gnu-gcc"):
|
||||
return "aarch64-linux-gnu-"
|
||||
if is_file(cross_compiler_arm64 + "/aarch64-unknown-linux-gnu-g++") and is_file(cross_compiler_arm64 + "/aarch64-unknown-linux-gnu-gcc"):
|
||||
return "aarch64-unknown-linux-gnu-"
|
||||
return ""
|
||||
|
||||
def get_gcc_version():
|
||||
gcc_version_major = 4
|
||||
gcc_version_minor = 0
|
||||
gcc_version_str = run_command("gcc -dumpfullversion -dumpversion")['stdout']
|
||||
if (gcc_version_str != ""):
|
||||
try:
|
||||
gcc_ver = gcc_version_str.split(".")
|
||||
gcc_version_major = int(gcc_ver[0])
|
||||
gcc_version_minor = int(gcc_ver[1])
|
||||
except Exception as e:
|
||||
gcc_version_major = 4
|
||||
gcc_version_minor = 0
|
||||
return gcc_version_major * 1000 + gcc_version_minor
|
||||
|
||||
# qmake -------------------------------------------------
|
||||
def qt_setup(platform):
|
||||
compiler = config.check_compiler(platform)
|
||||
qt_dir = config.option("qt-dir") if (-1 == platform.find("_xp")) else config.option("qt-dir-xp")
|
||||
qt_dir = (qt_dir + "/" + compiler["compiler"]) if platform_is_32(platform) else (qt_dir + "/" + compiler["compiler_64"])
|
||||
compiler_platform = compiler["compiler"] if platform_is_32(platform) else compiler["compiler_64"]
|
||||
qt_dir = qt_dir + "/" + compiler_platform
|
||||
|
||||
if (0 == platform.find("linux_arm")) and not is_dir(qt_dir):
|
||||
if ("gcc_arm64" == compiler_platform):
|
||||
qt_dir = config.option("qt-dir") + "/gcc_64"
|
||||
if ("gcc_arm" == compiler_platform):
|
||||
qt_dir = config.option("qt-dir") + "/gcc"
|
||||
|
||||
set_env("QT_DEPLOY", qt_dir + "/bin")
|
||||
|
||||
if ("linux_arm64" == platform):
|
||||
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
|
||||
if ("" != cross_compiler_arm64):
|
||||
set_env("ARM64_TOOLCHAIN_BIN", cross_compiler_arm64)
|
||||
set_env("ARM64_TOOLCHAIN_BIN_PREFIX", get_prefix_cross_compiler_arm64())
|
||||
|
||||
return qt_dir
|
||||
|
||||
def qt_version():
|
||||
@ -568,6 +618,10 @@ def qt_config(platform):
|
||||
config_param += " apple_silicon use_javascript_core"
|
||||
if config.check_option("module", "mobile"):
|
||||
config_param += " support_web_socket"
|
||||
|
||||
if ("linux_arm64" == platform):
|
||||
config_param += " linux_arm64"
|
||||
|
||||
return config_param
|
||||
|
||||
def qt_major_version():
|
||||
@ -671,9 +725,9 @@ def generate_doctrenderer_config(path, root, product, vendor = ""):
|
||||
content += ("<file>" + root + "sdkjs/common/Native/jquery_native.js</file>\n")
|
||||
|
||||
if ("server" != product):
|
||||
content += ("<file>" + root + "sdkjs/common/AllFonts.js</file>\n")
|
||||
content += ("<allfonts>" + root + "sdkjs/common/AllFonts.js</allfonts>\n")
|
||||
else:
|
||||
content += ("<file>./AllFonts.js</file>\n")
|
||||
content += ("<allfonts>./AllFonts.js</allfonts>\n")
|
||||
|
||||
vendor_dir = vendor
|
||||
if ("" == vendor_dir):
|
||||
@ -681,27 +735,13 @@ def generate_doctrenderer_config(path, root, product, vendor = ""):
|
||||
vendor_dir = root + vendor_dir + "/vendor/"
|
||||
|
||||
content += ("<file>" + vendor_dir + "xregexp/xregexp-all-min.js</file>\n")
|
||||
content += ("<htmlfile>" + vendor_dir + "jquery/jquery.min.js</htmlfile>\n")
|
||||
content += ("<sdkjs>" + root + "sdkjs</sdkjs>\n")
|
||||
|
||||
content += "<DoctSdk>\n"
|
||||
content += ("<file>" + root + "sdkjs/word/sdk-all-min.js</file>\n")
|
||||
content += ("<file>" + root + "sdkjs/common/libfont/js/fonts.js</file>\n")
|
||||
content += ("<file>" + root + "sdkjs/word/sdk-all.js</file>\n")
|
||||
content += "</DoctSdk>\n"
|
||||
content += "<PpttSdk>\n"
|
||||
content += ("<file>" + root + "sdkjs/slide/sdk-all-min.js</file>\n")
|
||||
content += ("<file>" + root + "sdkjs/common/libfont/js/fonts.js</file>\n")
|
||||
content += ("<file>" + root + "sdkjs/slide/sdk-all.js</file>\n")
|
||||
content += "</PpttSdk>\n"
|
||||
content += "<XlstSdk>\n"
|
||||
content += ("<file>" + root + "sdkjs/cell/sdk-all-min.js</file>\n")
|
||||
content += ("<file>" + root + "sdkjs/common/libfont/js/fonts.js</file>\n")
|
||||
content += ("<file>" + root + "sdkjs/cell/sdk-all.js</file>\n")
|
||||
content += "</XlstSdk>\n"
|
||||
|
||||
if ("desktop" == product):
|
||||
content += "<htmlnoxvfb/>\n"
|
||||
content += "<htmlfileinternal>./../</htmlfileinternal>\n"
|
||||
if (False): # old html file
|
||||
content += ("<htmlfile>" + vendor_dir + "jquery/jquery.min.js</htmlfile>\n")
|
||||
if ("desktop" == product):
|
||||
content += "<htmlnoxvfb/>\n"
|
||||
content += "<htmlfileinternal>./../</htmlfileinternal>\n"
|
||||
|
||||
content += "</Settings>"
|
||||
|
||||
@ -738,7 +778,7 @@ def generate_plist(path):
|
||||
content += "\t<key>CFBundleGetInfoString</key>\n"
|
||||
content += "\t<string>Created by " + bundle_creator + "</string>\n"
|
||||
content += "\t<key>CFBundleIdentifier</key>\n"
|
||||
content += "\t<string>" + bundle_id_url + name + "</string>\n"
|
||||
content += "\t<string>" + bundle_id_url + correct_bundle_identifier(name) + "</string>\n"
|
||||
content += "\t<key>CFBundlePackageType</key>\n"
|
||||
content += "\t<string>FMWK</string>\n"
|
||||
content += "\t<key>CFBundleShortVersionString</key>\n"
|
||||
@ -762,6 +802,9 @@ def generate_plist(path):
|
||||
|
||||
return
|
||||
|
||||
def correct_bundle_identifier(bundle_identifier):
|
||||
return re.sub("[^a-zA-Z0-9\.\-]", "-", bundle_identifier)
|
||||
|
||||
def get_sdkjs_addons():
|
||||
result = {}
|
||||
if ("" == config.option("sdkjs-addons")):
|
||||
@ -794,22 +837,6 @@ def get_web_apps_addons():
|
||||
result[name] = [True, False]
|
||||
return result
|
||||
|
||||
def get_plugins(plugins_list=""):
|
||||
result = {}
|
||||
if ("" == plugins_list):
|
||||
return result
|
||||
plugins_list = plugins_list.rsplit(", ")
|
||||
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
|
||||
for name in plugins_list:
|
||||
result["plugin-" + name] = [True, plugins_dir]
|
||||
return result
|
||||
|
||||
def get_sdkjs_plugins():
|
||||
return get_plugins(config.option("sdkjs-plugin"))
|
||||
|
||||
def get_sdkjs_plugins_server():
|
||||
return get_plugins(config.option("sdkjs-plugin-server"))
|
||||
|
||||
def sdkjs_addons_param():
|
||||
if ("" == config.option("sdkjs-addons")):
|
||||
return []
|
||||
@ -854,6 +881,12 @@ def extract(src, dst):
|
||||
app = "7za" if ("mac" == host_platform()) else "7z"
|
||||
return cmd_exe(app, ["x", "-y", src, "-o" + dst])
|
||||
|
||||
def extract_unicode(src, dst):
|
||||
if "windows" == host_platform():
|
||||
run_as_bat_win_isolate([u"chcp 65001", u"call 7z.exe x -y \"" + src + u"\" \"-o" + dst + u"\"", u"exit"])
|
||||
return
|
||||
return extract(src, dst)
|
||||
|
||||
def archive_folder(src, dst):
|
||||
app = "7za" if ("mac" == host_platform()) else "7z"
|
||||
return cmd_exe(app, ["a", "-r", dst, src])
|
||||
@ -919,6 +952,20 @@ def run_as_bat(lines, is_no_errors=False):
|
||||
delete_file(name)
|
||||
return
|
||||
|
||||
def run_as_bat_win_isolate(lines, is_no_errors=False):
|
||||
file = codecs.open("tmp.bat", "w", "utf-8")
|
||||
file.write("\n".join(lines))
|
||||
file.close()
|
||||
|
||||
file2 = codecs.open("tmp2.bat", "w", "utf-8")
|
||||
file2.write("start /wait /min tmp.bat")
|
||||
file2.close()
|
||||
|
||||
cmd("tmp2.bat", [], is_no_errors)
|
||||
delete_file("tmp.bat")
|
||||
delete_file("tmp2.bat")
|
||||
return
|
||||
|
||||
def save_as_script(path, lines):
|
||||
content = "\n".join(lines)
|
||||
|
||||
@ -956,7 +1003,7 @@ def get_file_last_modified_url(url):
|
||||
|
||||
def mac_correct_rpath_binary(path, libs):
|
||||
for lib in libs:
|
||||
cmd("install_name_tool", ["-change", "lib" + lib + ".dylib", "@rpath/lib" + lib + ".dylib", path])
|
||||
cmd("install_name_tool", ["-change", "lib" + lib + ".dylib", "@rpath/lib" + lib + ".dylib", path], True)
|
||||
return
|
||||
|
||||
def mac_correct_rpath_library(name, libs):
|
||||
@ -967,22 +1014,23 @@ def mac_correct_rpath_x2t(dir):
|
||||
os.chdir(dir)
|
||||
mac_correct_rpath_library("icudata.58", [])
|
||||
mac_correct_rpath_library("icuuc.58", ["icudata.58"])
|
||||
mac_correct_rpath_library("UnicodeConverter", ["icuuc.58", "icudata.58", "kernel"])
|
||||
mac_correct_rpath_library("kernel", [])
|
||||
mac_correct_rpath_library("kernel_network", ["kernel"])
|
||||
mac_correct_rpath_library("UnicodeConverter", ["icuuc.58", "icudata.58"])
|
||||
mac_correct_rpath_library("kernel", ["UnicodeConverter"])
|
||||
mac_correct_rpath_library("kernel_network", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "kernel_network", "graphics"])
|
||||
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "kernel_network", "graphics"])
|
||||
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2", "graphics"])
|
||||
mac_correct_rpath_library("EpubFile", ["UnicodeConverter", "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"])
|
||||
mac_correct_rpath_library("DjVuFile", ["kernel", "UnicodeConverter", "graphics", "PdfWriter"])
|
||||
mac_correct_rpath_library("PdfReader", ["kernel", "UnicodeConverter", "graphics", "PdfWriter", "HtmlRenderer"])
|
||||
mac_correct_rpath_library("XpsFile", ["kernel", "UnicodeConverter", "graphics", "PdfWriter"])
|
||||
mac_correct_rpath_library("PdfWriter", ["UnicodeConverter", "kernel", "graphics", "kernel_network"])
|
||||
mac_correct_rpath_library("DjVuFile", ["UnicodeConverter", "kernel", "graphics", "PdfWriter"])
|
||||
mac_correct_rpath_library("PdfReader", ["UnicodeConverter", "kernel", "graphics", "PdfWriter", "HtmlRenderer"])
|
||||
mac_correct_rpath_library("XpsFile", ["UnicodeConverter", "kernel", "graphics", "PdfWriter"])
|
||||
mac_correct_rpath_library("DocxRenderer", ["UnicodeConverter", "kernel", "graphics"])
|
||||
cmd("chmod", ["-v", "+x", "./x2t"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./x2t"], True)
|
||||
mac_correct_rpath_binary("./x2t", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer"])
|
||||
mac_correct_rpath_binary("./x2t", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer"])
|
||||
if is_file("./allfontsgen"):
|
||||
cmd("chmod", ["-v", "+x", "./allfontsgen"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allfontsgen"], True)
|
||||
@ -994,6 +1042,15 @@ def mac_correct_rpath_x2t(dir):
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
def mac_correct_rpath_docbuilder(dir):
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
cmd("chmod", ["-v", "+x", "./docbuilder"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./docbuilder"], True)
|
||||
mac_correct_rpath_binary("./docbuilder", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer"])
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
def mac_correct_rpath_desktop(dir):
|
||||
mac_correct_rpath_x2t(dir + "/converter")
|
||||
cur_dir = os.getcwd()
|
||||
@ -1037,7 +1094,7 @@ def common_check_version(name, good_version, clean_func):
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False, is_desktop_local=False):
|
||||
src_dir_path = src_dir + "/plugin-" + name
|
||||
src_dir_path = src_dir + "/" + name
|
||||
if not is_dir(src_dir_path):
|
||||
src_dir_path = src_dir + "/" + name
|
||||
if not is_file(src_dir_path + "/config.json"):
|
||||
@ -1073,7 +1130,7 @@ def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False, is_desktop_
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
|
||||
plugins_dir = get_script_dir() + "/../../onlyoffice.github.io/sdkjs-plugins/content"
|
||||
plugins_list_config = config.option("sdkjs-plugin")
|
||||
if ("" == plugins_list_config):
|
||||
return
|
||||
@ -1083,7 +1140,7 @@ def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins_server(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
|
||||
plugins_dir = get_script_dir() + "/../../onlyoffice.github.io/sdkjs-plugins/content"
|
||||
plugins_list_config = config.option("sdkjs-plugin-server")
|
||||
if ("" == plugins_list_config):
|
||||
return
|
||||
@ -1156,3 +1213,130 @@ def get_mac_sdk_version_number():
|
||||
return 1000 * int(ver_arr[0])
|
||||
return 1000 * int(ver_arr[0]) + int(ver_arr[1])
|
||||
|
||||
def make_sln(directory, args, is_no_errors):
|
||||
programFilesDir = get_env("ProgramFiles")
|
||||
if ("" != get_env("ProgramFiles(x86)")):
|
||||
programFilesDir = get_env("ProgramFiles(x86)")
|
||||
dev_path = programFilesDir + "\\Microsoft Visual Studio 14.0\\Common7\\IDE"
|
||||
if ("2019" == config.option("vs-version")):
|
||||
dev_path = programFilesDir + "\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE"
|
||||
if not is_dir(dev_path):
|
||||
dev_path = programFilesDir + "\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE"
|
||||
if not is_dir(dev_path):
|
||||
dev_path = programFilesDir + "\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE"
|
||||
|
||||
old_env = dict(os.environ)
|
||||
os.environ["PATH"] = dev_path + os.pathsep + os.environ["PATH"]
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(directory)
|
||||
run_as_bat(["call devenv " + " ".join(args)], is_no_errors)
|
||||
os.chdir(old_cur)
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
def make_sln_project(directory, sln_path):
|
||||
args = []
|
||||
args.append(sln_path)
|
||||
args.append("/Rebuild")
|
||||
if (config.check_option("platform", "win_64")):
|
||||
make_sln(directory, args + ["\"Release|x64\""], True)
|
||||
if True:#(config.check_option("platform", "win_32")):
|
||||
make_sln(directory, args + ["\"Release|Win32\""], True)
|
||||
return
|
||||
|
||||
def get_android_sdk_home():
|
||||
ndk_root_path = get_env("ANDROID_NDK_ROOT")
|
||||
if (-1 != ndk_root_path.find("/ndk/")):
|
||||
return ndk_root_path + "/../.."
|
||||
return ndk_root_path + "/.."
|
||||
|
||||
def readFileLicence(path):
|
||||
content = readFile(path)
|
||||
index = content.find("*/")
|
||||
if index >= 0:
|
||||
return content[0:index+2]
|
||||
return ""
|
||||
|
||||
def replaceFileLicence(path, license):
|
||||
old_licence = readFileLicence(path)
|
||||
replaceInFile(path, old_licence, license)
|
||||
return
|
||||
|
||||
def copy_v8_files(core_dir, deploy_dir, platform, is_xp=False):
|
||||
if (-1 != config.option("config").find("use_javascript_core")):
|
||||
return
|
||||
directory_v8 = core_dir + "/Common/3dParty"
|
||||
if is_xp:
|
||||
directory_v8 += "/v8/v8_xp"
|
||||
|
||||
if (-1 != config.option("config").lower().find("v8_version_89")) and not is_xp:
|
||||
directory_v8 += "/v8_89/v8/out.gn/"
|
||||
else:
|
||||
directory_v8 += "/v8/v8/out.gn/"
|
||||
|
||||
if is_xp:
|
||||
copy_files(directory_v8 + platform + "/release/icudt*.dll", deploy_dir + "/")
|
||||
return
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
copy_files(directory_v8 + platform + "/release/icudt*.dat", deploy_dir + "/")
|
||||
else:
|
||||
copy_files(directory_v8 + platform + "/icudt*.dat", deploy_dir + "/")
|
||||
return
|
||||
|
||||
def clone_marketplace_plugin(out_dir, is_name_as_guid=False):
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(out_dir)
|
||||
git_update("onlyoffice.github.io", False, True)
|
||||
os.chdir(old_cur)
|
||||
|
||||
dst_dir_name = "marketplace"
|
||||
if is_name_as_guid:
|
||||
config_content = readFile(out_dir + "/onlyoffice.github.io/store/plugin/config.json")
|
||||
index_start = config_content.find("\"asc.{")
|
||||
index_start += 5
|
||||
index_end = config_content.find("}", index_start)
|
||||
index_end += 1
|
||||
guid = config_content[index_start:index_end]
|
||||
dst_dir_name = guid
|
||||
|
||||
dst_dir_path = out_dir + "/" + dst_dir_name
|
||||
|
||||
if is_dir(dst_dir_path):
|
||||
delete_dir(dst_dir_path)
|
||||
|
||||
copy_dir(out_dir + "/onlyoffice.github.io/store/plugin", dst_dir_path)
|
||||
delete_dir_with_access_error(out_dir + "/onlyoffice.github.io")
|
||||
return
|
||||
|
||||
def correctPathForBuilder(path):
|
||||
replace_value = "../../../build/"
|
||||
if (config.option("branding") != ""):
|
||||
replace_value += (config.option("branding") + "/")
|
||||
replace_value += "lib/"
|
||||
if (config.check_option("config", "debug")):
|
||||
replace_value += ("debug/")
|
||||
if (replace_value == "../../../build/lib/"):
|
||||
return ""
|
||||
new_path = path + ".bak"
|
||||
copy_file(path, new_path)
|
||||
replaceInFile(path, "../../../build/lib/", replace_value)
|
||||
return new_path
|
||||
|
||||
def restorePathForBuilder(new_path):
|
||||
if ("" == new_path):
|
||||
return
|
||||
old_path = new_path[:-4]
|
||||
delete_file(old_path)
|
||||
copy_file(new_path, old_path)
|
||||
delete_file(new_path);
|
||||
return
|
||||
|
||||
def generate_check_linux_system(build_tools_dir, out_dir):
|
||||
create_dir(out_dir + "/.system")
|
||||
copy_file(build_tools_dir + "/tools/linux/check_system/check.sh", out_dir + "/.system/check.sh")
|
||||
copy_file(build_tools_dir + "/tools/linux/check_system/libstdc++.so.6", out_dir + "/.system/libstdc++.so.6")
|
||||
return
|
||||
@ -51,7 +51,7 @@ def make_pro_file(makefiles_dir, pro_file):
|
||||
# qmake ADDON
|
||||
qmake_addon = []
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon.append(config.option("qmake_addon"))
|
||||
qmake_addon = config.option("qmake_addon").split()
|
||||
|
||||
if not base.is_file(qt_dir + "/bin/qmake") and not base.is_file(qt_dir + "/bin/qmake.exe"):
|
||||
print("THIS PLATFORM IS NOT SUPPORTED")
|
||||
@ -67,6 +67,8 @@ 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)
|
||||
if not base.is_file(pro_file):
|
||||
base.cmd(qt_dir + "/bin/qmake", ["-nocache", pro_file, "CONFIG+=" + config_param] + qmake_addon)
|
||||
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:
|
||||
@ -77,11 +79,12 @@ def make_pro_file(makefiles_dir, pro_file):
|
||||
qmake_bat.append("if exist ./" + makefiles_dir + "/build.makefile_" + file_suff + " del /F ./" + makefiles_dir + "/build.makefile_" + file_suff)
|
||||
qmake_addon_string = ""
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon_string = " \"" + config.option("qmake_addon") + "\""
|
||||
qmake_addon_string = " " + (" ").join(["\"" + addon + "\"" for addon in qmake_addon])
|
||||
qmake_bat.append("call \"" + qt_dir + "/bin/qmake\" -nocache " + pro_file + " \"CONFIG+=" + config_param + "\"" + qmake_addon_string)
|
||||
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)
|
||||
qmake_bat.append("call \"" + qt_dir + "/bin/qmake\" -nocache " + pro_file + " \"CONFIG+=" + config_param + "\"" + qmake_addon_string)
|
||||
if ("0" != config.option("multiprocess")):
|
||||
qmake_bat.append("set CL=/MP")
|
||||
qmake_bat.append("call nmake -f " + makefiles_dir + "/build.makefile_" + file_suff)
|
||||
@ -94,20 +97,17 @@ def make_pro_file(makefiles_dir, pro_file):
|
||||
|
||||
# make build.pro
|
||||
def make():
|
||||
is_no_brandind_build = base.is_file("config")
|
||||
make_pro_file("makefiles", "build.pro")
|
||||
if config.check_option("module", "builder") and base.is_windows() and is_no_brandind_build:
|
||||
if config.check_option("module", "builder") and base.is_windows() and "onlyoffice" == config.branding():
|
||||
# check replace
|
||||
replace_path_lib = ""
|
||||
replace_path_lib_file = os.getcwd() + "/../core/DesktopEditor/doctrenderer/docbuilder.com/docbuilder.h"
|
||||
option_branding = config.option("branding")
|
||||
if (option_branding != ""):
|
||||
replace_path_lib = "../../../build/" + option_branding + "/lib/"
|
||||
# replace
|
||||
if (replace_path_lib != ""):
|
||||
base.replaceInFile(replace_path_lib_file, "../../../build/lib/", replace_path_lib)
|
||||
base.bash("../core/DesktopEditor/doctrenderer/docbuilder.com/build")
|
||||
# restore
|
||||
if (replace_path_lib != ""):
|
||||
base.replaceInFile(replace_path_lib_file, replace_path_lib, "../../../build/lib/")
|
||||
new_replace_path = base.correctPathForBuilder(os.getcwd() + "/../core/DesktopEditor/doctrenderer/docbuilder.com/docbuilder.h")
|
||||
if ("2019" == config.option("vs-version")):
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com", "docbuilder.com_2019.sln")
|
||||
if (True):
|
||||
new_path_net = base.correctPathForBuilder(os.getcwd() + "/../core/DesktopEditor/doctrenderer/docbuilder.net/src/docbuilder.net.cpp")
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.net/src", "docbuilder.net.sln")
|
||||
base.restorePathForBuilder(new_path_net)
|
||||
else:
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com", "docbuilder.com.sln")
|
||||
base.restorePathForBuilder(new_replace_path)
|
||||
return
|
||||
|
||||
@ -4,6 +4,25 @@ import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def correct_sdkjs_licence(directory):
|
||||
branding = config.option("branding")
|
||||
if "" == branding or "onlyoffice" == branding:
|
||||
return
|
||||
license = base.readFileLicence(directory + "/word/sdk-all-min.js")
|
||||
base.replaceFileLicence(directory + "/common/Charts/ChartStyles.js", license)
|
||||
base.replaceFileLicence(directory + "/common/hash/hash/engine.js", license)
|
||||
base.replaceFileLicence(directory + "/common/hash/hash/engine_ie.js", license)
|
||||
base.replaceFileLicence(directory + "/common/Native/native.js", license)
|
||||
base.replaceFileLicence(directory + "/common/Native/native_graphics.js", license)
|
||||
base.replaceFileLicence(directory + "/common/spell/spell/spell.js", license)
|
||||
base.replaceFileLicence(directory + "/common/spell/spell/spell_ie.js", license)
|
||||
base.replaceFileLicence(directory + "/pdf/src/engine/drawingfile.js", license)
|
||||
base.replaceFileLicence(directory + "/pdf/src/engine/drawingfile_ie.js", license)
|
||||
base.replaceInFile(directory + "/word/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
|
||||
base.replaceInFile(directory + "/slide/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
|
||||
base.replaceInFile(directory + "/cell/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
|
||||
return
|
||||
|
||||
# make build.pro
|
||||
def make():
|
||||
if ("1" == base.get_env("OO_NO_BUILD_JS")):
|
||||
@ -25,12 +44,14 @@ def make():
|
||||
base.create_dir(out_dir + "/builder")
|
||||
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/builder/web-apps")
|
||||
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/builder/sdkjs")
|
||||
correct_sdkjs_licence(out_dir + "/builder/sdkjs")
|
||||
|
||||
# desktop
|
||||
if config.check_option("module", "desktop"):
|
||||
build_sdk_desktop(base_dir + "/../sdkjs/build")
|
||||
base.create_dir(out_dir + "/desktop")
|
||||
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/desktop/sdkjs")
|
||||
correct_sdkjs_licence(out_dir + "/desktop/sdkjs")
|
||||
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/desktop/web-apps")
|
||||
if not base.is_file(out_dir + "/desktop/sdkjs/common/AllFonts.js"):
|
||||
base.copy_file(base_dir + "/../sdkjs/common/HtmlFileInternal/AllFonts.js", out_dir + "/desktop/sdkjs/common/AllFonts.js")
|
||||
@ -47,7 +68,7 @@ def make():
|
||||
|
||||
# mobile
|
||||
if config.check_option("module", "mobile"):
|
||||
build_sdk_native(base_dir + "/../sdkjs/build")
|
||||
build_sdk_native(base_dir + "/../sdkjs/build", False)
|
||||
base.create_dir(out_dir + "/mobile")
|
||||
base.create_dir(out_dir + "/mobile/sdkjs")
|
||||
vendor_dir_src = base_dir + "/../web-apps/vendor/"
|
||||
@ -55,7 +76,6 @@ def make():
|
||||
|
||||
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"],
|
||||
@ -63,7 +83,6 @@ def make():
|
||||
|
||||
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/cell/native/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
@ -71,7 +90,6 @@ def make():
|
||||
|
||||
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"],
|
||||
@ -124,10 +142,10 @@ def build_sdk_builder(directory):
|
||||
_run_grunt(directory, get_build_param() + base.sdkjs_addons_param())
|
||||
return
|
||||
|
||||
def build_sdk_native(directory):
|
||||
def build_sdk_native(directory, minimize=True):
|
||||
#_run_npm_cli(directory)
|
||||
_run_npm(directory)
|
||||
_run_grunt(directory, get_build_param() + ["--mobile=true"] + base.sdkjs_addons_param())
|
||||
_run_grunt(directory, get_build_param(minimize) + ["--mobile=true"] + base.sdkjs_addons_param())
|
||||
return
|
||||
|
||||
def build_js_develop(root_dir):
|
||||
|
||||
86
scripts/build_js_native.py
Normal file
86
scripts/build_js_native.py
Normal file
@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import base
|
||||
import build_js
|
||||
import config
|
||||
import optparse
|
||||
import sys
|
||||
|
||||
arguments = sys.argv[1:]
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("--output",
|
||||
action="store", type="string", dest="output",
|
||||
help="Directory for output the build result")
|
||||
parser.add_option("--write-version",
|
||||
action="store_true", dest="write_version", default=False,
|
||||
help="Create version file of build")
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
|
||||
def write_version_files(output_dir):
|
||||
if (base.is_dir(output_dir)):
|
||||
last_version_tag = base.run_command('git describe --abbrev=0 --tags')['stdout']
|
||||
version_numbers=last_version_tag.replace('v', '').split('.')
|
||||
major=(version_numbers[0:1] or ('0',))[0]
|
||||
minor=(version_numbers[1:2] or ('0',))[0]
|
||||
maintenance=(version_numbers[2:3] or ('0',))[0]
|
||||
build=(version_numbers[3:4] or ('0',))[0]
|
||||
full_version='%s.%s.%s.%s' % (major, minor, maintenance, build)
|
||||
|
||||
for name in ['word', 'cell', 'slide']:
|
||||
base.writeFile(output_dir + '/%s/sdk.version' % name, full_version)
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
config.extend_option("jsminimize", "0")
|
||||
|
||||
branding = config.option("branding-name")
|
||||
if ("" == branding):
|
||||
branding = "onlyoffice"
|
||||
|
||||
base_dir = base.get_script_dir() + "/.."
|
||||
out_dir = base_dir + "/../native-sdk/examples/win-linux-mac/build/sdkjs"
|
||||
|
||||
if (options.output):
|
||||
out_dir = options.output
|
||||
|
||||
base.create_dir(out_dir)
|
||||
|
||||
build_js.build_sdk_native(base_dir + "/../sdkjs/build")
|
||||
vendor_dir_src = base_dir + "/../web-apps/vendor/"
|
||||
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.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 + "/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/Native/native.js",
|
||||
base_dir + "/../sdkjs/cell/native/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/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/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/banners_slide.js")
|
||||
|
||||
base.create_dir(out_dir + "/word")
|
||||
base.join_scripts([out_dir + "/banners_word.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/word/script.bin")
|
||||
base.create_dir(out_dir + "/cell")
|
||||
base.join_scripts([out_dir + "/banners_cell.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/cell/script.bin")
|
||||
base.create_dir(out_dir + "/slide")
|
||||
base.join_scripts([out_dir + "/banners_slide.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/slide/script.bin")
|
||||
|
||||
base.delete_file(out_dir + "/banners_word.js")
|
||||
base.delete_file(out_dir + "/banners_cell.js")
|
||||
base.delete_file(out_dir + "/banners_slide.js")
|
||||
|
||||
# Write sdk version mark file if needed
|
||||
if (options.write_version):
|
||||
write_version_files(out_dir)
|
||||
@ -41,10 +41,12 @@ def make():
|
||||
if(base.is_exist(custom_public_key)):
|
||||
base.copy_file(custom_public_key, server_build_dir + '/Common/sources')
|
||||
|
||||
pkg_target = "node10"
|
||||
pkg_target = "node14"
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
pkg_target += "-linux"
|
||||
if (-1 != config.option("platform").find("linux_arm64")):
|
||||
pkg_target += "-arm64"
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
pkg_target += "-win"
|
||||
@ -56,13 +58,6 @@ def make():
|
||||
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
|
||||
base.delete_dir(example_dir + "/node_modules")
|
||||
base.cmd_in_dir(example_dir, "npm", ["install"])
|
||||
sync_rpc_lib_dir = example_dir + "/node_modules/sync-rpc/lib"
|
||||
patch_file = base.get_script_dir() + "/../tools/linux/sync-rpc.patch"
|
||||
if ("linux" == base.host_platform()):
|
||||
base.cmd_in_dir(sync_rpc_lib_dir, "patch", ["-N", "-i", patch_file])
|
||||
if ("windows" == base.host_platform()):
|
||||
patch_exe_dir = base.git_dir() + "/usr/bin"
|
||||
base.cmd_in_dir(patch_exe_dir, "patch.exe", ["-N", "-d", sync_rpc_lib_dir, "-i", patch_file])
|
||||
base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"])
|
||||
|
||||
def build_server_develop():
|
||||
|
||||
@ -25,7 +25,7 @@ def parse():
|
||||
# all platforms
|
||||
global platforms
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
|
||||
"linux_64", "linux_32",
|
||||
"linux_64", "linux_32", "linux_arm64",
|
||||
"mac_64", "mac_arm64",
|
||||
"ios",
|
||||
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]
|
||||
@ -53,27 +53,60 @@ def parse():
|
||||
else:
|
||||
options["platform"] += (" mac_" + bits)
|
||||
|
||||
if ("mac" == host_platform) and check_option("platform", "mac_arm64") and (platform.machine() != "arm64"):
|
||||
if ("mac" == host_platform) and check_option("platform", "mac_arm64") and not base.is_os_arm():
|
||||
if not check_option("platform", "mac_64"):
|
||||
options["platform"] = "mac_64 " + options["platform"]
|
||||
|
||||
if ("linux" == host_platform) and check_option("platform", "linux_arm64") and not base.is_os_arm():
|
||||
if not check_option("platform", "linux_64"):
|
||||
# linux_64 binaries need only for desktop
|
||||
if check_option("module", "desktop"):
|
||||
options["platform"] = "linux_64 " + options["platform"]
|
||||
|
||||
if check_option("platform", "xp") and ("windows" == host_platform):
|
||||
options["platform"] += " win_64_xp win_32_xp"
|
||||
|
||||
if check_option("platform", "android"):
|
||||
options["platform"] += " android_arm64_v8a android_armv7 android_x86 android_x86_64"
|
||||
|
||||
# check vs-version
|
||||
if ("" == option("vs-version")):
|
||||
options["vs-version"] = "2015"
|
||||
|
||||
# enable v8 8.9 version, if compiler support sources
|
||||
if ("linux" == host_platform) and (5004 <= base.get_gcc_version()) and not check_option("platform", "android"):
|
||||
extend_option("config", "v8_version_89")
|
||||
|
||||
if ("windows" == host_platform) and ("2019" == option("vs-version")):
|
||||
extend_option("config", "v8_version_89")
|
||||
extend_option("config", "vs2019")
|
||||
|
||||
if check_option("platform", "linux_arm64"):
|
||||
extend_option("config", "v8_version_89")
|
||||
|
||||
# check vs-path
|
||||
if ("windows" == host_platform):
|
||||
options["vs-path"] = base.get_env("ProgramFiles") + "/Microsoft Visual Studio 14.0/VC"
|
||||
if ("windows" == host_platform) and ("" == option("vs-path")):
|
||||
programFilesDir = base.get_env("ProgramFiles")
|
||||
if ("" != base.get_env("ProgramFiles(x86)")):
|
||||
options["vs-path"] = base.get_env("ProgramFiles(x86)") + "/Microsoft Visual Studio 14.0/VC"
|
||||
programFilesDir = base.get_env("ProgramFiles(x86)")
|
||||
if ("2015" == options["vs-version"]):
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio 14.0/VC"
|
||||
elif ("2019" == options["vs-version"]):
|
||||
if base.is_dir(programFilesDir + "/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build"):
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build"
|
||||
elif base.is_dir(programFilesDir + "/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build"):
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build"
|
||||
else:
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build"
|
||||
|
||||
# check sdkjs-plugins
|
||||
if not "sdkjs-plugin" in options:
|
||||
options["sdkjs-plugin"] = "default"
|
||||
if not "sdkjs-plugin-server" in options:
|
||||
options["sdkjs-plugin-server"] = "default"
|
||||
options["sdkjs-plugin-server"] = "default"
|
||||
|
||||
if not "arm64-toolchain-bin" in options:
|
||||
options["arm64-toolchain-bin"] = "/usr/bin"
|
||||
|
||||
return
|
||||
|
||||
@ -88,11 +121,14 @@ def check_compiler(platform):
|
||||
return compiler
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
compiler["compiler"] = "msvc2015"
|
||||
compiler["compiler_64"] = "msvc2015_64"
|
||||
compiler["compiler"] = "msvc" + options["vs-version"]
|
||||
compiler["compiler_64"] = "msvc" + options["vs-version"] + "_64"
|
||||
elif (0 == platform.find("linux")):
|
||||
compiler["compiler"] = "gcc"
|
||||
compiler["compiler_64"] = "gcc_64"
|
||||
if (0 == platform.find("linux_arm")) and not base.is_os_arm():
|
||||
compiler["compiler"] = "gcc_arm"
|
||||
compiler["compiler_64"] = "gcc_arm64"
|
||||
elif (0 == platform.find("mac")):
|
||||
compiler["compiler"] = "clang"
|
||||
compiler["compiler_64"] = "clang_64"
|
||||
@ -103,6 +139,12 @@ def check_compiler(platform):
|
||||
compiler["compiler"] = platform
|
||||
compiler["compiler_64"] = platform
|
||||
|
||||
if base.host_platform() == "mac":
|
||||
if not base.is_dir(options["qt-dir"] + "/" + compiler["compiler_64"]):
|
||||
if base.is_dir(options["qt-dir"] + "/macos"):
|
||||
compiler["compiler"] = "macos"
|
||||
compiler["compiler_64"] = "macos"
|
||||
|
||||
return compiler
|
||||
|
||||
def check_option(name, value):
|
||||
|
||||
@ -6,6 +6,7 @@ sys.path.append('..')
|
||||
|
||||
import config
|
||||
import base
|
||||
import glob
|
||||
|
||||
import boost
|
||||
import cef
|
||||
@ -17,8 +18,21 @@ import v8
|
||||
import html2
|
||||
import hunspell
|
||||
import glew
|
||||
import harfbuzz
|
||||
|
||||
def check_android_ndk_macos_arm(dir):
|
||||
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
|
||||
print("copy toolchain... [" + dir + "]")
|
||||
base.copy_dir(dir + "/darwin-x86_64", dir + "/darwin-arm64")
|
||||
return
|
||||
|
||||
|
||||
def make():
|
||||
if (config.check_option("platform", "android")) and (base.host_platform() == "mac") and (base.is_os_arm()):
|
||||
for toolchain in glob.glob(base.get_env("ANDROID_NDK_ROOT") + "/toolchains/*"):
|
||||
if base.is_dir(toolchain):
|
||||
check_android_ndk_macos_arm(toolchain + "/prebuilt")
|
||||
|
||||
boost.make()
|
||||
cef.make()
|
||||
icu.make()
|
||||
@ -26,6 +40,7 @@ def make():
|
||||
v8.make()
|
||||
html2.make()
|
||||
hunspell.make(False)
|
||||
harfbuzz.make()
|
||||
glew.make()
|
||||
if config.check_option("module", "mobile"):
|
||||
curl.make()
|
||||
|
||||
@ -67,26 +67,39 @@ def make():
|
||||
# build
|
||||
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", ["vc14"])
|
||||
win_boot_arg = "vc14"
|
||||
win_vs_version = "vc140"
|
||||
if (config.option("vs-version") == "2019"):
|
||||
win_toolset = "msvc-14.2"
|
||||
win_boot_arg = "vc142"
|
||||
win_vs_version = "vc142"
|
||||
if (-1 != config.option("platform").find("win_64")) and not base.is_file("../build/win_64/lib/libboost_system-" + win_vs_version + "-mt-x64-1_72.lib"):
|
||||
base.cmd("bootstrap.bat", [win_boot_arg])
|
||||
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", ["vc14"])
|
||||
if (-1 != config.option("platform").find("win_32")) and not base.is_file("../build/win_32/lib/libboost_system-" + win_vs_version + "-mt-x32-1_72.lib"):
|
||||
base.cmd("bootstrap.bat", [win_boot_arg])
|
||||
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"])
|
||||
correct_install_includes_win(base_dir, "win_64")
|
||||
correct_install_includes_win(base_dir, "win_32")
|
||||
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
if config.check_option("platform", "linux_64") and not base.is_dir("../build/linux_64"):
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC", "install"])
|
||||
# TODO: support x86
|
||||
|
||||
if config.check_option("platform", "linux_arm64") and not base.is_dir("../build/linux_arm64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "linux_arm64")
|
||||
directory_build = base_dir + "/build/linux_arm64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.so")
|
||||
base.copy_files(directory_build + "/linux_arm64/*.a", directory_build)
|
||||
|
||||
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios"):
|
||||
clang_correct()
|
||||
os.chdir("../")
|
||||
|
||||
@ -28,7 +28,7 @@ def make(src_dir, modules, build_platform="android"):
|
||||
pro_file_content.append("PWD_ROOT_DIR = $$PWD")
|
||||
pro_file_content.append("include($$PWD/../../../../../base.pri)")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("MAKEFILE=$$PWD/makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
pro_file_content.append("MAKEFILE=$$PWD/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
pro_file_content.append("core_debug:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_debug_\")")
|
||||
pro_file_content.append("build_xp:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_xp\")")
|
||||
pro_file_content.append("OO_BRANDING_SUFFIX = $$(OO_BRANDING)")
|
||||
@ -42,7 +42,8 @@ def make(src_dir, modules, build_platform="android"):
|
||||
pro_file_content.append("")
|
||||
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")
|
||||
os.chdir(module_dir)
|
||||
build.make_pro_file("./", module + ".pro")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -13,11 +13,13 @@ def make():
|
||||
os.chdir(path)
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
if base.is_dir(path + "/build/android"):
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
subprocess.call(["./build-android-curl.sh"])
|
||||
|
||||
elif (-1 != config.option("platform").find("ios")):
|
||||
if base.is_dir(path + "/build/ios"):
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
subprocess.call(["./build-ios-curl.sh"])
|
||||
|
||||
|
||||
15
scripts/core_common/modules/harfbuzz.py
Executable file
15
scripts/core_common/modules/harfbuzz.py
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: harfbuzz")
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../../core/Common/3dParty/harfbuzz", "./make.py")
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make()
|
||||
@ -8,164 +8,17 @@ 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("../")
|
||||
core_common_dir = base.get_script_dir() + "/../../core/Common"
|
||||
|
||||
if not build_js:
|
||||
os.chdir(old_cur_dir)
|
||||
return
|
||||
base.configure_common_apps()
|
||||
os.chdir(core_common_dir + "/3dParty/hunspell")
|
||||
base.cmd("python", ["./before.py"])
|
||||
|
||||
# remove previous version
|
||||
if base.is_dir("./deploy"):
|
||||
base.delete_dir("./deploy")
|
||||
base.create_dir("./deploy")
|
||||
base.create_dir("./deploy/spell")
|
||||
if (build_js):
|
||||
os.chdir(core_common_dir + "/js")
|
||||
base.cmd("python", ["./make.py", core_common_dir + "/3dParty/hunspell/hunspell.json"])
|
||||
|
||||
# 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)
|
||||
|
||||
@ -24,6 +24,9 @@ def make():
|
||||
base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu", "--non-interactive", "--trust-server-cert"])
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
platformToolset = "v140"
|
||||
if (config.option("vs-version") == "2019"):
|
||||
platformToolset = "v142"
|
||||
need_platforms = []
|
||||
if (-1 != config.option("platform").find("win_64")):
|
||||
need_platforms.append("win_64")
|
||||
@ -37,12 +40,9 @@ def make():
|
||||
compile_bat = []
|
||||
compile_bat.append("setlocal")
|
||||
compile_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
|
||||
compile_bat.append("call MSBuild.exe icu/source/allinone/allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform=" + ("Win32" if base.platform_is_32(platform) else "X64"))
|
||||
compile_bat.append("call MSBuild.exe icu/source/allinone/allinone.sln /p:Configuration=Release /p:PlatformToolset=" + platformToolset + " /p:Platform=" + ("Win32" if base.platform_is_32(platform) else "X64"))
|
||||
compile_bat.append("endlocal")
|
||||
base.run_as_bat(compile_bat)
|
||||
#base.vcvarsall_start("x64" if ("win_64" == platform) else "x86")
|
||||
#base.cmd("MSBuild.exe", ["icu/source/allinone/allinone.sln", "/p:Configuration=Release", "/p:PlatformToolset=v140", "/p:Platform=" + ("X64" if ("win_64" == platform) else "Win32")])
|
||||
#base.vcvarsall_end()
|
||||
bin_dir = "icu/bin64/" if ("win_64" == platform) else "icu/bin/"
|
||||
lib_dir = "icu/lib64/" if ("win_64" == platform) else "icu/lib/"
|
||||
base.create_dir(platform + "/build")
|
||||
@ -53,38 +53,56 @@ def make():
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
platform = ""
|
||||
if ("linux" == base.host_platform()):
|
||||
platform = "linux_64"
|
||||
if not base.is_dir(platform + "/build"):
|
||||
base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale")
|
||||
if not base.is_file("./icu/source/i18n/digitlst.cpp.bak"):
|
||||
base.copy_file("./icu/source/i18n/digitlst.cpp", "./icu/source/i18n/digitlst.cpp.bak")
|
||||
base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale")
|
||||
if base.is_dir(base_dir + "/linux_64"):
|
||||
base.delete_dir(base_dir + "/linux_64")
|
||||
if base.is_dir(base_dir + "/linux_arm64"):
|
||||
base.delete_dir(base_dir + "/linux_arm64")
|
||||
|
||||
if not base.is_dir(base_dir + "/linux_64"):
|
||||
base.create_dir(base_dir + "/icu/cross_build")
|
||||
os.chdir("icu/cross_build")
|
||||
base.cmd("./../source/runConfigureICU", ["Linux", "--prefix=" + base_dir + "/icu/cross_build_install"])
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
base.create_dir(base_dir + "/linux_64")
|
||||
base.create_dir(base_dir + "/linux_64/build")
|
||||
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicudata.so." + icu_major)
|
||||
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicuuc.so." + icu_major)
|
||||
base.copy_dir(base_dir + "/icu/cross_build_install/include", base_dir + "/linux_64/build/include")
|
||||
|
||||
if config.check_option("platform", "linux_arm64") and not base.is_dir(base_dir + "/linux_arm64") and not base.is_os_arm():
|
||||
base.create_dir(base_dir + "/icu/linux_arm64")
|
||||
os.chdir(base_dir + "/icu/linux_arm64")
|
||||
base_arm_tool_dir = base.get_prefix_cross_compiler_arm64()
|
||||
base.cmd("./../source/configure", ["--host=arm-linux", "--prefix=" + base_dir + "/icu/linux_arm64_install", "--with-cross-build=" + base_dir + "/icu/cross_build",
|
||||
"CC=" + base_arm_tool_dir + "gcc", "CXX=" + base_arm_tool_dir + "g++", "AR=" + base_arm_tool_dir + "ar", "RANLIB=" + base_arm_tool_dir + "ranlib"])
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
base.create_dir(base_dir + "/linux_arm64")
|
||||
base.create_dir(base_dir + "/linux_arm64/build")
|
||||
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicudata.so." + icu_major)
|
||||
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicuuc.so." + icu_major)
|
||||
base.copy_dir(base_dir + "/icu/linux_arm64_install/include", base_dir + "/linux_arm64/build/include")
|
||||
|
||||
os.chdir("../..")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
platform = "mac_64"
|
||||
if not base.is_dir(platform + "/build"):
|
||||
if not base.is_file("./icu/source/tools/pkgdata/pkgdata.cpp.bak"):
|
||||
base.copy_file("./icu/source/tools/pkgdata/pkgdata.cpp", "./icu/source/tools/pkgdata/pkgdata.cpp.bak")
|
||||
base.replaceInFile("./icu/source/tools/pkgdata/pkgdata.cpp", "cmd, \"%s %s -o %s%s %s %s%s %s %s\",", "cmd, \"%s %s -o %s%s %s %s %s %s %s\",")
|
||||
|
||||
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"])
|
||||
old_dest_dir = base.get_env("DESTDIR")
|
||||
base.set_env("DESTDIR", base_dir + "/" + platform)
|
||||
base.cmd("make", ["install"])
|
||||
if ("" == old_dest_dir):
|
||||
os.environ.pop("DESTDIR")
|
||||
else:
|
||||
base.set_env("DEST_DIR", old_dest_dir)
|
||||
os.chdir("../..")
|
||||
base.create_dir(platform + "/build")
|
||||
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)
|
||||
# mac
|
||||
if (-1 != config.option("platform").find("mac_")) and not base.is_dir("mac_64/build"):
|
||||
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
|
||||
|
||||
# ios
|
||||
if (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir("build"):
|
||||
base.bash("./icu_ios")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -13,6 +13,8 @@ def change_icu_defs(current_dir, arch):
|
||||
if arch == "arm64":
|
||||
param = "-arch arm64 -isysroot " + base.find_mac_sdk()
|
||||
|
||||
param += " -mmacosx-version-min=10.12"
|
||||
|
||||
base.copy_file(icudef_file, icudef_file_old)
|
||||
|
||||
base.replaceInFile(icudef_file, "CFLAGS = ", "CFLAGS = " + param + " ")
|
||||
|
||||
@ -11,7 +11,11 @@ current_dir = base.get_script_dir() + "/../../core/Common/3dParty/ixwebsocket"
|
||||
|
||||
CMAKE = "cmake"
|
||||
|
||||
def find_last_version(arr):
|
||||
def find_last_version(arr_input, base_directory):
|
||||
arr = []
|
||||
for arr_rec in arr_input:
|
||||
if base.is_file(base_directory + "/" + arr_rec + "/bin/cmake"):
|
||||
arr.append(arr_rec)
|
||||
res = arr[0]
|
||||
for version in arr:
|
||||
if(LooseVersion(version) > LooseVersion(res)):
|
||||
@ -90,8 +94,8 @@ def make():
|
||||
global CMAKE
|
||||
|
||||
CMAKE_TOOLCHAIN_FILE = base.get_env("ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake"
|
||||
CMAKE_DIR = base.get_env("ANDROID_HOME") + "/cmake/"
|
||||
CMAKE = CMAKE_DIR + find_last_version(os.listdir(CMAKE_DIR)) + "/bin/cmake"
|
||||
CMAKE_DIR = base.get_android_sdk_home() + "/cmake/"
|
||||
CMAKE = CMAKE_DIR + find_last_version(os.listdir(CMAKE_DIR), CMAKE_DIR) + "/bin/cmake"
|
||||
|
||||
def param_android(arch, api):
|
||||
return ["-G","Unix Makefiles", "-DANDROID_NATIVE_API_LEVEL=" + api, "-DANDROID_ABI=" + arch, "-DANDROID_TOOLCHAIN=clang", "-DANDROID_NDK=" + base.get_env("ANDROID_NDK_ROOT"), "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE, "-DCMAKE_MAKE_PROGRAM=make"]
|
||||
@ -137,19 +141,24 @@ def make():
|
||||
base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/include")
|
||||
base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/lib")
|
||||
|
||||
#copy include
|
||||
if base.is_dir(current_dir + "/IXWebSocket/build/ios/armv7/include"):
|
||||
base.cmd("cp", [ "-r", current_dir + "/IXWebSocket/build/ios/armv7/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(current_dir + "/IXWebSocket/build/armv64/include"):
|
||||
base.cmd("cp", [ "-r", current_dir + "/IXWebSocket/build/ios/armv64/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(current_dir + "/IXWebSocket/build/i386/include"):
|
||||
base.cmd("cp", [ "-r", current_dir + "/IXWebSocket/build/ios/i386/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(current_dir + "/IXWebSocket/build/ios/x86_64/include"):
|
||||
base.cmd("cp", [ "-r", current_dir + "/IXWebSocket/build/ios/x86_64/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
#copy include
|
||||
prefix_dir = current_dir + "/IXWebSocket/build/ios/"
|
||||
postfix_dir = ""
|
||||
if base.is_dir(prefix_dir + "armv7/usr"):
|
||||
postfix_dir = "/usr"
|
||||
|
||||
if base.is_dir(prefix_dir + "armv7" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "armv7" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(prefix_dir + "armv64" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "armv64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(prefix_dir + "i386" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "i386" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(prefix_dir + "x86_64" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "x86_64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
|
||||
# Create fat lib
|
||||
base.cmd("lipo", ["IXWebSocket/build/ios/armv7/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64/lib/libixwebsocket.a",
|
||||
"IXWebSocket/build/ios/i386/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64/lib/libixwebsocket.a",
|
||||
base.cmd("lipo", ["IXWebSocket/build/ios/armv7" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
|
||||
"IXWebSocket/build/ios/i386" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
|
||||
"-create", "-output",
|
||||
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
|
||||
|
||||
@ -171,12 +180,16 @@ def make():
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
|
||||
vsVersion = "14 2015"
|
||||
if (config.option("vs-version") == "2019"):
|
||||
vsVersion = "16 2019"
|
||||
|
||||
if (-1 != config.option("platform").find("win_32")):
|
||||
build_arch("windows", "win_32", ["-G","Visual Studio 14 2015", "-A", "Win32"])
|
||||
build_arch("windows_debug", "win_32", ["-G","Visual Studio 14 2015", "-A", "Win32"], True)
|
||||
build_arch("windows", "win_32", ["-G","Visual Studio " + vsVersion, "-A", "Win32"])
|
||||
build_arch("windows_debug", "win_32", ["-G","Visual Studio" + vsVersion, "-A", "Win32"], True)
|
||||
if (-1 != config.option("platform").find("win_64")):
|
||||
build_arch("windows", "win_64", ["-G","Visual Studio 14 2015 Win64"])
|
||||
build_arch("windows_debug", "win_64", ["-G","Visual Studio 14 2015 Win64"], True)
|
||||
build_arch("windows", "win_64", ["-G","Visual Studio " + vsVersion + " Win64"])
|
||||
build_arch("windows_debug", "win_64", ["-G","Visual Studio " + vsVersion + " Win64"], True)
|
||||
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
@ -5,6 +5,7 @@ sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import platform
|
||||
import openssl_mobile
|
||||
|
||||
def clean():
|
||||
@ -85,6 +86,20 @@ def make():
|
||||
base.cmd("make", ["install"])
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("linux_arm64")) and not base.is_dir("../build/linux_arm64"):
|
||||
if ("x86_64" != platform.machine()):
|
||||
base.copy_dir("../build/linux_64", "../build/linux_arm64")
|
||||
else:
|
||||
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
|
||||
if ("" == cross_compiler_arm64):
|
||||
cross_compiler_arm64 = "/usr/bin"
|
||||
cross_compiler_arm64_prefix = cross_compiler_arm64 + "/" + base.get_prefix_cross_compiler_arm64()
|
||||
base.cmd("./Configure", ["linux-aarch64", "--cross-compile-prefix=" + cross_compiler_arm64_prefix, "no-shared", "no-asm", "no-tests", "--prefix=" + old_cur_dir + "/build/linux_arm64", "--openssldir=" + old_cur_dir + "/build/linux_arm64"])
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.cmd("make", [], True)
|
||||
base.cmd("make", ["install"], True)
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
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"])
|
||||
|
||||
@ -9,6 +9,8 @@ def make():
|
||||
path = base.get_script_dir() + "/../../core/Common/3dParty/openssl"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(path)
|
||||
base.set_env("ANDROID_HOME", base.get_android_sdk_home())
|
||||
|
||||
if (-1 != config.option("platform").find("android") and not base.is_dir("./build/android")):
|
||||
subprocess.call(["./build-android-openssl.sh"])
|
||||
|
||||
|
||||
@ -23,8 +23,8 @@ def buildIOS():
|
||||
base.create_dir(current_dir + "/build/ios/lib")
|
||||
|
||||
# Create fat lib
|
||||
base.cmd("lipo", ["build/Release-iphonesimulator/libSocketRocket.a", "build/Release-iphoneos/libSocketRocket.a", "-create", "-output",
|
||||
"build/lib/ios/libSoсketRocket.a"])
|
||||
base.cmd("lipo", ["./build/Release-iphonesimulator/libSocketRocket.a", "./build/Release-iphoneos/libSocketRocket.a", "-create", "-output",
|
||||
"./build/ios/lib/libSoсketRocket.a"])
|
||||
|
||||
return
|
||||
|
||||
@ -44,10 +44,6 @@ def buildMacOS():
|
||||
return
|
||||
|
||||
def make():
|
||||
|
||||
if base.is_dir(current_dir + "/build"):
|
||||
return
|
||||
|
||||
if (-1 == config.option("platform").find("mac") and -1 == config.option("platform").find("ios")):
|
||||
return
|
||||
|
||||
@ -57,8 +53,10 @@ def make():
|
||||
os.chdir(current_dir)
|
||||
|
||||
if (-1 != config.option("platform").find("mac")):
|
||||
buildMacOS()
|
||||
if not base.is_dir(current_dir + "/build/mac_64") or not base.is_dir(current_dir + "/build/mac_arm_64"):
|
||||
buildMacOS()
|
||||
elif (-1 != config.option("platform").find("ios")):
|
||||
buildIOS()
|
||||
if not base.is_dir(current_dir + "/build/ios"):
|
||||
buildIOS()
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
|
||||
@ -6,6 +6,7 @@ import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
import v8_89
|
||||
|
||||
def clean():
|
||||
if base.is_dir("depot_tools"):
|
||||
@ -25,7 +26,7 @@ def clean():
|
||||
def is_main_platform():
|
||||
if (config.check_option("platform", "win_64") or config.check_option("platform", "win_32")):
|
||||
return True
|
||||
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32")):
|
||||
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32") or config.check_option("platform", "linux_arm64")):
|
||||
return True
|
||||
if config.check_option("platform", "mac_64"):
|
||||
return True
|
||||
@ -41,16 +42,13 @@ def is_xp_platform():
|
||||
return False
|
||||
|
||||
def is_use_clang():
|
||||
gcc_version = 4
|
||||
gcc_version_str = base.run_command("gcc -dumpfullversion -dumpversion")['stdout']
|
||||
if (gcc_version_str != ""):
|
||||
gcc_version = int(gcc_version_str.split(".")[0])
|
||||
gcc_version = base.get_gcc_version()
|
||||
|
||||
is_clang = "false"
|
||||
if (gcc_version >= 6):
|
||||
if (gcc_version >= 6000):
|
||||
is_clang = "true"
|
||||
|
||||
print("gcc major version: " + str(gcc_version) + ", use clang:" + is_clang)
|
||||
print("gcc version: " + str(gcc_version) + ", use clang:" + is_clang)
|
||||
return is_clang
|
||||
|
||||
def make():
|
||||
@ -70,6 +68,14 @@ def make():
|
||||
if ("mac" == base.host_platform()) and (-1 == config.option("config").find("use_v8")):
|
||||
return
|
||||
|
||||
use_v8_89 = False
|
||||
if (-1 != config.option("config").lower().find("v8_version_89")):
|
||||
use_v8_89 = True
|
||||
|
||||
if (use_v8_89):
|
||||
v8_89.make()
|
||||
return
|
||||
|
||||
print("[fetch & build]: v8")
|
||||
old_env = dict(os.environ)
|
||||
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8_87"
|
||||
if not base.is_dir(base_dir):
|
||||
base.create_dir(base_dir)
|
||||
|
||||
os.chdir(base_dir)
|
||||
if not base.is_dir("depot_tools"):
|
||||
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
|
||||
|
||||
os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]
|
||||
|
||||
if not base.is_dir("v8"):
|
||||
base.cmd("./depot_tools/fetch", ["v8"], True)
|
||||
base.cmd("./depot_tools/gclient", ["sync", "-r", "8.7.220.25"], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
|
||||
os.chdir("v8")
|
||||
|
||||
gn_args = ["target_cpu=\\\"x64\\\"",
|
||||
"v8_target_cpu=\\\"x64\\\"",
|
||||
"v8_static_library=true",
|
||||
"is_component_build=false",
|
||||
"v8_monolithic=true",
|
||||
"v8_use_external_startup_data=false",
|
||||
"use_custom_libcxx=false",
|
||||
"is_debug=false"]
|
||||
|
||||
base.cmd2("gn", ["gen", "out.gn/mac_64", "--args=\"" + " ".join(gn_args) + "\""])
|
||||
base.cmd("ninja", ["-C", "out.gn/mac_64"])
|
||||
130
scripts/core_common/modules/v8_89.py
Normal file
130
scripts/core_common/modules/v8_89.py
Normal file
@ -0,0 +1,130 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def make_args(args, platform, is_64=True, is_debug=False):
|
||||
args_copy = args[:]
|
||||
if is_64:
|
||||
args_copy.append("target_cpu=\\\"x64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"x64\\\"")
|
||||
else:
|
||||
args_copy.append("target_cpu=\\\"x86\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"x86\\\"")
|
||||
|
||||
if (platform == "linux_arm64"):
|
||||
args_copy = args[:]
|
||||
args_copy.append("target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("use_sysroot=true")
|
||||
|
||||
if is_debug:
|
||||
args_copy.append("is_debug=true")
|
||||
else:
|
||||
args_copy.append("is_debug=false")
|
||||
|
||||
if (platform == "linux"):
|
||||
args_copy.append("is_clang=true")
|
||||
args_copy.append("use_sysroot=false")
|
||||
if (platform == "windows"):
|
||||
args_copy.append("is_clang=false")
|
||||
|
||||
return "--args=\"" + " ".join(args_copy) + "\""
|
||||
|
||||
def ninja_windows_make(args, is_64=True, is_debug=False):
|
||||
directory_out = "out.gn/"
|
||||
directory_out += ("win_64/" if is_64 else "win_32/")
|
||||
directory_out += ("debug" if is_debug else "release")
|
||||
|
||||
base.cmd2("gn", ["gen", directory_out, make_args(args, "windows", is_64, is_debug)])
|
||||
base.copy_file("./" + directory_out + "/obj/v8_wrappers.ninja", "./" + directory_out + "/obj/v8_wrappers.ninja.bak")
|
||||
base.replaceInFile("./" + directory_out + "/obj/v8_wrappers.ninja", "target_output_name = v8_wrappers", "target_output_name = v8_wrappers\nbuild obj/v8_wrappers.obj: cxx ../../../src/base/platform/wrappers.cc")
|
||||
base.replaceInFile("./" + directory_out + "/obj/v8_wrappers.ninja", "build obj/v8_wrappers.lib: alink", "build obj/v8_wrappers.lib: alink obj/v8_wrappers.obj")
|
||||
base.cmd("ninja", ["-C", directory_out, "v8_wrappers"])
|
||||
base.cmd("ninja", ["-C", directory_out])
|
||||
base.delete_file("./" + directory_out + "/obj/v8_wrappers.ninja")
|
||||
base.move_file("./" + directory_out + "/obj/v8_wrappers.ninja.bak", "./" + directory_out + "/obj/v8_wrappers.ninja")
|
||||
return
|
||||
|
||||
def make():
|
||||
old_env = dict(os.environ)
|
||||
old_cur = os.getcwd()
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8_89"
|
||||
if not base.is_dir(base_dir):
|
||||
base.create_dir(base_dir)
|
||||
|
||||
os.chdir(base_dir)
|
||||
if not base.is_dir("depot_tools"):
|
||||
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
|
||||
|
||||
os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.set_env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0")
|
||||
base.set_env("GYP_MSVS_VERSION", config.option("vs-version"))
|
||||
|
||||
if not base.is_dir("v8"):
|
||||
base.cmd("./depot_tools/fetch", ["v8"], True)
|
||||
if ("windows" == base.host_platform()):
|
||||
os.chdir("v8")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"])
|
||||
os.chdir("../")
|
||||
base.cmd("./depot_tools/gclient", ["sync", "-r", "remotes/branch-heads/8.9"], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
|
||||
|
||||
if not base.is_file("v8/src/base/platform/wrappers.cc"):
|
||||
base.writeFile("v8/src/base/platform/wrappers.cc", "#include \"src/base/platform/wrappers.h\"\n")
|
||||
|
||||
os.chdir("v8")
|
||||
|
||||
gn_args = ["v8_static_library=true",
|
||||
"is_component_build=false",
|
||||
"v8_monolithic=true",
|
||||
"v8_use_external_startup_data=false",
|
||||
"use_custom_libcxx=false",
|
||||
"treat_warnings_as_errors=false"]
|
||||
|
||||
if config.check_option("platform", "linux_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_64"])
|
||||
|
||||
if config.check_option("platform", "linux_32"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_32", make_args(gn_args, "linux", False)])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_32"])
|
||||
|
||||
if config.check_option("platform", "linux_arm64"):
|
||||
base.cmd("build/linux/sysroot_scripts/install-sysroot.py", ["--arch=arm64"], False)
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_arm64", make_args(gn_args, "linux_arm64", False)])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_arm64"])
|
||||
|
||||
if config.check_option("platform", "mac_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/mac_64", make_args(gn_args, "mac")])
|
||||
base.cmd("ninja", ["-C", "out.gn/mac_64"])
|
||||
|
||||
if config.check_option("platform", "win_64"):
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
if not base.is_file("out.gn/win_64/debug/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args, True, True)
|
||||
|
||||
if not base.is_file("out.gn/win_64/release/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args)
|
||||
|
||||
if config.check_option("platform", "win_32"):
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
if not base.is_file("out.gn/win_32/debug/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args, False, True)
|
||||
|
||||
if not base.is_file("out.gn/win_32/release/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args, False)
|
||||
|
||||
os.chdir(old_cur)
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
@ -10,13 +10,7 @@ import socketrocket
|
||||
config_file = base.get_script_dir() + "/../../core/Common/WebSocket/websocket.pri"
|
||||
|
||||
def make():
|
||||
|
||||
ixwebsocket.make()
|
||||
socketrocket.make()
|
||||
|
||||
if (-1 != config.option("websocketlib").find("ixwebsocket")):
|
||||
base.writeFile(config_file, "CONFIG += ixwebsocket")
|
||||
elif (-1 != config.option("websocketlib").find("socketrocket")):
|
||||
base.writeFile(config_file, "CONFIG += socketrocket")
|
||||
|
||||
return
|
||||
|
||||
@ -44,12 +44,16 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlRenderer")
|
||||
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, "DocxRenderer")
|
||||
|
||||
if ("ios" == platform):
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
|
||||
else:
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "x2t")
|
||||
|
||||
if (native_platform == "linux_64"):
|
||||
base.generate_check_linux_system(git_dir + "/build_tools", root_dir)
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")
|
||||
@ -67,20 +71,16 @@ def make():
|
||||
if isWindowsXP:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir, "doctrenderer")
|
||||
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/xp/doctrenderer.lib", root_dir + "/doctrenderer.lib")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer")
|
||||
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 + "/")
|
||||
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")
|
||||
base.copy_v8_files(core_dir, root_dir, platform, isWindowsXP)
|
||||
|
||||
# app
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "docbuilder")
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder")
|
||||
base.copy_dir(git_dir + "/DocumentBuilder/empty", root_dir + "/empty")
|
||||
base.copy_dir(git_dir + "/DocumentBuilder/samples", root_dir + "/samples")
|
||||
base.copy_dir(git_dir + "/document-templates/new/en-US", root_dir + "/empty")
|
||||
|
||||
# js
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", root_dir + "/sdkjs")
|
||||
@ -96,8 +96,10 @@ def make():
|
||||
|
||||
if ("win_64" == platform):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/x64/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_64/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
|
||||
elif ("win_32" == platform):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/Win32/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_32/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
@ -105,6 +107,7 @@ def make():
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.mac_correct_rpath_x2t(root_dir)
|
||||
|
||||
base.mac_correct_rpath_docbuilder(root_dir)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "UnicodeConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DocxRenderer")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")
|
||||
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", archive_dir + "/sdkjs")
|
||||
@ -48,11 +49,9 @@ def make():
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*.dll", archive_dir + "/")
|
||||
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 + "/")
|
||||
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_v8_files(core_dir, archive_dir, platform)
|
||||
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allthemesgen")
|
||||
|
||||
@ -55,16 +55,21 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DocxRenderer")
|
||||
|
||||
if ("ios" == platform):
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "x2t")
|
||||
else:
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "x2t")
|
||||
|
||||
if (native_platform == "linux_64"):
|
||||
base.generate_check_linux_system(git_dir + "/build_tools", root_dir + "/converter")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/converter/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/converter/icuuc58.dll")
|
||||
base.copy_file(git_dir + "/desktop-apps/common/converter/package.config", root_dir + "/converter/package.config")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/converter/libicudata.so.58")
|
||||
@ -77,13 +82,9 @@ def make():
|
||||
# doctrenderer
|
||||
if isWindowsXP:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/converter/")
|
||||
else:
|
||||
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/")
|
||||
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.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
|
||||
base.copy_v8_files(core_dir, root_dir + "/converter", platform, isWindowsXP)
|
||||
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")
|
||||
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
|
||||
@ -156,13 +157,50 @@ def make():
|
||||
elif (0 == platform.find("linux")):
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors", root_dir + "/DesktopEditors")
|
||||
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
|
||||
if ("" != base.get_env("VIDEO_PLAYER_VLC_DIR")):
|
||||
vlc_dir = git_dir + "/desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc/"
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlc.dll", root_dir + "/libvlc.dll")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlccore.dll", root_dir + "/libvlccore.dll")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtCore.dll", root_dir + "/VLCQtCore.dll")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtWidgets.dll", root_dir + "/VLCQtWidgets.dll")
|
||||
else:
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlc.so", root_dir + "/libvlc.so")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlc.so.5", root_dir + "/libvlc.so.5")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlccore.so", root_dir + "/libvlccore.so")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlccore.so.8", root_dir + "/libvlccore.so.8")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtCore.so", root_dir + "/VLCQtCore.so")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtWidgets.so", root_dir + "/VLCQtWidgets.so")
|
||||
|
||||
if isWindowsXP:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform + "/mediaplayer/xp", root_dir, "videoplayer")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform + "/mediaplayer", root_dir, "videoplayer")
|
||||
|
||||
base.copy_dir(vlc_dir + platform + "/bin/plugins", root_dir + "/plugins")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
|
||||
|
||||
base.create_dir(root_dir + "/editors")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/desktop/sdkjs", root_dir + "/editors/sdkjs")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/desktop/web-apps", root_dir + "/editors/web-apps")
|
||||
base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local")
|
||||
|
||||
# desktopeditors-help
|
||||
root_help_dir = root_dir + "-help"
|
||||
if (base.is_dir(root_help_dir)):
|
||||
base.delete_dir(root_help_dir)
|
||||
for i in ["documenteditor", "presentationeditor", "spreadsheeteditor"]:
|
||||
base.copy_dir(
|
||||
base_dir + "/js/" + branding + "/desktop/web-apps/apps/%s/main/resources/help" % i,
|
||||
root_help_dir + "/editors/web-apps/apps/%s/main/resources/help" % i)
|
||||
|
||||
if ("1" != config.option("preinstalled-help") and not isWindowsXP):
|
||||
# remove help from install until web-apps containes help
|
||||
base.delete_dir(root_dir + "/editors/web-apps/apps/documenteditor/main/resources/help")
|
||||
base.delete_dir(root_dir + "/editors/web-apps/apps/presentationeditor/main/resources/help")
|
||||
base.delete_dir(root_dir + "/editors/web-apps/apps/spreadsheeteditor/main/resources/help")
|
||||
|
||||
base.create_dir(root_dir + "/editors/sdkjs-plugins")
|
||||
base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True, True)
|
||||
# remove some default plugins
|
||||
@ -225,6 +263,7 @@ def make():
|
||||
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params)
|
||||
base.delete_file(root_dir + "/converter/AllFonts.js")
|
||||
base.delete_file(root_dir + "/converter/font_selection.bin")
|
||||
base.delete_file(root_dir + "/converter/fonts.log")
|
||||
|
||||
base.delete_exe(root_dir + "/converter/allfontsgen")
|
||||
base.delete_exe(root_dir + "/converter/allthemesgen")
|
||||
|
||||
@ -3,6 +3,11 @@
|
||||
import config
|
||||
import base
|
||||
|
||||
def exclude_arch(directory, frameworks):
|
||||
for lib in frameworks:
|
||||
base.cmd("lipo", ["-remove", "arm64", directory + "/" + lib + ".framework/" + lib, "-o", directory + "/" + lib + ".framework/" + lib])
|
||||
return
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
@ -46,12 +51,19 @@ 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, "DocxRenderer")
|
||||
|
||||
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")
|
||||
|
||||
if ("ios" == platform) and config.check_option("config", "bundle_dylibs") and config.check_option("config", "simulator"):
|
||||
exclude_arch(root_dir, ["kernel", "kernel_network", "UnicodeConverter", "graphics", "PdfWriter",
|
||||
"PdfReader", "DjVuFile", "XpsFile", "HtmlFile2", "HtmlRenderer", "doctrenderer",
|
||||
"Fb2File", "EpubFile", "x2t"])
|
||||
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")
|
||||
|
||||
@ -84,8 +84,12 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "doctrenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DocxRenderer")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "x2t")
|
||||
|
||||
if (native_platform == "linux_64"):
|
||||
base.generate_check_linux_system(git_dir + "/build_tools", converter_dir)
|
||||
|
||||
base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server")
|
||||
|
||||
# icu
|
||||
@ -100,20 +104,20 @@ def make():
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", converter_dir + "/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", converter_dir + "/libicuuc.58.dylib")
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
|
||||
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")
|
||||
|
||||
base.copy_v8_files(core_dir, converter_dir, platform)
|
||||
|
||||
# builder
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "docbuilder")
|
||||
base.copy_dir(git_dir + "/DocumentBuilder/empty", converter_dir + "/empty")
|
||||
base.copy_dir(git_dir + "/document-templates/new/en-US", converter_dir + "/empty")
|
||||
|
||||
# js
|
||||
js_dir = root_dir
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", js_dir + "/sdkjs")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps", js_dir + "/web-apps")
|
||||
|
||||
# add embed worker code
|
||||
base.cmd_in_dir(git_dir + "/sdkjs/common/embed", "python", ["make.py", js_dir + "/web-apps/apps/api/documents/api.js"])
|
||||
|
||||
# plugins
|
||||
base.create_dir(js_dir + "/sdkjs-plugins")
|
||||
@ -124,6 +128,8 @@ def make():
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
|
||||
base.support_old_versions_plugins(js_dir + "/sdkjs-plugins")
|
||||
|
||||
base.clone_marketplace_plugin(root_dir + "/sdkjs-plugins")
|
||||
|
||||
# tools
|
||||
tools_dir = root_dir + "/server/tools"
|
||||
@ -161,8 +167,8 @@ def make():
|
||||
#document-templates
|
||||
document_templates_files = server_dir + '/../document-templates'
|
||||
document_templates = build_server_dir + '/../document-templates'
|
||||
base.create_dir(document_templates)
|
||||
base.copy_dir(document_templates_files, document_templates)
|
||||
base.copy_dir(document_templates_files + '/new', document_templates + '/new')
|
||||
base.copy_dir(document_templates_files + '/sample', document_templates + '/sample')
|
||||
|
||||
#license
|
||||
license_file1 = server_dir + '/LICENSE.txt'
|
||||
|
||||
@ -62,11 +62,15 @@ def make():
|
||||
print("-----------------------------------------------------------")
|
||||
|
||||
base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")
|
||||
base.support_old_versions_plugins(git_dir + "/sdkjs-plugins")
|
||||
|
||||
if base.is_dir(git_dir + "/fonts"):
|
||||
base.delete_dir(git_dir + "/fonts")
|
||||
base.create_dir(git_dir + "/fonts")
|
||||
if not base.is_dir(git_dir + "/sdkjs-plugins"):
|
||||
base.create_dir(git_dir + "/sdkjs-plugins")
|
||||
|
||||
base.support_old_versions_plugins(git_dir + "/sdkjs-plugins")
|
||||
base.clone_marketplace_plugin(git_dir + "/sdkjs-plugins")
|
||||
|
||||
if not base.is_dir(git_dir + "/fonts"):
|
||||
base.create_dir(git_dir + "/fonts")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
base.mac_correct_rpath_x2t("./")
|
||||
@ -131,6 +135,15 @@ def make():
|
||||
json_file = git_dir + "/server/Common/config/local-development-" + base.host_platform() + ".json"
|
||||
base.writeFile(json_file, json.dumps({"services": {"CoAuthoring": {"server": server_config, "sql": sql}}}, indent=2))
|
||||
|
||||
#site url
|
||||
example_config = {}
|
||||
example_config["port"] = 80
|
||||
example_config["siteUrl"] = "http://" + config.option("siteUrl") + ":8000/"
|
||||
example_config["apiUrl"] = "web-apps/apps/api/documents/api.js"
|
||||
example_config["preloaderUrl"] = "web-apps/apps/api/documents/cache-scripts.html"
|
||||
json_file = git_dir + "/document-server-integration/web/documentserver-example/nodejs/config/local-development-" + base.host_platform() + ".json"
|
||||
base.writeFile(json_file, json.dumps({"server": example_config}, indent=2))
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
|
||||
@ -75,18 +75,21 @@ def check_dependencies():
|
||||
checksResult = CDependencies()
|
||||
|
||||
checksResult.append(check_git())
|
||||
checksResult.append(check_nodejs())
|
||||
if (host_platform == 'linux'):
|
||||
checksResult.append(check_npm())
|
||||
checksResult.append(check_curl())
|
||||
checksResult.append(check_nodejs())
|
||||
checksResult.append(check_npm())
|
||||
checksResult.append(check_7z())
|
||||
|
||||
checksResult.append(check_java())
|
||||
checksResult.append(check_erlang())
|
||||
checksResult.append(check_rabbitmq())
|
||||
checksResult.append(check_gruntcli())
|
||||
|
||||
if (host_platform == 'windows'):
|
||||
checksResult.append(check_buildTools())
|
||||
if (config.option("sql-type") == 'mysql'):
|
||||
checksResult.append(check_nodejs())
|
||||
|
||||
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
|
||||
checksResult.append(check_mysqlServer())
|
||||
else:
|
||||
checksResult.append(check_postgreSQL())
|
||||
@ -106,11 +109,11 @@ def check_dependencies():
|
||||
if (host_platform == 'windows'):
|
||||
code = libwindows.sudo(unicode(sys.executable), install_args)
|
||||
elif (host_platform == 'linux'):
|
||||
base.cmd('python', install_args, False)
|
||||
get_updates()
|
||||
|
||||
base.cmd('python', install_args, False)
|
||||
|
||||
check_npmPath()
|
||||
if (config.option("sql-type") == 'mysql'):
|
||||
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
|
||||
return check_MySQLConfig(checksResult.sqlPath)
|
||||
return check_postgreConfig(checksResult.sqlPath)
|
||||
|
||||
@ -156,13 +159,16 @@ def check_nodejs():
|
||||
nodejs_version = base.run_command('node -v')['stdout']
|
||||
if (nodejs_version == ''):
|
||||
print('Node.js not found')
|
||||
dependence.append_install('Node.js')
|
||||
if (host_platform == 'windows'):
|
||||
dependence.append_install('Node.js')
|
||||
elif (host_platform == 'linux'):
|
||||
dependence.append_install('NodeJs')
|
||||
return dependence
|
||||
|
||||
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 = '14.14'
|
||||
nodejs_min_version_minor = 0
|
||||
major_minor_min_version = nodejs_min_version.split('.')
|
||||
nodejs_min_version_major = int(major_minor_min_version[0])
|
||||
@ -176,7 +182,7 @@ def check_nodejs():
|
||||
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')
|
||||
print('Installed Node.js version must be 14.14 to 14.x')
|
||||
isNeedReinstall = True
|
||||
elif (nodejs_min_version_major == nodejs_cur_version_major):
|
||||
if (nodejs_min_version_minor > nodejs_cur_version_minor):
|
||||
@ -186,12 +192,14 @@ def check_nodejs():
|
||||
isNeedReinstall = True
|
||||
|
||||
if (True == isNeedReinstall):
|
||||
print('Installed Node.js version must be 10.20 to 14.x')
|
||||
print('Installed Node.js version must be 14.14 to 14.x')
|
||||
if (host_platform == 'windows'):
|
||||
dependence.append_uninstall('Node.js')
|
||||
dependence.append_install('Node.js')
|
||||
elif (host_platform == 'linux'):
|
||||
dependence.append_uninstall('nodejs')
|
||||
dependence.append_install('Node.js')
|
||||
dependence.append_install('NodeJs')
|
||||
|
||||
return dependence
|
||||
|
||||
print('Installed Node.js is valid')
|
||||
@ -228,7 +236,7 @@ def check_erlang():
|
||||
|
||||
erlangBitness = ""
|
||||
erlang_path_home = get_erlang_path_to_bin()
|
||||
if base.is_exist(erlang_path_home) == False:
|
||||
if base.is_exist(erlang_path_home) == False and host_platform == 'windows':
|
||||
dependence.append_uninstall('Erlang')
|
||||
dependence.append_uninstall('RabbitMQ')
|
||||
return dependence
|
||||
@ -363,10 +371,11 @@ def check_npm():
|
||||
def check_vc_components():
|
||||
base.print_info('Check Visual C++ components')
|
||||
result = True
|
||||
if (len(get_programUninstalls('Microsoft Visual C++ 2015-2019 Redistributable (x64)')) == 0):
|
||||
print('Microsoft Visual C++ 2015-2019 Redistributable (x64) not found')
|
||||
if (len(get_programUninstalls('Microsoft Visual C++ 2015-')) == 0):
|
||||
print('Microsoft Visual C++ 2015-20** Redistributable (x64) not found')
|
||||
result = installProgram('VC2019x64') and result
|
||||
|
||||
|
||||
print('Installed Visual C++ components is valid')
|
||||
return result
|
||||
|
||||
@ -889,14 +898,21 @@ def install_postgresql():
|
||||
|
||||
return code
|
||||
|
||||
def install_nodejs():
|
||||
os.system('curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -')
|
||||
base.print_info("Install node.js...")
|
||||
install_command = 'yes | sudo apt install nodejs'
|
||||
print(install_command)
|
||||
return os.system(install_command)
|
||||
|
||||
downloads_list = {
|
||||
'Windows': {
|
||||
'Git': 'https://github.com/git-for-windows/git/releases/download/v2.29.0.windows.1/Git-2.29.0-64-bit.exe',
|
||||
'Node.js': 'https://nodejs.org/download/release/v14.15.1/node-v14.15.1-x64.msi',
|
||||
'Node.js': 'https://nodejs.org/download/release/v14.17.2/node-v14.17.2-x64.msi',
|
||||
'Java': 'https://javadl.oracle.com/webapps/download/AutoDL?BundleId=242990_a4634525489241b9a9e1aa73d9e118e6',
|
||||
'RabbitMQ': 'https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-3.8.9.exe',
|
||||
'Erlang': 'http://erlang.org/download/otp_win64_23.1.exe',
|
||||
'VC2019x64': 'https://aka.ms/vs/16/release/vc_redist.x64.exe',
|
||||
'VC2019x64': 'https://aka.ms/vs/17/release/vc_redist.x64.exe',
|
||||
'MySQLInstaller': 'https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-8.0.21.0.msi',
|
||||
'BuildTools': 'https://download.visualstudio.microsoft.com/download/pr/11503713/e64d79b40219aea618ce2fe10ebd5f0d/vs_BuildTools.exe',
|
||||
'Redis': 'https://github.com/tporadowski/redis/releases/download/v5.0.9/Redis-x64-5.0.9.msi',
|
||||
@ -904,7 +920,6 @@ downloads_list = {
|
||||
},
|
||||
'Linux': {
|
||||
'Git': 'git',
|
||||
'Node.js': 'nodejs',
|
||||
'Npm': 'npm',
|
||||
'Java': 'openjdk-11-jdk',
|
||||
'RabbitMQ': 'rabbitmq-server',
|
||||
@ -916,6 +931,7 @@ downloads_list = {
|
||||
}
|
||||
}
|
||||
install_special = {
|
||||
'NodeJs': install_nodejs,
|
||||
'GruntCli': install_gruntcli,
|
||||
'MySQLServer': install_mysqlserver,
|
||||
'RedisServer' : install_redis,
|
||||
|
||||
@ -3,25 +3,30 @@
|
||||
import sys
|
||||
sys.path.append('../')
|
||||
|
||||
import optparse
|
||||
import argparse
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
arguments = sys.argv[1:]
|
||||
parser = argparse.ArgumentParser(description="Print repositories list.")
|
||||
parser.add_argument('-P', '--platform', type=str, dest='platform',
|
||||
action='store', default="native", help="Defines platform")
|
||||
parser.add_argument('-M', '--module', type=str, dest='module',
|
||||
action='store', default="core desktop builder server",
|
||||
help="Defines modules")
|
||||
parser.add_argument('-B', '--branding', type=str, dest='branding',
|
||||
action='store', help="Defines branding path")
|
||||
args = parser.parse_args()
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("--module", action="store", type="string", dest="module", default="core desktop builder server", help="defines modules")
|
||||
parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines platform")
|
||||
parser.add_option("--branding", action="store", type="string", dest="branding", default="onlyoffice", help="provides branding path")
|
||||
config_args = [
|
||||
'configure.py',
|
||||
'--platform', args.platform,
|
||||
'--module', args.module
|
||||
]
|
||||
if args.branding != None:
|
||||
config_args += ['--branding', args.branding]
|
||||
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
configOptions = vars(options)
|
||||
|
||||
base.cmd_in_dir('../../', 'python',['configure.py',
|
||||
'--module', configOptions["module"],
|
||||
'--platform', configOptions["platform"],
|
||||
'--branding', configOptions["branding"]])
|
||||
base.cmd_in_dir('../../', 'python', config_args)
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
@ -29,9 +34,6 @@ config.parse_defaults()
|
||||
|
||||
repositories = base.get_repositories()
|
||||
|
||||
# Add other plugins
|
||||
repositories.update(base.get_plugins('autocomplete, easybib, wordpress'))
|
||||
|
||||
# Add other repositories
|
||||
if config.check_option("module", "builder"):
|
||||
repositories['document-builder-package'] = [False, False]
|
||||
|
||||
@ -39,8 +39,6 @@ config.parse_defaults()
|
||||
|
||||
repositories = base.get_repositories()
|
||||
|
||||
# Add other plugins
|
||||
repositories.update(base.get_plugins('autocomplete, easybib, glavred, wordpress'))
|
||||
# Add other repositories
|
||||
repositories['core-ext'] = [True, False]
|
||||
|
||||
|
||||
@ -64,7 +64,11 @@ def make(args = []):
|
||||
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
|
||||
|
||||
base.print_info('Build modules')
|
||||
base.cmd_in_dir('../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
|
||||
if ("linux" == platform):
|
||||
base.cmd_in_dir('../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
|
||||
else:
|
||||
base.cmd_in_dir('../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0', '--sql-type', 'mysql', '--db-port', '3306', '--db-user', 'root', '--db-pass', 'onlyoffice'] + args)
|
||||
|
||||
base.cmd_in_dir('../../', 'python', ['make.py'])
|
||||
|
||||
run_integration_example()
|
||||
|
||||
12
scripts/package.py
Normal file
12
scripts/package.py
Normal file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import package_desktop
|
||||
import package_server
|
||||
import package_builder
|
||||
|
||||
def make(product):
|
||||
if product == 'desktop': package_desktop.make()
|
||||
elif product == 'server': package_server.make()
|
||||
elif product == 'builder': package_builder.make()
|
||||
else: exit(1)
|
||||
return
|
||||
44
scripts/package_branding.py
Normal file
44
scripts/package_branding.py
Normal file
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from package_utils import *
|
||||
|
||||
onlyoffice = True
|
||||
company_name = 'ONLYOFFICE'
|
||||
company_name_l = company_name.lower()
|
||||
publisher_name = 'Ascensio System SIA'
|
||||
cert_name = 'Ascensio System SIA'
|
||||
|
||||
if product == 'desktop':
|
||||
|
||||
if system == 'windows':
|
||||
build_dir = get_path("desktop-apps/win-linux/package/windows")
|
||||
# branding_dir = get_path(branding, build_dir)
|
||||
product_name = 'Desktop Editors'
|
||||
product_name_s = product_name.replace(' ','')
|
||||
package_name = company_name + '_' + product_name_s
|
||||
vcredist_list = ['2022', '2013']
|
||||
update_changes_list = {
|
||||
'en': "changes",
|
||||
'ru': "changes_ru"
|
||||
}
|
||||
|
||||
elif system == 'darwin':
|
||||
build_dir = "desktop-apps/macos"
|
||||
branding_build_dir = "desktop-apps/macos"
|
||||
package_name = company_name
|
||||
updates_dir = "build/update"
|
||||
changes_dir = "ONLYOFFICE/update/updates/ONLYOFFICE/changes"
|
||||
update_changes_list = {
|
||||
'en': "ReleaseNotes",
|
||||
'ru': "ReleaseNotesRU"
|
||||
}
|
||||
sparkle_base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
|
||||
|
||||
if product == 'builder':
|
||||
|
||||
if system == 'windows':
|
||||
build_dir = "document-builder-package"
|
||||
product_name = 'Document Builder'
|
||||
product_name_s = product_name.replace(' ','')
|
||||
package_name = company_name + '_' + product_name_s
|
||||
105
scripts/package_builder.py
Normal file
105
scripts/package_builder.py
Normal file
@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from package_utils import *
|
||||
from package_branding import *
|
||||
|
||||
def make():
|
||||
if system == 'windows':
|
||||
make_windows()
|
||||
elif system == 'linux':
|
||||
if 'packages' in targets:
|
||||
set_cwd(build_dir)
|
||||
log("Clean")
|
||||
cmd("make", ["clean"])
|
||||
log("Build packages")
|
||||
cmd("make", ["packages"])
|
||||
else:
|
||||
exit(1)
|
||||
return
|
||||
|
||||
#
|
||||
# Windows
|
||||
#
|
||||
|
||||
def make_windows():
|
||||
global package_version, sign, machine, arch, source_dir, base_dir, \
|
||||
innosetup_file, portable_zip_file, isxdl_file
|
||||
base_dir = "base"
|
||||
isxdl_file = "exe/scripts/isxdl/isxdl.dll"
|
||||
|
||||
set_cwd(get_abspath(git_dir, build_dir))
|
||||
|
||||
if 'clean' in targets:
|
||||
log("\n=== Clean\n")
|
||||
delete_dir(base_dir)
|
||||
delete_files(isxdl_file)
|
||||
delete_files("exe/*.exe")
|
||||
delete_files("zip/*.zip")
|
||||
|
||||
package_version = version + '.' + build
|
||||
sign = 'sign' in targets
|
||||
|
||||
for target in targets:
|
||||
if not (target.startswith('innosetup') or target.startswith('portable')):
|
||||
continue
|
||||
|
||||
machine = get_platform(target)['machine']
|
||||
arch = get_platform(target)['arch']
|
||||
suffix = arch
|
||||
source_prefix = "win_" + machine
|
||||
source_dir = get_path("%s/%s/%s/%s" % (out_dir, source_prefix, company_name_l, product_name_s))
|
||||
|
||||
log("\n=== Copy arifacts\n")
|
||||
create_dir(base_dir)
|
||||
copy_dir_content(source_dir, base_dir + '\\')
|
||||
|
||||
if target.startswith('innosetup'):
|
||||
download_isxdl()
|
||||
innosetup_file = "exe/%s_%s_%s.exe" % (package_name, package_version, suffix)
|
||||
make_innosetup()
|
||||
|
||||
if target.startswith('portable'):
|
||||
portable_zip_file = "zip/%s_%s_%s.zip" % (package_name, package_version, suffix)
|
||||
make_win_portable()
|
||||
return
|
||||
|
||||
def download_isxdl():
|
||||
log("\n=== Download isxdl\n")
|
||||
log("--- " + isxdl_file)
|
||||
if is_file(isxdl_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
create_dir(get_dirname(isxdl_file))
|
||||
download_file(isxdl_link, isxdl_file)
|
||||
return
|
||||
|
||||
def make_innosetup():
|
||||
log("\n=== Build innosetup project\n")
|
||||
iscc_args = [
|
||||
"/Qp",
|
||||
"/DVERSION=" + package_version,
|
||||
"/DARCH=" + arch
|
||||
]
|
||||
if not onlyoffice:
|
||||
iscc_args.append("/DBRANDING_DIR=" + get_abspath(git_dir, branding, build_dir, "exe"))
|
||||
if sign:
|
||||
iscc_args.append("/DSIGN")
|
||||
iscc_args.append("/Sbyparam=signtool.exe sign /v /n $q" + cert_name + "$q /t " + tsa_server + " $f")
|
||||
log("--- " + innosetup_file)
|
||||
if is_file(innosetup_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
set_cwd("exe")
|
||||
cmd("iscc", iscc_args + ["builder.iss"])
|
||||
set_cwd("..")
|
||||
return
|
||||
|
||||
def make_win_portable():
|
||||
log("\n=== Build portable\n")
|
||||
log("--- " + portable_zip_file)
|
||||
if is_file(portable_zip_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
cmd("7z", ["a", "-y", portable_zip_file, get_path(base_dir, "*")])
|
||||
return
|
||||
409
scripts/package_desktop.py
Normal file
409
scripts/package_desktop.py
Normal file
@ -0,0 +1,409 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
from package_utils import *
|
||||
from package_branding import *
|
||||
|
||||
def make():
|
||||
if system == 'windows':
|
||||
make_windows()
|
||||
elif system == 'darwin':
|
||||
make_macos()
|
||||
elif system == 'linux':
|
||||
if 'packages' in targets:
|
||||
set_cwd(build_dir)
|
||||
log("Clean")
|
||||
cmd("make", ["clean"])
|
||||
log("Build packages")
|
||||
cmd("make", ["packages"])
|
||||
else:
|
||||
exit(1)
|
||||
return
|
||||
|
||||
#
|
||||
# Windows
|
||||
#
|
||||
|
||||
def make_windows():
|
||||
global package_version, sign, machine, arch, xp, iscc_args, \
|
||||
source_dir, source_help_dir, innosetup_file, innosetup_help_file, \
|
||||
innosetup_update_file, advinst_file, portable_zip_file
|
||||
|
||||
set_cwd(get_abspath(git_dir, build_dir))
|
||||
|
||||
if 'clean' in targets:
|
||||
log("\n=== Clean\n")
|
||||
delete_dir(get_path("data/vcredist"))
|
||||
delete_dir("DesktopEditors-cache")
|
||||
delete_files("*.exe")
|
||||
delete_files("*.msi")
|
||||
delete_files("*.aic")
|
||||
delete_files("*.tmp")
|
||||
delete_files("*.zip")
|
||||
delete_files(get_path("update/*.exe"))
|
||||
delete_files(get_path("update/*.xml"))
|
||||
delete_files(get_path("update/*.html"))
|
||||
|
||||
package_version = version + '.' + build
|
||||
sign = 'sign' in targets
|
||||
|
||||
for target in targets:
|
||||
if not (target.startswith('innosetup') or target.startswith('advinst') or
|
||||
target.startswith('portable')):
|
||||
continue
|
||||
|
||||
machine = get_platform(target)['machine']
|
||||
arch = get_platform(target)['arch']
|
||||
xp = get_platform(target)['xp']
|
||||
suffix = arch + ("_xp" if xp else "")
|
||||
source_prefix = "win_" + machine + ("_xp" if xp else "")
|
||||
source_dir = get_path("%s/%s/%s/%s" % (out_dir, source_prefix, company_name_l, product_name_s))
|
||||
source_help_dir = source_dir + "-help"
|
||||
|
||||
if target.startswith('innosetup'):
|
||||
for year in vcredist_list:
|
||||
download_vcredist(year)
|
||||
|
||||
innosetup_file = "%s_%s_%s.exe" % (package_name, package_version, suffix)
|
||||
make_innosetup()
|
||||
|
||||
if 'winsparkle-update' in targets:
|
||||
innosetup_update_file = get_path("update/editors_update_%s.exe" % suffix)
|
||||
make_innosetup_update()
|
||||
|
||||
if 'winsparkle-files' in targets:
|
||||
make_winsparkle_files()
|
||||
|
||||
if target.startswith('innosetup-help'):
|
||||
innosetup_help_file = "%s_Help_%s_%s.exe" % (package_name, package_version, suffix)
|
||||
make_innosetup_help()
|
||||
|
||||
if target.startswith('advinst'):
|
||||
advinst_file = "%s_%s_%s.msi" % (package_name, package_version, suffix)
|
||||
make_advinst()
|
||||
|
||||
if target.startswith('portable'):
|
||||
portable_zip_file = "%s_%s_%s.zip" % (package_name, package_version, suffix)
|
||||
make_win_portable()
|
||||
|
||||
return
|
||||
|
||||
def download_vcredist(year):
|
||||
log("\n=== Download vcredist " + year + "\n")
|
||||
vcredist = get_path("data/vcredist/vcredist_%s_%s.exe" % (year, arch))
|
||||
log("--- " + vcredist)
|
||||
if is_file(vcredist):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
create_dir(get_dirname(vcredist))
|
||||
download_file(vcredist_links[year][machine], vcredist)
|
||||
return
|
||||
|
||||
def make_innosetup():
|
||||
log("\n=== Build innosetup project\n")
|
||||
global iscc_args
|
||||
iscc_args = [
|
||||
"/Qp",
|
||||
"/DsAppVersion=" + package_version,
|
||||
"/DDEPLOY_PATH=" + source_dir,
|
||||
"/D_ARCH=" + machine
|
||||
]
|
||||
if onlyoffice:
|
||||
iscc_args.append("/D_ONLYOFFICE=1")
|
||||
else:
|
||||
iscc_args.append("/DsBrandingFolder=" + get_abspath(git_dir, branding_dir))
|
||||
if xp:
|
||||
iscc_args.append("/D_WIN_XP=1")
|
||||
if sign:
|
||||
iscc_args.append("/DENABLE_SIGNING=1")
|
||||
iscc_args.append("/Sbyparam=signtool.exe sign /v /n $q" + cert_name + "$q /t " + tsa_server + " $f")
|
||||
log("--- " + innosetup_file)
|
||||
if is_file(innosetup_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
cmd("iscc", iscc_args + ["common.iss"])
|
||||
return
|
||||
|
||||
def make_innosetup_help():
|
||||
log("\n=== Build innosetup help project\n")
|
||||
global iscc_args
|
||||
iscc_args = [
|
||||
"/Qp",
|
||||
"/DsAppVersion=" + package_version,
|
||||
"/DDEPLOY_PATH=" + source_help_dir,
|
||||
"/D_ARCH=" + machine
|
||||
]
|
||||
if onlyoffice:
|
||||
iscc_args.append("/D_ONLYOFFICE=1")
|
||||
else:
|
||||
iscc_args.append("/DsBrandingFolder=" + get_abspath(git_dir, branding_dir))
|
||||
if sign:
|
||||
iscc_args.append("/DENABLE_SIGNING=1")
|
||||
iscc_args.append("/Sbyparam=signtool.exe sign /v /n $q" + cert_name + "$q /t " + tsa_server + " $f")
|
||||
log("--- " + innosetup_help_file)
|
||||
if is_file(innosetup_help_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
cmd("iscc", iscc_args + ["help.iss"])
|
||||
return
|
||||
|
||||
def make_innosetup_update():
|
||||
log("\n=== Build innosetup update project\n")
|
||||
log("--- " + innosetup_update_file)
|
||||
if is_file(innosetup_update_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
cmd("iscc", iscc_args + ["/DTARGET_NAME=" + innosetup_file, "update_common.iss"])
|
||||
return
|
||||
|
||||
def make_winsparkle_files():
|
||||
log("\n=== Build winsparkle files\n")
|
||||
|
||||
awk_branding = "update/branding.awk"
|
||||
if not onlyoffice:
|
||||
build_branding_dir = get_abspath(git_dir, branding_dir, "win-linux/package/windows")
|
||||
else:
|
||||
build_branding_dir = get_path(".")
|
||||
awk_args = [
|
||||
"-v", "Version=" + version,
|
||||
"-v", "Build=" + build,
|
||||
"-v", "Branch=" + get_env("RELEASE_BRANCH"),
|
||||
"-v", "Timestamp=" + timestamp,
|
||||
"-i", get_path(build_branding_dir, awk_branding)
|
||||
]
|
||||
|
||||
appcast = get_path("update/appcast.xml")
|
||||
log("--- " + appcast)
|
||||
if is_file(appcast):
|
||||
log("! file exist, skip")
|
||||
else:
|
||||
command = "env LANG=en_US.UTF-8 awk " + \
|
||||
' '.join(awk_args) + " -f update/appcast.xml.awk"
|
||||
appcast_result = proc_open(command)
|
||||
if appcast_result['stderr'] != "":
|
||||
log("! error: " + appcast_result['stderr'])
|
||||
write_file(appcast, appcast_result['stdout'])
|
||||
|
||||
appcast_prod = get_path("update/appcast-prod.xml")
|
||||
log("--- " + appcast_prod)
|
||||
if is_file(appcast_prod):
|
||||
log("! file exist, skip")
|
||||
else:
|
||||
command = "env LANG=en_US.UTF-8 awk -v Prod=1 " + \
|
||||
' '.join(awk_args) + " -f update/appcast.xml.awk"
|
||||
appcast_result = proc_open(command)
|
||||
if appcast_result['stderr'] != "":
|
||||
log("! error: " + appcast_result['stderr'])
|
||||
write_file(appcast_prod, appcast_result['stdout'])
|
||||
|
||||
changes_dir = get_path(build_branding_dir, "update/changes", version)
|
||||
for lang, base in update_changes_list.items():
|
||||
changes = get_path("update/" + base + ".html")
|
||||
if lang == 'en': encoding = 'en_US.UTF-8'
|
||||
elif lang == 'ru': encoding = 'ru_RU.UTF-8'
|
||||
log("--- " + changes)
|
||||
if is_file(changes):
|
||||
log("! file exist, skip")
|
||||
else:
|
||||
command = "env LANG=" + encoding + " awk " + ' '.join(awk_args) + \
|
||||
" -f update\\changes.html.awk " + changes_dir + "\\" + lang + ".html"
|
||||
changes_result = proc_open(command)
|
||||
if changes_result['stderr'] != "":
|
||||
log("! error: " + changes_result['stderr'])
|
||||
write_file(changes, changes_result['stdout'])
|
||||
return
|
||||
|
||||
def make_advinst():
|
||||
log("\n=== Build advanced installer project\n")
|
||||
log("--- " + advinst_file)
|
||||
if is_file(advinst_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
if not onlyoffice:
|
||||
branding_path = get_abspath(git_dir, branding_dir)
|
||||
copy_dir_content(
|
||||
branding_path + "\\win-linux\\package\\windows\\data", "data", ".bmp")
|
||||
copy_dir_content(
|
||||
branding_path + "\\win-linux\\package\\windows\\data", "data", ".png")
|
||||
copy_dir_content(
|
||||
branding_path + "\\win-linux\\extras\\projicons\\res",
|
||||
"..\\..\\extras\\projicons\\res", ".ico")
|
||||
copy_file(
|
||||
branding_path + "\\win-linux\\package\\windows\\dictionary.ail",
|
||||
"dictionary.ail")
|
||||
copy_file(
|
||||
branding_path + "\\common\\package\\license\\eula_" + branding + ".rtf",
|
||||
"..\\..\\..\\common\\package\\license\\agpl-3.0.rtf")
|
||||
copy_file(
|
||||
branding_path + "\\..\\multimedia\\videoplayer\\icons\\" + branding + ".ico",
|
||||
"..\\..\\extras\\projicons\\res\\media.ico")
|
||||
copy_file(
|
||||
branding_path + "\\..\\multimedia\\imageviewer\\icons\\ico\\" + branding + ".ico",
|
||||
"..\\..\\extras\\projicons\\res\\gallery.ico")
|
||||
aic_content = [";aic"]
|
||||
if not sign:
|
||||
aic_content += [
|
||||
"ResetSig"
|
||||
]
|
||||
if machine == '32':
|
||||
aic_content += [
|
||||
"SetPackageType x86",
|
||||
"SetAppdir -buildname DefaultBuild -path [ProgramFilesFolder][MANUFACTURER_INSTALL_FOLDER]\\[PRODUCT_INSTALL_FOLDER]",
|
||||
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x64)"',
|
||||
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x64)"'
|
||||
]
|
||||
if machine == '64':
|
||||
aic_content += [
|
||||
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x86)"',
|
||||
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x86)"'
|
||||
]
|
||||
if onlyoffice:
|
||||
aic_content += [
|
||||
"DelFolder CUSTOM_PATH"
|
||||
]
|
||||
else:
|
||||
aic_content += [
|
||||
"DelLanguage 1029 -buildname DefaultBuild",
|
||||
"DelLanguage 1031 -buildname DefaultBuild",
|
||||
"DelLanguage 1041 -buildname DefaultBuild",
|
||||
"DelLanguage 1046 -buildname DefaultBuild",
|
||||
"DelLanguage 2070 -buildname DefaultBuild",
|
||||
"DelLanguage 1060 -buildname DefaultBuild",
|
||||
"DelLanguage 1036 -buildname DefaultBuild",
|
||||
"DelLanguage 3082 -buildname DefaultBuild",
|
||||
"DelLanguage 1033 -buildname DefaultBuild",
|
||||
"NewSync CUSTOM_PATH " + source_dir + "\\..\\MediaViewer",
|
||||
"UpdateFile CUSTOM_PATH\\ImageViewer.exe " + source_dir + "\\..\\MediaViewer\\ImageViewer.exe",
|
||||
"UpdateFile CUSTOM_PATH\\VideoPlayer.exe " + source_dir + "\\..\\MediaViewer\\VideoPlayer.exe",
|
||||
"SetProperty ASCC_REG_PREFIX=" + ascc_reg_prefix
|
||||
]
|
||||
aic_content += [
|
||||
"AddOsLc -buildname DefaultBuild -arch " + arch,
|
||||
"NewSync APPDIR " + source_dir,
|
||||
"UpdateFile APPDIR\\DesktopEditors.exe " + source_dir + "\\DesktopEditors.exe",
|
||||
"SetVersion " + package_version,
|
||||
"SetPackageName " + advinst_file + " -buildname DefaultBuild",
|
||||
"Rebuild -buildslist DefaultBuild"
|
||||
]
|
||||
write_file("DesktopEditors.aic", "\r\n".join(aic_content), 'utf-8-sig')
|
||||
cmd("AdvancedInstaller.com",
|
||||
["/execute", "DesktopEditors.aip", "DesktopEditors.aic"])
|
||||
return
|
||||
|
||||
def make_win_portable():
|
||||
log("\n=== Build portable\n")
|
||||
log("--- " + portable_zip_file)
|
||||
if is_file(portable_zip_file):
|
||||
log("! file exist, skip")
|
||||
return
|
||||
cmd("7z", ["a", "-y", portable_zip_file, get_path(source_dir, "*")])
|
||||
return
|
||||
|
||||
#
|
||||
# macOS
|
||||
#
|
||||
|
||||
def make_macos():
|
||||
global suffix, lane, scheme
|
||||
|
||||
set_cwd(git_dir + "/" + branding_build_dir)
|
||||
|
||||
if 'clean' in targets:
|
||||
log("\n=== Clean\n")
|
||||
delete_dir(get_env("HOME") + "/Library/Developer/Xcode/Archives")
|
||||
delete_dir(get_env("HOME") + "/Library/Caches/Sparkle_generate_appcast")
|
||||
|
||||
for target in targets:
|
||||
if not target.startswith('diskimage'):
|
||||
continue
|
||||
|
||||
if target.startswith('diskimage'):
|
||||
if (target == 'diskimage-x86_64'): suffix = 'x86_64'
|
||||
elif (target == 'diskimage-x86_64-v8'): suffix = 'v8'
|
||||
elif (target == 'diskimage-arm64'): suffix = 'arm'
|
||||
else: exit(1)
|
||||
lane = "release_" + suffix
|
||||
scheme = package_name + '-' + suffix
|
||||
|
||||
make_diskimage(target)
|
||||
|
||||
if ('sparkle-updates' in targets):
|
||||
make_sparkle_updates()
|
||||
return
|
||||
|
||||
def make_diskimage(target):
|
||||
log("\n=== Build package " + scheme + "\n")
|
||||
log("--- build/" + package_name + ".app")
|
||||
cmd("bundler", ["exec", "fastlane", lane, "skip_git_bump:true"])
|
||||
return
|
||||
|
||||
def make_sparkle_updates():
|
||||
log("\n=== Build sparkle updates\n")
|
||||
|
||||
app_version = proc_open("/usr/libexec/PlistBuddy \
|
||||
-c 'print :CFBundleShortVersionString' \
|
||||
build/" + package_name + ".app/Contents/Info.plist")['stdout']
|
||||
zip_filename = scheme + '-' + app_version
|
||||
macos_zip = "build/" + zip_filename + ".zip"
|
||||
updates_storage_dir = "%s/%s/_updates" % (get_env('ARCHIVES_DIR'), scheme)
|
||||
create_dir(updates_dir)
|
||||
copy_dir_content(updates_storage_dir, updates_dir, ".zip")
|
||||
# copy_dir_content(updates_storage_dir, updates_dir, ".html")
|
||||
copy_file(macos_zip, updates_dir)
|
||||
|
||||
if "en" in update_changes_list:
|
||||
notes_src = "%s/%s/%s.html" % (changes_dir, app_version, update_changes_list["en"])
|
||||
notes_dst = "%s/%s.html" % (updates_dir, zip_filename)
|
||||
if is_file(notes_src):
|
||||
copy_file(notes_src, notes_dst)
|
||||
cur_date = sh_output("env LC_ALL=en_US.UTF-8 date -u \"+%B %e, %Y\"", verbose=True)
|
||||
replace_in_file(notes_dst,
|
||||
r"(<span class=\"releasedate\">).+(</span>)",
|
||||
"\\1 - " + cur_date + "\\2")
|
||||
else:
|
||||
write_file(notes_dst, '<html></html>\n')
|
||||
|
||||
if "ru" in update_changes_list:
|
||||
notes_src = "%s/%s/%s.html" % (changes_dir, app_version, update_changes_list["ru"])
|
||||
if update_changes_list["ru"] != "ReleaseNotes":
|
||||
notes_dst = "%s/%s.ru.html" % (updates_dir, zip_filename)
|
||||
else:
|
||||
notes_dst = "%s/%s.html" % (updates_dir, zip_filename)
|
||||
if is_file(notes_src):
|
||||
copy_file(notes_src, notes_dst)
|
||||
cur_date = sh_output("env LC_ALL=ru_RU.UTF-8 date -u \"+%e %B %Y\"", verbose=True)
|
||||
replace_in_file(notes_dst,
|
||||
r"(<span class=\"releasedate\">).+(</span>)",
|
||||
"\\1 - " + cur_date + "\\2")
|
||||
else:
|
||||
write_file(notes_dst, '<html></html>\n')
|
||||
|
||||
sparkle_download_url = "%s/%s/updates/" % (sparkle_base_url, suffix)
|
||||
sparkle_release_notes_url = "%s/%s/updates/changes/%s/" % (sparkle_base_url, suffix, app_version)
|
||||
cmd(git_dir + "/" + build_dir + "/Vendor/Sparkle/bin/generate_appcast", [
|
||||
updates_dir,
|
||||
"--download-url-prefix", sparkle_download_url,
|
||||
"--release-notes-url-prefix", sparkle_release_notes_url
|
||||
])
|
||||
|
||||
log("\n=== Edit Sparkle appcast links\n")
|
||||
appcast_url = sparkle_base_url + "/" + suffix
|
||||
appcast = "%s/%s.xml" % (updates_dir, package_name.lower())
|
||||
|
||||
for lang, base in update_changes_list.items():
|
||||
if base == "ReleaseNotes":
|
||||
replace_in_file(appcast,
|
||||
r'(<sparkle:releaseNotesLink>.+/).+(\.html</sparkle:releaseNotesLink>)',
|
||||
"\\1" + base + "\\2")
|
||||
else:
|
||||
replace_in_file(appcast,
|
||||
r'(<sparkle:releaseNotesLink xml:lang="' + lang + r'">).+(\.html</sparkle:releaseNotesLink>)',
|
||||
"\\1" + sparkle_release_notes_url + base + "\\2")
|
||||
|
||||
log("\n=== Delete unnecessary files\n")
|
||||
for file in os.listdir(updates_dir):
|
||||
if (-1 == file.find(app_version)) and (file.endswith(".zip") or
|
||||
file.endswith(".html")):
|
||||
delete_file(updates_dir + '/' + file)
|
||||
return
|
||||
25
scripts/package_server.py
Normal file
25
scripts/package_server.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import base
|
||||
import os
|
||||
|
||||
def make(platform, targets):
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
package_dir = os.path.abspath(git_dir + "/document-server-package")
|
||||
|
||||
if ("windows" == platform) or ("linux" == platform):
|
||||
|
||||
if ("packages" in targets):
|
||||
|
||||
print("Make clean")
|
||||
base.cmd_in_dir(package_dir, "make", ["clean"])
|
||||
|
||||
print("Make packages")
|
||||
base.cmd_in_dir(package_dir, "make", ["packages"])
|
||||
|
||||
else:
|
||||
|
||||
exit(1)
|
||||
|
||||
return
|
||||
287
scripts/package_utils.py
Normal file
287
scripts/package_utils.py
Normal file
@ -0,0 +1,287 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import argparse
|
||||
import codecs
|
||||
import glob
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import base
|
||||
|
||||
def parse():
|
||||
parser = argparse.ArgumentParser(description="Build packages.")
|
||||
parser.add_argument('-P', '--product', dest='product', type=str,
|
||||
action='store', help="Defines product")
|
||||
parser.add_argument('-S', '--system', dest='system', type=str,
|
||||
action='store', help="Defines system")
|
||||
parser.add_argument('-R', '--branding', dest='branding', type=str,
|
||||
action='store', help="Provides branding path")
|
||||
parser.add_argument('-V', '--version', dest='version', type=str,
|
||||
action='store', help="Defines version")
|
||||
parser.add_argument('-B', '--build', dest='build', type=str,
|
||||
action='store', help="Defines build")
|
||||
parser.add_argument('-T', '--targets', dest='targets', type=str, nargs='+',
|
||||
action='store', help="Defines targets")
|
||||
args = parser.parse_args()
|
||||
|
||||
global product, system, targets, version, build, branding, sign, clean
|
||||
product = args.product
|
||||
system = args.system if (args.system is not None) else host_platform()
|
||||
targets = args.targets
|
||||
version = args.version if (args.version is not None) else get_env('PRODUCT_VERSION', '0.0.0')
|
||||
build = args.build if (args.build is not None) else get_env('BUILD_NUMBER', '0')
|
||||
branding = args.branding
|
||||
return
|
||||
|
||||
def host_platform():
|
||||
return platform.system().lower()
|
||||
|
||||
def log(string, end='\n', bold=False):
|
||||
if bold:
|
||||
out = '\033[1m' + string + '\033[0m' + end
|
||||
else:
|
||||
out = string + end
|
||||
sys.stdout.write(out)
|
||||
sys.stdout.flush()
|
||||
return
|
||||
|
||||
def get_env(name, default=''):
|
||||
return os.getenv(name, default)
|
||||
|
||||
def set_env(name, value):
|
||||
os.environ[name] = value
|
||||
return
|
||||
|
||||
def set_cwd(dir):
|
||||
log("- change working dir: " + dir)
|
||||
os.chdir(dir)
|
||||
return
|
||||
|
||||
def get_path(*paths):
|
||||
arr = []
|
||||
for path in paths:
|
||||
if host_platform() == 'windows':
|
||||
arr += path.split('/')
|
||||
else:
|
||||
arr += [path]
|
||||
return os.path.join(*arr)
|
||||
|
||||
def get_abspath(*paths):
|
||||
arr = []
|
||||
for path in paths:
|
||||
arr += path.split('/')
|
||||
return os.path.abspath(os.path.join(*arr))
|
||||
|
||||
def is_file(path):
|
||||
return os.path.isfile(path)
|
||||
|
||||
def is_dir(path):
|
||||
return os.path.isdir(path)
|
||||
|
||||
def is_exist(path):
|
||||
if os.path.exists(path):
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_dirname(path):
|
||||
return os.path.dirname(path)
|
||||
|
||||
def create_dir(path):
|
||||
log("- create dir: " + path)
|
||||
if not is_exist(path):
|
||||
os.makedirs(path)
|
||||
else:
|
||||
log("! dir exist")
|
||||
return
|
||||
|
||||
def write_file(path, data, encoding='utf-8'):
|
||||
if is_file(path):
|
||||
delete_file(path)
|
||||
log("- write file: " + path)
|
||||
with codecs.open(path, 'w', encoding) as file:
|
||||
file.write(data)
|
||||
return
|
||||
|
||||
def write_template(src, dst, encoding='utf-8', **kwargs):
|
||||
template = Template(open(src).read())
|
||||
if is_file(dst):
|
||||
os.remove(dst)
|
||||
log("- write template: " + dst + " < " + src)
|
||||
with codecs.open(dst, 'w', encoding) as file:
|
||||
file.write(template.render(**kwargs))
|
||||
return
|
||||
|
||||
def replace_in_file(path, pattern, textReplace, encoding='utf-8'):
|
||||
log("- replace in file: " + path + \
|
||||
"\n pattern: " + pattern + \
|
||||
"\n replace: " + textReplace)
|
||||
filedata = ""
|
||||
with codecs.open(get_path(path), "r", encoding) as file:
|
||||
filedata = file.read()
|
||||
filedata = re.sub(pattern, textReplace, filedata)
|
||||
delete_file(path)
|
||||
with codecs.open(get_path(path), "w", encoding) as file:
|
||||
file.write(filedata)
|
||||
return
|
||||
|
||||
def copy_file(src, dst):
|
||||
log("- copy file: " + dst + " < " + src)
|
||||
if is_file(dst):
|
||||
delete_file(dst)
|
||||
if not is_file(src):
|
||||
log("! file not exist: " + src)
|
||||
return
|
||||
return shutil.copy2(get_path(src), get_path(dst))
|
||||
|
||||
def copy_files(src, dst, override=True):
|
||||
log("- copy files: " + dst + " < " + src)
|
||||
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):
|
||||
copy_file(file, dst)
|
||||
elif is_dir(file):
|
||||
if not is_dir(dst + "/" + file_name):
|
||||
create_dir(dst + "/" + file_name)
|
||||
copy_files(file + "/*", dst + "/" + file_name, override)
|
||||
return
|
||||
|
||||
def copy_dir(src, dst):
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
try:
|
||||
shutil.copytree(get_path(src), get_path(dst))
|
||||
except OSError as e:
|
||||
log('! Directory not copied. Error: %s' % e)
|
||||
return
|
||||
|
||||
def copy_dir_content(src, dst, filterInclude = "", filterExclude = ""):
|
||||
log("- copy dir content: " + src + " " + dst + " " + filterInclude + " " + filterExclude)
|
||||
src_folder = src
|
||||
if ("/" != src[-1:]):
|
||||
src_folder += "/"
|
||||
src_folder += "*"
|
||||
for file in glob.glob(src_folder):
|
||||
basename = os.path.basename(file)
|
||||
if ("" != filterInclude) and (-1 == basename.find(filterInclude)):
|
||||
continue
|
||||
if ("" != filterExclude) and (-1 != basename.find(filterExclude)):
|
||||
continue
|
||||
if is_file(file):
|
||||
copy_file(file, dst)
|
||||
elif is_dir(file):
|
||||
copy_dir(file, dst + "/" + basename)
|
||||
return
|
||||
|
||||
def delete_file(path):
|
||||
log("- delete file: " + path)
|
||||
if not is_file(path):
|
||||
log("! file not exist")
|
||||
return
|
||||
return os.remove(path)
|
||||
|
||||
def delete_dir(path):
|
||||
log("- delete dir: " + path)
|
||||
if not is_dir(path):
|
||||
log("! dir not exist")
|
||||
return
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
return
|
||||
|
||||
def delete_files(src):
|
||||
for path in glob.glob(src):
|
||||
if is_file(path):
|
||||
delete_file(path)
|
||||
elif is_dir(path):
|
||||
delete_dir(path)
|
||||
return
|
||||
|
||||
def download_file(url, path):
|
||||
log("- download file: " + path + " < " + url)
|
||||
if is_file(path):
|
||||
os.remove(path)
|
||||
powershell(["Invoke-WebRequest", url, "-OutFile", path])
|
||||
return
|
||||
|
||||
def proc_open(command):
|
||||
log("- open process: " + command)
|
||||
popen = subprocess.Popen(command, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, shell=True)
|
||||
ret = {'stdout' : '', 'stderr' : ''}
|
||||
try:
|
||||
stdout, stderr = popen.communicate()
|
||||
popen.wait()
|
||||
ret['stdout'] = stdout.strip().decode('utf-8', errors='ignore')
|
||||
ret['stderr'] = stderr.strip().decode('utf-8', errors='ignore')
|
||||
finally:
|
||||
popen.stdout.close()
|
||||
popen.stderr.close()
|
||||
return ret
|
||||
|
||||
def cmd(prog, args=[], is_no_errors=False):
|
||||
log("- cmd: " + prog + " " + ' '.join(args))
|
||||
ret = 0
|
||||
if host_platform() == 'windows':
|
||||
sub_args = args[:]
|
||||
sub_args.insert(0, get_path(prog))
|
||||
ret = subprocess.call(sub_args, stderr=subprocess.STDOUT, shell=True)
|
||||
else:
|
||||
command = prog
|
||||
for arg in args:
|
||||
command += (" \"%s\"" % arg)
|
||||
ret = subprocess.call(command, stderr=subprocess.STDOUT, shell=True)
|
||||
if ret != 0 and True != is_no_errors:
|
||||
sys.exit("! error (" + prog + "): " + str(ret))
|
||||
return ret
|
||||
|
||||
def powershell(cmd):
|
||||
log("- pwsh: " + ' '.join(cmd))
|
||||
ret = subprocess.call(['powershell', '-Command'] + cmd,
|
||||
stderr=subprocess.STDOUT, shell=True)
|
||||
if ret != 0:
|
||||
sys.exit("! error: " + str(ret))
|
||||
return ret
|
||||
|
||||
def sh_output(command, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- sh output: " + command)
|
||||
ret = subprocess.check_output(
|
||||
command, stderr=subprocess.STDOUT, shell=True
|
||||
)
|
||||
return ret.decode("utf-8").strip()
|
||||
|
||||
def get_platform(target):
|
||||
xp = (-1 != target.find('-xp'))
|
||||
if (-1 != target.find('-x64')):
|
||||
return {'machine': "64", 'arch': "x64", 'xp': xp}
|
||||
elif (-1 != target.find('-x86')):
|
||||
return {'machine': "32", 'arch': "x86", 'xp': xp}
|
||||
return
|
||||
|
||||
global git_dir, out_dir, tsa_server, vcredist_links
|
||||
git_dir = get_abspath(get_dirname(__file__), '../..')
|
||||
out_dir = get_abspath(get_dirname(__file__), '../out')
|
||||
timestamp = "%.f" % time.time()
|
||||
tsa_server = "http://timestamp.digicert.com"
|
||||
vcredist_links = {
|
||||
'2022': {
|
||||
'64': "https://aka.ms/vs/17/release/vc_redist.x64.exe",
|
||||
'32': "https://aka.ms/vs/17/release/vc_redist.x86.exe"
|
||||
},
|
||||
'2015': {
|
||||
'64': "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe",
|
||||
'32': "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe"
|
||||
},
|
||||
'2013': {
|
||||
'64': "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe",
|
||||
'32': "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe"
|
||||
}
|
||||
}
|
||||
isxdl_link = "https://raw.githubusercontent.com/jrsoftware/ispack/is-5_6_1/isxdlfiles/isxdl.dll"
|
||||
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import packages_desktop
|
||||
# import packages_server
|
||||
# import packages_builder
|
||||
|
||||
def make(product, package_list):
|
||||
if ("desktop" == product):
|
||||
packages_desktop.make(package_list.split())
|
||||
# if ("server" == product):
|
||||
# packages_server.make(package_list.split())
|
||||
# if ("builder" == product):
|
||||
# packages_builder.make(package_list.split())
|
||||
return
|
||||
@ -1,77 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import base
|
||||
import os
|
||||
import re
|
||||
|
||||
def make(packages):
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
|
||||
for package in packages:
|
||||
|
||||
if -1 != package.find("diskimage"):
|
||||
macos_dir = os.path.abspath(git_dir + "/desktop-apps/macos")
|
||||
update_dir = macos_dir + "/build/update"
|
||||
changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes"
|
||||
|
||||
if (package == "diskimage-x86_64"):
|
||||
lane = "release_x86_64"
|
||||
scheme = "ONLYOFFICE-x86_64"
|
||||
elif (package == "diskimage-v8-x86_64"):
|
||||
lane = "release_v8"
|
||||
scheme = "ONLYOFFICE-v8"
|
||||
elif (package == "diskimage-arm64"):
|
||||
lane = "release_arm"
|
||||
scheme = "ONLYOFFICE-arm"
|
||||
else:
|
||||
exit(1)
|
||||
|
||||
print("Build package " + scheme)
|
||||
|
||||
print("$ bundler exec fastlane " + lane + " skip_git_bump:true")
|
||||
base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", lane, "skip_git_bump:true"])
|
||||
|
||||
print("Build updates")
|
||||
|
||||
app_version = base.run_command("/usr/libexec/PlistBuddy -c 'print :CFBundleShortVersionString' " +
|
||||
macos_dir + "/build/ONLYOFFICE.app/Contents/Info.plist")['stdout']
|
||||
macos_zip = macos_dir + "/build/" + scheme + "-" + app_version + ".zip"
|
||||
update_storage_dir = base.get_env("ARCHIVES_DIR") + "/" + scheme + "/_updates"
|
||||
|
||||
base.create_dir(update_dir)
|
||||
base.copy_dir_content(update_storage_dir, update_dir, ".zip")
|
||||
base.copy_file(macos_zip, update_dir)
|
||||
for file in os.listdir(update_dir):
|
||||
if file.endswith(".zip"):
|
||||
zip_name = os.path.splitext(file)[0]
|
||||
zip_ver = os.path.splitext(file)[0].split("-")[-1]
|
||||
base.copy_file(changes_dir + "/" + zip_ver + "/ReleaseNotes.html", update_dir + "/" + zip_name + ".html")
|
||||
base.copy_file(changes_dir + "/" + zip_ver + "/ReleaseNotesRU.html", update_dir + "/" + zip_name + ".ru.html")
|
||||
|
||||
print("$ ./generate_appcast " + update_dir)
|
||||
base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast", [update_dir])
|
||||
|
||||
print("Edit Sparkle appcast links")
|
||||
|
||||
sparkle_base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
|
||||
if (package == "diskimage-x86_64"): sparkle_base_url += "/x86_64"
|
||||
elif (package == "diskimage-v8-x86_64"): sparkle_base_url += "/v8"
|
||||
elif (package == "diskimage-arm64"): sparkle_base_url += "/arm"
|
||||
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE-(?:x86|x86_64|v8|arm)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
|
||||
"\\1" + sparkle_base_url + "/updates/changes/\\2/ReleaseNotes.html\\3")
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE-(?:x86|x86_64|v8|arm)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
|
||||
"\\1" + sparkle_base_url + "/updates/changes/\\2/ReleaseNotesRU.html\\3")
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(url=\")(?:.+/)(ONLYOFFICE.+\")", "\\1" + sparkle_base_url + "/updates/\\2")
|
||||
|
||||
print("Delete unnecessary files")
|
||||
|
||||
for file in os.listdir(update_dir):
|
||||
if (-1 == file.find(app_version)) and (file.endswith(".zip") or file.endswith(".html")):
|
||||
base.delete_file(update_dir + "/" + file)
|
||||
|
||||
return
|
||||
26
tools/common/README.md
Normal file
26
tools/common/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
## Overview
|
||||
|
||||
**change_autor.py** is a tool for change autor and last modifiend in all documents in folder.
|
||||
|
||||
## How to use
|
||||
|
||||
1. Place the files to be changed in a folder, e.g. **input**.
|
||||
2. Create a folder in which the modified files will be stored, e.g. **output**.
|
||||
3. Call the file *change_autor.py* as shown below.
|
||||
|
||||
```bash
|
||||
change_autor.py path_to_input_folder path_to_output_folder new_author_name
|
||||
```
|
||||
|
||||
________________________
|
||||
**convert_directory.py** is a tool to convert all files in the directory to the specified format.
|
||||
|
||||
## How to use
|
||||
|
||||
1. Place the files to be changed in a folder, e.g. **input**.
|
||||
2. Create a folder in which the converted files will be stored, e.g. **output**.
|
||||
3. Call the file *convert_directory.py* as shown below.
|
||||
|
||||
```bash
|
||||
convert_directory.py path_to_builder_directory path_to_input_folder path_to_output_folder format_ext
|
||||
```
|
||||
86
tools/common/change_autor.py
Normal file
86
tools/common/change_autor.py
Normal file
@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import shutil
|
||||
|
||||
params = sys.argv[1:]
|
||||
|
||||
if (3 > len(params)):
|
||||
print("use: change_autor.py path_to_input_files_directory path_to_output_files_directory author_name")
|
||||
exit(0)
|
||||
|
||||
cur_path = os.getcwd()
|
||||
base.configure_common_apps()
|
||||
|
||||
directory_input = params[0].replace("\\", "/")
|
||||
directory_output = params[1].replace("\\", "/")
|
||||
author_name = params[2]
|
||||
|
||||
input_files = []
|
||||
for file in glob.glob(os.path.join(u"" + directory_input, u'*')):
|
||||
input_files.append(file.replace("\\", "/"))
|
||||
|
||||
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
|
||||
|
||||
def change_author_name(file_dist, output_file, author_name):
|
||||
app = "7za" if ("mac" == base.host_platform()) else "7z"
|
||||
base.cmd_exe(app, ["x", "-y", file_dist, "-o" + temp_dir, "docProps\\core.xml", "-r"])
|
||||
|
||||
with open(temp_dir + "/docProps/core.xml", 'r') as file:
|
||||
data = file.read()
|
||||
|
||||
creator_open = "<dc:creator>"
|
||||
creator_close = "</dc:creator>"
|
||||
open_tag_pos = data.find(creator_open)
|
||||
if open_tag_pos == -1:
|
||||
creator_close_to_find = "<dc:creator/>"
|
||||
else:
|
||||
creator_close_to_find = "</dc:creator>"
|
||||
close_tag_pos = data.find(creator_close_to_find)
|
||||
last_tag_pos = data.find("</cp:coreProperties>")
|
||||
|
||||
if open_tag_pos != -1 and close_tag_pos != - 1:
|
||||
data = data[:open_tag_pos + len(creator_open)] + author_name + data[close_tag_pos:]
|
||||
elif close_tag_pos != - 1:
|
||||
data = data[:close_tag_pos] + creator_open + author_name + creator_close + data[close_tag_pos + len(creator_close_to_find):]
|
||||
else:
|
||||
data = data[:last_tag_pos] + creator_open + author_name + creator_close + data[last_tag_pos:]
|
||||
|
||||
lastModified_open = "<cp:lastModifiedBy>"
|
||||
lastModified_close = "</cp:lastModifiedBy>"
|
||||
open_tag_pos = data.find(lastModified_open)
|
||||
if open_tag_pos == -1:
|
||||
lastModified_close_to_find = "<cp:lastModifiedBy/>"
|
||||
else:
|
||||
lastModified_close_to_find = "</cp:lastModifiedBy>"
|
||||
close_tag_pos = data.find(lastModified_close_to_find)
|
||||
last_tag_pos = data.find("</cp:coreProperties>")
|
||||
|
||||
if open_tag_pos != -1 and close_tag_pos != - 1:
|
||||
data = data[:open_tag_pos + len(lastModified_open)] + author_name + data[close_tag_pos:]
|
||||
elif close_tag_pos != - 1:
|
||||
data = data[:close_tag_pos] + lastModified_open + author_name + lastModified_close + data[close_tag_pos + len(lastModified_close_to_find):]
|
||||
else:
|
||||
data = data[:last_tag_pos] + lastModified_open + author_name + lastModified_close + data[last_tag_pos:]
|
||||
|
||||
with open(temp_dir + "/docProps/core.xml", 'w') as file:
|
||||
file.write(data)
|
||||
|
||||
shutil.copyfile(file_dist, output_file)
|
||||
base.cmd_exe(app, ["a", "-r", output_file, temp_dir + "\\docProps"])
|
||||
|
||||
output_len = len(input_files)
|
||||
output_cur = 1
|
||||
for input_file in input_files:
|
||||
if base.is_dir(temp_dir):
|
||||
base.delete_dir(temp_dir)
|
||||
base.create_dir(temp_dir)
|
||||
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
|
||||
output_file = os.path.join(directory_output, os.path.splitext(os.path.basename(input_file))[0]) + u"." + input_file.split(".")[-1]
|
||||
change_author_name(input_file, output_file, author_name)
|
||||
base.delete_dir(temp_dir)
|
||||
output_cur += 1
|
||||
29
tools/common/convert.py
Normal file
29
tools/common/convert.py
Normal file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import convert_common
|
||||
|
||||
params = sys.argv[1:]
|
||||
|
||||
if (3 > len(params)):
|
||||
print("use: convert.py path_to_builder_directory path_to_input_file path_to_output_file [params]")
|
||||
exit(0)
|
||||
|
||||
base.configure_common_apps()
|
||||
|
||||
directory_x2t = params[0].replace("\\", "/")
|
||||
file_input = params[1].replace("\\", "/")
|
||||
file_output = params[2].replace("\\", "/")
|
||||
convert_params = ""
|
||||
if 4 == len(params):
|
||||
convert_params = params[3]
|
||||
|
||||
directory_fonts = directory_x2t + "/sdkjs/common"
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js"):
|
||||
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
|
||||
|
||||
convert_common.convertFile(directory_x2t, file_input, file_output, convert_params)
|
||||
153
tools/common/convert_common.py
Normal file
153
tools/common/convert_common.py
Normal file
@ -0,0 +1,153 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT = 0x0040
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0001
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0002
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0003
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0004
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0005
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0006
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0007
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0008
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2 = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0009
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000a
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000b
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000c
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000d
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT_FLAT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000e
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_OTT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000f
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC_FLAT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0010
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX_FLAT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0011
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML_IN_CONTAINER = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0012
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX_PACKAGE = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0014
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0015
|
||||
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCXF = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0016
|
||||
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION = 0x0080
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0001
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0002
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0003
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0004
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0005
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSM = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0006
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0007
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0008
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP_FLAT = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0009
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_OTP = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000a
|
||||
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX_PACKAGE = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000b
|
||||
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET = 0x0100
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0001
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0002
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0003
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0004
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0005
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0006
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0007
|
||||
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSB = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0008
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0009
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000a
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_FLAT = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000b
|
||||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_PACKAGE = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000c
|
||||
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM = 0x0200
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SWF = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0002
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0003
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0004
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SVG = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0005
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0006
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRMenu = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0007
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRCanvas = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0008
|
||||
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDFA = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0009
|
||||
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE = 0x0400
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_JPG = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0001
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_TIFF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0002
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_TGA = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0003
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_GIF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0004
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_PNG = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0005
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_EMF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0006
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_WMF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0007
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_BMP = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0008
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_CR2 = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0009
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_PCX = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000a
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_RAS = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000b
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_PSD = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000c
|
||||
AVS_OFFICESTUDIO_FILE_IMAGE_ICO = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000d
|
||||
|
||||
EXT_TO_FORMAT = {
|
||||
"docx" : AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX,
|
||||
"docxf" : AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCXF,
|
||||
"oform" : AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM,
|
||||
"dotx" : AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX,
|
||||
"odt" : AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT,
|
||||
"ott" : AVS_OFFICESTUDIO_FILE_DOCUMENT_OTT,
|
||||
"rtf" : AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF,
|
||||
"txt" : AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT,
|
||||
"html" : AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML,
|
||||
"xlsx" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX,
|
||||
"xltx" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX,
|
||||
"ods" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS,
|
||||
"ots" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS,
|
||||
"csv" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV,
|
||||
"pptx" : AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX,
|
||||
"potx" : AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX,
|
||||
"odp" : AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP,
|
||||
"otp" : AVS_OFFICESTUDIO_FILE_PRESENTATION_OTP,
|
||||
"pdf" : AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF,
|
||||
"fb2" : AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2,
|
||||
"epub" : AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB,
|
||||
"png" : AVS_OFFICESTUDIO_FILE_IMAGE_PNG,
|
||||
"jpg" : AVS_OFFICESTUDIO_FILE_IMAGE_JPG
|
||||
}
|
||||
|
||||
def getFormatByExt(ext):
|
||||
format = 0
|
||||
try:
|
||||
format = EXT_TO_FORMAT[ext]
|
||||
except KeyError as e:
|
||||
raise ValueError('Undefined format: {}'.format(e.args[0]))
|
||||
return format
|
||||
|
||||
def getFormatByFile(file_path):
|
||||
ext = file_path.split(".")[-1]
|
||||
return getFormatByExt(ext)
|
||||
|
||||
def convertFile(directory_x2t, file_input, file_output, convert_params):
|
||||
cur_path = os.getcwd()
|
||||
|
||||
directory_fonts = directory_x2t + "/sdkjs/common"
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js"):
|
||||
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
|
||||
|
||||
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
|
||||
if base.is_dir(temp_dir):
|
||||
base.delete_dir(temp_dir)
|
||||
base.create_dir(temp_dir)
|
||||
|
||||
xml_convert = u"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||
xml_convert += u"<TaskQueueDataConvert>"
|
||||
xml_convert += (u"<m_sFileFrom>" + escape(file_input) + u"</m_sFileFrom>")
|
||||
xml_convert += (u"<m_sFileTo>" + escape(file_output) + u"</m_sFileTo>")
|
||||
xml_convert += u"<m_nFormatTo>" + str(getFormatByFile(file_output)) + u"</m_nFormatTo>"
|
||||
xml_convert += (u"<m_sAllFontsPath>" + directory_fonts + u"/AllFonts.js</m_sAllFontsPath>")
|
||||
xml_convert += (u"<m_sFontDir>" + directory_fonts + "</m_sFontDir>")
|
||||
xml_convert += u"<m_sJsonParams>{"spreadsheetLayout":{"fitToWidth":1,"fitToHeight":1}}</m_sJsonParams>"
|
||||
xml_convert += u"<m_nDoctParams>1</m_nDoctParams>"
|
||||
xml_convert += convert_params
|
||||
xml_convert += (u"<m_sTempDir>" + temp_dir + u"</m_sTempDir>")
|
||||
xml_convert += u"</TaskQueueDataConvert>"
|
||||
base.save_as_script(temp_dir + "/to.xml", [xml_convert])
|
||||
base.cmd_in_dir(directory_x2t, "x2t", [temp_dir + "/to.xml"], True)
|
||||
base.delete_dir(temp_dir)
|
||||
|
||||
os.chdir(cur_path)
|
||||
41
tools/common/convert_directory.py
Normal file
41
tools/common/convert_directory.py
Normal file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import convert_common
|
||||
|
||||
params = sys.argv[1:]
|
||||
|
||||
if (4 > len(params)):
|
||||
print("use: convert_directory.py path_to_builder_directory path_to_input_files_directory path_to_output_files_directory format_ext [convert_params]")
|
||||
exit(0)
|
||||
|
||||
cur_path = os.getcwd()
|
||||
base.configure_common_apps()
|
||||
|
||||
directory_x2t = params[0].replace("\\", "/")
|
||||
directory_input = params[1].replace("\\", "/")
|
||||
directory_output = params[2].replace("\\", "/")
|
||||
format_ext = params[3]
|
||||
convert_params = ""
|
||||
if (5 == len(params)):
|
||||
convert_params = params[4]
|
||||
|
||||
input_files = []
|
||||
for file in glob.glob(os.path.join(u"" + directory_input, u'*')):
|
||||
input_files.append(file.replace("\\", "/"))
|
||||
|
||||
directory_fonts = directory_x2t + "/sdkjs/common"
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js"):
|
||||
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
|
||||
|
||||
output_len = len(input_files)
|
||||
output_cur = 1
|
||||
for input_file in input_files:
|
||||
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
|
||||
output_file = os.path.join(directory_output, os.path.splitext(os.path.basename(input_file))[0]) + u"." + format_ext
|
||||
convert_common.convertFile(directory_x2t, input_file, output_file, convert_params)
|
||||
output_cur += 1
|
||||
80
tools/common/thumbnails.py
Normal file
80
tools/common/thumbnails.py
Normal file
@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
|
||||
params = sys.argv[1:]
|
||||
|
||||
if (5 != len(params)):
|
||||
print("use: thumbnails.py path_to_builder_directory path_to_input_files_directory path_to_output_files_directory width height")
|
||||
exit(0)
|
||||
|
||||
cur_path = os.getcwd()
|
||||
base.configure_common_apps()
|
||||
|
||||
directory_x2t = params[0].replace("\\", "/")
|
||||
directory_input = params[1].replace("\\", "/")
|
||||
directory_output = params[2].replace("\\", "/")
|
||||
th_width = params[3]
|
||||
th_height = params[4]
|
||||
|
||||
output_dir = directory_output + "/[" + str(th_width) + "x" + str(th_height) + "]"
|
||||
if base.is_dir(output_dir):
|
||||
base.delete_dir(output_dir)
|
||||
base.create_dir(output_dir)
|
||||
|
||||
input_files = []
|
||||
for file in glob.glob(os.path.join(u"" + directory_input, u'*')):
|
||||
input_files.append(file.replace("\\", "/"))
|
||||
|
||||
#print(input_files)
|
||||
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
|
||||
if base.is_dir(temp_dir):
|
||||
base.delete_dir(temp_dir)
|
||||
base.create_dir(temp_dir)
|
||||
|
||||
directory_fonts = directory_x2t + "/sdkjs/common"
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js"):
|
||||
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
|
||||
|
||||
json_params = "{'spreadsheetLayout':{'fitToWidth':1,'fitToHeight':1},"
|
||||
json_params += "'documentLayout':{'drawPlaceHolders':true,'drawFormHighlight':true,'isPrint':true}}"
|
||||
json_params = json_params.replace("'", """)
|
||||
|
||||
output_len = len(input_files)
|
||||
output_cur = 1
|
||||
for input_file in input_files:
|
||||
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
|
||||
output_file = os.path.join(output_dir, os.path.splitext(os.path.basename(input_file))[0])
|
||||
xml_convert = u"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||
xml_convert += u"<TaskQueueDataConvert>"
|
||||
xml_convert += (u"<m_sFileFrom>" + input_file + u"</m_sFileFrom>")
|
||||
xml_convert += (u"<m_sFileTo>" + output_file + u".zip</m_sFileTo>")
|
||||
xml_convert += u"<m_nFormatTo>1029</m_nFormatTo>"
|
||||
xml_convert += (u"<m_sAllFontsPath>" + directory_fonts + u"/AllFonts.js</m_sAllFontsPath>")
|
||||
xml_convert += (u"<m_sFontDir>" + directory_fonts + u"</m_sFontDir>")
|
||||
xml_convert += (u"<m_sJsonParams>" + json_params + u"</m_sJsonParams>")
|
||||
xml_convert += u"<m_nDoctParams>1</m_nDoctParams>"
|
||||
xml_convert += u"<m_oThumbnail>"
|
||||
xml_convert += u"<first>false</first>"
|
||||
if ((0 != th_width) and (0 != th_height)):
|
||||
xml_convert += u"<aspect>0</aspect>"
|
||||
xml_convert += (u"<width>" + str(th_width) + u"</width>")
|
||||
xml_convert += (u"<height>" + str(th_height) + u"</height>")
|
||||
xml_convert += u"</m_oThumbnail>"
|
||||
xml_convert += u"<m_nDoctParams>1</m_nDoctParams>"
|
||||
xml_convert += (u"<m_sTempDir>" + temp_dir + u"</m_sTempDir>")
|
||||
xml_convert += u"</TaskQueueDataConvert>"
|
||||
base.save_as_script(temp_dir + "/to.xml", [xml_convert])
|
||||
base.cmd_in_dir(directory_x2t, "x2t", [temp_dir + "/to.xml"], True)
|
||||
base.delete_dir(temp_dir)
|
||||
base.create_dir(temp_dir)
|
||||
base.extract_unicode(output_file + u".zip", output_file)
|
||||
base.delete_file(output_dir + "/" + os.path.splitext(os.path.basename(input_file))[0] + ".zip")
|
||||
output_cur += 1
|
||||
|
||||
base.delete_dir(temp_dir)
|
||||
os.chdir(cur_path)
|
||||
@ -5,6 +5,7 @@ sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
import deps
|
||||
|
||||
def get_branch_name(directory):
|
||||
cur_dir = os.getcwd()
|
||||
@ -16,86 +17,6 @@ def get_branch_name(directory):
|
||||
os.chdir(cur_dir)
|
||||
return current_branch
|
||||
|
||||
def install_deps():
|
||||
if base.is_file("./packages_complete"):
|
||||
return
|
||||
|
||||
# dependencies
|
||||
packages = ["apt-transport-https",
|
||||
"autoconf2.13",
|
||||
"build-essential",
|
||||
"ca-certificates",
|
||||
"cmake",
|
||||
"curl",
|
||||
"git",
|
||||
"glib-2.0-dev",
|
||||
"libglu1-mesa-dev",
|
||||
"libgtk-3-dev",
|
||||
"libpulse-dev",
|
||||
"libtool",
|
||||
"p7zip-full",
|
||||
"subversion",
|
||||
"gzip",
|
||||
"libasound2-dev",
|
||||
"libatspi2.0-dev",
|
||||
"libcups2-dev",
|
||||
"libdbus-1-dev",
|
||||
"libicu-dev",
|
||||
"libglu1-mesa-dev",
|
||||
"libgstreamer1.0-dev",
|
||||
"libgstreamer-plugins-base1.0-dev",
|
||||
"libx11-xcb-dev",
|
||||
"libxcb*",
|
||||
"libxi-dev",
|
||||
"libxrender-dev",
|
||||
"libxss1",
|
||||
"libncurses5"]
|
||||
|
||||
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
|
||||
|
||||
# nodejs
|
||||
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"])
|
||||
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
|
||||
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"):
|
||||
@ -137,7 +58,7 @@ def install_qt():
|
||||
|
||||
if not base.is_file("./node_js_setup_10.x"):
|
||||
print("install dependencies...")
|
||||
install_deps()
|
||||
deps.install_deps()
|
||||
|
||||
if not base.is_dir("./qt_build"):
|
||||
print("install qt...")
|
||||
@ -147,6 +68,7 @@ branch = get_branch_name("../..")
|
||||
|
||||
array_args = sys.argv[1:]
|
||||
array_modules = []
|
||||
params = []
|
||||
|
||||
config = {}
|
||||
for arg in array_args:
|
||||
@ -154,6 +76,8 @@ for arg in array_args:
|
||||
indexEq = arg.find("=")
|
||||
if (-1 != indexEq):
|
||||
config[arg[2:indexEq]] = arg[indexEq + 1:]
|
||||
params.append(arg[:indexEq])
|
||||
params.append(arg[indexEq + 1:])
|
||||
else:
|
||||
array_modules.append(arg)
|
||||
|
||||
@ -175,7 +99,7 @@ print("---------------------------------------------")
|
||||
build_tools_params = ["--branch", branch,
|
||||
"--module", modules,
|
||||
"--update", "1",
|
||||
"--qt-dir", os.getcwd() + "/qt_build/Qt-5.9.9"]
|
||||
"--qt-dir", os.getcwd() + "/qt_build/Qt-5.9.9"] + params
|
||||
|
||||
base.cmd_in_dir("../..", "./configure.py", build_tools_params)
|
||||
base.cmd_in_dir("../..", "./make.py")
|
||||
|
||||
9
tools/linux/check_system/check.sh
Executable file
9
tools/linux/check_system/check.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
DIR_X2T=$SCRIPTPATH/..
|
||||
$("$DIR_X2T/x2t" &>/dev/null)
|
||||
status=$?
|
||||
|
||||
[ $status -ne 88 ] && $(cp "$SCRIPTPATH/libstdc++.so.6" "$DIR_X2T/libstdc++.so.6")
|
||||
|
||||
BIN
tools/linux/check_system/libstdc++.so.6
Normal file
BIN
tools/linux/check_system/libstdc++.so.6
Normal file
Binary file not shown.
91
tools/linux/deps.py
Executable file
91
tools/linux/deps.py
Executable file
@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def install_deps():
|
||||
if base.is_file("./packages_complete"):
|
||||
return
|
||||
|
||||
# dependencies
|
||||
packages = ["apt-transport-https",
|
||||
"autoconf2.13",
|
||||
"build-essential",
|
||||
"ca-certificates",
|
||||
"cmake",
|
||||
"curl",
|
||||
"git",
|
||||
"glib-2.0-dev",
|
||||
"libglu1-mesa-dev",
|
||||
"libgtk-3-dev",
|
||||
"libpulse-dev",
|
||||
"libtool",
|
||||
"p7zip-full",
|
||||
"subversion",
|
||||
"gzip",
|
||||
"libasound2-dev",
|
||||
"libatspi2.0-dev",
|
||||
"libcups2-dev",
|
||||
"libdbus-1-dev",
|
||||
"libicu-dev",
|
||||
"libglu1-mesa-dev",
|
||||
"libgstreamer1.0-dev",
|
||||
"libgstreamer-plugins-base1.0-dev",
|
||||
"libx11-xcb-dev",
|
||||
"libxcb*",
|
||||
"libxi-dev",
|
||||
"libxrender-dev",
|
||||
"libxss1",
|
||||
"libncurses5"]
|
||||
|
||||
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
|
||||
|
||||
# nodejs
|
||||
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"])
|
||||
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
|
||||
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
|
||||
|
||||
if __name__ == "__main__":
|
||||
install_deps()
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
--- index.js
|
||||
+++ index.js
|
||||
@@ -101,18 +101,11 @@
|
||||
|
||||
function nodeNC(port, input) {
|
||||
const src = nodeNetCatSrc(port, input);
|
||||
- if (src.length < 1000) {
|
||||
- return spawnSync(process.execPath, ['-e', src], {
|
||||
- windowsHide: true,
|
||||
- maxBuffer: Infinity,
|
||||
- });
|
||||
- } else {
|
||||
return spawnSync(process.execPath, [], {
|
||||
input: src,
|
||||
windowsHide: true,
|
||||
maxBuffer: Infinity,
|
||||
});
|
||||
- }
|
||||
}
|
||||
|
||||
function test(fn, port) {
|
||||
Reference in New Issue
Block a user