properly patch nodewebkit

This commit is contained in:
Matej Cotman 2014-09-13 10:01:01 +02:00
parent e0eb4c5bc5
commit 77fa9da425

View File

@ -9,8 +9,9 @@ let
name = "node-webkit-env"; name = "node-webkit-env";
paths = [ paths = [
xlibs.libX11 xlibs.libXrender glib gtk atk pango cairo gdk_pixbuf xlibs.libX11 xlibs.libXrender glib gtk atk pango cairo gdk_pixbuf
freetype fontconfig xlibs.libXcomposite alsaLib xlibs.libXdamage xlibs.libXext freetype fontconfig xlibs.libXcomposite alsaLib xlibs.libXdamage
xlibs.libXfixes nss nspr gconf expat dbus udev stdenv.gcc.gcc xlibs.libXext xlibs.libXfixes nss nspr gconf expat dbus stdenv.gcc.gcc
xlibs.libXtst xlibs.libXi
]; ];
}; };
@ -19,28 +20,27 @@ in stdenv.mkDerivation rec {
version = "0.9.2"; version = "0.9.2";
src = fetchurl { src = fetchurl {
url = "https://s3.amazonaws.com/node-webkit/v${version}/node-webkit-v${version}-linux-${bits}.tar.gz"; url = "http://dl.node-webkit.org/v${version}/node-webkit-v${version}-linux-${bits}.tar.gz";
sha256 = if bits == "x64" then sha256 = if bits == "x64" then
"04b9hgrxxnvrzyc7kmlabvrfbzj9d6lif7z69zgsbn3x25nxxd2n" else "04b9hgrxxnvrzyc7kmlabvrfbzj9d6lif7z69zgsbn3x25nxxd2n" else
"0icwdl564sbx27124js1l4whfld0n6nbysdd522frzk1759dzgri"; "0icwdl564sbx27124js1l4whfld0n6nbysdd522frzk1759dzgri";
}; };
patchPhase = '' installPhase = ''
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" nw
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" nwsnapshot
'';
installPhase = let
LD_LIBRARY_PATH = "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit";
in ''
mkdir -p $out/bin
mkdir -p $out/share/node-webkit mkdir -p $out/share/node-webkit
cp -R * $out/share/node-webkit cp -R * $out/share/node-webkit
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0 ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
makeWrapper $out/share/node-webkit/nw $out/bin/nw --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}" patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
makeWrapper $out/share/node-webkit/nwsnapshot $out/bin/nwsnapshot --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}" patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot
mkdir -p $out/bin
ln -s $out/share/node-webkit/nw $out/bin
ln -s $out/share/node-webkit/nwsnapshot $out/bin
''; '';
buildInputs = [ makeWrapper ]; buildInputs = [ makeWrapper ];