vscode: Add libxkbfile to rpath

Otherwise vscode complains about it.
This commit is contained in:
Benjamin Staffin 2017-04-06 23:35:49 -04:00
parent 4a08528b4a
commit 987cafe5e0
No known key found for this signature in database
GPG Key ID: A490C0134E09AF4A

View File

@ -1,5 +1,5 @@
{ stdenv, lib, callPackage, fetchurl, unzip, atomEnv, makeDesktopItem, { stdenv, lib, callPackage, fetchurl, unzip, atomEnv, makeDesktopItem,
makeWrapper, libXScrnSaver }: makeWrapper, libXScrnSaver, libxkbfile }:
let let
version = "1.11.1"; version = "1.11.1";
@ -19,6 +19,13 @@ let
archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz"; archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz";
rpath = lib.concatStringsSep ":" [
atomEnv.libPath
"${lib.makeLibraryPath [libXScrnSaver]}/libXss.so.1"
"${lib.makeLibraryPath [libxkbfile]}/libxkbfile.so.1"
"$out/lib/vscode"
];
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "vscode-${version}"; name = "vscode-${version}";
@ -41,7 +48,7 @@ in
buildInputs = if stdenv.system == "x86_64-darwin" buildInputs = if stdenv.system == "x86_64-darwin"
then [ unzip makeWrapper libXScrnSaver ] then [ unzip makeWrapper libXScrnSaver ]
else [ makeWrapper libXScrnSaver ]; else [ makeWrapper libXScrnSaver libxkbfile ];
installPhase = installPhase =
if stdenv.system == "x86_64-darwin" then '' if stdenv.system == "x86_64-darwin" then ''
@ -63,7 +70,7 @@ in
postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") '' postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") ''
patchelf \ patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${atomEnv.libPath}:${stdenv.lib.makeLibraryPath [libXScrnSaver]}/libXss.so.1:$out/lib/vscode" \ --set-rpath "${rpath}" \
$out/lib/vscode/code $out/lib/vscode/code
''; '';