push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
# Schema:
# ${flutterVersion}.${targetPlatform}.${hostPlatform}
#
# aarch64-darwin as a host is not yet supported.
# https://github.com/flutter/flutter/issues/60118
{
lib,
runCommand,
xorg,
cacert,
unzip,
flutterPlatform,
systemPlatform,
flutter,
hash,
}:
let
flutterPlatforms = [
"android"
"ios"
"web"
"linux"
"windows"
"macos"
"fuchsia"
"universal"
];
flutter' = flutter.override {
# Use a version of Flutter with just enough capabilities to download
# artifacts.
supportedTargetFlutterPlatforms = [ ];
# Modify flutter-tool's system platform in order to get the desired platform's hashes.
flutter = flutter.unwrapped.override {
flutterTools = flutter.unwrapped.tools.override {
inherit systemPlatform;
};
};
};
in
runCommand "flutter-artifacts-${flutterPlatform}-${systemPlatform}"
{
nativeBuildInputs = [
xorg.lndir
flutter'
unzip
];
NIX_FLUTTER_TOOLS_VM_OPTIONS = "--root-certs-file=${cacert}/etc/ssl/certs/ca-bundle.crt";
NIX_FLUTTER_OPERATING_SYSTEM =
{
"x86_64-linux" = "linux";
"aarch64-linux" = "linux";
"x86_64-darwin" = "macos";
"aarch64-darwin" = "macos";
}
.${systemPlatform};
outputHash = hash;
outputHashMode = "recursive";
outputHashAlgo = "sha256";
passthru = {
inherit flutterPlatform;
};
}
(
''
export FLUTTER_ROOT="$NIX_BUILD_TOP"
lndir -silent '${flutter'}' "$FLUTTER_ROOT"
rm -rf "$FLUTTER_ROOT/bin/cache"
mkdir "$FLUTTER_ROOT/bin/cache"
''
+ lib.optionalString (lib.versionAtLeast flutter'.version "3.26") ''
mkdir "$FLUTTER_ROOT/bin/cache/dart-sdk"
lndir -silent '${flutter'}/bin/cache/dart-sdk' "$FLUTTER_ROOT/bin/cache/dart-sdk"
''
# Could not determine engine revision
+ lib.optionalString (lib.versionAtLeast flutter'.version "3.32") ''
cp '${flutter'}/bin/internal/engine.version' "$FLUTTER_ROOT/bin/cache/engine.stamp"
''
+ ''
HOME="$(mktemp -d)" flutter precache ${
lib.optionalString (
flutter ? engine && flutter.engine.meta.available
) "--local-engine ${flutter.engine.outName}"
} \
-v '--${flutterPlatform}' ${
builtins.concatStringsSep " " (map (p: "'--no-${p}'") (lib.remove flutterPlatform flutterPlatforms))
}
rm -rf "$FLUTTER_ROOT/bin/cache/lockfile"
''
+ lib.optionalString (lib.versionAtLeast flutter'.version "3.26") ''
rm -rf "$FLUTTER_ROOT/bin/cache/dart-sdk"
''
+ ''
find "$FLUTTER_ROOT" -type l -lname '${flutter'}/*' -delete
cp -r bin/cache "$out"
''
)

View File

@@ -0,0 +1,14 @@
{ }:
{
buildInputs ? [ ],
...
}:
{
postPatch = ''
if [ "$pname" == "flutter-tools" ]; then
# Use arm64 instead of arm64e.
substituteInPlace lib/src/ios/xcodeproj.dart \
--replace-fail arm64e arm64
fi
'';
}

View File

@@ -0,0 +1,12 @@
{
gtk3,
}:
{
buildInputs ? [ ],
...
}:
{
buildInputs = buildInputs ++ [ gtk3 ];
}

View File

@@ -0,0 +1,30 @@
{
lib,
stdenv,
callPackage,
autoPatchelfHook,
src,
}:
(stdenv.mkDerivation {
inherit (src) name;
inherit src;
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
cp -r . "$out/bin/cache"
rm -f "$out/bin/cache/flutter.version.json"
runHook postInstall
'';
}).overrideAttrs
(
if builtins.pathExists (./overrides + "/${src.flutterPlatform}.nix") then
callPackage (./overrides + "/${src.flutterPlatform}.nix") { }
else
({ ... }: { })
)