Skip to content

Commit

Permalink
discord: fix "corrupt install" warnings, misc cleanup
Browse files Browse the repository at this point in the history
Few things:
* Discord binary has RUNPATH not RPATH set
* patchelf uses RUNPATH if it already exits, so deps end up in RUNPATH
* RUNPATH isn't searched for plugins or transitive deps
* ..badness results

Despite this, it currently seems to work-- with the caveat
that it has a little bar on top complaining about how
"it looks like your installation is corrupt".

This fixes that warning and does some minor cleanup.

(cherry picked from commit 8753b10)
  • Loading branch information
dtzWill authored and Cray Elliott committed Jan 11, 2018
1 parent eae2506 commit 60f71d8
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -18,6 +18,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper ];

libPath = stdenv.lib.makeLibraryPath [
libcxx systemd libpulseaudio
stdenv.cc.cc alsaLib atk cairo cups dbus expat fontconfig freetype
gdk_pixbuf glib gnome2.GConf gtk2 libnotify libX11 libXcomposite
libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
Expand All @@ -28,15 +29,12 @@ stdenv.mkDerivation rec {
mkdir -p $out/{bin,opt/discord,share/pixmaps}
mv * $out/opt/discord
# Copying how adobe-reader does it,
# see pkgs/applications/misc/adobe-reader/builder.sh
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "$out/opt/discord:$libPath" \
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
$out/opt/discord/Discord
paxmark m $out/opt/discord/Discord
wrapProgram $out/opt/discord/Discord --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH:${libcxx}/lib:${systemd.lib}/lib:${libpulseaudio}/lib"
wrapProgram $out/opt/discord/Discord --prefix LD_LIBRARY_PATH : ${libPath}
ln -s $out/opt/discord/Discord $out/bin/
ln -s $out/opt/discord/discord.png $out/share/pixmaps
Expand Down

0 comments on commit 60f71d8

Please sign in to comment.