install-session: install libseat for the copied host (its RUNPATH only resolves inside the checkout)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 13:47:35 -08:00
1 parent bb7c9b947f
commit 326dd06f30
1 file changed
+23 -1
+23 -1
View File
@@ -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"))