嘗試構(gòu)建基于LoongArch64架構(gòu)Linux系統(tǒng)桌面辦公軟件libreoffice

1 設(shè)置環(huán)境變量
```shexport LDFLAGS="-Wl,-rpath-link=${SYSDIR}/sysroot/usr/lib64"export PKG_CONFIG_SYSROOT_DIR=${SYSDIR}/sysrootexport PKG_CONFIG_PATH="${SYSDIR}/sysroot/usr/lib64/pkgconfig:${SYSDIR}/sysroot/usr/share/pkgconfig"export COMMON_CONFIG="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64 \ ? ? ? ? ? ? ? ? ? ? ?--build=${CROSS_HOST} --host=${CROSS_TARGET}"export JOBS="-j8"```
2?LibreOffice
獲取軟件代碼。
```shgit clone https://git.libreoffice.org/core --depth 1pushd coregit submodule initgit submodule update --depth 1popdmv core libreoffice-7.5-gittar -czf ${DOWNLOADDIR}/libreoffice-7.5-git.tar.gz libreoffice-7.5-git```
編譯和安裝。
```tar xvf ${DOWNLOADDIR}/libreoffice-7.5-git.tar.gz -C ${BUILDDIR}pushd ${BUILDDIR}/libreoffice-7.5-git ??
?cp ${SYSDIR}/cross-tools/share/automake-1.16/config.* ./ ? ?aclocal ? ?
patch -Np1 -i ${DOWNLOADDIR}/libreoffice-7.5-for-clfs.patch ? ?
patch -Np1 -i ${DOWNLOADDIR}/libreoffice-7.5-libgpg-error-add-loongarch64.patch ? ?
patch -Np1 -i ${DOWNLOADDIR}/libreoffice-7.5-postgresql-disable_spinlock.patch ? ?
PKG_CONFIG_FOR_BUILD=/bin/pkg-config \ ? ?
perl ./autogen.sh CC=${CROSS_TARGET}-gcc CXX=${CROSS_TARGET}-g++ \ ? ? ? ? ? ? ? ? ? ??
?--build=${CROSS_HOST} --host=${CROSS_TARGET} \ ? ? ? ? ? ? ? ? ? ? ?
--prefix=/opt/libreoffice \ ? ? ? ? ? ? ? ? ? ? ?
--with-lang="zh-CN" --with-vendor=Sunhaiyong \ ? ? ? ? ? ? ? ? ? ??
?--with-help --with-myspell-dicts \ ? ? ? ? ? ? ? ? ? ??
?--without-junit --without-system-dicts --disable-dconf --disable-odk \ ? ? ? ? ? ? ? ? ? ? ?
--enable-release-build=yes --without-java \ ? ? ? ? ? ? ? ? ? ? ?
--with-system-boost --with-system-curl --with-system-epoxy \ ? ? ? ? ? ? ? ? ? ??
?--with-system-expat --with-system-graphite --with-system-harfbuzz \ ? ? ? ? ? ? ? ? ? ? ?
--with-system-icu --with-system-jpeg --with-system-lcms2 \ ? ? ? ? ? ? ? ? ? ? ?
--with-system-libatomic_ops --with-system-libpng --with-system-libxml \ ? ? ? ? ? ? ? ? ? ??
?--with-system-nss --with-system-openssl \ ? ? ? ? ? ? ? ? ? ??
--with-system-zlib --with-system-openjpeg \ ? ? ? ? ? ? ? ? ? ??
?LIBS="-lstdc++" \ ? ? ? ? ? ? ? ? ? ? ?
--with-boost-libdir=${SYSDIR}/sysroot/usr/lib64 \ ? ? ? ? ? ? ? ? ? ? ?
--disable-coinmp --enable-python=no ? ?
ZIC=/usr/sbin/zic make build ${JOBS} ? ?
make DESTDIR=${PWD}/dest distro-pack-install ? ?
cp -a ${PWD}/dest/opt/libreoffice ${SYSDIR}/sysroot/opt/ ? ?
mkdir -pv ${SYSDIR}/sysroot/usr/share/bash-completion/completions/ ? ?
cp -a ${PWD}/dest/usr/share/bash-completion/completions/* ${SYSDIR}/sysroot/usr/share/bash-completion/completions/ ? ?cp -a ${PWD}/dest/opt/libreoffice/share/applications/*.desktop \ ? ? ? ? ??
${SYSDIR}/sysroot/usr/share/applications/ ? ?
mkdir -pv ${SYSDIR}/sysroot/usr/share/xdg/ ? ?
cp -a ${PWD}/dest/opt/libreoffice/lib/libreoffice/share/xdg/*.desktop \ ? ? ? ? ??
${SYSDIR}/sysroot/usr/share/xdg/popd```
