mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-24 10:09:01 -06:00
Nix: fix the flake at HEAD (git dependency) and load libdbus/libEGL on NixOS
Cargo.lock now pins storytold/craft-libs by git revision, so the flake failed at evaluation with "No hash was found while vendoring the git dependency" (cargoLock.allowBuiltinFetchGit fixes it). rfd dlopens libdbus-1 for the xdg-desktop-portal file chooser and wgpu may fall back to libEGL: neither is on NixOS's default library path, so add dbus and libglvnd to the wrapper's LD_LIBRARY_PATH. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
25ef65c81e
commit
7aaeef2676
+15
-5
@@ -4,8 +4,8 @@
|
|||||||
# nix build # → ./result/bin/lightcraft, ./result/bin/lightcraft-cli
|
# nix build # → ./result/bin/lightcraft, ./result/bin/lightcraft-cli
|
||||||
#
|
#
|
||||||
# Kept in step with the release workflow (.github/workflows/release.yml) and packaging/env.sh:
|
# Kept in step with the release workflow (.github/workflows/release.yml) and packaging/env.sh:
|
||||||
# * `Cargo.lock` drives the dependencies (`cargoLock`), so there is no vendorHash to bump — only
|
# * `Cargo.lock` drives the dependencies (`cargoLock`), so there is no vendorHash to bump. The git
|
||||||
# crates.io, no git sources;
|
# source (storytold/craft-libs) is fetched at the revision the lock file pins;
|
||||||
# * `CRAFT_FONTS_DIR` embeds the CJK fonts from storytold/craft-fonts (the `craft-fonts`
|
# * `CRAFT_FONTS_DIR` embeds the CJK fonts from storytold/craft-fonts (the `craft-fonts`
|
||||||
# flake input); without it everything builds and runs, but Japanese and Chinese text have no glyphs;
|
# flake input); without it everything builds and runs, but Japanese and Chinese text have no glyphs;
|
||||||
# * the desktop file, hicolor icons and AppStream metadata are the same files the .deb/.rpm ship
|
# * the desktop file, hicolor icons and AppStream metadata are the same files the .deb/.rpm ship
|
||||||
@@ -32,6 +32,9 @@
|
|||||||
libxi,
|
libxi,
|
||||||
libxrandr,
|
libxrandr,
|
||||||
vulkan-loader,
|
vulkan-loader,
|
||||||
|
libglvnd,
|
||||||
|
# rfd opens libdbus-1 at run time to reach the xdg-desktop-portal file chooser (Open/Save dialogs).
|
||||||
|
dbus,
|
||||||
# Validates the desktop file and the AppStream metadata we install (as CI does).
|
# Validates the desktop file and the AppStream metadata we install (as CI does).
|
||||||
desktop-file-utils,
|
desktop-file-utils,
|
||||||
appstream,
|
appstream,
|
||||||
@@ -56,8 +59,9 @@ let
|
|||||||
appId = "ai.storyteller.lightcraft";
|
appId = "ai.storyteller.lightcraft";
|
||||||
|
|
||||||
# Libraries the binaries open at run time with dlopen(): nothing links them, so no RPATH points at
|
# Libraries the binaries open at run time with dlopen(): nothing links them, so no RPATH points at
|
||||||
# them — winit loads libxkbcommon/libxcb, wgpu the Vulkan loader (NixOS patches that loader to
|
# them — winit loads libwayland-client/libxkbcommon/libxcb, rfd libdbus-1, wgpu the Vulkan loader
|
||||||
# find the drivers in /run/opengl-driver). The wrapper below points LD_LIBRARY_PATH here.
|
# or libEGL (NixOS patches that loader to find the drivers in /run/opengl-driver). The wrapper
|
||||||
|
# below points LD_LIBRARY_PATH here.
|
||||||
runtimeLibs = lib.optionals isLinux [
|
runtimeLibs = lib.optionals isLinux [
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
wayland
|
wayland
|
||||||
@@ -67,6 +71,8 @@ let
|
|||||||
libxi
|
libxi
|
||||||
libxrandr
|
libxrandr
|
||||||
vulkan-loader
|
vulkan-loader
|
||||||
|
libglvnd
|
||||||
|
dbus
|
||||||
];
|
];
|
||||||
|
|
||||||
# The two native binaries. The wasm app (apps/lightcraft-web) is built by `cargo xtask web`, not
|
# The two native binaries. The wasm app (apps/lightcraft-web) is built by `cargo xtask web`, not
|
||||||
@@ -98,7 +104,11 @@ rustPlatform.buildRustPackage {
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoLock.lockFile = root + "/Cargo.lock";
|
cargoLock = {
|
||||||
|
lockFile = root + "/Cargo.lock";
|
||||||
|
# The git dependency (storytold/craft-libs) is pinned by revision in Cargo.lock.
|
||||||
|
allowBuiltinFetchGit = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Both binaries, as the .deb/.rpm install them (`packaging/linux/package.sh`).
|
# Both binaries, as the .deb/.rpm install them (`packaging/linux/package.sh`).
|
||||||
cargoBuildFlags = [
|
cargoBuildFlags = [
|
||||||
|
|||||||
Reference in New Issue
Block a user