5 # Example usage: ./pkgs/development/compilers/llvm/update.sh 12.0.0-rc4
8 readonly VERSION_MAJOR
="${VERSION%%.*}"
9 readonly VERSION_MAIN
="${VERSION%%-*}"
10 declare VERSION_PATCH
="${VERSION/$VERSION_MAIN/}"
11 readonly VERSION_PATCH
="${VERSION_PATCH/-/}"
13 readonly DIR
="pkgs/development/compilers/llvm/$VERSION_MAJOR"
14 readonly FILE
="$DIR/default.nix"
17 -e "s/release_version = \".+\";/release_version = \"$VERSION_MAIN\";/" \
18 -e "s/candidate = \".*\";/candidate = \"$VERSION_PATCH\";/" \
21 readonly ATTRSET
="llvmPackages_$VERSION_MAJOR"
23 if [ "$VERSION_MAJOR" -ge "14" ]; then
27 elif [ "$VERSION_MAJOR" -eq "13" ]; then
35 "clang-unwrapped.clang-tools-extra_src"
47 for SOURCE
in "${SOURCES[@]}"; do
48 echo "Updating the hash of $SOURCE:"
49 declare ATTR
="$ATTRSET.$SOURCE"
50 declare OLD_HASH
="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)"
51 declare NEW_HASH
="\"$(nix-prefetch-url -A $ATTR)\""
52 find "$DIR" -type f
-exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +