2020-08-12 19:16:44 +01:00
|
|
|
{ stdenv, lib, fetchurl, buildEnv, makeWrapper
|
2016-09-11 22:24:51 +01:00
|
|
|
, xorg, alsaLib, dbus, glib, gtk2, atk, pango, freetype, fontconfig
|
2019-05-22 12:03:39 +01:00
|
|
|
, gdk-pixbuf, cairo, nss, nspr, gconf, expat, systemd, libcap
|
2015-07-14 21:38:05 +01:00
|
|
|
, libnotify}:
|
|
|
|
let
|
2018-08-20 20:11:29 +01:00
|
|
|
bits = if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
|
2015-07-14 21:38:05 +01:00
|
|
|
else "ia32";
|
|
|
|
|
|
|
|
nwEnv = buildEnv {
|
|
|
|
name = "nwjs-env";
|
|
|
|
paths = [
|
2019-05-22 12:03:39 +01:00
|
|
|
xorg.libX11 xorg.libXrender glib gtk2 atk pango cairo gdk-pixbuf
|
2015-09-15 10:26:18 +01:00
|
|
|
freetype fontconfig xorg.libXcomposite alsaLib xorg.libXdamage
|
2016-05-01 13:43:36 +01:00
|
|
|
xorg.libXext xorg.libXfixes nss nspr gconf expat dbus
|
2015-09-15 10:26:18 +01:00
|
|
|
xorg.libXtst xorg.libXi xorg.libXcursor xorg.libXrandr libcap
|
2015-07-14 21:38:05 +01:00
|
|
|
libnotify
|
|
|
|
];
|
2016-05-01 13:43:36 +01:00
|
|
|
|
|
|
|
extraOutputsToInstall = [ "lib" "out" ];
|
2015-07-14 21:38:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "nwjs";
|
2015-07-14 21:38:05 +01:00
|
|
|
version = "0.12.3";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-23 12:34:55 +01:00
|
|
|
url = "https://dl.nwjs.io/v${version}/nwjs-v${version}-linux-${bits}.tar.gz";
|
2015-07-14 21:38:05 +01:00
|
|
|
sha256 = if bits == "x64" then
|
|
|
|
"1i5ipn5x188cx54pbbmjj1bz89vvcfx5z1c7pqy2xzglkyb2xsyg" else
|
|
|
|
"117gx6yjbcya64yg2vybcfyp591sid209pg8a33k9afbsmgz684c";
|
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/nwjs
|
|
|
|
cp -R * $out/share/nwjs
|
|
|
|
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nw
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nwjc
|
|
|
|
|
2020-08-12 19:16:44 +01:00
|
|
|
ln -s ${lib.getLib systemd}/lib/libudev.so $out/share/nwjs/libudev.so.0
|
2015-07-14 21:38:05 +01:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:${lib.makeLibraryPath [ stdenv.cc.cc ]}:$out/share/nwjs" $out/share/nwjs/nw
|
2015-07-14 21:38:05 +01:00
|
|
|
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/nwjs" $out/share/nwjs/nwjc
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/share/nwjs/nw $out/bin
|
|
|
|
ln -s $out/share/nwjs/nwjc $out/bin
|
|
|
|
'';
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2015-07-14 21:38:05 +01:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2015-07-14 21:38:05 +01:00
|
|
|
description = "An app runtime based on Chromium and node.js";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://nwjs.io/";
|
2015-07-14 21:38:05 +01:00
|
|
|
platforms = ["i686-linux" "x86_64-linux"];
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|