From 086140219e4f413e7d4bc92143ea91f4cdc53c47 Mon Sep 17 00:00:00 2001 From: qzylinra Date: Wed, 13 Aug 2025 16:21:52 +0800 Subject: [PATCH 1/2] flutter: remove with lib --- .../compilers/flutter/engine/package.nix | 32 +++++++++---------- .../development/compilers/flutter/flutter.nix | 14 ++++---- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/pkgs/development/compilers/flutter/engine/package.nix b/pkgs/development/compilers/flutter/engine/package.nix index 76300ee2b5ed..343a9957ea61 100644 --- a/pkgs/development/compilers/flutter/engine/package.nix +++ b/pkgs/development/compilers/flutter/engine/package.nix @@ -347,21 +347,19 @@ stdenv.mkDerivation (finalAttrs: { dart = callPackage ./dart.nix { engine = finalAttrs.finalPackage; }; }; - meta = - with lib; - { - # Very broken on Darwin - broken = stdenv.hostPlatform.isDarwin; - description = "Flutter engine"; - homepage = "https://flutter.dev"; - maintainers = with maintainers; [ RossComputerGuy ]; - license = licenses.bsd3; - platforms = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - } - // lib.optionalAttrs (lib.versionOlder flutterVersion "3.22") { hydraPlatforms = [ ]; }; + meta = { + # Very broken on Darwin + broken = stdenv.hostPlatform.isDarwin; + description = "Flutter engine"; + homepage = "https://flutter.dev"; + maintainers = with lib.maintainers; [ RossComputerGuy ]; + license = lib.licenses.bsd3; + platforms = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + } + // lib.optionalAttrs (lib.versionOlder flutterVersion "3.22") { hydraPlatforms = [ ]; }; }) diff --git a/pkgs/development/compilers/flutter/flutter.nix b/pkgs/development/compilers/flutter/flutter.nix index e1aed72276e1..fb7b3fa4a9cc 100644 --- a/pkgs/development/compilers/flutter/flutter.nix +++ b/pkgs/development/compilers/flutter/flutter.nix @@ -189,14 +189,14 @@ let inherit engine; }; - meta = with lib; { - description = "Flutter is Google's SDK for building mobile, web and desktop with Dart"; + meta = { + description = "Makes it easy and fast to build beautiful apps for mobile and beyond"; longDescription = '' - Flutter is Google’s UI toolkit for building beautiful, - natively compiled applications for mobile, web, and desktop from a single codebase. + Flutter is Google's SDK for crafting beautiful, + fast user experiences for mobile, web, and desktop from a single codebase. ''; homepage = "https://flutter.dev"; - license = licenses.bsd3; + license = lib.licenses.bsd3; platforms = [ "x86_64-linux" "aarch64-linux" @@ -204,10 +204,10 @@ let "aarch64-darwin" ]; mainProgram = "flutter"; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ ericdallo ]; - teams = [ teams.flutter ]; + teams = [ lib.teams.flutter ]; }; }; in From 02a40a83dea39f4e598522d08ec9b5fa3c0ea9ea Mon Sep 17 00:00:00 2001 From: qzylinra Date: Wed, 13 Aug 2025 16:26:50 +0800 Subject: [PATCH 2/2] flutter: remove rec --- .../flutter/build-support/build-flutter-application.nix | 5 ++++- pkgs/development/compilers/flutter/default.nix | 2 +- pkgs/development/compilers/flutter/flutter-tools.nix | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix b/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix index 69c776102d7d..3b8c1941dfc6 100644 --- a/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix +++ b/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix @@ -39,7 +39,7 @@ let ++ flutterFlags; builderArgs = - rec { + let universal = args // { inherit flutterMode flutterFlags flutterBuildFlags; @@ -125,6 +125,9 @@ let fi ''; }; + in + { + inherit universal; linux = universal // { outputs = universal.outputs or [ ] ++ [ "debug" ]; diff --git a/pkgs/development/compilers/flutter/default.nix b/pkgs/development/compilers/flutter/default.nix index 192b6e61fd06..32e7581df049 100644 --- a/pkgs/development/compilers/flutter/default.nix +++ b/pkgs/development/compilers/flutter/default.nix @@ -96,7 +96,7 @@ let in (mkCustomFlutter args).overrideAttrs ( prev: next: { - passthru = next.passthru // rec { + passthru = next.passthru // { inherit wrapFlutter mkCustomFlutter mkFlutter; buildFlutterApplication = callPackage ./build-support/build-flutter-application.nix { flutter = wrapFlutter (mkCustomFlutter args); diff --git a/pkgs/development/compilers/flutter/flutter-tools.nix b/pkgs/development/compilers/flutter/flutter-tools.nix index 4eb71e2afabe..00db44021a8c 100644 --- a/pkgs/development/compilers/flutter/flutter-tools.nix +++ b/pkgs/development/compilers/flutter/flutter-tools.nix @@ -27,14 +27,16 @@ let content_hash = "1111111111111111111111111111111111111111"; }; }; + + dartEntryPoints."flutter_tools.snapshot" = "bin/flutter_tools.dart"; in -buildDartApplication.override { inherit dart; } rec { +buildDartApplication.override { inherit dart; } { pname = "flutter-tools"; - inherit version; + inherit version dartEntryPoints; dartOutputType = "jit-snapshot"; src = flutterSrc; - sourceRoot = "${src.name}/packages/flutter_tools"; + sourceRoot = "${flutterSrc.name}/packages/flutter_tools"; postUnpack = ''chmod -R u+w "$NIX_BUILD_TOP/source"''; inherit patches; @@ -69,7 +71,6 @@ buildDartApplication.override { inherit dart; } rec { ln -s '${dart}' "$FLUTTER_ROOT/bin/cache/dart-sdk" ''; - dartEntryPoints."flutter_tools.snapshot" = "bin/flutter_tools.dart"; dartCompileFlags = [ "--define=NIX_FLUTTER_HOST_PLATFORM=${systemPlatform}" ]; # The Dart wrapper launchers are useless for the Flutter tool - it is designed