Skip to content

Commit

Permalink
llvmPackages: Fix the update script
Browse files Browse the repository at this point in the history
  • Loading branch information
primeos committed Mar 13, 2022
1 parent e7eaee7 commit 90d9b7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkgs/development/compilers/llvm/14/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/";
Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/compilers/llvm/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
Expand Down

0 comments on commit 90d9b7c

Please sign in to comment.