summary refs log tree commit diff
path: root/pkgs/development/tools/electron
diff options
context:
space:
mode:
authorPavol Rusnak <pavol@rusnak.io>2021-05-19 12:48:59 +0200
committerPavol Rusnak <pavol@rusnak.io>2021-05-19 12:54:51 +0200
commit9fcdd5557a8f80c0339138195ff3b4e3416ff2b8 (patch)
tree4145d4f60c463fab9015e8eced68632dc30e43c3 /pkgs/development/tools/electron
parenta6b4be87755db9b90e1b7659dde0bfd7738ea351 (diff)
downloadnixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.tar
nixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.tar.gz
nixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.tar.bz2
nixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.tar.lz
nixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.tar.xz
nixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.tar.zst
nixpkgs-9fcdd5557a8f80c0339138195ff3b4e3416ff2b8.zip
electron: enable aarch64-darwin build (for electron 11+)
Diffstat (limited to 'pkgs/development/tools/electron')
-rw-r--r--pkgs/development/tools/electron/default.nix2
-rw-r--r--pkgs/development/tools/electron/generic.nix4
-rwxr-xr-xpkgs/development/tools/electron/print-hashes.sh7
3 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/development/tools/electron/default.nix b/pkgs/development/tools/electron/default.nix
index d5007989bcb..5ecec0059a0 100644
--- a/pkgs/development/tools/electron/default.nix
+++ b/pkgs/development/tools/electron/default.nix
@@ -101,6 +101,7 @@ rec {
     i686-linux = "b76e69ad4b654384b4f1647f0cb362e78c1d99be7b814d7d32abc22294639ace";
     armv7l-linux = "cc4be8e0c348bc8db5002cf6c63c1d02fcb594f1f8bfc358168738c930098857";
     aarch64-linux = "75665dd5b2b9938bb4572344d459db65f46c5f7c637a32946c5a822cc23a77dc";
+    aarch64-darwin = "0c782b1d4eb848bae780f4e3a236caa1671486264c1f8e72fde98f1256d8f9e5";
     headers = "0ip1wxgflifs86vk4xpz1555xa7yjy64ygqgd5a2g723148m52rk";
   };
 
@@ -110,6 +111,7 @@ rec {
     i686-linux = "16023d86b88c7fccafd491c020d064caa2138d6a3493664739714555f72e5b06";
     armv7l-linux = "53cc1250ff62f2353d8dd37552cbd7bdcaaa756106faee8b809303bed00e040a";
     aarch64-linux = "3eddc0c507a43cce4e714bfe509d99218b5ab99f4660dd173aac2a895576dc71";
+    aarch64-darwin = "2bc8f37af68e220f93fb9abc62d1c56d8b64baaf0ef9ef974f24ddcbe4f8b488";
     headers = "1ji9aj7qr4b27m5kprsgsrl21rjphz5bbnmn6q0n2x84l429nyfb";
   };
 }
diff --git a/pkgs/development/tools/electron/generic.nix b/pkgs/development/tools/electron/generic.nix
index 7d4593dee3c..def103f6e56 100644
--- a/pkgs/development/tools/electron/generic.nix
+++ b/pkgs/development/tools/electron/generic.nix
@@ -26,7 +26,8 @@ let
     homepage = "https://github.com/electron/electron";
     license = licenses.mit;
     maintainers = with maintainers; [ travisbhartwell manveru prusnak ];
-    platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ];
+    platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ]
+      ++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ];
     knownVulnerabilities = optional (versionOlder version "6.0.0") "Electron version ${version} is EOL";
   };
 
@@ -46,6 +47,7 @@ let
     armv7l-linux = "linux-armv7l";
     aarch64-linux = "linux-arm64";
     x86_64-darwin = "darwin-x64";
+    aarch64-darwin = "darwin-arm64";
   };
 
   get = as: platform: as.${platform.system} or
diff --git a/pkgs/development/tools/electron/print-hashes.sh b/pkgs/development/tools/electron/print-hashes.sh
index d6c5d94ec41..48c8f0412e1 100755
--- a/pkgs/development/tools/electron/print-hashes.sh
+++ b/pkgs/development/tools/electron/print-hashes.sh
@@ -17,6 +17,7 @@ SYSTEMS=(
     [armv7l-linux]=linux-armv7l
     [aarch64-linux]=linux-arm64
     [x86_64-darwin]=darwin-x64
+    [aarch64-darwin]=darwin-arm64
 )
 
 hashfile="$(nix-prefetch-url --print-path "https://github.com/electron/electron/releases/download/v${VERSION}/SHASUMS256.txt" 2>/dev/null | tail -n1)"
@@ -27,8 +28,10 @@ headers="$(nix-prefetch-url "https://atom.io/download/electron/v${VERSION}/node-
 echo "  electron_${VERSION%%.*} = mkElectron \"${VERSION}\" {"
 
 for S in "${!SYSTEMS[@]}"; do
-  hash="$(grep " *electron-v${VERSION}-${SYSTEMS[$S]}.zip$" "$hashfile"|cut -f1 -d' ')"
-  echo "    $S = \"$hash\";"
+  hash="$(grep " *electron-v${VERSION}-${SYSTEMS[$S]}.zip$" "$hashfile"|cut -f1 -d' ' || :)"
+  if [[ -n $hash ]]; then
+    echo "    $S = \"$hash\";"
+  fi
 done
 
 echo "    headers = \"$headers\";"