depot/third_party/nixpkgs/pkgs/development/compilers/flutter/engine/default.nix
Default email 83627f9931 Project import generated by Copybara.
GitOrigin-RevId: 2893f56de08021cffd9b6b6dfc70fd9ccd51eb60
2024-06-24 14:47:55 -04:00

76 lines
1.5 KiB
Nix

{
callPackage,
dartSdkVersion,
flutterVersion,
swiftshaderHash,
swiftshaderRev,
version,
hashes,
url,
patches,
runtimeModes,
isOptimized ? true,
lib,
stdenv,
dart,
mainRuntimeMode ? null,
altRuntimeMode ? null,
}@args:
let
mainRuntimeMode = args.mainRuntimeMode or builtins.elemAt runtimeModes 0;
altRuntimeMode = args.altRuntimeMode or builtins.elemAt runtimeModes 1;
runtimeModesBuilds = lib.genAttrs runtimeModes (
runtimeMode:
callPackage ./package.nix {
inherit
dartSdkVersion
flutterVersion
swiftshaderHash
swiftshaderRev
version
hashes
url
patches
runtimeMode
isOptimized
;
}
);
in
stdenv.mkDerivation (
{
pname = "flutter-engine";
inherit url runtimeModes;
inherit (runtimeModesBuilds.${mainRuntimeMode})
meta
src
version
dartSdkVersion
isOptimized
runtimeMode
outName
dart
;
inherit altRuntimeMode;
dontUnpack = true;
dontBuild = true;
installPhase =
''
mkdir -p $out/out
''
+ lib.concatMapStrings (
runtimeMode:
let
runtimeModeBuild = runtimeModesBuilds.${runtimeMode};
runtimeModeOut = runtimeModeBuild.outName;
in
''
ln -sf ${runtimeModeBuild}/out/${runtimeModeOut} $out/out/${runtimeModeOut}
''
) runtimeModes;
}
// runtimeModesBuilds
)