Skip to content

Commit

Permalink
fix(flake): missing libEGL
Browse files Browse the repository at this point in the history
  • Loading branch information
cliarena committed Feb 10, 2024
1 parent 698159e commit ab61574
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions nix/gst-wayland-display.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ pkgs.rustPlatform.buildRustPackage rec {
};
nativeBuildInputs = with pkgs; [ pkg-config cargo-c ];
buildInputs = with pkgs; [
mesa
libglvnd
pipewire
glib
wayland
libinput
Expand All @@ -27,6 +30,7 @@ pkgs.rustPlatform.buildRustPackage rec {

udev
];

cargoLockFile =
builtins.toFile "cargo.lock" (builtins.readFile "${src}/Cargo.lock");
cargoLock = {
Expand All @@ -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
'';
Expand Down

0 comments on commit ab61574

Please sign in to comment.