@@ -0,0 +1,51 @@
1+{ autoPatchelfHook, electron, fetchurl, makeDesktopItem, makeWrapper, nodePackages, nss, stdenv, xdg_utils, xorg }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "rambox-pro";
5+ version = "1.1.2";
6+
7+ dontBuild = true;
8+ dontStrip = true;
9+
10+ buildInputs = [ nss xorg.libxkbfile ];
11+ nativeBuildInputs = [ autoPatchelfHook makeWrapper nodePackages.asar ];
12+
13+ src = fetchurl {
14+ url = "https://github.com/ramboxapp/download/releases/download/v${version}/RamboxPro-${version}-linux-x64.tar.gz";
15+ sha256 = "0rrfpl371hp278b02b9b6745ax29yrdfmxrmkxv6d158jzlv0dlr";
16+ };
17+
18+ postPatch = ''
19+ substituteInPlace resources/app.asar.unpacked/node_modules/ad-block/vendor/depot_tools/create-chromium-git-src \
20+ --replace "/usr/bin/env -S bash -e" "${stdenv.shell}"
21+ substituteInPlace resources/app.asar.unpacked/node_modules/ad-block/node_modules/bloom-filter-cpp/vendor/depot_tools/create-chromium-git-src \
22+ --replace "/usr/bin/env -S bash -e" "${stdenv.shell}"
23+ '';
24+
25+ installPhase = ''
26+ mkdir -p $out/bin $out/opt/RamboxPro $out/share/applications
27+ asar e resources/app.asar $out/opt/RamboxPro/resources/app.asar.unpacked
28+ ln -s ${desktopItem}/share/applications/* $out/share/applications
29+ '';
30+
31+ postFixup = ''
32+ makeWrapper ${electron}/lib/electron/.electron-wrapped $out/bin/ramboxpro \
33+ --add-flags "$out/opt/RamboxPro/resources/app.asar.unpacked --without-update" \
34+ --prefix PATH : ${xdg_utils}/bin
35+ '';
36+
37+ desktopItem = makeDesktopItem {
38+ name = "rambox-pro";
39+ exec = "ramboxpro";
40+ type = "Application";
41+ desktopName = "Rambox Pro";
42+ };
43+
44+ meta = with stdenv.lib; {
45+ description = "Messaging and emailing app that combines common web applications into one";
46+ homepage = https://rambox.pro;
47+ license = licenses.unfree;
48+ maintainers = with maintainers; [ chrisaw ];
49+ platforms = [ "i686-linux" "x86_64-linux" ];
50+ };
51+}