Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

306.14. pencil2d-0.7.2

Pencil2D: hand-drawn 2D animation with bitmap and vector layers, for Qt 6

Version 0.7.2, release 1
Shelf graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers
Phase 44_apps (Applications), 234 of 422 in build order
Licence GPL-2.0-only
Homepage https://www.pencil2d.org/
Build time 2.1 SBU
Installed size 3.9 MiB in 9 files
Recipe ports/core/graphics/pencil2d/kpkgbuild

About

Pencil2D is a hand-drawn 2D animation program with bitmap and vector layers, onion skinning and a sound track. It is a qmake project built against Qt 6.

Sources

Dependencies

Depends on: qt6-qtbase, qt6-qtmultimedia, qt6-qtsvg, qt6-qttools, ffmpeg, hicolor-icon-theme, shared-mime-info.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install pencil2d'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/graphics/pencil2d.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/graphics/pencil2d
echo '22af8bf304cd18ae5d7a84e66d80ea2a21a53963476ffabb60d1d5f37f091a0c  pencil2d-0.7.2.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/pencil2d
SRC=$SRC_ROOT/pencil2d-0.7.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf pencil2d-0.7.2.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/no-palette-mime-glob.patch"

mkdir -p build && cd build
qmake6 .. \
	PREFIX=/usr \
	CONFIG+=release \
	CONFIG+=NO_TESTS \
	QMAKE_CFLAGS+="$CFLAGS" \
	QMAKE_CXXFLAGS+="$CXXFLAGS" \
	QMAKE_LFLAGS+="$LDFLAGS"
make
make INSTALL_ROOT="$PKG" install

cat > "$PKG/usr/share/applications/org.pencil2d.Pencil2D.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Pencil2D
GenericName=2D Animation
Comment=Hand-drawn animation with bitmap and vector layers
Exec=pencil2d %f
Icon=org.pencil2d.Pencil2D
Terminal=false
StartupWMClass=org.pencil2d.Pencil2D
MimeType=application/x-pencil2d-pcl;application/x-pencil2d-pclx;
Categories=Qt;Graphics;2DGraphics;VectorGraphics;RasterGraphics;
Keywords=animation;cartoon;drawing;frame;onion;pencil2d;
EOF
chmod 644 "$PKG/usr/share/applications/org.pencil2d.Pencil2D.desktop"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/pencil2d, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf pencil2d-0.7.2-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/pencil2d, and runs the triggers its paths call for.

Contents

Installed programs: pencil2d.

Installed directories: /usr/share/licenses/pencil2d.

Notes

Movie and GIF export and import run the ffmpeg program found on PATH when the menu entry is used, so ffmpeg is in depends; without it those entries fail with an error.

The desktop entry is written over upstream’s: it carries StartupWMClass=org.pencil2d.Pencil2D, the Wayland app id setDesktopFileName sets, so the panel ties the window to its launcher. Its two MIME types are Pencil2D’s own project formats, from the XML installed above.