Compare commits

...

82 Commits

Author SHA1 Message Date
1a35214b2b Merge branch hotfix/v6.3.1 into master 2021-07-15 13:01:08 +00:00
e93317ebb2 Add packages branding (#342) 2021-06-30 15:07:07 +03:00
8381ef6c24 Merge branch hotfix/v6.3.1 into master 2021-06-08 11:50:57 +00:00
d5bf7cff40 Merge pull request #328 from ONLYOFFICE/fix/buildOnWindows
Fix build on windows
2021-06-04 11:20:43 +03:00
a00f198a33 Fix build on windows 2021-06-04 11:20:02 +03:00
3d9870e8a3 Add macOS x86 package build (#326) 2021-05-31 15:44:30 +03:00
070c77f11a Merge pull request #327 from ONLYOFFICE/fix/turnOfGcModule
Turn off gc.js module. it works inside server.js
2021-05-31 13:17:06 +03:00
b34e11cfdf Turn off gc.js module. it works inside server.js 2021-05-31 12:53:51 +03:00
25a453fa1e Merge pull request #325 from ONLYOFFICE/fix/ubuntu14
Fix compile on ubuntu14
2021-05-28 19:04:56 +03:00
830b01114a Fix compile on ubuntu14 2021-05-28 19:04:08 +03:00
48f2d54676 Merge pull request #324 from ONLYOFFICE/fix/issue-rake
Fix rake build task if there is no archive old previous version present
2021-05-28 18:51:33 +03:00
c3ab2959bd Merge pull request #323 from ONLYOFFICE/fix/handle-python2
Install both python2 and python3
2021-05-28 18:51:12 +03:00
4e5fe85e6d Fix rake build task if there is no archive old previous version present 2021-05-28 18:42:07 +03:00
730b2e5adb Install both python2 and python3
`build_tools` are not require python2, but it use
Google Build tools to build v8 and those tools are still require
python2

This changes allow correctly build our product on all systems starting
from Ubuntu 14.04 and until Ubuntu 20.04 including Debian 10
2021-05-28 18:32:10 +03:00
5217b7c342 Merge pull request #321 from ONLYOFFICE/ShockwaveNN-patch-1
Fix forgotten `-y` flag for installation confirmation
2021-05-28 10:27:46 +03:00
ee22cbca1b Fix forgotten -y flag for installation confirmation 2021-05-28 10:27:03 +03:00
c1e21f9884 Merge pull request #320 from ONLYOFFICE/fix/buildOnDiffLinux
Fix build in Debian 10
2021-05-27 20:48:17 +03:00
74a6da2f57 Fix build in Debian 10 2021-05-27 20:42:58 +03:00
c25c28333a [run] Fix (#319)
Fix running-document-server task
2021-05-26 17:05:48 +03:00
fc80745b8d Fix macOS build [2] (#318)
* Fix macOS build

* Fix variable app_version
2021-05-25 16:52:18 +03:00
b361128ec4 Fix macOS build (#317) 2021-05-25 14:59:12 +03:00
fa7dfa2e96 Fix macOS appcast (#316)
* Fix version detection

* Fix urls

* Newlines

* Rename variable
2021-05-24 18:30:59 +03:00
bb58688b49 Merge branch release/v6.3.0 into master 2021-05-20 11:55:10 +00:00
676b519f46 Editing macOS appcast (#313)
* Copy changes html for appcast

* Fix version

* Replace urls in onlyoffice.xml

* File deletion refactoring
2021-05-19 18:34:38 +03:00
626a121eb0 Fix android build (#312) 2021-05-18 17:55:58 +03:00
c89a54ccf4 Merge pull request #309 from ONLYOFFICE/fix/qtPluginPDB
Remove .pdb files from qt plugins in deploy forder
2021-05-12 11:12:30 +03:00
23a7b9cc87 Remove .pdb files from qt plugins in deploy forder 2021-05-12 11:11:35 +03:00
351192378d Merge pull request #307 from apritcha1/master
Update Qt 5.9.9 link
2021-05-11 10:22:41 +03:00
aa978f56d1 Update Qt 5.9.9 link 2021-05-07 17:20:17 -05:00
df98984a40 Merge branch hotfix/v6.2.2 into release/v6.3.0 2021-05-07 13:03:05 +00:00
1af7d31285 Add fastlane param (#303) 2021-05-06 14:53:30 +03:00
3942c2f69a Add macOS package build (#300) 2021-05-05 15:19:57 +03:00
8c93a0ebae Merge pull request #299 from ONLYOFFICE/feature/refactoring-macsdk-path
Refactoring set paths of macos sdk
2021-05-05 11:34:22 +03:00
e9359c86d2 Refactoring set paths of macos sdk 2021-05-05 11:33:37 +03:00
afde46bbae Merge pull request #296 from ONLYOFFICE/fix/changeDefaultJSEngine
Change script for v8 building
2021-05-04 11:34:38 +03:00
ee9fed8fe8 Change script for v8 building 2021-05-04 11:37:01 +03:00
68a2eb8742 Merge pull request #294 from ONLYOFFICE/fix/buildXcodeSdk11.3
Fix v8 build on new xcode sdk
2021-05-04 00:09:27 +03:00
d582343874 Fix v8 build on new xcode sdk 2021-05-04 00:08:44 +03:00
ac071bd62b Merge pull request #292 from ONLYOFFICE/fix/buildOnMacArm64
Fix build on mac arm64
2021-05-03 14:24:29 +03:00
b6260f100a Fix build on mac arm64 2021-05-03 14:23:39 +03:00
0fb4a31c3c Fix scripts/develop/dependence.py (#284) 2021-04-06 14:27:34 +03:00
407db1a1ae Merge branch hotfix/v6.2.1 into release/v6.3.0 2021-03-31 11:12:32 +00:00
2abdf201df [release] Fix 2021-03-22 12:13:50 +03:00
8a61529d41 Merge branch release/v6.2.0 into release/v6.3.0 2021-03-19 07:50:50 +00:00
cf5b322852 [release] Protect
Add protect branches
2021-03-15 19:09:48 +03:00
42ac2b9907 [develop] Spell
Disable install and run server spellcheck
2021-03-15 14:22:43 +03:00
917165cc86 [release] Check
Add check gh install and auth
2021-03-09 13:22:30 +03:00
12c18895e9 [release] Check
Add check gh install and auth
2021-03-09 13:20:42 +03:00
832147f4d2 [release] Use gh
Use gh instead of the hub
2021-03-09 13:07:17 +03:00
a9ad740efe [release] Message
Change message
2021-03-04 16:06:20 +03:00
0b33ff68bf Merge branch 'master' into release/v6.3.0 2021-03-04 16:05:11 +03:00
d685720dd6 Add "graphics" dependence to epub library 2021-03-02 18:15:21 +03:00
c305cf4684 Merge pull request #267 from ONLYOFFICE/feature/localspellcheck
hunspell build
2021-03-02 13:21:14 +03:00
f254b46efc hunspell build 2021-03-01 10:01:22 +03:00
b627457c98 fix qt_copy_plugin
add qt_dst_postfix
2021-02-25 11:25:04 +03:00
a739db1854 Deploy qt debug libs instead release in debug builds 2021-02-25 09:30:05 +03:00
5631c9825e Correct run_as_bat function 2021-02-17 18:23:45 +03:00
11487b4fd2 Fixes 2021-02-15 14:49:06 +03:00
7bb5eba0ea Add fetch submodules 2021-02-08 14:51:19 +03:00
284b7e2f90 Merge pull request #261 from ONLYOFFICE/feature/mac_arm64
Feature/mac arm64
2021-02-05 16:08:57 +03:00
b3b23e4d47 Merge branch hotfix/v6.1.1 into develop 2021-01-28 08:01:13 +00:00
f09cd28ba3 . 2021-01-07 10:29:40 +03:00
7cd507d023 . 2021-01-06 20:59:45 +03:00
68cfbf067d . 2021-01-06 20:47:04 +03:00
9538741b11 . 2021-01-06 20:01:48 +03:00
7219c65dcb . 2021-01-06 18:59:29 +03:00
938019d26f . 2021-01-06 00:49:41 +03:00
c4b81dc438 build core for apple silicon 2021-01-06 00:36:02 +03:00
46bbbd1bc0 [run] Start
Disable Redis for mac os for all run
2020-12-30 17:15:01 +03:00
bb690328a8 Merge branch release/v6.1.0 into develop 2020-12-24 07:35:42 +00:00
5e7b22b6d7 [spellchecker] Fix (#247) 2020-12-21 11:06:45 +03:00
4a4e8b7568 Merge pull request #241 from ONLYOFFICE/release/v6.2.0
Release/v6.2.0
2020-12-13 22:11:41 +03:00
26ce05f76c Fix check dependencies 2020-12-10 14:58:11 +03:00
1f3f801124 Merge pull request #237 from ONLYOFFICE/fix/fixScript
Fix script
2020-12-10 13:30:25 +03:00
63a6ecd17f Fix 2020-12-10 13:28:26 +03:00
55448fcb73 Merge pull request #236 from ONLYOFFICE/fix/fixesScripts
Fixes
2020-12-10 13:04:30 +03:00
6364de594f Fixes 2020-12-10 13:03:07 +03:00
dd8145083e Merge branch hotfix/v6.0.2 into develop 2020-12-07 14:20:50 +00:00
d17eec062c Merge pull request #229 from ONLYOFFICE/release/v6.1.0
[ios] Removed limitation in version numbering. https://developer.appl…
2020-12-07 15:05:53 +03:00
22d8c377df fix scripts (#225)
* Fix
2020-12-03 16:47:38 +03:00
ad12cc9a54 Merge pull request #226 from ONLYOFFICE/release/v6.2.0
Release/v6.2.0
2020-12-03 16:20:26 +03:00
baee5f58b8 Merge pull request #223 from ONLYOFFICE/release/v6.2.0
Release/v6.2.0
2020-12-03 00:15:36 +03:00
26 changed files with 687 additions and 112 deletions

View File

@ -4,9 +4,10 @@ ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get -y update && \
apt-get -y install python3 \
apt-get -y install python \
python3 \
sudo
RUN rm /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python
ADD . /build_tools
WORKDIR /build_tools

View File

@ -2,8 +2,9 @@
desc 'Cleanup old build files'
task :clean do
archive_name_pattern = 'build_tools*.tar.gz'
sh('sudo rm -rf out')
sh('rm build_tools*.tar.gz')
sh("rm #{archive_name_pattern}") unless Dir.glob(archive_name_pattern).empty?
end
desc 'Build version anew'

View File

@ -267,8 +267,8 @@ epubfile.makefile = $$CORE_ROOT_DIR/EpubFile/Makefile.EpubFile$$PRO_SUF
}
desktop {
hunspell.file = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/hunspell.pro
hunspell.makefile = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/Makefile.hunspell$$PRO_SUFFIX
hunspell.file = $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro
hunspell.makefile = $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/Makefile.hunspell$$PRO_SUFFIX
ooxmlsignature.file = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro
ooxmlsignature.makefile = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/Makefile.ooxmlsignature$$PRO_SUFFIX
@ -353,4 +353,4 @@ desktop {
xlsformat \
fb2file \
epubfile
}
}

12
make.py
View File

@ -13,13 +13,13 @@ import build_js
import build_server
import deploy
import make_common
import config_server as develop_config_server
import dependence
import develop
# parse configuration
config.parse()
base_dir = base.get_script_dir(__file__)
base.set_env("BUILD_PLATFORM", config.option("platform"))
# branding
@ -59,13 +59,7 @@ if ("1" == config.option("update")):
base.configure_common_apps()
# developing...
if ("1" == config.option("develop")):
if not dependence.check_dependencies():
exit(1)
build_server.build_server_develop()
build_js.build_js_develop(base_dir + "/..")
develop_config_server.make()
exit(0)
develop.make();
# check only js builds
if ("1" == base.get_env("OO_ONLY_BUILD_JS")):

34
make_packages.py Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env python
import sys
sys.path.append('scripts')
sys.path.append('scripts/develop')
sys.path.append('scripts/develop/vendor')
sys.path.append('scripts/core_common')
sys.path.append('scripts/core_common/modules')
import config
import base
import packages
# parse configuration
config.parse()
base_dir = base.get_script_dir(__file__)
base.set_env("BUILD_PLATFORM", config.option("platform"))
# branding
if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("branding")):
branding_dir = base_dir + "/../" + config.option("branding")
if base.is_file(branding_dir + "/build_tools/make_packages.py"):
base.check_build_version(branding_dir + "/build_tools")
base.set_env("OO_RUNNING_BRANDING", "1")
base.set_env("OO_BRANDING", config.option("branding"))
base.cmd_in_dir(branding_dir + "/build_tools", "python", ["make_packages.py"])
exit(0)
base.check_build_version(base_dir)
# build packages
packages.make()

View File

@ -328,11 +328,29 @@ def run_command(sCommand):
return result
def run_command_in_dir(directory, sCommand):
dir = get_path(directory)
cur_dir = os.getcwd()
os.chdir(dir)
host = host_platform()
if (host == 'windows'):
dir = get_path(directory)
cur_dir = os.getcwd()
os.chdir(dir)
ret = run_command(sCommand)
os.chdir(cur_dir)
if (host == 'windows'):
os.chdir(cur_dir)
return ret
def exec_command_in_dir(directory, sCommand):
host = host_platform()
if (host == 'windows'):
dir = get_path(directory)
cur_dir = os.getcwd()
os.chdir(dir)
ret = os.system(sCommand)
if (host == 'windows'):
os.chdir(cur_dir)
return ret
def run_process(args=[]):
@ -390,8 +408,10 @@ def git_update(repo, is_no_errors=False, is_current_dir=False):
print("branch does not exist...")
print("switching to master...")
cmd("git", ["checkout", "-f", "master"])
cmd("git", ["submodule", "update", "--init", "--recursive"], True)
if (0 != config.option("branch").find("tags/")):
cmd("git", ["pull"], False if ("1" != config.option("update-light")) else True)
cmd("git", ["submodule", "update", "--recursive", "--remote"], True)
os.chdir(old_cur)
return
@ -445,7 +465,7 @@ def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=Fa
if "" != run_command("git log origin/" + branch_to + "..origin/" + branch_from)["stdout"]:
cmd("git", ["checkout", "-f", branch_to], is_no_errors)
cmd("git", ["pull"], is_no_errors)
cmd("hub", ["pull-request", "--force", "--base", branch_to, "--head", branch_from, "--message", "Merge from " + branch_from + " to " + branch_to], is_no_errors)
cmd("gh", ["pr", "create", "--base", branch_to, "--head", branch_from, "--title", "Merge branch " + branch_from + " to " + branch_to, "--body", ""], is_no_errors)
if 0 != cmd("git", ["merge", "origin/" + branch_from, "--no-ff", "--no-edit"], is_no_errors):
print_error("[git] Conflicts merge " + "origin/" + branch_from + " to " + branch_to + " in repo " + url)
cmd("git", ["merge", "--abort"], is_no_errors)
@ -501,6 +521,8 @@ def qt_config(platform):
config_param += " iphoneos device"
if (-1 == config_param_lower.find("debug")):
config_param += " release"
if ("mac_arm64" == platform):
config_param += " apple_silicon use_javascript_core"
return config_param
def qt_major_version():
@ -510,7 +532,10 @@ def qt_major_version():
def qt_copy_lib(lib, dir):
qt_dir = get_env("QT_DEPLOY")
if ("windows" == host_platform()):
copy_lib(qt_dir, dir, lib)
if ("" == qt_dst_postfix()):
copy_lib(qt_dir, dir, lib)
else:
copy_lib(qt_dir, dir, lib + "d")
else:
copy_file(qt_dir + "/../lib/lib" + lib + ".so." + qt_version(), dir + "/lib" + lib + ".so." + qt_major_version())
return
@ -550,8 +575,12 @@ def qt_copy_plugin(name, out):
for file in glob.glob(out + "/" + name + "/*d.dll"):
fileCheck = file[0:-5] + ".dll"
if is_file(fileCheck):
delete_file(file)
if ("" == qt_dst_postfix()):
delete_file(file)
else:
delete_file(fileCheck)
for file in glob.glob(out + "/" + name + "/*.pdb"):
delete_file(file)
return
def qt_dst_postfix():
@ -822,13 +851,16 @@ def vcvarsall_end():
return
def run_as_bat(lines, is_no_errors=False):
name = "tmp.bat"
name = "tmp.bat" if ("windows" == host_platform()) else "./tmp.sh"
content = "\n".join(lines)
file = codecs.open(name, "w", "utf-8")
file.write(content)
file.close()
if ("windows" != host_platform()):
os.system("chmod +x " + name)
cmd(name, [], is_no_errors)
delete_file(name)
return
@ -886,7 +918,7 @@ def mac_correct_rpath_x2t(dir):
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2"])
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2", "graphics"])
mac_correct_rpath_library("Fb2File", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("HtmlRenderer", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("PdfWriter", ["UnicodeConverter", "kernel", "graphics"])
@ -1049,3 +1081,23 @@ def hack_xcode_ios():
with open(get_path(qmake_spec_file), "w") as file:
file.write(filedata)
return
def find_mac_sdk_version():
sdk_dir = run_command("xcode-select -print-path")['stdout']
sdk_dir = os.path.join(sdk_dir, "Platforms/MacOSX.platform/Developer/SDKs")
sdks = [re.findall('^MacOSX(1\d\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
sdks = [s[0] for s in sdks if s]
return sdks[0]
def find_mac_sdk():
return run_command("xcrun --sdk macosx --show-sdk-path")['stdout']
def get_mac_sdk_version_number():
ver = find_mac_sdk_version()
ver_arr = ver.split(".")
if 0 == len(ver_arr):
return 0
if 1 == len(ver_arr):
return 1000 * int(ver_arr[0])
return 1000 * int(ver_arr[0]) + int(ver_arr[1])

View File

@ -26,7 +26,7 @@ def parse():
global platforms
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
"linux_64", "linux_32",
"mac_64",
"mac_64", "mac_arm64",
"ios",
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]

View File

@ -13,6 +13,7 @@ import icu
import openssl
import v8
import html2
import hunspell
def make():
boost.make()
@ -21,4 +22,5 @@ def make():
openssl.make()
v8.make()
html2.make()
hunspell.make(False)
return

View File

@ -68,12 +68,12 @@ def make():
if ("windows" == base.host_platform()):
win_toolset = "msvc-14.0"
if (-1 != config.option("platform").find("win_64")) and not base.is_dir("../build/win_64"):
base.cmd("bootstrap.bat")
base.cmd("bootstrap.bat", ["vc14"])
base.cmd("b2.exe", ["headers"])
base.cmd("b2.exe", ["--clean"])
base.cmd("b2.exe", ["--prefix=./../build/win_64", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=64", "install"])
if (-1 != config.option("platform").find("win_32")) and not base.is_dir("../build/win_32"):
base.cmd("bootstrap.bat")
base.cmd("bootstrap.bat", ["vc14"])
base.cmd("b2.exe", ["headers"])
base.cmd("b2.exe", ["--clean"])
base.cmd("b2.exe", ["--prefix=./../build/win_32", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=32", "install"])
@ -87,13 +87,6 @@ def make():
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC", "install"])
# TODO: support x86
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
clang_correct()
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
base.cmd("./b2", ["headers"])
base.cmd("./b2", ["--clean"])
base.cmd("./b2", ["--prefix=./../build/mac_64", "link=static", "install"])
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios"):
clang_correct()
os.chdir("../")
@ -102,6 +95,20 @@ def make():
if (-1 != config.option("platform").find("android")) and not base.is_dir("../build/android"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"])
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_64")
directory_build = base_dir + "/build/mac_64/lib"
base.delete_file(directory_build + "/libboost_system.a")
base.delete_file(directory_build + "/libboost_system.dylib")
base.copy_files(directory_build + "/mac_64/*.a", directory_build)
if (-1 != config.option("platform").find("mac_arm64")) and not base.is_dir("../build/mac_arm64"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_arm64")
directory_build = base_dir + "/build/mac_arm64/lib"
base.delete_file(directory_build + "/libboost_system.a")
base.delete_file(directory_build + "/libboost_system.dylib")
base.copy_files(directory_build + "/mac_arm64/*.a", directory_build)
os.chdir(old_cur)
return

View File

@ -7,12 +7,12 @@ import base
import os
import build
def make(src_dir, modules):
def make(src_dir, modules, build_platform="android"):
old_cur = os.getcwd()
print("boost-headers...")
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
base.cmd("./b2", ["--prefix=./../build/android", "headers", "install"])
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install"])
for module in modules:
print("boost-module: " + module + " ...")
@ -40,7 +40,7 @@ def make(src_dir, modules):
pro_file_content.append("")
pro_file_content.append("SOURCES += $$files($$PWD/src/*.cpp, true)")
pro_file_content.append("")
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/" + build_platform + "/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content)
build.make_pro_file(module_dir + "/makefiles", module_dir + "/" + module + ".pro")

View File

@ -0,0 +1,171 @@
import sys
sys.path.append('../../../scripts')
import base
import os
def make(build_js = True):
old_cur_dir = os.getcwd()
#fetch libhunspell
print("[fetch & build]: hunspell")
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/hunspell"
os.chdir(base_dir)
if not base.is_dir("hunspell"):
last_stable_commit = "8a2fdfe5a6bb1cbafc04b0c8486abcefd17ad903"
repo_path = "https://github.com/hunspell/hunspell.git"
base.cmd("git", ["clone", repo_path])
os.chdir("hunspell")
base.cmd("git", ["checkout", last_stable_commit])
base.replaceInFile("./src/hunspell/filemgr.hxx", "FileMgr& operator=(const FileMgr&);", "FileMgr& operator=(const FileMgr&); \n"
+" #ifdef HUNSPELL_WASM_MODULE \n char* memory;size_t index;size_t size; \n #endif") #custon filemgr support watch filemgr_wrapper_new.cxx
os.chdir("../")
if not build_js:
os.chdir(old_cur_dir)
return
base.configure_common_apps()
# remove previous version
if base.is_dir("./deploy"):
base.delete_dir("./deploy")
base.create_dir("./deploy")
base.create_dir("./deploy/spell")
# fetch emsdk
command_prefix = "" if ("windows" == base.host_platform()) else "./"
if not base.is_dir("emsdk"):
base.cmd("git", ["clone", "https://github.com/emscripten-core/emsdk.git"])
os.chdir("emsdk")
base.cmd(command_prefix + "emsdk", ["install", "latest"])
base.cmd(command_prefix + "emsdk", ["activate", "latest"])
os.chdir("../")
# compile
compiler_flags = ["-o spell.js",
"-O3",
"-fno-exceptions",
"-fno-rtti",
"-s WASM=1",
"-s ALLOW_MEMORY_GROWTH=1",
"-s FILESYSTEM=0",
"-s ENVIRONMENT='web,worker'"]
exported_functions = ["_malloc",
"_free",
"_Spellchecker_Malloc",
"_Spellchecker_Free",
"_Spellchecker_Create",
"_Spellchecker_Destroy",
"_Spellchecker_AddDictionary",
"_Spellchecker_RemoveDicrionary",
"_Spellchecker_Load",
"_Spellchecker_Spell",
"_Spellchecker_Suggest",
"_Spellchecker_RemoveEngine",
"_Spellchecker_TotalAllocatedMemory"]
version_hunspell = 17
libhunspell_src_path = "./hunspell/src/hunspell"
input_sources = ["affentry.cxx",
"affixmgr.cxx",
"csutil.cxx",
"dictmgr.cxx",
"hashmgr.cxx",
"hunspell.cxx",
"hunzip.cxx",
"phonet.cxx",
"replist.cxx",
"suggestmgr.cxx"]
sources = []
for item in input_sources:
if base.is_file(libhunspell_src_path + "/" + item):
sources.append(libhunspell_src_path + "/" + item)
if (13 == version_hunspell):
sources.append("./wasm/src/filemgr_wrapper.cxx")
else:
sources.append("./wasm/src/filemgr_wrapper_new.cxx")
sources.append("./wasm/src/base.cpp")
compiler_flags.append("-I" + libhunspell_src_path)
compiler_flags.append("-DWIN32 -DNDEBUG -DHUNSPELL_STATIC -DBUILDING_LIBHUNSPELL -DHUNSPELL_WASM_MODULE")
# arguments
arguments = ""
for item in compiler_flags:
arguments += (item + " ")
arguments += "-s EXPORTED_FUNCTIONS=\"["
for item in exported_functions:
arguments += ("'" + item + "',")
arguments = arguments[:-1]
arguments += "]\" "
for item in sources:
arguments += (item + " ")
# command
windows_bat = []
if (base.host_platform() == "windows"):
windows_bat.append("call emsdk/emsdk_env.bat")
windows_bat.append("call emcc " + arguments)
else:
windows_bat.append("#!/bin/bash")
windows_bat.append("source ./emsdk/emsdk_env.sh")
windows_bat.append("emcc " + arguments)
base.run_as_bat(windows_bat)
# finalize
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
spell_js_content = base.readFile("./spell.js")
engine_base_js_content = base.readFile("./wasm/js/spell.js")
engine_js_content = engine_base_js_content.replace("//module", spell_js_content)
# write new version
base.writeFile("./deploy/spell/spell.js", engine_js_content)
base.copy_file("spell.wasm", "./deploy/spell/spell.wasm")
# ie asm version
arguments = arguments.replace("WASM=1", "WASM=0")
# command
windows_bat = []
if (base.host_platform() == "windows"):
windows_bat.append("call emsdk/emsdk_env.bat")
windows_bat.append("call emcc " + arguments)
else:
windows_bat.append("#!/bin/bash")
windows_bat.append("source ./emsdk/emsdk_env.sh")
windows_bat.append("emcc " + arguments)
base.run_as_bat(windows_bat)
# finalize
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
spell_js_content = base.readFile("./spell.js")
engine_base_js_content = base.readFile("./wasm/js/spell.js")
engine_base_js_polyfill = base.readFile("./wasm/js/polyfill.js")
engine_js_content = engine_base_js_polyfill + "\n\n" + engine_base_js_content.replace("//module", spell_js_content)
# write new version
base.writeFile("./deploy/spell/spell_ie.js", engine_js_content)
base.copy_file("spell.js.mem", "./deploy/spell/spell.js.mem")
base.copy_file("./wasm/js/code.js", "./deploy/spell.js")
base.copy_file("./wasm/js/index.html", "./deploy/index.html")
base.delete_file("spell.js")
base.delete_file("spell.js.mem")
os.chdir(old_cur_dir)
if __name__ == '__main__':
# manual compile
make(True)

View File

@ -67,10 +67,12 @@ def make():
if (-1 != config.option("platform").find("ios")):
if not base.is_dir("build"):
base.bash("./icu_ios")
elif (platform == "mac_64") and not base.is_dir(platform + "/build"):
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
elif ("" != platform) and not base.is_dir(platform + "/build"):
base.create_dir(platform)
os.chdir("icu/source")
base.cmd("./runConfigureICU", ["Linux" if "linux" == base.host_platform() else "MacOSX"])
base.cmd("./runConfigureICU", ["Linux"])
old_dest_dir = base.get_env("DESTDIR")
base.set_env("DESTDIR", base_dir + "/" + platform)
base.cmd("make", ["install"])
@ -83,9 +85,6 @@ def make():
if ("linux_64" == platform):
base.copy_file("icu/source/lib/libicudata.so." + icu_major + "." + icu_minor, platform + "/build/libicudata.so." + icu_major)
base.copy_file("icu/source/lib/libicuuc.so." + icu_major + "." + icu_minor, platform + "/build/libicuuc.so." + icu_major)
elif ("mac_64" == platform):
base.copy_file("icu/source/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicudata." + icu_major + ".dylib")
base.copy_file("icu/source/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicuuc." + icu_major + ".dylib")
os.chdir(old_cur)
return

View File

@ -0,0 +1,96 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import base
import os
def change_icu_defs(current_dir, arch):
icudef_file = current_dir + "/icudefs.mk"
icudef_file_old = current_dir + "/icudefs.mk.back"
param = "-arch x86_64"
if arch == "arm64":
param = "-arch arm64 -isysroot " + base.find_mac_sdk()
base.copy_file(icudef_file, icudef_file_old)
base.replaceInFile(icudef_file, "CFLAGS = ", "CFLAGS = " + param + " ")
base.replaceInFile(icudef_file, "CXXFLAGS = ", "CXXFLAGS = " + param + " ")
base.replaceInFile(icudef_file, "RPATHLDFLAGS =", "RPATHLDFLAGS2 =")
base.replaceInFile(icudef_file, "LDFLAGS = ", "LDFLAGS = " + param + " ")
base.replaceInFile(icudef_file, "RPATHLDFLAGS2 =", "RPATHLDFLAGS =")
return
def restore_icu_defs(current_dir):
icudef_file = current_dir + "/icudefs.mk"
icudef_file_old = current_dir + "/icudefs.mk.back"
base.delete_file(icudef_file)
base.copy_file(icudef_file_old, icudef_file)
base.delete_file(icudef_file_old)
return
icu_major = "58"
icu_minor = "2"
current_dir_old = os.getcwd()
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
os.chdir(current_dir)
if not base.is_dir(current_dir + "/mac_cross_64"):
base.create_dir(current_dir + "/mac_cross_64")
os.chdir(current_dir + "/mac_cross_64")
base.cmd("../icu/source/runConfigureICU", ["MacOSX",
"--prefix=" + current_dir + "/mac_cross_64", "CFLAGS=-Os CXXFLAGS=--std=c++11"])
change_icu_defs(current_dir + "/mac_cross_64", "x86_64")
base.cmd("make", ["-j4"])
base.cmd("make", ["install"], True)
restore_icu_defs(current_dir + "/mac_cross_64")
os.chdir(current_dir)
os.chdir(current_dir + "/icu/source")
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm_64",
"--with-cross-build=" + current_dir + "/mac_cross_64", "VERBOSE=1"])
change_icu_defs(current_dir + "/icu/source", "arm64")
base.cmd("make", ["-j4"])
base.cmd("make", ["install"])
restore_icu_defs(current_dir + "/icu/source")
os.chdir(current_dir)
if base.is_dir(current_dir + "/mac_64"):
base.delete_dir(current_dir + "/mac_64")
if base.is_dir(current_dir + "/mac_arm64"):
base.delete_dir(current_dir + "/mac_arm64")
base.create_dir(current_dir + "/mac_64")
base.create_dir(current_dir + "/mac_64/build")
base.create_dir(current_dir + "/mac_arm64")
base.create_dir(current_dir + "/mac_arm64/build")
base.copy_dir(current_dir + "/mac_cross_64/include", current_dir + "/mac_64/build/include")
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
base.copy_dir(current_dir + "/mac_arm_64/include", current_dir + "/mac_arm64/build/include")
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
base.delete_dir(current_dir + "/mac_cross_64")
base.delete_dir(current_dir + "/mac_arm_64")
os.chdir(current_dir_old)

View File

@ -83,7 +83,25 @@ def make():
# TODO: support x86
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
base.cmd("./config", ["no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-x86_64-cc", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
base.cmd("make", ["build_libs", "install"])
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_arm64"):
os.chdir(base_dir)
base.cmd("git", ["clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git", "openssl2"])
os.chdir(base_dir + "/openssl2")
replace1 = "\"darwin64-x86_64-cc\" => {"
replace2 = "\"darwin64-arm64-cc\" => {\n\
inherit_from => [ \"darwin-common\", asm(\"aarch64_asm\") ],\n\
CFLAGS => add(\"-Wall\"),\n\
cflags => add(\"-arch arm64 -isysroot " + base.find_mac_sdk() + "\"),\n\
lib_cppflags => add(\"-DL_ENDIAN\"),\n\
bn_ops => \"SIXTY_FOUR_BIT_LONG\",\n\
perlasm_scheme => \"macosx\",\n\
},\n\
\"darwin64-x86_64-cc\" => {"
base.replaceInFile(base_dir + "/openssl2/Configurations/10-main.conf", replace1, replace2)
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-arm64-cc", "--prefix=" + old_cur_dir + "/build/mac_arm64", "--openssldir=" + old_cur_dir + "/build/mac_arm64"])
base.cmd("make", ["build_libs", "install"])
os.chdir(old_cur)

View File

@ -67,6 +67,9 @@ def make():
if (-1 == config.option("platform").find("linux")) and (-1 == config.option("platform").find("mac")) and (-1 == config.option("platform").find("win")):
return
if ("mac" == base.host_platform()) and (-1 == config.option("config").find("use_v8")):
return
print("[fetch & build]: v8")
old_env = dict(os.environ)
@ -146,6 +149,11 @@ def make():
base.replaceInFile("v8/build/config/mac/mac_sdk.gni", "if (mac_sdk_version != mac_sdk_min_build_override", "if (false && mac_sdk_version != mac_sdk_min_build_override")
base.replaceInFile("v8/build/mac/find_sdk.py", "^MacOSX(10\\.\\d+)\\.sdk$", "^MacOSX(1\\d\\.\\d+)\\.sdk$")
if (11003 <= base.get_mac_sdk_version_number()):
base.copy_dir("v8/third_party/llvm-build/Release+Asserts/include", "v8/third_party/llvm-build/Release+Asserts/__include")
base.delete_dir("v8/third_party/llvm-build/Release+Asserts/include")
base.replaceInFile("v8/build/config/mac/BUILD.gn", "\"-mmacosx-version-min=$mac_deployment_target\",", "\"-mmacosx-version-min=$mac_deployment_target\",\n \"-Wno-deprecated-declarations\",")
# --------------------------------------------------------------------------
# build
os.chdir("v8")

View File

@ -72,7 +72,7 @@ def make():
if (0 == platform.find("win")):
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/doctrenderer.lib", root_dir + "/doctrenderer.lib")
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/")
else:
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/icudtl.dat")
# app

View File

@ -49,7 +49,8 @@ def make():
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", archive_dir + "/")
else:
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
if (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allfontsgen")
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allthemesgen")

View File

@ -80,7 +80,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
if (0 == platform.find("win")):
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/converter/")
else:
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat")
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")

View File

@ -106,7 +106,7 @@ def make():
if (0 == platform.find("win")):
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
else:
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat")
# builder

View File

@ -102,11 +102,11 @@ def check_dependencies():
install_args += checksResult.get_uninstall()
install_args += checksResult.get_removepath()
install_args += checksResult.get_install()
install_args[0] = './scripts/develop/' + install_args[0]
if (host_platform == 'windows'):
install_args[0] = './scripts/develop/' + install_args[0]
code = libwindows.sudo(unicode(sys.executable), install_args)
elif (host_platform == 'linux'):
base.cmd_in_dir('./scripts/develop/', 'python', install_args)
base.cmd('python', install_args, False)
get_updates()
check_npmPath()
@ -195,16 +195,19 @@ def check_java():
def get_erlang_path_to_bin():
erlangPath = ''
if (host_platform == 'windows'):
erlangPath = os.getenv("ERLANG_HOME")
if (erlangPath is not None):
erlangPath += '\\bin'
erlangPath = os.getenv("ERLANG_HOME", "")
if (erlangPath != ""):
erlangPath += "\\bin"
return erlangPath
def check_erlang():
dependence = CDependencies()
base.print_info('Check installed Erlang')
erlangBitness = base.run_command_in_dir(get_erlang_path_to_bin(), 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']
erlangBitness = ""
erlang_path_home = get_erlang_path_to_bin()
if ("" != erlang_path_home or host_platform != 'windows'):
erlangBitness = base.run_command_in_dir(erlang_path_home, 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']
if (erlangBitness == '8'):
print("Installed Erlang is valid")
return dependence
@ -384,6 +387,31 @@ def check_7z():
return dependence
def check_gh():
base.print_info('Check installed GitHub CLI')
result = base.run_command('gh --version')['stdout']
if (result == ''):
base.print_info('GitHub CLI not found')
# ToDo install
return False
base.print_info('GitHub CLI is installed')
return True
def check_gh_auth():
base.print_info('Check auth for GitHub CLI')
result = base.run_command('gh auth status')['stderr']
if (result.find('not logged') != -1):
base.print_info('GitHub CLI not logged in to github')
return False
base.print_info('GitHub CLI logged in to github')
return True
def get_mysql_path_to_bin(mysqlPath = ''):
if (host_platform == 'windows'):
if (mysqlPath == ''):
@ -450,9 +478,14 @@ def check_mysqlServer():
print('Valid MySQL Server not found')
dependence.append_uninstall('MySQL Server')
dependence.append_uninstall('MySQL Installer')
dependence.append_install('MySQLInstaller')
dependence.append_install('MySQLServer')
MySQLData = os.environ['ProgramData'] + '\\MySQL\\'
if base.is_exist(MySQLData) == False:
return dependence
dir = os.listdir(MySQLData)
for path in dir:
if (path.find('MySQL Server') != -1) and (base.is_file(MySQLData + path) == False):
@ -467,27 +500,26 @@ def check_MySQLConfig(mysqlPath = ''):
if (base.run_command_in_dir(mysql_path_to_bin, mysqlLoginSrt + ' -e "SHOW DATABASES;"')['stdout'].find('onlyoffice') == -1):
print('Database onlyoffice not found')
creatdb_path = base.get_script_dir() + "/../../server/schema/mysql/createdb.sql"
result = execMySQLScript(mysqlPath, creatdb_path)
result = execMySQLScript(mysql_path_to_bin, creatdb_path)
if (base.run_command_in_dir(mysql_path_to_bin, mysqlLoginSrt + ' -e "SELECT plugin from mysql.user where User=' + "'" + install_params['MySQLServer']['user'] + "';" + '"')['stdout'].find('mysql_native_password') == -1):
print('Password encryption is not valid')
result = set_MySQLEncrypt(mysqlPath, 'mysql_native_password') and result
result = set_MySQLEncrypt(mysql_path_to_bin, 'mysql_native_password') and result
return result
def execMySQLScript(mysqlPath, scriptPath):
#ToDo check path to mysql
def execMySQLScript(mysql_path_to_bin, scriptPath):
print('Execution ' + scriptPath)
code = subprocess.call(get_mysqlLoginSrting() + ' < "' + scriptPath + '"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
mysqlLoginSrt = get_mysqlLoginSrting()
code = base.exec_command_in_dir(mysql_path_to_bin, get_mysqlLoginSrting() + ' < "' + scriptPath + '"')
if (code != 0):
print('Execution failed!')
return False
print('Execution completed')
return True
def set_MySQLEncrypt(mysqlPath, sEncrypt):
#ToDo check path to mysql
def set_MySQLEncrypt(mysql_path_to_bin, sEncrypt):
print('Setting MySQL password encrypting...')
code = subprocess.call(get_mysqlLoginSrting() + ' -e "' + "ALTER USER '" + install_params['MySQLServer']['user'] + "'@'localhost' IDENTIFIED WITH " + sEncrypt + " BY '" + install_params['MySQLServer']['pass'] + "';" + '"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
code = base.exec_command_in_dir(mysql_path_to_bin, get_mysqlLoginSrting() + ' -e "' + "ALTER USER '" + install_params['MySQLServer']['user'] + "'@'localhost' IDENTIFIED WITH " + sEncrypt + " BY '" + install_params['MySQLServer']['pass'] + "';" + '"')
if (code != 0):
print('Setting password encryption failed!')
return False
@ -508,8 +540,8 @@ def uninstall_mysqlserver():
def get_postrgre_path_to_bin(postgrePath = ''):
if (host_platform == 'windows'):
if (postgrePath == ''):
postgrePath = os.environ['PROGRAMW6432'] + '\\PostgreSQL\\13\\'
postgrePath += 'bin'
postgrePath = os.environ['PROGRAMW6432'] + '\\PostgreSQL\\13'
postgrePath += '\\bin'
return postgrePath
def get_postgreLoginSrting(userName):
if (host_platform == 'windows'):
@ -548,8 +580,9 @@ def check_postgreSQL():
if (host_platform == 'linux'):
result = os.system(postgreLoginSrt + ' -c "\q"')
connectionResult = base.run_command(connectionString)['stdout']
if (result != 0):
if (result != 0 or connectionResult.find(install_params['PostgreSQL']['dbPort']) == -1):
print('Valid PostgreSQL not found!')
dependence.append_install('PostgreSQL')
dependence.append_uninstall('PostgreSQL')
@ -563,7 +596,7 @@ def check_postgreSQL():
for info in arrInfo:
if (base.is_dir(info['Location']) == False):
continue
postgre_full_name = 'PostgreSQL ' + info['Version'][:2] + ' '
connectionResult = base.run_command_in_dir(get_postrgre_path_to_bin(info['Location']), connectionString)['stdout']
@ -601,60 +634,55 @@ def check_postgreConfig(postgrePath = ''):
if (os.system(postgreLoginDbUser + '-c "\q"') != 0):
print('Invalid user password!')
base.print_info('Changing password...')
result = change_userPass(dbUser, dbPass, postgrePath) and result
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
else:
print('User ' + dbUser + ' not exist!')
base.print_info('Creating ' + dbName + ' user...')
result = create_postgreUser(dbUser, dbPass, postgrePath) and result
result = create_postgreUser(dbUser, dbPass, postgre_path_to_bin) and result
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"')['stdout'].find('onlyoffice') == -1):
print('Database ' + dbName + ' not found')
base.print_info('Creating ' + dbName + ' database...')
result = create_postgreDb(dbName, postgrePath) and configureDb(dbUser, dbName, creatdb_path, postgrePath)
result = create_postgreDb(dbName, postgre_path_to_bin) and configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
else:
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT pg_size_pretty(pg_database_size(' + "'" + dbName + "'" + '));"')['stdout'].find('7559 kB') != -1):
print('Database ' + dbName + ' not configured')
base.print_info('Configuring ' + dbName + ' database...')
result = configureDb(dbName, creatdb_path, postgrePath) and result
result = configureDb(dbName, creatdb_path, postgre_path_to_bin) and result
print('Database ' + dbName + ' is valid')
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "\l+ ' + dbName + '"')['stdout'].find(dbUser +'=CTc/' + rootUser) == -1):
print('User ' + dbUser + ' has no database privileges!')
base.print_info('Setting database privileges for user ' + dbUser + '...')
result = set_dbPrivilegesForUser(dbUser, dbName, postgrePath) and result
result = set_dbPrivilegesForUser(dbUser, dbName, postgre_path_to_bin) and result
print('User ' + dbUser + ' has database privileges')
return result
def create_postgreDb(dbName, postgrePath = ''):
#ToDo check path to postgre
def create_postgreDb(dbName, postgre_path_to_bin = ''):
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (os.system(postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
return False
return True
def set_dbPrivilegesForUser(userName, dbName, postgrePath = ''):
#ToDo check path to postgre
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (os.system(postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
return False
return True
def create_postgreUser(userName, userPass, postgrePath = ''):
#ToDo check path to postgre
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (os.system(postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
return False
return True
def change_userPass(userName, userPass, postgrePath = ''):
#ToDo check path to postgre
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (os.system(postgreLoginRoot + '-c "ALTER USER ' + userName + " WITH PASSWORD '" + userPass + "';" + '"') != 0):
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "ALTER USER ' + userName + " WITH PASSWORD '" + userPass + "';" + '"') != 0):
return False
return True
def configureDb(userName, dbName, scriptPath, postgrePath = ''):
#ToDo check path to postgre
def configureDb(userName, dbName, scriptPath, postgre_path_to_bin = ''):
print('Execution ' + scriptPath)
postgreLoginSrt = get_postgreLoginSrting(userName)
code = os.system(postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
code = base.exec_command_in_dir(postgre_path_to_bin, postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
if (code != 0):
print('Execution failed!')
return False
@ -667,6 +695,7 @@ def uninstall_postgresql():
code = os.system('sudo rm -rf /etc/postgresql/') and code
code = os.system('sudo userdel -r postgres') and code
code = os.system('sudo groupdel postgres') and code
os.system('sudo kill ' + base.run_command('sudo fuser -vn tcp 5432')['stdout'])
return code
@ -724,12 +753,11 @@ def uninstallProgram(sName):
if (code != 0):
print("Uninstalling was failed!")
return False
return True
def installProgram(sName):
base.print_info("Installing " + sName + "...")
if (host_platform == 'windows'):
if (sName in install_special):
code = install_special[sName]()
@ -891,3 +919,4 @@ install_params = {
uninstall_params = {
'PostgreSQL': '--mode unattended --unattendedmodeui none'
}

View File

@ -0,0 +1,22 @@
import sys
sys.path.append('scripts')
sys.path.append('scripts/develop')
import base
import build_js
import build_server
import config
import dependence
import config_server as develop_config_server
base_dir = base.get_script_dir(__file__)
def make():
if ("1" != config.option("develop")):
return
if not dependence.check_dependencies():
exit(1)
build_server.build_server_develop()
build_js.build_js_develop(base_dir + "/../../..")
develop_config_server.make()
exit(0)

View File

@ -7,14 +7,26 @@ import base
import dependence
import config
branch_from = ''
branches_to = []
def protect_brunch(branch, repo, strict = False):
team = '' if strict else 'dep-application-development-leads'
command = 'echo {"required_status_checks": null,"enforce_admins":true,"required_pull_request_reviews": null,"restrictions": {"users":[],"teams":["'
command += team + '"]}} | gh api -X PUT repos/ONLYOFFICE/' + repo + '/branches/' + branch + '/protection --input -'
result = base.run_command(command)
if ('' != result['stderr']):
print(result['stderr'])
return
branch_from = 'release/v6.2.0'
branches_to = ['develop']
platform = base.host_platform()
if ("windows" == platform):
dependence.check_pythonPath()
dependence.check_gitPath()
if (dependence.check_gh() != True or dependence.check_gh_auth() != True):
sys.exit(0)
base.cmd_in_dir('../../', 'python', ['configure.py', '--branding', 'onlyoffice', '--branding-url', 'https://github.com/ONLYOFFICE/onlyoffice.git', '--branch', branch_from, '--module', 'core desktop builder server mobile', '--update', '1', '--update-light', '1', '--clean', '0'])
# parse configuration
@ -37,6 +49,14 @@ base.update_repositories(repositories)
repositories['onlyoffice'] = [True, False]
for repo in repositories:
base.create_pull_request(branches_to, repo, True)
current_dir = repositories[repo][1]
if current_dir != False:
cur_dir = os.getcwd()
os.chdir(current_dir)
base.create_pull_request(branches_to, repo, True, current_dir)
if current_dir != False:
os.chdir(cur_dir)
sys.exit(0)

View File

@ -31,12 +31,21 @@ def start_mac_services():
base.run_process(['mysql.server', 'restart'])
base.print_info('Start RabbitMQ Server')
base.run_process(['rabbitmq-server'])
base.print_info('Start Redis')
base.run_process(['redis-server'])
# base.print_info('Start Redis')
# base.run_process(['redis-server'])
def start_linux_services():
base.print_info('Restart MySQL Server')
os.system('sudo service mysql restart')
base.print_info('Restart RabbitMQ Server')
os.system('sudo service rabbitmq-server restart')
def run_integration_example():
base.cmd_in_dir('../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
def start_linux_services():
base.print_info('Restart MySQL Server')
def make(args = []):
try:
base.configure_common_apps()
@ -48,6 +57,9 @@ def make(args = []):
restart_win_rabbit()
elif ("mac" == platform):
start_mac_services()
elif ("linux" == platform):
start_linux_services()
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
@ -62,20 +74,18 @@ def make(args = []):
install_module('../../../server/DocService')
install_module('../../../server/Common')
install_module('../../../server/FileConverter')
install_module('../../../server/SpellChecker')
base.set_env('NODE_ENV', 'development-' + platform)
base.set_env('NODE_CONFIG_DIR', '../../Common/config')
base.set_env('NODE_CONFIG_DIR', '../Common/config')
if ("mac" == platform):
base.set_env('DYLD_LIBRARY_PATH', '../../FileConverter/bin/')
base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/')
elif ("linux" == platform):
base.set_env('LD_LIBRARY_PATH', '../../FileConverter/bin/')
base.set_env('LD_LIBRARY_PATH', '../FileConverter/bin/')
run_module('../../../server/DocService/sources', ['server.js'])
run_module('../../../server/DocService/sources', ['gc.js'])
run_module('../../../server/FileConverter/sources', ['convertermaster.js'])
run_module('../../../server/SpellChecker/sources', ['server.js'])
run_module('../../../server/DocService', ['sources/server.js'])
#run_module('../../../server/DocService', ['sources/gc.js'])
run_module('../../../server/FileConverter', ['sources/convertermaster.js'])
except SystemExit:
input("Ignoring SystemExit. Press Enter to continue...")
exit(0)

16
scripts/packages.py Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
import config
import base
import packages_desktop
# import packages_server
# import packages_builder
def make():
if config.check_option("module", "desktop"):
packages_desktop.make()
# if config.check_option("module", "server"):
# packages_server.make()
# if config.check_option("module", "builder"):
# packages_builder.make()
return

View File

@ -0,0 +1,67 @@
#!/usr/bin/env python
import config
import base
import os
import re
def make():
base_dir = base.get_script_dir() + "/../out"
git_dir = base.get_script_dir() + "/../.."
branding = config.branding()
platforms = config.option("platform").split()
for native_platform in platforms:
if not native_platform in config.platforms:
continue
isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
platform = native_platform[0:-3] if isWindowsXP else native_platform
if (0 == platform.find("mac")):
macos_dir = git_dir + "/desktop-apps/macos"
update_dir = macos_dir + "/build/update"
isX86 = True if ("" != base.get_env("_X86")) else False
target = "release" if not isX86 else "release_x86"
base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", target, "skip_git_bump:true"])
package = "ONLYOFFICE" if not isX86 else "ONLYOFFICE-x86"
app_version = base.run_command("mdls -name kMDItemVersion -raw " +
macos_dir + "/build/ONLYOFFICE.app")['stdout']
macos_zip = macos_dir + "/build/" + package + "-" + app_version + ".zip"
update_storage = base.get_env("ARCHIVES_DIR") + "/" + package + "/_updates"
changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes/" + app_version
base.delete_dir(update_dir)
base.delete_dir(os.path.expanduser("~/Library/Caches/Sparkle_generate_appcast"))
base.create_dir(update_dir)
base.copy_dir_content(update_storage, update_dir, ".zip")
base.copy_file(macos_zip, update_dir)
for file in os.listdir(update_dir):
if file.endswith(".zip"):
base.copy_file(changes_dir + "/ReleaseNotes.html",
update_dir + "/" + os.path.splitext(file)[0] + ".html")
base.copy_file(changes_dir + "/ReleaseNotesRU.html",
update_dir + "/" + os.path.splitext(file)[0] + ".ru.html")
base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast", [update_dir])
base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
changes_url = base_url + "/updates/onlyoffice/changes"
update_url = base_url + ("/updates/onlyoffice" if not isX86 else "/x86")
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
"\\1" + changes_url + "/\\2/ReleaseNotes.html\\3")
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
"\\1" + changes_url + "/\\2/ReleaseNotesRU.html\\3")
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
r"(url=\")(?:.+/)(ONLYOFFICE.+\")", "\\1" + update_url + "/\\2")
for file in os.listdir(update_dir):
if -1 == file.find(app_version) and (file.endswith(".zip") or file.endswith(".html")):
base.delete_dir(update_dir + "/" + file)
return

View File

@ -17,6 +17,9 @@ def get_branch_name(directory):
return current_branch
def install_deps():
if base.is_file("./packages_complete"):
return
# dependencies
packages = ["apt-transport-https",
"autoconf2.13",
@ -51,28 +54,52 @@ def install_deps():
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
# nodejs
if not base.is_file("./node_js_setup_10.x"):
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
nodejs_cur = 0
try:
nodejs_version = base.run_command('node -v')['stdout']
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
nodejs_cur = nodejs_cur_version_major * 1000 + nodejs_cur_version_minor
print("Installed Node.js version: " + str(nodejs_cur_version_major) + "." + str(nodejs_cur_version_minor))
except:
nodejs_cur = 1
if (nodejs_cur < 10020):
print("Node.js version cannot be less 10.20")
print("Reinstall")
if (base.is_dir("./node_js_setup_10.x")):
base.delete_dir("./node_js_setup_10.x")
base.cmd("sudo", ["apt-get", "remove", "--purge", "-y", "nodejs"])
base.download("https://deb.nodesource.com/setup_10.x", "./node_js_setup_10.x")
base.cmd('curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -')
base.cmd("sudo", ["bash", "./node_js_setup_10.x"])
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
else:
print("OK")
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
# java
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
base.cmd("sudo", ["apt-get", "update"])
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
base.cmd("sudo", ["update-alternatives", "--config", "java"])
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True)
if (0 != java_error):
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"], True)
if (0 != java_error):
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
base.cmd("sudo", ["apt-get", "update"])
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
base.cmd("sudo", ["update-alternatives", "--config", "java"])
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
base.writeFile("./packages_complete", "complete")
return
def install_qt():
# qt
if not base.is_file("./qt_source_5.9.9.tar.xz"):
base.download("http://download.qt.io/official_releases/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
base.download("https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
if not base.is_dir("./qt-everywhere-opensource-src-5.9.9"):
base.cmd("tar", ["-xf", "./qt_source_5.9.9.tar.xz"])