about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorhacker1024 <hacker1024@users.sourceforge.net>2023-08-28 12:28:31 +1000
committerhacker1024 <hacker1024@users.sourceforge.net>2023-08-29 13:12:15 +0200
commit1dcba055e58c5d37e90adc70a26ba7dc3931567f (patch)
tree676c2448c8ab1da9b0df17c12f8c12f67b5dfb9b /pkgs/build-support
parent0606fd67326ff8684c7e88a8d44ace1d968ceba6 (diff)
buildDartApplication: Supply CA bundle to Dart in FOD
DART_VM_OPTIONS is not effective.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/dart/build-dart-application/default.nix10
-rw-r--r--pkgs/build-support/dart/fetch-dart-deps/default.nix8
2 files changed, 9 insertions, 9 deletions
diff --git a/pkgs/build-support/dart/build-dart-application/default.nix b/pkgs/build-support/dart/build-dart-application/default.nix
index 7e9c3f842b80f..be1fd72776711 100644
--- a/pkgs/build-support/dart/build-dart-application/default.nix
+++ b/pkgs/build-support/dart/build-dart-application/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchDartDeps, writeText, dartHooks, makeWrapper, dart, nodejs, darwin }:
+{ lib, stdenv, fetchDartDeps, runCommand, writeText, dartHooks, makeWrapper, dart, cacert, nodejs, darwin }:
 
 { pubGetScript ? "dart pub get"
 
@@ -30,7 +30,13 @@
 }@args:
 
 let
-  dartDeps = fetchDartDeps {
+  dartDeps = (fetchDartDeps.override {
+    dart = runCommand "dart-fod" { nativeBuildInputs = [ makeWrapper ]; } ''
+      mkdir -p "$out/bin"
+      makeWrapper "${dart}/bin/dart" "$out/bin/dart" \
+        --add-flags "--root-certs-file=${cacert}/etc/ssl/certs/ca-bundle.crt"
+    '';
+  }) {
     buildDrvArgs = args;
     inherit pubGetScript vendorHash pubspecLockFile;
   };
diff --git a/pkgs/build-support/dart/fetch-dart-deps/default.nix b/pkgs/build-support/dart/fetch-dart-deps/default.nix
index d6920a35e2046..e523b60797eb1 100644
--- a/pkgs/build-support/dart/fetch-dart-deps/default.nix
+++ b/pkgs/build-support/dart/fetch-dart-deps/default.nix
@@ -79,13 +79,7 @@ let
 
       installPhase = ''
         _pub_get() {
-          (
-            # Dart does not respect SSL_CERT_FILE.
-            # https://github.com/dart-lang/sdk/issues/48506
-            export DART_VM_OPTIONS="--root-certs-file=$SSL_CERT_FILE"
-
-            ${pubGetScript}
-          )
+          ${pubGetScript}
         }
 
         # so we can use lock, diff yaml