1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/tools/electron/print-hashes.sh
Will Dietz 8e8285d9ca electron*: refactor 4+ to common expression, add 7, updates
* print-hashes.nix uses upstream-provided SHA256SUMS file
* electron_4: 4.2.8 -> 4.2.12
* electron_5: 5.0.8 -> 5.0.13
* electron_6: 6.0.1 -> 6.1.7
* electron_7:: init at 7.1.10

FWIW:
electron_4 previously did not include at-spi2-core, only at-spi2-atk.
Both are now included, matching other versions for a slightly simpler
expression.
2020-02-05 10:21:06 -05:00

34 lines
757 B
Bash
Executable file

#!/usr/bin/env bash
set -eu -o pipefail
if [[ $# -lt 1 ]]; then
echo "$0: version" >&2
exit 1
fi
VERSION=$1
declare -A SYSTEMS HASHES
SYSTEMS=(
[i686-linux]=linux-ia32
[x86_64-linux]=linux-x64
[armv7l-linux]=linux-armv7l
[aarch64-linux]=linux-arm64
[x86_64-darwin]=darwin-x64
)
hashfile="$(nix-prefetch-url --print-path "https://github.com/electron/electron/releases/download/v${VERSION}/SHASUMS256.txt" 2>/dev/null | tail -n1)"
echo "Entry similar to the following goes in default.nix:"
echo
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\";"
done
echo " };"