284.2. git-cola-4.19.0
Git GUI for staging, committing and reviewing, with the git-dag history viewer
| Version | 4.19.0, release 1 |
| Shelf | vcs — Version control and diff/merge tools |
| Phase | 44_apps (Applications), 398 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://git-cola.github.io/ |
| Build time | 0.2 SBU |
| Installed size | 7.7 MiB in 383 files |
| Recipe | ports/core/vcs/git-cola/kpkgbuild |
About
git-cola is a Git GUI for staging, committing, branching and reviewing changes, and git-dag, installed with it, draws a repository’s history as a graph. Both run the git command for every operation. They are Python programs on Qt, reached through QtPy, which loads whichever Qt binding it finds; the binding the recipe depends on is PyQt6.
Sources
git-cola-4.19.0.tar.gz(1.4 MiB)
sha2568b85c50ecf1086c9664c79348a96cebd7dbb65054d53ea2b02e70d53cb7f0981
upstream: https://files.pythonhosted.org/packages/source/g/git-cola/git_cola-4.19.0.tar.gz
archive copy: sources-4/vcs--git-cola-4.19.0.tar.gzgit-cola-vendor-4.19.0.tar.xz(1.9 MiB)
sha25653ee3e6017c3ed1a5e666a386c16b4ad29cb842e5aa3d0ca20eb7d3ba7b39c4c
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-4/vcs--git-cola-vendor-4.19.0.tar.xz
Dependencies
Depends on: python3, python3-setuptools, python3-setuptools-scm, python3-pip, python3-qtpy, python3-pyqt6, python3-sphinx, librsvg, git.
Required by: no port names it.
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 git-cola'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/vcs/git-cola.
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/vcs/git-cola
echo '8b85c50ecf1086c9664c79348a96cebd7dbb65054d53ea2b02e70d53cb7f0981 git-cola-4.19.0.tar.gz' | sha256sum -c -
echo '53ee3e6017c3ed1a5e666a386c16b4ad29cb842e5aa3d0ca20eb7d3ba7b39c4c git-cola-vendor-4.19.0.tar.xz' | 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/git-cola
SRC=$SRC_ROOT/git-cola-4.19.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf git-cola-4.19.0.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:
mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor
export SETUPTOOLS_SCM_PRETEND_VERSION=$version
pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
--root=$PKG --prefix=/usr polib .
(cd docs && sphinx-build -b man -q -d "$SRC_ROOT/cola-doctrees" . "$SRC_ROOT/cola-man")
install -Dm644 "$SRC_ROOT"/cola-man/git-cola.1 "$SRC_ROOT"/cola-man/git-dag.1 \
-t "$PKG/usr/share/man/man1"
for s in 48 64 128 256; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
rsvg-convert -w $s -h $s cola/icons/git-cola.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/git-cola.png"
done
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/git-cola.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Git Cola
GenericName=Git Client
Comment=Stage, commit, branch and review changes in a Git repository
TryExec=git-cola
Exec=git-cola --prompt
Icon=git-cola
Terminal=false
StartupNotify=true
StartupWMClass=git-cola
Categories=Development;RevisionControl;
Keywords=git;commit;stage;diff;branch;vcs;cola;
DESKTOP
cat > "$PKG/usr/share/applications/git-dag.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Git DAG
GenericName=Git History Viewer
Comment=Browse a Git repository's history as a graph
TryExec=git-dag
Exec=git-dag --prompt
Icon=git-cola
Terminal=false
StartupNotify=true
StartupWMClass=git-cola
Categories=Development;RevisionControl;
Keywords=git;history;log;graph;dag;branch;
DESKTOP
chmod 644 "$PKG"/usr/share/applications/git-cola.desktop \
"$PKG"/usr/share/applications/git-dag.desktop
The switches, and why each is set:
SETUPTOOLS_SCM_PRETEND_VERSION— setuptools_scm takes the version from this variable instead of working it out from Git metadata or the source distribution’sPKG-INFO. It is set to the recipe’s$version, so the installed package reports the release the recipe names.
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/git-cola, 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 git-cola-4.19.0-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/git-cola, and runs the triggers its paths call for.
Contents
Installed programs: cola, git-cola, git-cola-sequence-editor, git-dag.
Installed directories: /usr/lib/python3.14/site-packages/cola, /usr/lib/python3.14/site-packages/git_cola-4.19.0.dist-info, /usr/lib/python3.14/site-packages/polib-1.2.0.dist-info, /usr/share/licenses/git-cola.
Short descriptions
git-cola |
The highly caffeinated Git GUI |
git-dag |
The sleek and powerful Git history browser |
Notes
- The vendor bundle carries one run-time module,
polib, whichpyproject.tomlrequires and which is not a port;cola/i18n.pyimports it to read git-cola’s translation catalogues, and falls back to its own copy,cola/polib.py, when it is missing. The rest of the bundle, setuptools, setuptools_scm and the packages they are built with, is the build-requirement chainports/fetchcollects from eachpyproject.toml.build.shpasses--no-build-isolation, so pip builds polib and git-cola with the setuptools and setuptools-scm ports independsand installs none of those archives.extras/holds thesphinxtogithubSphinx extension and the licences of polib and QtPy, and is not installed. - The manual pages for
git-colaandgit-dagare built from the Sphinx sources indocs/with python3-sphinx.docs/conf.pyputsextras/onsys.path, because thesphinxtogithubextension it loads lives there. - The menu icon. Upstream ships
git-cola.svgonly;build.shalso renders 48, 64, 128 and 256 pixel PNGs withrsvg-convert. - The menu entries are written by
build.sh. Upstream installs its.desktopfiles from its Makefile, not from the Python package thatpipbuilds. Both programs set the desktop file name, and so the Wayland app_id, togit-cola, which is theStartupWMClassof both entries. Upstream’s third entry,git-cola-folder-handler.desktop, is left out: it claimsinode/directory, the file manager’s type.