mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 02:03:01 +00:00
coreboot-toolchain: Introduce script for generating sources file
Add and adjust update script from https://git.petabyte.dev/petabyteboy/corenix. The script is meant to be run from the package directory of the coreboot-toolchain. The script generates a sources.nix files, which contains all sources used for the coreboot toolchain and some other tools. Thus, it needs to be stripped down to the necessary sources. Signed-off-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
parent
cff7863c34
commit
28383a922e
31
pkgs/development/tools/misc/coreboot-toolchain/update.sh
Executable file
31
pkgs/development/tools/misc/coreboot-toolchain/update.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell --pure -i bash -p nix cacert git getopt
|
||||
|
||||
rootdir="../../../../../"
|
||||
|
||||
src="$(nix-build $rootdir --no-out-link -A coreboot-toolchain.src)"
|
||||
urls=$($src/util/crossgcc/buildgcc -u)
|
||||
|
||||
tmp=$(mktemp)
|
||||
echo '{ fetchurl }: [' > $tmp
|
||||
|
||||
for url in $urls; do
|
||||
name="$(basename $url)"
|
||||
hash="$(nix-prefetch-url "$url")"
|
||||
|
||||
cat << EOF >> $tmp
|
||||
{
|
||||
name = "$name";
|
||||
archive = fetchurl {
|
||||
sha256 = "$hash";
|
||||
url = "$url";
|
||||
};
|
||||
}
|
||||
EOF
|
||||
done
|
||||
|
||||
echo ']' >> $tmp
|
||||
|
||||
sed -ie 's/https\:\/\/ftpmirror\.gnu\.org/mirror\:\/\/gnu/g' $tmp
|
||||
|
||||
mv $tmp sources.nix
|
Loading…
Reference in New Issue
Block a user