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

This commit is contained in:
Pavol Rusnak 2021-05-19 12:48:59 +02:00
parent a6b4be8775
commit 9fcdd5557a
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
3 changed files with 10 additions and 3 deletions

View file

@ -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";
};
}

View file

@ -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

View file

@ -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\";"