biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / misc / coreboot-toolchain / update.sh
blobfc758e4ab021afbc963c965939e6b140791b6634
1 #!/usr/bin/env nix-shell
2 #!nix-shell --pure -i bash -p nix cacert git getopt
4 # shellcheck shell=bash
6 if [ ! -d .git ]; then
7 echo "This script needs to be run from the root directory of nixpkgs. Exiting."
8 exit 1
9 fi
11 pkg_dir="$(dirname "$0")"
13 src="$(nix-build . --no-out-link -A coreboot-toolchain.i386.src)"
14 urls=$("${src}/util/crossgcc/buildgcc" -u)
16 tmp=$(mktemp)
17 echo '{ fetchurl }: [' >"$tmp"
19 for url in $urls; do
20 name="$(basename "$url")"
21 hash="$(nix-prefetch-url "$url")"
23 cat <<EOF >>"$tmp"
25 name = "$name";
26 archive = fetchurl {
27 sha256 = "$hash";
28 url = "$url";
31 EOF
32 done
34 echo ']' >>"$tmp"
36 sed -ie 's/https\:\/\/ftpmirror\.gnu\.org/mirror\:\/\/gnu/g' "$tmp"
38 mv "$tmp" "${pkg_dir}/sources.nix"