···95959696 enableParallelBuilding = true;
97979898- # disable stackprotector on aarch64-darwin for now
9999- # https://github.com/NixOS/nixpkgs/issues/158730
100100- # see https://github.com/NixOS/nixpkgs/issues/127608 for a similar issue
101101- hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ];
102102-10398 setupHook = ./setup-hook.sh;
10499105100 meta = with lib; {
···11#!/usr/bin/env nix-shell
22-#!nix-shell --pure -i bash -p cacert bundix
22+#!nix-shell --pure -i bash -p cacert bundix bundler
3344# Do these steps before running this script:
55# 1. Copy Gemfile from new Redmine version to this folder
···1414 fi
1515done
16161717+bundle lock --add-platform ruby
1818+bundle lock --remove-platform x86_64-linux
1719bundix -l
···133133 die "Couldn't locate old source hash '$oldHash' (or it appeared more than once) in '$nixFile'!"
134134fi
135135136136-oldUrl=$(nix-instantiate $systemArg --eval -E "with $importTree; builtins.elemAt ($attr.$sourceKey.drvAttrs.urls or [ $attr.$sourceKey.url ]) 0" | tr -d '"')
137137-138138-if [[ -z "$oldUrl" ]]; then
139139- die "Couldn't evaluate source url from '$attr.$sourceKey'!"
140140-fi
141141-142136oldVersion=$(nix-instantiate $systemArg --eval -E "with $importTree; $attr.${versionKey} or (builtins.parseDrvName $attr.name).version" | tr -d '"')
143137144138if [[ -z "$oldVersion" ]]; then
···162156163157# Escape regex metacharacter that are allowed in store path names
164158oldVersionEscaped=$(echo "$oldVersion" | sed -re 's|[.+]|\\&|g')
165165-oldUrlEscaped=$(echo "$oldUrl" | sed -re 's|[${}.+]|\\&|g')
166159167160if [[ $(grep --count --extended-regexp "^\s*(let\b)?\s*$versionKey\s*=\s*\"$oldVersionEscaped\"" "$nixFile") = 1 ]]; then
168161 pattern="/\b$versionKey\b\s*=/ s|\"$oldVersionEscaped\"|\"$newVersion\"|"
···206199tempHashEscaped=$(echo "$tempHash" | sed -re 's|[+]|\\&|g')
207200208201# Replace new version
209209-sed -i.bak "$nixFile" -re "$pattern"
210210-if cmp -s "$nixFile" "$nixFile.bak"; then
202202+sed -i.cmp "$nixFile" -re "$pattern"
203203+if cmp -s "$nixFile" "$nixFile.cmp"; then
211204 die "Failed to replace version '$oldVersion' to '$newVersion' in '$attr'!"
212205fi
213206214207# Replace new URL
215208if [[ -n "$newUrl" ]]; then
216216- sed -i "$nixFile" -re "s|\"$oldUrlEscaped\"|\"$newUrl\"|"
209209+ oldUrl=$(nix-instantiate $systemArg --eval -E "with $importTree; builtins.elemAt ($attr.$sourceKey.drvAttrs.urls or [ $attr.$sourceKey.url ]) 0" | tr -d '"')
210210+ if [[ -z "$oldUrl" ]]; then
211211+ die "Couldn't evaluate source url from '$attr.$sourceKey'!"
212212+ fi
217213218218- if cmp -s "$nixFile" "$nixFile.bak"; then
214214+ # Escape regex metacharacter that are allowed in store path names
215215+ oldUrlEscaped=$(echo "$oldUrl" | sed -re 's|[${}.+]|\\&|g')
216216+217217+ sed -i.cmp "$nixFile" -re "s|\"$oldUrlEscaped\"|\"$newUrl\"|"
218218+ if cmp -s "$nixFile" "$nixFile.cmp"; then
219219 die "Failed to replace source URL '$oldUrl' to '$newUrl' in '$attr'!"
220220 fi
221221fi
222222223223-sed -i "$nixFile" -re "s|\"$oldHashEscaped\"|\"$tempHash\"|"
224224-if cmp -s "$nixFile" "$nixFile.bak"; then
223223+sed -i.cmp "$nixFile" -re "s|\"$oldHashEscaped\"|\"$tempHash\"|"
224224+if cmp -s "$nixFile" "$nixFile.cmp"; then
225225 die "Failed to replace source hash of '$attr' to a temporary hash!"
226226fi
227227228228# Replace new revision, if given
229229if [[ -n "$newRevision" ]]; then
230230- sed -i "$nixFile" -re "s|\"$oldRevision\"|\"$newRevision\"|"
231231-232232- if cmp -s "$nixFile" "$nixFile.bak"; then
230230+ sed -i.cmp "$nixFile" -re "s|\"$oldRevision\"|\"$newRevision\"|"
231231+ if cmp -s "$nixFile" "$nixFile.cmp"; then
233232 die "Failed to replace source revision '$oldRevision' to '$newRevision' in '$attr'!"
234233 fi
235234fi
···254253fi
255254256255if [[ -z "${ignoreSameHash}" && "$oldVersion" != "$newVersion" && "$oldHash" = "$newHash" ]]; then
257257- mv "$nixFile.bak" "$nixFile"
258256 die "Both the old and new source hashes of '$attr.$sourceKey' were equivalent. Please fix the package's source URL to be dependent on '\${version}'!"
259257fi
260258261261-sed -i "$nixFile" -re "s|\"$tempHashEscaped\"|\"$newHash\"|"
262262-if cmp -s "$nixFile" "$nixFile.bak"; then
259259+sed -i.cmp "$nixFile" -re "s|\"$tempHashEscaped\"|\"$newHash\"|"
260260+if cmp -s "$nixFile" "$nixFile.cmp"; then
263261 die "Failed to replace temporary source hash of '$attr' to the final source hash!"
264262fi
265263266266-rm -f "$nixFile.bak"
264264+rm -f "$nixFile.cmp"
267265rm -f "$attr.fetchlog"
268266269267if [ -n "$printChanges" ]; then