After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
result/bin/apply-formatting $NIXPKGS_PATH
65 lines
1.9 KiB
Nix
65 lines
1.9 KiB
Nix
{
|
|
symlinkJoin,
|
|
makeWrapper,
|
|
}:
|
|
flutter:
|
|
|
|
let
|
|
self = symlinkJoin {
|
|
name = "${flutter.name}-sdk-links";
|
|
paths = [
|
|
flutter
|
|
flutter.cacheDir
|
|
flutter.sdk
|
|
];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
postBuild = ''
|
|
wrapProgram "$out/bin/flutter" \
|
|
--set-default FLUTTER_ROOT "$out"
|
|
|
|
# symlinkJoin seems to be missing the .git directory for some reason.
|
|
if [ -d '${flutter.sdk}/.git' ]; then
|
|
ln -s '${flutter.sdk}/.git' "$out"
|
|
fi
|
|
|
|
# For iOS/macOS builds, *.xcframework/'s from the pre-built
|
|
# artifacts are copied into each built app. However, the symlinkJoin
|
|
# means that the *.xcframework's contain symlinks into the nix store,
|
|
# which causes issues when actually running the apps.
|
|
#
|
|
# We'll fix this by only linking to an outer *.xcframework dir instead
|
|
# of trying to symlinkJoin the files inside the *.xcframework.
|
|
artifactsDir="$out/bin/cache/artifacts/engine"
|
|
shopt -s globstar
|
|
for file in "$artifactsDir"/**/*.xcframework/Info.plist; do
|
|
# Get the unwrapped path from the Info.plist inside each .xcframework
|
|
origFile="$(readlink -f "$file")"
|
|
origFrameworkDir="$(dirname "$origFile")"
|
|
|
|
# Remove the symlinkJoin .xcframework dir and replace it with a symlink
|
|
# to the unwrapped .xcframework dir.
|
|
frameworkDir="$(dirname "$file")"
|
|
rm -r "$frameworkDir"
|
|
ln -s "$origFrameworkDir" "$frameworkDir"
|
|
done
|
|
shopt -u globstar
|
|
'';
|
|
|
|
passthru = flutter.passthru // {
|
|
# Update the SDK attribute.
|
|
# This allows any modified SDK files to be included
|
|
# in future invocations.
|
|
sdk = self;
|
|
};
|
|
|
|
meta = flutter.meta // {
|
|
longDescription = ''
|
|
${flutter.meta.longDescription}
|
|
Modified binaries are linked into the original SDK directory for use with tools that use the whole SDK.
|
|
'';
|
|
};
|
|
};
|
|
in
|
|
self
|