01 基本信息

目前office开源版本主流是 libreoffice。其前身是openoffice。
官网:https://zh-cn.libreoffice.org/
wiki: https://wiki.documentfoundation.org/
windows 版编译说明: https://wiki.documentfoundation.org/Development/BuildingOnWindows
发布版本下载地址: https://www.libreoffice.org/download/download/

关于类图文档:https://docs.libreoffice.org/sw/html/annotated.html
比如:在页面搜索SwFrame,可以得到如下详细类图及类关系:

一个比较古老的关于OpenOffice 的中文介绍:
OpenOffice.org简介
OpenOffice.org技术架构
OpenOffice.org中的XML应用

一个比较古老的介绍uno的文档:https://wiki.openoffice.org/wiki/UNO_registery_and_Bootstrapping

这个 IDE 的配置方法:https://wiki.documentfoundation.org/Development/IDE

libreoffice的国际化技术

https://www.cnblogs.com/linux-wang/p/9001368.html

02 win 版本libreoffice编译方法

参照官网: 使用 Cygwin 和 MSVC 在 Windows 上构建 LibreOffice:提示和技巧

02.01 vs2019及必要组件

vs2019 社区版、专业版、企业版均可。只要安装下列必要组件即可。

MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.2x)
C++ core features
Windows 10 SDK (10.0.xxxxx.x)
Windows Universal C Runtime
C++ ATL for v142 build tools (x86 & x64)
.NET Framework 4.x.x SDK
C++ Clang Compiler for Windows (9.0.0)

建议安装英文语言支持。

02.02 安装jdk

https://adoptopenjdk.net/archive.html

windows 64位:
https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10.1/OpenJDK11U-jdk_x64_windows_hotspot_11.0.7_10.zip

windwos32位:
https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10.1/OpenJDK11U-jdk_x86-32_windows_hotspot_11.0.7_10.zip

02.03 安装cygwin 64位版本

下载并安装setup-x86_64.exe

注意:对于 libreoffice 7.0.4.2 版本,可能会编译不过。建议使用 libreoffice 7.1版本源码编译。libreoffice7.0.4.2版本,需要使用老版本的cygwin才可以编译通过,20210329日之前的。

对于3月29日后的cygwin64位版本编译libreoffice可能会出现 libgpg-error 错误,参考:
https://wiki.documentfoundation.org/Development/msvc-x86_64

参考libreoffice中文论坛上的帖子:有没有在win10上编译通过的

用管理员权限启动cmd窗口,运行setup-x86_64.exe

注意:管理员权限cmd窗口,不是PowerShell

安装路径:`D:\cygwin64`
setup-x86_64.exe -P autoconf -P automake -P bison -P cabextract -P doxygen -P flex -P gcc-g++ ^-P gettext-devel -P git -P gnupg -P gperf -P make -P mintty ^-P nasm -P openssh -P openssl -P patch -P perl -P python -P python3 ^-P pkg-config -P rsync -P unzip -P vim -P wget -P zip -P perl-Archive-Zip ^-P perl-Font-TTF -P perl-IO-String

建议安装时,保留下载的cygwin安装包到本地。并且安装、编译成功后,保存本地cygwin安装包。以备不时之需。

02.04 指定更新依赖目录

libreoffice 编译时,会下载很多依赖文件。需要指定一个依赖存放目录。
该测试中 在代码同级的 libo-core-buildtools 目录中。

e:\git\libreoffice\libo-core-buildtools # 存放依赖包文件夹
e:\git\libreoffice\libo-core # 存放libreoffice源码目录
e:\cygwin64  # cygwin 安装目录

02.05 git 配置

下列配置项在 windows 和 cygwin 中都设置

:: 设置不转换换行符
git config --global core.safecrlf false
git config --global core.autocrlf false
::设置不忽略大小写
git config --global core.ignorecase false
::设置HTTP仓库不用每次输入账户密码
git config --global credential.helper store:: 下载代码
git clone --recursive https://gerrit.libreoffice.org/core.git libo-core
:: 切换到当前稳定分支libreoffice-7-1-3
git checkout -b b7.1.3 origin/libreoffice-7-1-3

