2023-11-06 13:03:02 +00:00
|
|
|
|
{ alsa-lib
|
|
|
|
|
, at-spi2-core
|
|
|
|
|
, atk
|
|
|
|
|
, autoPatchelfHook
|
|
|
|
|
, buildEnv
|
|
|
|
|
, cairo
|
|
|
|
|
, cups
|
|
|
|
|
, dbus
|
|
|
|
|
, expat
|
|
|
|
|
, fetchurl
|
|
|
|
|
, ffmpeg
|
|
|
|
|
, fontconfig
|
|
|
|
|
, freetype
|
|
|
|
|
, gdk-pixbuf
|
|
|
|
|
, glib
|
|
|
|
|
, gtk3
|
|
|
|
|
, lib
|
|
|
|
|
, libcap
|
|
|
|
|
, libdrm
|
2017-08-03 00:30:42 +00:00
|
|
|
|
, libnotify
|
2018-10-02 08:24:05 +00:00
|
|
|
|
, libuuid
|
2023-11-06 13:03:02 +00:00
|
|
|
|
, libxcb
|
|
|
|
|
, libxkbcommon
|
2023-12-08 23:48:23 +00:00
|
|
|
|
, makeWrapper
|
2023-11-06 13:03:02 +00:00
|
|
|
|
, mesa
|
|
|
|
|
, nspr
|
|
|
|
|
, nss
|
|
|
|
|
, pango
|
2018-10-02 08:24:05 +00:00
|
|
|
|
, sdk ? false
|
2023-11-06 13:03:02 +00:00
|
|
|
|
, sqlite
|
|
|
|
|
, stdenv
|
|
|
|
|
, systemd
|
|
|
|
|
, udev
|
2023-12-08 23:48:23 +00:00
|
|
|
|
, wrapGAppsHook
|
2023-11-06 13:03:02 +00:00
|
|
|
|
, xorg
|
2017-08-03 00:30:42 +00:00
|
|
|
|
}:
|
2023-11-06 13:03:02 +00:00
|
|
|
|
|
2017-08-03 00:30:42 +00:00
|
|
|
|
let
|
2023-11-06 13:03:02 +00:00
|
|
|
|
bits = if stdenv.hostPlatform.system == "x86_64-linux" then "x64" else "ia32";
|
2017-08-03 00:30:42 +00:00
|
|
|
|
|
|
|
|
|
nwEnv = buildEnv {
|
|
|
|
|
name = "nwjs-env";
|
|
|
|
|
paths = [
|
2023-11-06 13:03:02 +00:00
|
|
|
|
alsa-lib
|
|
|
|
|
at-spi2-core
|
|
|
|
|
atk
|
|
|
|
|
cairo
|
|
|
|
|
cups
|
|
|
|
|
dbus
|
|
|
|
|
expat
|
|
|
|
|
fontconfig
|
|
|
|
|
freetype
|
|
|
|
|
gdk-pixbuf
|
|
|
|
|
glib
|
|
|
|
|
gtk3
|
|
|
|
|
libcap
|
|
|
|
|
libdrm
|
|
|
|
|
libnotify
|
2021-11-29 17:38:59 +00:00
|
|
|
|
libxkbcommon
|
2023-11-06 13:03:02 +00:00
|
|
|
|
mesa
|
|
|
|
|
nspr
|
|
|
|
|
nss
|
|
|
|
|
pango
|
|
|
|
|
xorg.libX11
|
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
|
xorg.libXcomposite
|
|
|
|
|
xorg.libXcursor
|
|
|
|
|
xorg.libXdamage
|
|
|
|
|
xorg.libXext
|
|
|
|
|
xorg.libXfixes
|
|
|
|
|
xorg.libXi
|
|
|
|
|
xorg.libXrandr
|
|
|
|
|
xorg.libXrender
|
|
|
|
|
xorg.libXtst
|
|
|
|
|
xorg.libxshmfence
|
2017-08-03 00:30:42 +00:00
|
|
|
|
# libnw-specific (not chromium dependencies)
|
2023-11-06 13:03:02 +00:00
|
|
|
|
ffmpeg
|
|
|
|
|
libxcb
|
2017-08-03 00:30:42 +00:00
|
|
|
|
# chromium runtime deps (dlopen’d)
|
2018-10-02 08:24:05 +00:00
|
|
|
|
libuuid
|
2023-11-06 13:03:02 +00:00
|
|
|
|
sqlite
|
|
|
|
|
udev
|
2017-08-03 00:30:42 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
extraOutputsToInstall = [ "lib" "out" ];
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-23 23:32:17 +00:00
|
|
|
|
version = "0.83.0";
|
2023-11-06 13:03:02 +00:00
|
|
|
|
in
|
2023-11-06 13:04:27 +00:00
|
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
|
pname = "nwjs";
|
2023-11-06 13:04:27 +00:00
|
|
|
|
inherit version;
|
2017-08-03 00:30:42 +00:00
|
|
|
|
|
2023-11-06 13:03:02 +00:00
|
|
|
|
src =
|
|
|
|
|
let flavor = if sdk then "sdk-" else "";
|
|
|
|
|
in fetchurl {
|
|
|
|
|
url = "https://dl.nwjs.io/v${version}/nwjs-${flavor}v${version}-linux-${bits}.tar.gz";
|
|
|
|
|
hash = {
|
2023-12-23 23:32:17 +00:00
|
|
|
|
"sdk-ia32" = "sha256-Sps0XFOnnJIkDRPI+PJSjseF8cyaYvXXs4ZeVI8mcm8=";
|
|
|
|
|
"sdk-x64" = "sha256-qsNPfmDQK/BZzMTlX9MDaV7KZsU32YQ1B/Qh/EHIZrQ=";
|
|
|
|
|
"ia32" = "sha256-99+EU4Kg8lH8facRmIl2SV3GyWUw46rGYpso5QSP//k=";
|
|
|
|
|
"x64" = "sha256-y0oBVvVguRDe391EsQs6qYqkTRPzUfm50m6NDOZh+7o=";
|
2023-11-06 13:03:02 +00:00
|
|
|
|
}."${flavor + bits}";
|
|
|
|
|
};
|
2017-08-03 00:30:42 +00:00
|
|
|
|
|
2023-12-08 23:48:23 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
autoPatchelfHook
|
|
|
|
|
(wrapGAppsHook.override { inherit makeWrapper; })
|
|
|
|
|
];
|
|
|
|
|
|
2023-11-06 13:04:27 +00:00
|
|
|
|
buildInputs = [ nwEnv ];
|
|
|
|
|
appendRunpaths = map (pkg: (lib.getLib pkg) + "/lib") [ nwEnv stdenv.cc.libc stdenv.cc.cc ];
|
|
|
|
|
|
2023-12-08 23:48:23 +00:00
|
|
|
|
preFixup = ''
|
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
|
|
|
|
)
|
|
|
|
|
'';
|
|
|
|
|
|
2023-11-06 13:04:27 +00:00
|
|
|
|
installPhase = ''
|
|
|
|
|
runHook preInstall
|
2017-08-03 00:30:42 +00:00
|
|
|
|
|
|
|
|
|
mkdir -p $out/share/nwjs
|
|
|
|
|
cp -R * $out/share/nwjs
|
|
|
|
|
find $out/share/nwjs
|
|
|
|
|
|
2020-08-12 18:17:35 +00:00
|
|
|
|
ln -s ${lib.getLib systemd}/lib/libudev.so $out/share/nwjs/libudev.so.0
|
2017-08-03 00:30:42 +00:00
|
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
ln -s $out/share/nwjs/nw $out/bin
|
2021-11-02 18:29:41 +00:00
|
|
|
|
|
|
|
|
|
mkdir $out/lib
|
|
|
|
|
ln -s $out/share/nwjs/lib/libnw.so $out/lib/libnw.so
|
2023-11-06 13:04:27 +00:00
|
|
|
|
|
|
|
|
|
runHook postInstall
|
2023-11-06 13:03:02 +00:00
|
|
|
|
'';
|
2017-08-03 00:30:42 +00:00
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
|
meta = with lib; {
|
2017-08-03 00:30:42 +00:00
|
|
|
|
description = "An app runtime based on Chromium and node.js";
|
2020-04-01 01:11:51 +00:00
|
|
|
|
homepage = "https://nwjs.io/";
|
2023-11-06 13:03:02 +00:00
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2023-11-06 13:04:27 +00:00
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2023-11-06 13:44:35 +00:00
|
|
|
|
maintainers = [ maintainers.mikaelfangel ];
|
2023-12-06 08:37:54 +00:00
|
|
|
|
mainProgram = "nw";
|
2017-08-03 00:30:42 +00:00
|
|
|
|
license = licenses.bsd3;
|
|
|
|
|
};
|
|
|
|
|
}
|