ARM架构下麒麟v10操作系统源码编译libreoffice7

本文详细介绍了如何在基于ARM的麒麟v10操作系统上编译LibreOffice7.1.8.1,包括下载源码、安装依赖、配置预编译选项、创建非root用户进行编译以及验证编译结果和文件转换操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境信息
架构:ARM
操作系统:麒麟v10-20210524版本
libreoffice版本:7.1.8.1
源码下载链接:https://download.documentfoundation.org/libreoffice/src/7.1.8/libreoffice-7.1.8.1.tar.xz?idx=1
 

安装依赖
yum install -y "@Standard" "@Development Tools"
# 如果已经安装可以不安装standard和Development Tools
yum install -y automake autoconf cups-devel fontconfig-devel \
gperf libxslt-devel python3-devel libXext-devel libICE-devel \
libSM-devel libXrender-devel xorg-x11-xauth x11* libX11 \
libXrandr-devel cairo-devel  gtk3-devel gstreamer-devel \
gstreamer-plugins-base gstreamer1-*  gstreamer* \
glibc-headers  gcc-c++ fakeroot 
 

预编译
将源码包上传到/root目录下

tar xf /root/libreoffice-7.1.8.1.tar.xz -C /opt
cd /opt/libreoffice-7.1.8.1
./autogen.sh --without-java --without-junit \
--with-lang=zh-CN --disable-postgresql-sdbc \
--without-doxygen --with-package-format=rpm --enable-epm \
--srcdir=/opt/libreoffice-7.1.8.1 --enable-option-checking=fatal

预编译选项解释:

–without-java: 表示不用java
–with-lang=zh-CN:启用简体及繁体中文用户界面
–disable-postgresql-sdbc:由于我不用pg数据库,所以在这里禁用掉
–with-package-format=rpm --enable-epm:将编译结果打包成rpm包,打包完成后在./workdir/installation/ 目录下
预编译结果

To build, run:
/usr/bin/make
To view some help, run:
/usr/bin/make/help
After the build has finished successfully, you can immediately run
what you built using the command: instdir/program/soffice
If you want to run the smoketest, run: /usr/bin/make check
HOST config (config.warn)
 

开始编译
由于libreoffice不允许直接用root用户来编译,所以先创建一个普通用户用于编译

useradd libreoffice
cd /opt && chown -R libreoffice:libreoffice libreoffice-7.1.8.1 
su libreoffice && cd /opt/libreoffice-7.1.8.1 
make -j 16  
# -j 16表示用16个cpu来跑编译,如果不指定默认使用全部cpu来跑

注意:服务器要通互联网,因为编译过程中程序会下载依赖包,由于依赖包网址在国外,所以会慢一点,耐心等待啦。另外依赖包下载完了之后编译也需要一定的时间,大概一个小时左右。

验证
编译结果忘记截图了,可以用获取版本的方式来验证是否编译成功

./instdir/program/soffice --version
be18cdfa2cc947af80b4bcf4f9be89df.png

将一个pptx文件转换为pdf格式

/opt/libreoffice-7.1.8/instdir/program/soffice --headless --invisible --convert-to pdf:writer_pdf_Export ./aa.pptx

1b739d272b5d4b0a8658a325baa86ef5.png 

最后
到以上步骤已经编译完成啦,有问题欢迎评论或者私聊我,每天进步一点点。

参考资料
https://wiki.documentfoundation.org/Development/BuildingOnLinux/zh-cn
https://www.libreofficechina.org/how-to-build-libreoffice-zh-cn/
 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值