02.06 安装ant和junit

mkdir -p /cygdrive/e/libreoffice/libo-core-buildtools
cd /cygdrive/e/cygdrive/e/libreoffice/libo-core-buildtools
wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.5-bin.tar.bz2
tar -xjvf apache-ant-1.9.5-bin.tar.bz2
wget http://downloads.sourceforge.net/project/junit/junit/4.10/junit-4.10.jar

02.07 安装GNU make

mkdir -p /opt/lo/bin
cd /opt/lo/bin
wget http://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
mv make-4.2.1-msvc.exe make.exe

02.08 设置环境变量 VSDEVCMD

VSDEVCMD=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat

02.08 生成工程文件

cd /cygdrive/e/git/libreoffice/libo-core
mkdir buildx64 && cd buildx64
/cygdrive/e/git/libreoffice/libo-core/autogen.sh --with-external-tar=/cygdrive/e/git/libreoffice/libo-core-buildtools/lo-externalsrc \
--with-junit=/cygdrive/e/git/libreoffice/libo-core-buildtools/junit-4.10.jar \
--with-jdk-home=/cygdrive/d/install/Java/jdk-16.0.1 \
--with-ant-home=/cygdrive/d/install/eclipse/apache-ant-1.10.10 \
--with-visual-studio=2019 \
--disable-dependency-tracking \
--enable-pch \
--disable-ccache \
--without-ucrt-dir \
--with-lang=zh-CN \
--enable-symbols \
--host=x86_64-pc-cygwin \
--enable-debug \
--with-distro=LibreOfficeWin64

02.09 编译

:: cd /cygdrive/e/git/libreoffice/libo-core/buildx64
/opt/lo/bin/make build-nocheck gb_COLOR=1

02.10 生成vs工程文件

:: cd /cygdrive/e/git/libreoffice/libo-core/buildx64
/opt/lo/bin/make vs2019-ide-integration
:: 设置 Executable soffice_exe 为vs2019的默认启动项

03 关于 libreoffice的国际化

libreoffice的国际化使用gettext工具集。

gettext是一套工具集的名称。这套工具集包含 xgettext/msginit/msgfmt 等一套建立模版(POT)、创建PO文件和编译MO文件的工具。

参考:关于操作系统中英文切换的.po和.mo介绍
https://www.cnblogs.com/linux-wang/p/9001368.html

例子:
比如:我们发现一个弹出窗口字符串

xxxx yyyy zzzzz

以上内容中文简体,到 源码的 translations\source\zh-CN 目录查找,
发现中文字符串在 yyyy 在 translations\source\zh-CN\desktop\messages.po

继而找到直接依赖字符串
// 代码中的直接依赖
desktop\inc\strings.hrc

如果要修改其他语言的该字符串内容,即可到对应 translations\source\XXX 下面去找,xxx即为感兴趣的语言目录。

04 关于libreoffice多进程启动

libreoffice 7.0.4 避免多重启动使用的是 PipeIpcThread,但是到7.1中,已经把PipeIpcThread取消掉了。

libreoffice支持每个应用一个进程的方式启动。具体如下:

::如果指定word、excel、ppt的环境变量即可开多个进程
:: 开word
soffice.exe -env:UserInstallation="file:///C:/TEMP/tempOffice1" -writer
:: 开excel
soffice.exe -env:UserInstallation="file:///C:/TEMP/tempOffice2" -calc
:: 开ppt
soffice.exe -env:UserInstallation="file:///C:/TEMP/tempOffice3" -impress

这样每个应用一个窗口,一般 -env:UserInstallation 参数相同,会放到一个进程中运行。

