nixpkgs/pkgs/development/tools/node-webkit/nw11.nix

58 lines
2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, buildEnv, makeWrapper
, xlibs, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
2015-01-22 05:15:02 +01:00
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev, libcap
, libnotify}:
let
bits = if stdenv.system == "x86_64-linux" then "x64"
else "ia32";
nwEnv = buildEnv {
name = "node-webkit-env";
paths = [
xlibs.libX11 xlibs.libXrender glib gtk atk pango cairo gdk_pixbuf
2014-09-13 10:01:01 +02:00
freetype fontconfig xlibs.libXcomposite alsaLib xlibs.libXdamage
2015-01-22 05:15:02 +01:00
xlibs.libXext xlibs.libXfixes nss nspr gconf expat dbus stdenv.cc
xlibs.libXtst xlibs.libXi xlibs.libXcursor xlibs.libXrandr libcap
libnotify
];
};
in stdenv.mkDerivation rec {
name = "node-webkit-${version}";
2015-01-22 05:15:02 +01:00
version = "0.11.2";
src = fetchurl {
2014-09-13 10:01:01 +02:00
url = "http://dl.node-webkit.org/v${version}/node-webkit-v${version}-linux-${bits}.tar.gz";
sha256 = if bits == "x64" then
2015-01-22 05:15:02 +01:00
"1iby0yrnbk9xfcsfz59f6g00l6rxiyxvq78shs0c145ky7lknq5q" else
"1hk3c9z3kwmqaj87vc5k1a7fv8jhkyqw1wjmsl3q5i50w880h398";
};
2014-09-13 10:01:01 +02:00
installPhase = ''
mkdir -p $out/share/node-webkit
cp -R * $out/share/node-webkit
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 10:01:01 +02:00
ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
2014-09-13 10:01:01 +02: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
'';
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;
};
}