llvmPackages: Fix the update script

main
Michael Weiss 2 years ago
parent e7eaee7da8
commit 90d9b7c8dc
No known key found for this signature in database
GPG Key ID: 5BE487C4D4771D83
  1. 3
      pkgs/development/compilers/llvm/14/llvm/default.nix
  2. 8
      pkgs/development/compilers/llvm/update.sh

@ -209,6 +209,9 @@ in stdenv.mkDerivation (rec {
checkTarget = "check-all";
# For the update script:
passthru.monorepoSrc = monorepoSrc;
requiredSystemFeatures = [ "big-parallel" ];
meta = llvm_meta // {
homepage = "https://llvm.org/";

@ -20,7 +20,11 @@ sed -Ei \
readonly ATTRSET="llvmPackages_$VERSION_MAJOR"
if [ "$VERSION_MAJOR" -ge "13" ]; then
if [ "$VERSION_MAJOR" -ge "14" ]; then
readonly SOURCES=(
"llvm.monorepoSrc"
)
elif [ "$VERSION_MAJOR" -eq "13" ]; then
readonly SOURCES=(
"llvm.src"
)
@ -43,7 +47,7 @@ fi
for SOURCE in "${SOURCES[@]}"; do
echo "Updating the hash of $SOURCE:"
declare ATTR="$ATTRSET.$SOURCE"
declare OLD_HASH="$(nix eval -f . $ATTR.outputHash)"
declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)"
declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\""
find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +
done

Loading…
Cancel
Save