vscode: fix rpath for native modules
This commit is contained in:
parent
9905c44eca
commit
919a5f6963
@ -1,6 +1,8 @@
|
|||||||
{ stdenv, lib, fetchurl, unzip, atomEnv, makeDesktopItem,
|
{ stdenv, lib, fetchurl, makeDesktopItem
|
||||||
gtk2, wrapGAppsHook, libXScrnSaver, libxkbfile, libsecret,
|
, unzip, libsecret, libXScrnSaver, wrapGAppsHook
|
||||||
isInsiders ? false }:
|
, gtk2, atomEnv, at-spi2-atk, autoPatchelfHook
|
||||||
|
, systemd, fontconfig
|
||||||
|
, isInsiders ? false }:
|
||||||
|
|
||||||
let
|
let
|
||||||
executableName = "code" + lib.optionalString isInsiders "-insiders";
|
executableName = "code" + lib.optionalString isInsiders "-insiders";
|
||||||
@ -20,16 +22,6 @@ let
|
|||||||
}.${stdenv.hostPlatform.system};
|
}.${stdenv.hostPlatform.system};
|
||||||
|
|
||||||
archive_fmt = if stdenv.hostPlatform.system == "x86_64-darwin" then "zip" else "tar.gz";
|
archive_fmt = if stdenv.hostPlatform.system == "x86_64-darwin" then "zip" else "tar.gz";
|
||||||
|
|
||||||
rpath = lib.concatStringsSep ":" [
|
|
||||||
atomEnv.libPath
|
|
||||||
"${lib.makeLibraryPath [gtk2]}"
|
|
||||||
"${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0"
|
|
||||||
"${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}";
|
||||||
@ -83,9 +75,12 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = if stdenv.hostPlatform.system == "x86_64-darwin"
|
buildInputs = (if stdenv.isDarwin
|
||||||
then [ unzip libXScrnSaver libsecret ]
|
then [ unzip ]
|
||||||
else [ wrapGAppsHook libXScrnSaver libxkbfile libsecret ];
|
else [ gtk2 at-spi2-atk wrapGAppsHook ] ++ atomEnv.packages)
|
||||||
|
++ [ libsecret libXScrnSaver ];
|
||||||
|
|
||||||
|
nativeBuildInputs = lib.optional (!stdenv.isDarwin) autoPatchelfHook;
|
||||||
|
|
||||||
installPhase =
|
installPhase =
|
||||||
if stdenv.hostPlatform.system == "x86_64-darwin" then ''
|
if stdenv.hostPlatform.system == "x86_64-darwin" then ''
|
||||||
@ -111,19 +106,8 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") ''
|
postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") ''
|
||||||
patchelf \
|
wrapProgram $out/lib/vscode/${executableName} \
|
||||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ systemd fontconfig ]}
|
||||||
--set-rpath "${rpath}" \
|
|
||||||
$out/lib/vscode/${executableName}
|
|
||||||
|
|
||||||
patchelf \
|
|
||||||
--set-rpath "${rpath}" \
|
|
||||||
$out/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
|
|
||||||
|
|
||||||
patchelf \
|
|
||||||
--set-rpath "${rpath}" \
|
|
||||||
"$out/lib/vscode/resources/app/node_modules.asar.unpacked/native-keymap/build/Release/\
|
|
||||||
keymapping.node"
|
|
||||||
|
|
||||||
ln -s ${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0 $out/lib/vscode/libsecret-1.so.0
|
ln -s ${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0 $out/lib/vscode/libsecret-1.so.0
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user