2024-01-02 11:29:13 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, libnotify
|
|
|
|
|
, libuuid
|
2024-01-02 11:29:13 +00:00
|
|
|
|
, libxcb
|
|
|
|
|
, libxkbcommon
|
|
|
|
|
, makeWrapper
|
|
|
|
|
, mesa
|
|
|
|
|
, nspr
|
|
|
|
|
, nss
|
|
|
|
|
, pango
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, sdk ? false
|
2024-01-02 11:29:13 +00:00
|
|
|
|
, sqlite
|
|
|
|
|
, stdenv
|
|
|
|
|
, systemd
|
|
|
|
|
, udev
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, xorg
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
let
|
2024-01-02 11:29:13 +00:00
|
|
|
|
bits = if stdenv.hostPlatform.system == "x86_64-linux" then "x64" else "ia32";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
nwEnv = buildEnv {
|
|
|
|
|
name = "nwjs-env";
|
|
|
|
|
paths = [
|
2024-01-02 11:29:13 +00:00
|
|
|
|
alsa-lib
|
|
|
|
|
at-spi2-core
|
|
|
|
|
atk
|
|
|
|
|
cairo
|
|
|
|
|
cups
|
|
|
|
|
dbus
|
|
|
|
|
expat
|
|
|
|
|
fontconfig
|
|
|
|
|
freetype
|
|
|
|
|
gdk-pixbuf
|
|
|
|
|
glib
|
|
|
|
|
gtk3
|
|
|
|
|
libcap
|
|
|
|
|
libdrm
|
|
|
|
|
libnotify
|
2021-12-06 16:07:01 +00:00
|
|
|
|
libxkbcommon
|
2024-01-02 11:29:13 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# libnw-specific (not chromium dependencies)
|
2024-01-02 11:29:13 +00:00
|
|
|
|
ffmpeg
|
|
|
|
|
libxcb
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# chromium runtime deps (dlopen’d)
|
|
|
|
|
libuuid
|
2024-01-02 11:29:13 +00:00
|
|
|
|
sqlite
|
|
|
|
|
udev
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
extraOutputsToInstall = [ "lib" "out" ];
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
|
version = "0.85.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
in
|
|
|
|
|
stdenv.mkDerivation {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
pname = "nwjs";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2024-01-02 11:29:13 +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 = {
|
2024-04-21 15:54:59 +00:00
|
|
|
|
"sdk-ia32" = "sha256-QcFKX+TLRBYAMt5oUYoVMfBgGFZZ/4pdhhtNI0OxF/M=";
|
|
|
|
|
"sdk-x64" = "sha256-Wqq0iI5VLa/hJLTNF10YpFTtLRP6okjCC2EzlXxeuWI=";
|
|
|
|
|
"ia32" = "sha256-st/J/Zejo3R0dKxxdM7XBvmAlfsO2+2i5lYlAv9A5lY=";
|
|
|
|
|
"x64" = "sha256-hxSyzNEH6UJVejUqoG01vpJxb319wrLgp7uyF6Pt5YQ=";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
}."${flavor + bits}";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
autoPatchelfHook
|
|
|
|
|
(wrapGAppsHook.override { inherit makeWrapper; })
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [ nwEnv ];
|
|
|
|
|
appendRunpaths = map (pkg: (lib.getLib pkg) + "/lib") [ nwEnv stdenv.cc.libc stdenv.cc.cc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
|
preFixup = ''
|
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
|
|
|
|
)
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
mkdir -p $out/share/nwjs
|
|
|
|
|
cp -R * $out/share/nwjs
|
|
|
|
|
find $out/share/nwjs
|
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
|
ln -s ${lib.getLib systemd}/lib/libudev.so $out/share/nwjs/libudev.so.0
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
ln -s $out/share/nwjs/nw $out/bin
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
|
|
mkdir $out/lib
|
|
|
|
|
ln -s $out/share/nwjs/lib/libnw.so $out/lib/libnw.so
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
|
runHook postInstall
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "An app runtime based on Chromium and node.js";
|
|
|
|
|
homepage = "https://nwjs.io/";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
|
|
|
maintainers = [ maintainers.mikaelfangel ];
|
|
|
|
|
mainProgram = "nw";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
license = licenses.bsd3;
|
|
|
|
|
};
|
|
|
|
|
}
|