git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #123663 from prusnak/electron-aarch64-darwin

electron: enable aarch64-darwin build (for electron 11+)

commitdbfdb51933210910f3ce4bd6e3d75e83bc17458d authorPavol Rusnak <pavol@rusnak.io> dateWed 19 May 2021, 23:00 (5 years ago) parent8e9d8039fcdd55
3 files changed+10−3
pkgs/development/tools/electron/default.nix+2 pkgs/development/tools/electron/generic.nix+3−1 pkgs/development/tools/electron/print-hashes.sh+5−2
pkgs/development/tools/electron/default.nix+2
@@ -101,6 +101,7 @@ rec {
101101 i686-linux = "b76e69ad4b654384b4f1647f0cb362e78c1d99be7b814d7d32abc22294639ace";
102102 armv7l-linux = "cc4be8e0c348bc8db5002cf6c63c1d02fcb594f1f8bfc358168738c930098857";
103103 aarch64-linux = "75665dd5b2b9938bb4572344d459db65f46c5f7c637a32946c5a822cc23a77dc";
104+ aarch64-darwin = "0c782b1d4eb848bae780f4e3a236caa1671486264c1f8e72fde98f1256d8f9e5";
104105 headers = "0ip1wxgflifs86vk4xpz1555xa7yjy64ygqgd5a2g723148m52rk";
105106 };
106107
@@ -110,6 +111,7 @@ rec {
110111 i686-linux = "16023d86b88c7fccafd491c020d064caa2138d6a3493664739714555f72e5b06";
111112 armv7l-linux = "53cc1250ff62f2353d8dd37552cbd7bdcaaa756106faee8b809303bed00e040a";
112113 aarch64-linux = "3eddc0c507a43cce4e714bfe509d99218b5ab99f4660dd173aac2a895576dc71";
114+ aarch64-darwin = "2bc8f37af68e220f93fb9abc62d1c56d8b64baaf0ef9ef974f24ddcbe4f8b488";
113115 headers = "1ji9aj7qr4b27m5kprsgsrl21rjphz5bbnmn6q0n2x84l429nyfb";
114116 };
115117}
pkgs/development/tools/electron/generic.nix+3−1
@@ -26,7 +26,8 @@ let
2626 homepage = "https://github.com/electron/electron";
2727 license = licenses.mit;
2828 maintainers = with maintainers; [ travisbhartwell manveru prusnak ];
29− platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ];
29+ platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ]
30+ ++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ];
3031 knownVulnerabilities = optional (versionOlder version "6.0.0") "Electron version ${version} is EOL";
3132 };
3233
@@ -46,6 +47,7 @@ let
4647 armv7l-linux = "linux-armv7l";
4748 aarch64-linux = "linux-arm64";
4849 x86_64-darwin = "darwin-x64";
50+ aarch64-darwin = "darwin-arm64";
4951 };
5052
5153 get = as: platform: as.${platform.system} or
pkgs/development/tools/electron/print-hashes.sh+5−2
@@ -17,6 +17,7 @@ SYSTEMS=(
1717 [armv7l-linux]=linux-armv7l
1818 [aarch64-linux]=linux-arm64
1919 [x86_64-darwin]=darwin-x64
20+ [aarch64-darwin]=darwin-arm64
2021)
2122
2223hashfile="$(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-
2728echo " electron_${VERSION%%.*} = mkElectron \"${VERSION}\" {"
2829
2930for S in "${!SYSTEMS[@]}"; do
30− hash="$(grep " *electron-v${VERSION}-${SYSTEMS[$S]}.zip$" "$hashfile"|cut -f1 -d' ')"
31− echo " $S = \"$hash\";"
31+ hash="$(grep " *electron-v${VERSION}-${SYSTEMS[$S]}.zip$" "$hashfile"|cut -f1 -d' ' || :)"
32+ if [[ -n $hash ]]; then
33+ echo " $S = \"$hash\";"
34+ fi
3235done
3336
3437echo " headers = \"$headers\";"