libreoffice 01 windows 版本编译相关推荐

  1. 6 redis 编译失败_Redis6 Windows 版本编译

    编译工具 Cygwin3 步骤 选择安装路径,这个是之cygwin命令窗口的路径.这个路径就是cygwin模拟linux环境的根路径/,再这个路径之下会有home/的文件夹,相当于windows环境中 ...

  2. 在Windows下编译多种VS版本的Skia

    转载请说明原出处,谢谢~~:http://blog.csdn.net/zhuhongshu/article/details/51272050 这几天刚改了改Duilib,之前为了让Duilib更好的支 ...

  3. Caffe Windows版本的编译

    2019独角兽企业重金招聘Python工程师标准>>> 1:Caffe的主版本只支持Linux,所以要下载专门的Caffe Windows版本,网址为 https://github. ...

  4. 在windows下编译FFMPEG-最新2009版本

    转]在windows下编译FFMPEG-最新2009版本 2010-11-17 18:50 大家可以看到,此篇之前有很多个版本的"在windows下编译FFMPEG",那些都是我在 ...

  5. 开源终端上网行为管理服务器windows版本包的编译及运行环境搭建

    前面几篇文章主要介绍开源终端上网行为管理服务器的编译与部分代码解讯,这里主要介绍下这个开源服务器的搭建过程,分别从环境的要求,服务的启动与一些基本配置来说明 1.从https://github.com ...

  6. Windows中编译wireshark3.0以上版本指南

    Windows中编译wireshark3.0以上版本指南 一.摘要 在网上已有的wireshark编译的网页文档中,只有编译wireshark1.0和wireshark2.0相关版本的内容,对于已经发 ...

  7. openh264 Windows 平台x64版本编译

    需求Windows x64支持h264编码的视频 pjsip如果需要支持h264编码格式的视频,需要引入openh264. openh264源码下载 https://github.com/cisco/ ...

  8. 编译PHP的windows版本

    下面是在看<Sams.Extending.and.Embedding.PHP>的第4章 编译PHP的一些实践记录,相应中文版 地址 http://www.walu.cc/phpbook/4 ...

  9. Hdf5开发笔记(一):hdf5介绍,在windows上编译msvc2015x64版本

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://hpzwl.blog.csdn.net/article/details/121008456 长期持续带来更多项目与技术分享,咨询请 ...

最新文章

  1. cvThreshold()函数理解
  2. iOS9定位获取经纬度 swift
  3. 嗓子痛引发大抢救!33岁程序员的垂死经历,为所有人敲响警钟!
  4. LeetCode : Power of Two
  5. 提升存储设备的吞吐量
  6. C++11特性补充笔记1
  7. 精准 iOS 内存泄露检测工具
  8. h264解码延迟优化_JEET Air Plus:延迟优化技术,让你游戏不掉线
  9. 初识webservice 服务
  10. 【信息系统项目管理师】第十五六章 配置管理和标准化
  11. linux执行arm文件,Linux安装FFMPEG转换amr为mp3格式
  12. 光漫反射和散射的区别
  13. 汉语语法与人工智能---数据结构+汉语语法
  14. python多线程网易云歌单
  15. r语言中的或怎么表示什么不同_R语言 基本语法
  16. 普通打印机如何才能实现双面打印呢
  17. 【Spring】Spring MVC原理及配置详解
  18. 接口测试平台代码实现54:首页重构-2
  19. 川普哭诉“推特狂掉粉”,将用行政命令监管硅谷?
  20. 如何远程连接另外一台电脑

热门文章

  1. BFS---陨石坠落
  2. 接口分析--今日头条天气数据接口
  3. 面向对象:往后余生,希望是对的你
  4. 胜者的诅咒与double DQN
  5. 工程伦理--2.5 工程伦理的作用
  6. Reformulating HOI Detection as Adaptive Set Prediction
  7. vivado生成ltx文件命令_Xilinx Artix-7系列FPGA 高速采集卡开发例程使用手册.pdf
  8. 手游联运是什么意思?
  9. 收藏向 | 车载Android系统开发学习专题,进军车载必备
  10. 200smart实现C语言编程,有关S7-200 SMART的编程示例-工业支持中心-西门子中国