summaryrefslogtreecommitdiffstats
path: root/pkgs/development/tools/electron
diff options
context:
space:
mode:
authorSarunas Valaskevicius <rakatan@gmail.com>2019-08-09 17:45:58 +0100
committerSarunas Valaskevicius <rakatan@gmail.com>2019-08-12 18:14:10 +0100
commit4a31479ae5d6b95aaccbfd4598944980a7d894a8 (patch)
treeeee2637290257c6d4054d3c585c40062444cd226 /pkgs/development/tools/electron
parentf5674b20ac08da1f16a710a87fa515d068114768 (diff)
electron_6: init at 6.0.1
Diffstat (limited to 'pkgs/development/tools/electron')
-rw-r--r--pkgs/development/tools/electron/6.x.nix86
1 files changed, 86 insertions, 0 deletions
diff --git a/pkgs/development/tools/electron/6.x.nix b/pkgs/development/tools/electron/6.x.nix
new file mode 100644
index 000000000000..5d412848d2d6
--- /dev/null
+++ b/pkgs/development/tools/electron/6.x.nix
@@ -0,0 +1,86 @@
+{ stdenv, libXScrnSaver, makeWrapper, fetchurl, wrapGAppsHook, gtk3, unzip, atomEnv, libuuid, at-spi2-atk, at-spi2-core}:
+
+let
+ version = "6.0.1";
+ name = "electron-${version}";
+
+ throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
+
+ meta = with stdenv.lib; {
+ description = "Cross platform desktop application shell";
+ homepage = https://github.com/electron/electron;
+ license = licenses.mit;
+ maintainers = with maintainers; [ travisbhartwell manveru ];
+ platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ];
+ };
+
+ linux = {
+ inherit name version meta;
+ src = {
+ i686-linux = fetchurl {
+ url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-ia32.zip";
+ sha256 = "0ly6mjcljw0axkkrz7dsvfywmjb3pmspalfk2259gyqqxj8a37pb";
+ };
+ x86_64-linux = fetchurl {
+ url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-x64.zip";
+ sha256 = "0l8k6v16ynikf6x59w5byzhji0d6mqp2q0kjlrby56546qzyfkh6";
+ };
+ armv7l-linux = fetchurl {
+ url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-armv7l.zip";
+ sha256 = "0c2xl8dm9fmj0d92w53zbn2np2fiwr88hw0dqjdn1rwczhw7zqss";
+ };
+ aarch64-linux = fetchurl {
+ url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-arm64.zip";
+ sha256 = "0iyq229snm7z411xxfsv7f0bqg6hbw2l8y6ymys110f83hp01f8a";
+ };
+ }.${stdenv.hostPlatform.system} or throwSystem;
+
+ buildInputs = [ gtk3 ];
+
+ nativeBuildInputs = [
+ unzip
+ makeWrapper
+ wrapGAppsHook
+ ];
+
+ dontWrapGApps = true; # electron is in lib, we need to wrap it manually
+
+ buildCommand = ''
+ mkdir -p $out/lib/electron $out/bin
+ unzip -d $out/lib/electron $src
+ ln -s $out/lib/electron/electron $out/bin
+
+ fixupPhase
+
+ patchelf \
+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+ --set-rpath "${atomEnv.libPath}:${stdenv.lib.makeLibraryPath [ libuuid at-spi2-atk at-spi2-core ]}:$out/lib/electron" \
+ $out/lib/electron/electron
+
+ wrapProgram $out/lib/electron/electron \
+ --prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \
+ "''${gappsWrapperArgs[@]}"
+ '';
+ };
+
+ darwin = {
+ inherit name version meta;
+
+ src = fetchurl {
+ url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-darwin-x64.zip";
+ sha256 = "0m8v5fs69kanrd1yk6smbmaaj9gb5j3q487z3wicifry0xn381i2";
+ };
+
+ buildInputs = [ unzip ];
+
+ buildCommand = ''
+ mkdir -p $out/Applications
+ unzip $src
+ mv Electron.app $out/Applications
+ mkdir -p $out/bin
+ ln -s $out/Applications/Electron.app/Contents/MacOs/Electron $out/bin/electron
+ '';
+ };
+in
+
+ stdenv.mkDerivation (if stdenv.isDarwin then darwin else linux)