From cd1f0103302f3f36e32ede0244a181d8385f625a Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 29 Feb 2024 16:19:37 +0000 Subject: [PATCH] nix: update flake.nix Fix rpaths for built crescent so it can find libX* libraries Signed-off-by: Yuxuan Shui --- flake.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 078744d..88ec624 100644 --- a/flake.nix +++ b/flake.nix @@ -24,14 +24,18 @@ cargo = rust-toolchain; rustc = rust-toolchain; }; + runtimeDependencies = (with pkgs; [ libGL vulkan-loader ]) ++ + (with pkgs.xorg; [ libX11 libXdmcp libXrender libXcursor libXau libxcb libXfixes libXrandr libXext libXi ]); in with pkgs; { packages = rec { crescent = rustPlatform.buildRustPackage rec { + inherit runtimeDependencies; pname = "crescent"; version = "0.1.0"; src = ./.; - buildInputs = [ libxkbcommon ]; + buildInputs = [ libxkbcommon gccForLibs.lib ]; + nativeBuildInputs = [ autoPatchelfHook ]; postUnpack = '' echo $(pwd) ls $sourceRoot/runa-wayland-protocols/spec @@ -54,7 +58,7 @@ nativeBuildInputs = [ pkg-config cmake rust-toolchain ]; buildInputs = [ libxkbcommon ]; shellHook = '' - export LD_LIBRARY_PATH="${lib.makeLibraryPath [ libglvnd vulkan-loader ]}:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="${lib.makeLibraryPath runtimeDependencies}:$LD_LIBRARY_PATH" ''; LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages_17.libclang.lib ];