多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 概述 由于国产化的需要所以需要在arm64的cpu上编译 onlyoffice 目前编译的为 onlyoffice 7.x的版本 ## 编译的目录架构 ``` onlyoffice ├── build_tools ├── core │ └── Common │ └── 3dParty │ ├── boost │ │ ├── boost_1_72_0 │ │ └── build │ │ └── linux_64 │ ├── cef │ ├── cryptoop │ ├── curl │ ├── glew │ ├── html │ ├── hunspell │ ├── icu │ ├── ixwebsocket │ ├── openssl │ ├── socketrocket │ ├── v8 │ └── v8_89 ├── core_fonts ├── dictionaries ├── document-server-interation ├── document-templates ├── DocumentBuilder ├── osnfs ├── plugin-highlightcode ├── plugin-macros ├── plugin-mendeley ├── plugin-ocr ├── plugin-photoeditor ├── plugin-speech ├── plugin-thesaurus ├── plugin-translator ├── plugin-youtube ├── plugin-zotero ├── sdkjs ├── sdkjs-forms ├── sdkjs-plugins ├── server └── web-apps ``` ## 准备 ### 切换源 ``` mv /etc/apt/sources.list /etc/apt/sources.list.bak echo "deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse deb http://ftp.de.debian.org/debian sid main ">/etc/apt/sources.list apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 apt update ``` ### 安装常用库 提示:有些库在镜像的源中可能会安装失败,此时切换到官方源上尝试下载 ``` apt install libxcb-xfixes0-dev ``` ### 常用第三方库 #### node 由于编译 onlyoffice 需要使用 node>10 版本,所以需要下载符合要求的node 版本 ``` cd ~ wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-arm64.tar.xz ln -s ~/node-v16.14.2-linux-arm64/bin/node /usr/bin/ ``` #### qt 在 `automate.py` 中需要查看需要下载的qt 版本,并提前进行安装,安装在 `build_tools/tools/linux` 下 ``` wget 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 ``` ### boost 由于boost 可以编译麻烦,可以下载已经编译好的放到指定目录下即可 下载地址 https://archlinuxarm.org/packages/aarch64/boost 下载好后,放到 `core/Comon/3dParty/boost` 下的 `build/linux_64` 只需要, bin,include,lib.share ### 编译 officeonly 编译前最好先进入 `build_tools/tools/linux/automate.py` 文件,24行处,先提前安装好需要的依赖库,并注释掉automate.py 中已安装的依赖库(推荐全部安装好,并注释所有依赖) 先进行第一次尝试编译 ``` git clone https://github.com/ONLYOFFICE/build_tools.git cd build_tools/tools/linux python3 ./automate.py server ```