Skip to content

Commit

Permalink
🔥 remove LD_LIBRARY_PATH wrapper (#85)
Browse files Browse the repository at this point in the history
Removes the wrapper that sets `LD_LIBRARY_PATH`.
The path is passed through to programs that are opened, which could be
an error source.
  • Loading branch information
a-kenji authored Mar 6, 2024
1 parent acf33fe commit 56597ef
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,28 @@
}-${builtins.substring 6 2 self.lastModifiedDate}";
GIT_REV = self.shortRev or "Not committed yet.";
treefmt = (treefmt-nix.lib.evalModule pkgs ./formatter.nix).config.build;
libPath = pkgs.lib.makeLibraryPath [
pkgs.wayland
pkgs.libxkbcommon
pkgs.vulkan-loader
pkgs.libGL
];

in {
devShells.${system}.default = pkgs.mkShellNoCC {
inherit nativeBuildInputs buildInputs GIT_DATE GIT_REV;
packages = devInputs ++ [ treefmt.wrapper ];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.wayland
pkgs.libxkbcommon
pkgs.vulkan-loader
pkgs.libGL
];
LD_LIBRARY_PATH = libPath;
};
packages.${system} = {
default = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts nativeBuildInputs buildInputs pname GIT_REV
GIT_DATE;
postInstall = ''
wrapProgram "$out/bin/${pname}" \
--prefix LD_LIBRARY_PATH : ${
pkgs.lib.makeLibraryPath [
pkgs.wayland
pkgs.libxkbcommon
pkgs.vulkan-loader
pkgs.libGL
]
}
postFixup = pkgs.lib.optional pkgs.stdenv.isLinux ''
rpath=$(patchelf --print-rpath $out/bin/${pname})
patchelf --set-rpath "$rpath:${libPath}" $out/bin/${pname}
'';

meta = with pkgs.lib; {
description = "Your trusty omnibox search.";
homepage = "https://github.com/friedow/centerpiece";
Expand Down

0 comments on commit 56597ef

Please sign in to comment.