buildDartApplication: Allow passing a sdkSetupScript

This commit is contained in:
hacker1024 2023-10-21 22:37:01 +11:00
parent 6298ac2774
commit 5391c0204e
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,7 @@
{ lib, stdenv, callPackage, fetchDartDeps, runCommand, writeText, dartHooks, makeWrapper, dart, cacert, nodejs, darwin, jq }:
{ pubGetScript ? "dart pub get"
{ sdkSetupScript ? ""
, pubGetScript ? "dart pub get"
# Output type to produce. Can be any kind supported by dart
# https://dart.dev/tools/dart-compile#types-of-output
@ -41,13 +42,13 @@ let
'';
}) {
buildDrvArgs = args;
inherit pubGetScript vendorHash pubspecLockFile;
inherit sdkSetupScript pubGetScript vendorHash pubspecLockFile;
};
inherit (dartHooks.override { inherit dart; }) dartConfigHook dartBuildHook dartInstallHook dartFixupHook;
baseDerivation = stdenv.mkDerivation (finalAttrs: args // {
inherit pubGetScript dartCompileCommand dartOutputType dartRuntimeCommand
dartCompileFlags dartJitFlags runtimeDependencies;
inherit sdkSetupScript pubGetScript dartCompileCommand dartOutputType
dartRuntimeCommand dartCompileFlags dartJitFlags runtimeDependencies;
dartEntryPoints =
if (dartEntryPoints != null)

View File

@ -3,6 +3,9 @@
dartConfigHook() {
echo "Executing dartConfigHook"
echo "Setting up SDK"
eval "$sdkSetupScript"
echo "Installing dependencies"
eval doPubGet "$pubGetScript" --offline