nix: Fix gpu-lib/wayland binary patching on nix package (#16958)

Also, includes some cleanup -- adds missing flake-compat input and
aligns the nix build module with how nixpkgs does it.

Release Notes:

- Fixed an issue on NixOS package where the wrong binaries were being
patched, leading to missing Wayland libs when launching Zed
This commit is contained in:
jvmncs 2024-08-27 12:24:42 -04:00 committed by GitHub
parent 1f0b7d45ff
commit ff26abdc2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 29 deletions

View file

@ -1,6 +1,7 @@
{
lib,
craneLib,
rustPlatform,
clang,
llvmPackages_18,
mold-wrapped,
@ -48,6 +49,17 @@
// {
inherit src stdenv;
nativeBuildInputs = [
clang
copyDesktopItems
curl
mold-wrapped
perl
pkg-config
protobuf
rustPlatform.bindgenHook
];
buildInputs = [
curl
fontconfig
@ -57,22 +69,13 @@
sqlite
zlib
zstd
alsa-lib
libxkbcommon
wayland
xorg.libxcb
];
nativeBuildInputs = [
clang
copyDesktopItems
curl
mold-wrapped
perl
pkg-config
protobuf
];
ZSTD_SYS_USE_PKG_CONFIG = true;
FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [
@ -103,8 +106,8 @@
else "";
postFixup = ''
patchelf --add-rpath ${gpu-lib}/lib $out/bin/*
patchelf --add-rpath ${wayland}/lib $out/bin/*
patchelf --add-rpath ${gpu-lib}/lib $out/libexec/*
patchelf --add-rpath ${wayland}/lib $out/libexec/*
'';
postInstall = ''