buildFlutterApplication: Change flutterHostPlatform to targetFlutterPlatform

This commit is contained in:
hacker1024 2024-01-19 11:07:33 +11:00
parent 3b33435d02
commit 64f9fa0d2c
4 changed files with 12 additions and 12 deletions

View File

@ -105,8 +105,8 @@ flutter.buildFlutterApplication {
pname = "firmware-updater";
version = "unstable-2023-04-30";
# To build for the Web, use the flutterHostPlatform argument.
# flutterHostPlatform = "web";
# To build for the Web, use the targetFlutterPlatform argument.
# targetFlutterPlatform = "web";
src = fetchFromGitHub {
owner = "canonical";
@ -126,7 +126,7 @@ Flutter-specific `nix-shell` usage notes are included here. See the [Dart docume
#### Entering the shell {#ssec-dart-flutter-nix-shell-enter}
By default, dependencies for only the `flutterHostPlatform` are available in the
By default, dependencies for only the `targetFlutterPlatform` are available in the
build environment. This is useful for keeping closures small, but be problematic
during development. It's common, for example, to build Web apps for Linux during
development to take advantage of native features such as stateful hot reload.

View File

@ -9,14 +9,14 @@
, makeDesktopItem
, gnome
, flutterHostPlatform ? "linux"
, targetFlutterPlatform ? "linux"
}:
let
libwebrtcRpath = lib.makeLibraryPath [ mesa libdrm ];
in
flutter313.buildFlutterApplication (rec {
pname = "fluffychat-${flutterHostPlatform}";
pname = "fluffychat-${targetFlutterPlatform}";
version = "1.14.1";
src = fetchFromGitHub {
@ -33,7 +33,7 @@ flutter313.buildFlutterApplication (rec {
wakelock_windows = "sha256-Dfwe3dSScD/6kvkP67notcbb+EgTQ3kEYcH7wpra2dI=";
};
inherit flutterHostPlatform;
inherit targetFlutterPlatform;
meta = with lib; {
description = "Chat with your friends (matrix client)";
@ -43,7 +43,7 @@ flutter313.buildFlutterApplication (rec {
platforms = [ "x86_64-linux" "aarch64-linux" ];
sourceProvenance = [ sourceTypes.fromSource ];
};
} // lib.optionalAttrs (flutterHostPlatform == "linux") {
} // lib.optionalAttrs (targetFlutterPlatform == "linux") {
nativeBuildInputs = [ imagemagick ];
runtimeDependencies = [ pulseaudio ];
@ -78,7 +78,7 @@ flutter313.buildFlutterApplication (rec {
patchelf --add-rpath ${libwebrtcRpath} $out/app/lib/libwebrtc.so
'';
} // lib.optionalAttrs (flutterHostPlatform == "web") {
} // lib.optionalAttrs (targetFlutterPlatform == "web") {
prePatch =
# https://github.com/krille-chan/fluffychat/blob/v1.17.1/scripts/prepare-web.sh
let

View File

@ -17,7 +17,7 @@
{ pubGetScript ? "flutter pub get"
, flutterBuildFlags ? [ ]
, flutterHostPlatform ? "linux"
, targetFlutterPlatform ? "linux"
, extraWrapProgramArgs ? ""
, ...
}@args:
@ -170,9 +170,9 @@ let
runHook postInstall
'';
};
}.${flutterHostPlatform} or (throw "Unsupported Flutter host platform: ${flutterHostPlatform}");
}.${targetFlutterPlatform} or (throw "Unsupported Flutter host platform: ${targetFlutterPlatform}");
minimalFlutter = flutter.override { supportedTargetFlutterPlatforms = [ "universal" flutterHostPlatform ]; };
minimalFlutter = flutter.override { supportedTargetFlutterPlatforms = [ "universal" targetFlutterPlatform ]; };
buildAppWith = flutter: buildDartApplication.override { dart = flutter; };
in

View File

@ -3850,7 +3850,7 @@ with pkgs;
fluffychat = callPackage ../applications/networking/instant-messengers/fluffychat { };
fluffychat-web = fluffychat.override { flutterHostPlatform = "web"; };
fluffychat-web = fluffychat.override { targetFlutterPlatform = "web"; };
fxlinuxprintutil = callPackage ../tools/misc/fxlinuxprintutil { };