Neon/Locally build packages: Difference between revisions
(Added compiler cache for speeding up compilation.) |
m (Minor text fixes.) |
||
Line 13: | Line 13: | ||
# Change debian/source/format to use native instead of quilt, <code>sed -i 's/quilt/native/' debian/source/format</code> | # Change debian/source/format to use native instead of quilt, <code>sed -i 's/quilt/native/' debian/source/format</code> | ||
Or in one command: | Or, in one command: | ||
<code>mkdir -p usr/share/locale && touch usr/share/locale/stub && rm -f debian/*.symbols && sed -i 's/quilt/native/' debian/source/format</code> | <code>mkdir -p usr/share/locale && touch usr/share/locale/stub && rm -f debian/*.symbols && sed -i 's/quilt/native/' debian/source/format</code> | ||
Revision as of 15:52, 17 December 2020
This page describes some basics in taking a package from https://invent.kde.org/neon/ and building it locally. This can be useful for doing local testing before committing changes.
Prerequisites
- A pre-existing KDE development environment.
dpkg-dev
package will include the standard debian toolchain for building packages.
Setting up local files for building package
- Clone the package repository repository, i.e. https://invent.kde.org/neon/kde/libkdegames
- Copy the source tree from your kde sources to where the
debian/
path resides. - Create a
usr/share/locale
to simulate CI locale injection,mkdir -p usr/share/locale && touch usr/share/locale/stub
- Remove symbols to simulate CI removing the symbol files,
rm debian/*.symbols
- Change debian/source/format to use native instead of quilt,
sed -i 's/quilt/native/' debian/source/format
Or, in one command:
mkdir -p usr/share/locale && touch usr/share/locale/stub && rm -f debian/*.symbols && sed -i 's/quilt/native/' debian/source/format
Building the package
Use your favorite tool:
dpkg-buildpackage
debuild
Known false negatives
- Complaints about dsc and missing key.
- Lintian returns
malformed-debian-changelog-version
.
Speeding up compilation
A compiler cache can help speed things up immensely, particularly when it comes to packages that take a while to compile.
Install ccache
. It might be worth also setting these options:
ccache -o max_size="20G"
- Increases the cache size to 20G, roughly kdesrc-build uses about 12G currently and the default is 10G.ccache -o compression="true"
- Enable compression, reduces cache size by compressing objects.ccache -o compression_level="9"
- Highest level of compression, helps utilize your space significantly better at a relatively minimal performance cost.
Configure ~/.devscripts
to use ccache
when using debuild
:
echo 'DEBUILD_PREPEND_PATH="/usr/lib/ccache"' | tee -a ~/.devscripts
Now you should be able to use debuild
with ccache. You may want to validate this by checking its' usage statistics while building, use ccache -s
.