node_webkit/nwjs: 0.12 -> 0.23.6

Keep 0.12, because it is still needed by `nixui`.
Keep 0.9, because it is still needed by `zed`.
This commit is contained in:
Profpatsch 2017-08-03 02:30:42 +02:00
parent 0f6286cc4b
commit 5e0cf582c1
3 changed files with 99 additions and 69 deletions

View File

@ -1,59 +0,0 @@
{ stdenv, fetchurl, buildEnv, makeWrapper
, xorg, alsaLib, dbus, glib, gtk2, atk, pango, freetype, fontconfig
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, systemd, libcap
, libnotify}:
let
bits = if stdenv.system == "x86_64-linux" then "x64"
else "ia32";
nwEnv = buildEnv {
name = "node-webkit-env";
paths = [
xorg.libX11 xorg.libXrender glib gtk2 atk pango cairo gdk_pixbuf
freetype fontconfig xorg.libXcomposite alsaLib xorg.libXdamage
xorg.libXext xorg.libXfixes nss nspr gconf expat dbus stdenv.cc
xorg.libXtst xorg.libXi xorg.libXcursor xorg.libXrandr libcap
libnotify
];
extraOutputsToInstall = [ "lib" "out" ];
};
in stdenv.mkDerivation rec {
name = "node-webkit-${version}";
version = "0.11.2";
src = fetchurl {
url = "http://dl.node-webkit.org/v${version}/node-webkit-v${version}-linux-${bits}.tar.gz";
sha256 = if bits == "x64" then
"1iby0yrnbk9xfcsfz59f6g00l6rxiyxvq78shs0c145ky7lknq5q" else
"1hk3c9z3kwmqaj87vc5k1a7fv8jhkyqw1wjmsl3q5i50w880h398";
};
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
ln -s ${systemd.lib}/lib/libudev.so $out/share/node-webkit/libudev.so.0
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;
};
}

View File

@ -0,0 +1,87 @@
{ stdenv, fetchurl, buildEnv, makeWrapper
, xorg, alsaLib, dbus, glib, gtk2, gtk3, atk, pango, freetype, fontconfig
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, systemd, libcap
, libnotify
, ffmpeg, libxcb, libXScrnSaver, cups
, sqlite, udev
}:
let
bits = if stdenv.system == "x86_64-linux" then "x64"
else "ia32";
nwEnv = buildEnv {
name = "nwjs-env";
paths = [
xorg.libX11 xorg.libXrender glib /*gtk2*/ gtk3 atk pango cairo gdk_pixbuf
freetype fontconfig xorg.libXcomposite alsaLib xorg.libXdamage
xorg.libXext xorg.libXfixes nss nspr gconf expat dbus
xorg.libXtst xorg.libXi xorg.libXcursor xorg.libXrandr
xorg.libXScrnSaver cups
libcap libnotify
# libnw-specific (not chromium dependencies)
ffmpeg libxcb
# chromium runtime deps (dlopend)
sqlite udev
];
extraOutputsToInstall = [ "lib" "out" ];
};
in stdenv.mkDerivation rec {
name = "nwjs-${version}";
version = "0.23.6";
src = fetchurl {
url = "http://dl.nwjs.io/v${version}/nwjs-v${version}-linux-${bits}.tar.gz";
sha256 = if bits == "x64" then
"0ppyjspdvacarhdn4xd5i1pqgmf4z1bxnh1cry780489h25rcjgj" else
"0c0j73vnzhsry5rdx41d954a29jmjnvzli728cfbjybfr51zdybg";
};
phases = [ "unpackPhase" "installPhase" ];
# we have runtime deps like sqlite3 that should remain
dontPatchELF = true;
installPhase =
let ccPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
in ''
mkdir -p $out/share/nwjs
cp -R * $out/share/nwjs
find $out/share/nwjs
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nw
ln -s ${systemd.lib}/lib/libudev.so $out/share/nwjs/libudev.so.0
libpath="$out/share/nwjs/lib/"
for f in "$libpath"/*.so; do
patchelf --set-rpath "${nwEnv}/lib:${ccPath}:$libpath" "$f"
done
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:${ccPath}:$libpath" $out/share/nwjs/nw
# check, whether all RPATHs are correct (all dependencies found)
checkfile=$(mktemp)
for f in "$libpath"/*.so "$out/share/nwjs/nw"; do
(echo "$f:";
ldd "$f" ) > "$checkfile"
done
if <"$checkfile" grep -e "not found"; then
cat "$checkfile"
exit 1
fi
mkdir -p $out/bin
ln -s $out/share/nwjs/nw $out/bin
'';
buildInputs = [ makeWrapper ];
meta = with stdenv.lib; {
description = "An app runtime based on Chromium and node.js";
homepage = http://nwjs.io/;
platforms = ["i686-linux" "x86_64-linux"];
maintainers = [ maintainers.offline ];
license = licenses.bsd3;
};
}

View File

@ -7955,20 +7955,20 @@ with pkgs;
nexus = callPackage ../development/tools/repository-managers/nexus { };
node_webkit = node_webkit_0_9;
nwjs = callPackage ../development/tools/nwjs {
gconf = pkgs.gnome2.GConf;
};
# only kept for zed, see https://github.com/NixOS/nixpkgs/issues/37361
nwjs_0_9 = callPackage ../development/tools/node-webkit/nw9.nix {
gconf = pkgs.gnome2.GConf;
};
# only kept for nixui, see https://github.com/matejc/nixui/issues/27
nwjs_0_12 = callPackage ../development/tools/node-webkit/nw12.nix {
gconf = pkgs.gnome2.GConf;
};
node_webkit_0_11 = callPackage ../development/tools/node-webkit/nw11.nix {
gconf = pkgs.gnome2.GConf;
};
node_webkit_0_9 = callPackage ../development/tools/node-webkit/nw9.nix {
gconf = pkgs.gnome2.GConf;
};
noweb = callPackage ../development/tools/literate-programming/noweb { };
nuweb = callPackage ../development/tools/literate-programming/nuweb { tex = texlive.combined.scheme-small; };
@ -18581,7 +18581,9 @@ with pkgs;
useMupdf = config.zathura.useMupdf or true;
};
zed = callPackage ../applications/editors/zed { };
zed = callPackage ../applications/editors/zed {
node_webkit = nwjs_0_9;
};
zeroc_ice = callPackage ../development/libraries/zeroc-ice {
inherit (darwin.apple_sdk.frameworks) Security;