2016-04-03 17:04:31 +02:00
|
|
|
{ stdenv, fetchurl, buildEnv, zlib, glib, alsaLib
|
2014-11-13 06:39:58 +01:00
|
|
|
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
|
2015-09-15 11:26:18 +02:00
|
|
|
, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, unzip
|
2016-01-06 19:05:00 +01:00
|
|
|
, systemd, libnotify
|
2016-04-03 17:04:31 +02:00
|
|
|
, version ? "0.36.2", sha256 ? "01d78j8dfrdygm1r141681b3bfz1f1xqg9vddz7j52z1mlfv9f1d", ...
|
2014-11-13 06:39:58 +01:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
atomEnv = buildEnv {
|
|
|
|
name = "env-atom";
|
|
|
|
paths = [
|
2015-01-15 05:25:26 +01:00
|
|
|
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
|
2014-11-13 06:39:58 +01:00
|
|
|
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
|
2015-09-15 11:26:18 +02:00
|
|
|
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
|
|
|
|
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
|
2016-01-06 19:05:00 +01:00
|
|
|
xorg.libXcursor libcap systemd libnotify
|
2014-11-13 06:39:58 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-06-19 23:17:00 +02:00
|
|
|
name = "electron-${version}";
|
2016-04-03 17:04:31 +02:00
|
|
|
inherit version;
|
2014-11-13 06:39:58 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-06-19 23:17:00 +02:00
|
|
|
url = "https://github.com/atom/electron/releases/download/v${version}/electron-v${version}-linux-x64.zip";
|
2016-04-03 17:04:31 +02:00
|
|
|
inherit sha256;
|
2014-11-13 06:39:58 +01:00
|
|
|
name = "${name}.zip";
|
|
|
|
};
|
|
|
|
|
2016-04-03 17:04:31 +02:00
|
|
|
buildInputs = [ atomEnv unzip ];
|
2014-11-13 06:39:58 +01:00
|
|
|
|
|
|
|
phases = [ "installPhase" "fixupPhase" ];
|
|
|
|
|
|
|
|
unpackCmd = "unzip";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
unzip -d $out/bin $src
|
2014-12-17 19:11:30 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2015-06-19 23:17:00 +02:00
|
|
|
$out/bin/electron
|
2016-04-03 17:04:31 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
patchelf \
|
|
|
|
--set-rpath "${atomEnv}/lib:${atomEnv}/lib64:$out/bin:$(patchelf --print-rpath $out/bin/electron)" \
|
|
|
|
$out/bin/electron
|
2014-11-13 06:39:58 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Cross platform desktop application shell";
|
2015-06-19 23:17:00 +02:00
|
|
|
homepage = https://github.com/atom/electron;
|
2015-05-28 19:20:29 +02:00
|
|
|
license = licenses.mit;
|
2015-06-20 20:43:10 +02:00
|
|
|
maintainers = [ maintainers.travisbhartwell ];
|
2014-11-13 06:39:58 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|