From 326dd06f30b467f1c96d7a5c2cbff87f204ea463 Mon Sep 17 00:00:00 2001 From: nandi Date: Wed, 25 Nov 2026 13:47:35 -0800 Subject: [PATCH] install-session: install libseat for the copied host (its RUNPATH only resolves inside the checkout) Co-Authored-By: Claude Sonnet 5.5 --- session/install.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/session/install.py b/session/install.py index 8641d73..ccf6360 100755 --- a/session/install.py +++ b/session/install.py @@ -29,7 +29,7 @@ Installs: /usr/share/xdg-desktop-portal/portals/chandra.portal xdg-desktop-portal backend: the compositor /usr/share/xdg-desktop-portal/chandra-portals.conf serves Settings (apps' dark/light preference) """ -import os, shutil, sys +import os, shutil, subprocess, sys root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) native = "--native" in sys.argv @@ -61,6 +61,9 @@ if "--remove" in sys.argv: if os.path.lexists(t): os.remove(t) print("removed", t) + if os.path.exists("/etc/ld.so.conf.d/chandra.conf"): + os.remove("/etc/ld.so.conf.d/chandra.conf") + print("removed /etc/ld.so.conf.d/chandra.conf") if os.path.isdir(share) and not os.path.islink(share): shutil.rmtree(share) # removes symlinks, never what they point at print("removed", share) @@ -104,6 +107,25 @@ if native: else: install(host, "/usr/local/bin/chandra-host") drop("/usr/local/bin/chandra") + if not linked: + # The host's RUNPATH ($ORIGIN/../.pixi/...) only resolves inside the checkout, so a copied + # host needs libseat (from the pixi env) somewhere the loader looks: share/lib + ld.so.conf.d. + pixi_lib = os.path.join(root, ".pixi/envs/default/lib") + seat = [f for f in sorted(os.listdir(pixi_lib)) if f.startswith("libseat.so")] if os.path.isdir(pixi_lib) else [] + if seat: + for f in seat: + dst = os.path.join(share, "lib", f) + os.makedirs(os.path.dirname(dst), exist_ok=True) + if os.path.lexists(dst): + os.remove(dst) + if os.path.islink(os.path.join(pixi_lib, f)): + os.symlink(os.readlink(os.path.join(pixi_lib, f)), dst) + else: + shutil.copyfile(os.path.join(pixi_lib, f), dst) + print("installed", dst) + with open("/etc/ld.so.conf.d/chandra.conf", "w") as c: + c.write(os.path.join(share, "lib") + "\n") + subprocess.run(["ldconfig"], check=False) os.makedirs(share, exist_ok=True) if not native: install(component, os.path.join(share, "compositor.wasm"))