Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / ue4 / generate-expr-from-cdn.sh
blob91cab1ca32f5bab439d71cbd5de0c9a28182189c
1 #!/bin/sh
3 go() {
4 file="$1"
6 IFS=$'\n'
7 for pack in $(perl -n -e '/(<Pack .*\/>)/ && print "$1\n"' $file); do
8 remotepath=$(echo "$pack" | perl -n -e '/RemotePath="([^"]*)"/ && print $1')
9 hash=$(echo "$pack" | perl -n -e '/Hash="([^"]*)"/ && print $1')
10 url="http://cdn.unrealengine.com/dependencies/$remotepath/$hash"
12 until sha256=$(nix-prefetch-url $url --type sha256); do
13 true
14 done
16 cat <<EOF
17 "$hash" = fetchurl {
18 url = $url;
19 sha256 = "$sha256";
21 EOF
22 done
26 cat <<EOF
27 { fetchurl }:
30 EOF
32 go Engine/Build/Commit.gitdeps.xml
33 go Engine/Build/Promoted.gitdeps.xml
35 cat <<EOF
37 EOF