2014-01-12 22:39:14 +00:00
|
|
|
{ stdenv, fetchurl, buildEnv, makeWrapper
|
2015-09-15 10:26:18 +01:00
|
|
|
, xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
|
2015-10-03 19:52:03 +01:00
|
|
|
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev }:
|
2014-01-12 22:39:14 +00:00
|
|
|
let
|
|
|
|
bits = if stdenv.system == "x86_64-linux" then "x64"
|
|
|
|
else "ia32";
|
|
|
|
|
|
|
|
nwEnv = buildEnv {
|
|
|
|
name = "node-webkit-env";
|
|
|
|
paths = [
|
2015-09-15 10:26:18 +01:00
|
|
|
xorg.libX11 xorg.libXrender glib gtk atk pango cairo gdk_pixbuf
|
|
|
|
freetype fontconfig xorg.libXcomposite alsaLib xorg.libXdamage
|
|
|
|
xorg.libXext xorg.libXfixes nss nspr gconf expat dbus stdenv.cc.cc
|
|
|
|
xorg.libXtst xorg.libXi
|
2014-01-12 22:39:14 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "node-webkit-${version}";
|
2014-07-27 07:23:11 +01:00
|
|
|
version = "0.9.2";
|
2014-01-12 22:39:14 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-09-13 09:01:01 +01:00
|
|
|
url = "http://dl.node-webkit.org/v${version}/node-webkit-v${version}-linux-${bits}.tar.gz";
|
2014-01-12 22:39:14 +00:00
|
|
|
sha256 = if bits == "x64" then
|
2014-07-27 07:23:11 +01:00
|
|
|
"04b9hgrxxnvrzyc7kmlabvrfbzj9d6lif7z69zgsbn3x25nxxd2n" else
|
|
|
|
"0icwdl564sbx27124js1l4whfld0n6nbysdd522frzk1759dzgri";
|
2014-01-12 22:39:14 +00:00
|
|
|
};
|
|
|
|
|
2014-09-13 09:01:01 +01:00
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/share/node-webkit
|
2014-01-12 22:39:14 +00:00
|
|
|
cp -R * $out/share/node-webkit
|
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
|
2014-09-13 09:01:01 +01:00
|
|
|
|
2015-10-03 19:52:03 +01:00
|
|
|
ln -s ${libudev.out}/lib/libudev.so $out/share/node-webkit/libudev.so.0
|
2014-01-12 22:39:14 +00:00
|
|
|
|
2014-09-13 09:01:01 +01:00
|
|
|
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
|
|
|
|
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
|
2014-01-12 22:39:14 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An app runtime based on Chromium and node.js";
|
|
|
|
homepage = https://github.com/rogerwang/node-webkit;
|
|
|
|
platforms = ["i686-linux" "x86_64-linux"];
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|