2016-06-08 19:31:36 +01:00
|
|
|
{ stdenv, lib, libXScrnSaver, makeWrapper, fetchurl, unzip, atomEnv }:
|
2016-04-04 17:11:41 +01:00
|
|
|
|
2016-04-22 11:51:11 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-19 22:17:00 +01:00
|
|
|
name = "electron-${version}";
|
2016-06-08 19:31:36 +01:00
|
|
|
version = "1.2.2";
|
2014-11-13 05:39:58 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-06-08 19:31:36 +01:00
|
|
|
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-x64.zip";
|
|
|
|
sha256 = "0jqzs1297f6w7s4j9pd7wyyqbidb0c61yjz47raafslg6nljgp1c";
|
2014-11-13 05:39:58 +00:00
|
|
|
name = "${name}.zip";
|
|
|
|
};
|
|
|
|
|
2016-06-08 19:31:36 +01:00
|
|
|
buildInputs = [ unzip makeWrapper ];
|
2014-11-13 05:39:58 +00:00
|
|
|
|
2016-04-22 11:51:11 +01:00
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/lib/electron $out/bin
|
|
|
|
unzip -d $out/lib/electron $src
|
|
|
|
ln -s $out/lib/electron/electron $out/bin
|
2014-11-13 05:39:58 +00:00
|
|
|
|
2016-04-22 15:44:30 +01:00
|
|
|
fixupPhase
|
|
|
|
|
2016-04-03 16:04:31 +01:00
|
|
|
patchelf \
|
2016-04-22 11:51:11 +01:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${atomEnv.libPath}:$out/lib/electron" \
|
|
|
|
$out/lib/electron/electron
|
2016-06-08 19:31:36 +01:00
|
|
|
|
|
|
|
wrapProgram $out/lib/electron/electron \
|
|
|
|
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1
|
2014-11-13 05:39:58 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Cross platform desktop application shell";
|
2016-06-08 19:31:36 +01:00
|
|
|
homepage = https://github.com/electron/electron;
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.mit;
|
2015-06-20 19:43:10 +01:00
|
|
|
maintainers = [ maintainers.travisbhartwell ];
|
2014-11-13 05:39:58 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|