Skip to content

Instantly share code, notes, and snippets.

@nogajun
Last active August 22, 2024 13:19
Show Gist options
  • Save nogajun/24f89f60a4a758588a0c10d8f4dcaf4a to your computer and use it in GitHub Desktop.
Save nogajun/24f89f60a4a758588a0c10d8f4dcaf4a to your computer and use it in GitHub Desktop.
libreoffice repository clone and build tips

LibreOffice Building Tips

Cloning repositories

This is about cloning LibreOffice repositories. since LibreOffice source code repositories are large and far away, you can quickly clone the source code using shallow clone from a github mirror.

git clone -o github --depth=1 --recurse-submodules --shallow-submodules https://github.com/LibreOffice/core.git libreoffice

If you only want to use it for events, this is OK; if you want to continue to use this repository, unshallow it.

git fetch --unshallow

Register the TDF repository to origin since the remote is github.

cd libreoffice/
git remote add origin https://git.libreoffice.org/core  

Add origin to dictionary, helpcontents and translations in the submodule as well.

cd dictionaries
git remote add origin https://git.libreoffice.org/dictionaries

cd ../helpcontents2/
git remote add origin https://git.libreoffice.org/help

cd ../translations/
git remote add origin https://git.libreoffice.org/translations

To do a git pull

When you git pull the libreoffice repository, you also need to take care of the submodule. So also run git submodule update.

cd libreoffice/
git pull
git submodule update

Specifying options

When specifying options, it is easier to create an autogen.input file and specify them in it than to specify them in autogen.sh.

cd libreoffice/
touch autogen.input

Edit this autogen.input. I do the following

--disable-breakpad
--disable-odk
--disable-online-update
--enable-dbgutil
--enable-debug
--enable-epm
--enable-gen
--enable-gtk3-kde5
--enable-gtk4
--enable-kf5
--enable-optimized=debug
--enable-qt5
--enable-qt6
--enable-sal-log
--with-help
--with-lang=ja en-US
--with-locales=ja en
--with-package-format=deb
--with-privacy-policy-url=https://www.nofuture.tv/
--with-vendor=Jun Nogata
--without-doxygen
--without-myspell-dicts

Configure ccache

When you build, you should also set up ccache.

sudo apt install ccache
mkdir ~/.ccache/
touch ~/.ccache/ccache.conf

In ~/.ccache/ccache.conf, the configuration is written as follows

max_size = 32G
compression = true
# cache_dir = /var/cache/ccache

Let's also add ccache to the beginning of the PATH and reload it.

echo 'export PATH="/usr/lib/ccache:$PATH"' >> ~/.bashrc
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment