diff --git a/nix/gst-wayland-display.nix b/nix/gst-wayland-display.nix index 469a8c25..abd41ca2 100644 --- a/nix/gst-wayland-display.nix +++ b/nix/gst-wayland-display.nix @@ -11,6 +11,9 @@ pkgs.rustPlatform.buildRustPackage rec { }; nativeBuildInputs = with pkgs; [ pkg-config cargo-c ]; buildInputs = with pkgs; [ + mesa + libglvnd + pipewire glib wayland libinput @@ -27,6 +30,7 @@ pkgs.rustPlatform.buildRustPackage rec { udev ]; + cargoLockFile = builtins.toFile "cargo.lock" (builtins.readFile "${src}/Cargo.lock"); cargoLock = { @@ -36,6 +40,17 @@ pkgs.rustPlatform.buildRustPackage rec { "smithay-0.3.0" = "sha256-jrBY/r4IuVKiE7ykuxeZcJgikqJo6VoKQlBWrDbpy9Y="; }; }; + + # Force linking to libEGL, which is always dlopen()ed, and to + # libwayland-client, which is always dlopen()ed except by the + # obscure winit backend. + RUSTFLAGS = map (a: "-C link-arg=${a}") [ + "-Wl,--push-state,--no-as-needed" + "-lEGL" + "-lwayland-client" + "-Wl,--pop-state" + ]; + postPatch = '' cp ${cargoLockFile} Cargo.lock '';