Install as the session, at upstream's paths

Eight files: upstream's six, where upstream puts them, plus this fork's
start-hyprcosmic and hyprcosmic.desktop. Replaces the private libexec
prefix, matching the same change in cosmic-comp.

A machine that installs this gets its cosmic-session from here, so there
is nothing else on disk to provide the systemd target, the mimeapps list
or the dconf profile. Omitting them produced a session that started and
then had no user target for the portals to attach to, which surfaces much
later and much less clearly than a missing file.

Both session entries are installed and both are served by these binaries.
Replacing COSMIC need not mean removing its shell, and keeping
cosmic.desktop costs one file while preserving the one property worth
keeping from the beside-install layout: if the HyDE shell will not start,
there is still something on the greeter's menu that will.

start-hyprcosmic now names /usr/bin for both binaries, still through
overridable variables so the check below it can say which path was
missing and so the session still runs out of a build tree.

The dconf asymmetry is deliberate and now asserted in CI, because it is
easy to get backwards once both scripts are installed: start-cosmic is
sed'd to an absolute profile path, as upstream does; start-hyprcosmic is
not, because it searches /etc/dconf/profile and XDG_DATA_DIRS at runtime
and pinning a build prefix would break an administrator's override.
This commit is contained in:
2026-08-10 18:21:42 +07:00
parent 8ff1e72d3e
commit 73867a5d6a
3 changed files with 77 additions and 50 deletions
+28 -12
View File
@@ -131,24 +131,40 @@ jobs:
- name: Install into a staging root
run: just rootdir="$PWD/stage" install
# These assertions are the "three files, not seven" commit as something
# executable. Upstream's recipe wrote /usr/bin/cosmic-session and
# cosmic.desktop, which replaced the stock COSMIC session and left nothing
# to log into when the fork failed to start. The negative tests are the
# important half: it is the files that must NOT appear that made the old
# recipe dangerous.
- name: Assert it installs beside COSMIC, not over it
# Eight files: upstream's six, at upstream's paths, plus this fork's two.
# HyprCosmic replaces COSMIC rather than installing beside it, so nothing
# else on the machine provides the systemd target, the mimeapps list or
# the dconf profile -- a session that omits them starts, and then has no
# user target for the portals to attach to, which surfaces much later and
# much less clearly than a missing file would.
#
# Both session entries are asserted. Dropping cosmic.desktop would leave a
# machine whose only way in is the HyDE shell, and the last two lines are
# what stop the private libexec layout from creeping back.
- name: Assert it installs as the session, at upstream's paths
run: |
set -eux
test -x stage/usr/libexec/hyprcosmic/cosmic-session
test -x stage/usr/bin/cosmic-session
test -x stage/usr/bin/start-hyprcosmic
test -x stage/usr/bin/start-cosmic
test -f stage/usr/share/wayland-sessions/hyprcosmic.desktop
test ! -e stage/usr/bin/cosmic-session
test ! -e stage/usr/bin/start-cosmic
test ! -e stage/usr/share/wayland-sessions/cosmic.desktop
test ! -e stage/usr/share/applications/cosmic-mimeapps.list
test -f stage/usr/share/wayland-sessions/cosmic.desktop
test -f stage/usr/lib/systemd/user/cosmic-session.target
test -f stage/usr/share/applications/cosmic-mimeapps.list
test -f stage/usr/share/dconf/profile/cosmic
test ! -e stage/usr/libexec/hyprcosmic/cosmic-session
find stage -type f -printf '%M %10s %P\n'
# Upstream rewrites DCONF_PROFILE to an absolute path in its own start
# script; this fork's searches for the profile at runtime instead. Both
# behaviours are deliberate, and the pair is easy to get backwards in a
# recipe that now installs both scripts.
- name: Assert the dconf rewrite hit start-cosmic and only start-cosmic
run: |
set -eux
grep -q 'DCONF_PROFILE=/usr/share/dconf/profile/cosmic' stage/usr/bin/start-cosmic
grep -q 'DCONF_PROFILE=cosmic$' stage/usr/bin/start-hyprcosmic
- uses: actions/upload-artifact@v4
with:
name: cosmic-session-${{ matrix.distro }}