discord: fix "corrupt install" warnings, misc cleanup

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.
wip/yesman
Will Dietz 7 years ago committed by Cray Elliott
parent 15b1432435
commit 8753b10808
  1. 8
      pkgs/applications/networking/instant-messengers/discord/default.nix

@ -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
@ -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

Loading…
Cancel
Save