@@ -1,64 +1,26 @@
1−{ stdenv, fetchurl, dpkg, makeWrapper
2−, xorg, gtk2, atk, glib, pango, gdk_pixbuf, cairo, freetype, fontconfig
3−, gnome2, dbus, nss, nspr, alsaLib, cups, expat, udev, libnotify, xdg_utils }:
1+{ stdenv, newScope, makeWrapper, electron, xdg_utils }:
42
53let
6− bits = if stdenv.system == "x86_64-linux" then "x64"
7− else "ia32";
8−
9− version = "0.5.13";
10−
11− runtimeDeps = [
12− udev libnotify
13− ];
14− deps = (with xorg; [
15− libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes
16− libXrender libX11 libXtst libXScrnSaver libxcb
17− ]) ++ [
18− gtk2 atk glib pango gdk_pixbuf cairo freetype fontconfig dbus
19− gnome2.GConf nss nspr alsaLib cups expat stdenv.cc.cc
20− ] ++ runtimeDeps;
21−in stdenv.mkDerivation rec {
22− name = "rambox-${version}";
23− src = fetchurl {
24− url = "https://github.com/saenzramiro/rambox/releases/download/${version}/Rambox_${version}-${bits}.deb";
25− sha256 = if bits == "x64" then
26− "0bn562fr1wsnn3xsd4q2rrxi6c56vckrkfmjl2dqb30hpmj2vn0d" else
27− "180ndvkil5mk5idwnn7spfygnhhll6pjc342pfzgmzk46a723qs4";
4+ callPackage = newScope self;
5+ self = {
6+ fetchNodeModules = callPackage ./fetchNodeModules.nix {};
7+ rambox-bare = callPackage ./bare.nix {};
8+ sencha = callPackage ./sencha {};
289 };
10+in
2911
30− # don't remove runtime deps
31− dontPatchELF = true;
12+with self;
3213
33− buildInputs = [ dpkg makeWrapper ];
14+stdenv.mkDerivation {
15+ name = "rambox-${rambox-bare.version}";
3416
35− unpackPhase = "dpkg-deb -x $src .";
17+ nativeBuildInputs = [ makeWrapper ];
3618
37− installPhase = ''
38− patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" opt/Rambox/rambox
39− patchelf --set-rpath "$out/opt/Rambox:${stdenv.lib.makeLibraryPath deps}" opt/Rambox/rambox
19+ unpackPhase = ":";
4020
41− mkdir -p $out/bin
42− cp -r opt $out
43− ln -s $out/opt/Rambox/rambox $out/bin
44−
45− # provide resources
46− cp -r usr/share $out
47− substituteInPlace $out/share/applications/rambox.desktop \
48− --replace Exec=\"/opt/Rambox/rambox\" Exec=rambox
49− '';
50−
51− postFixup = ''
52− paxmark m $out/opt/Rambox/rambox
53− wrapProgram $out/opt/Rambox/rambox --prefix PATH : ${xdg_utils}/bin
21+ installPhase = ''
22+ makeWrapper ${electron}/bin/electron $out/bin/rambox \
23+ --add-flags "${rambox-bare} --without-update" \
24+ --prefix PATH : ${xdg_utils}/bin
5425 '';
55−
56− meta = with stdenv.lib; {
57− description = "Free and Open Source messaging and emailing app that combines common web applications into one";
58− homepage = http://rambox.pro;
59− license = licenses.mit;
60− maintainers = [ maintainers.gnidorah ];
61− platforms = ["i686-linux" "x86_64-linux"];
62− hydraPlatforms = [];
63− };
6426}