summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/dart/source/unbundle-icu.patch
blob: eac4b77a8f82e4246a5662791f1a866d51d8979e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 0d936b3e64e1e629bd29fa4dd84240f5c5344092 Mon Sep 17 00:00:00 2001
From: LN Liberda <lauren@selfisekai.rocks>
Date: Tue, 26 Nov 2024 19:28:59 +0100
Subject: [PATCH] build: option to not embed icu data

Bug: none
---
 runtime/bin/BUILD.gn     | 11 ++++++++---
 runtime/runtime_args.gni |  3 +++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index 90dc09a0c02..8f88873dc18 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -795,7 +795,6 @@ template("dart_executable") {
     }
     deps = [
       ":crashpad",
-      ":icudtl_cc",
       "//third_party/boringssl",
       "//third_party/icu:icui18n",
       "//third_party/icu:icuuc",
@@ -804,7 +803,11 @@ template("dart_executable") {
     if (is_fuchsia) {
       deps += [ "$fuchsia_sdk/pkg/fdio" ]
     }
-    defines = [ "DART_EMBED_ICU_DATA" ] + extra_defines
+    defines = extra_defines
+    if (dart_embed_icu_data) {
+      defines += [ "DART_EMBED_ICU_DATA" ]
+      deps += [ ":icudtl_cc" ]
+    }
     if (exclude_kernel_service) {
       defines += [ "EXCLUDE_CFE_AND_KERNEL_PLATFORM" ]
     }
@@ -1004,10 +1004,12 @@
     "..:add_empty_macho_section_config",
   ]
   extra_deps = [
-    ":icudtl_cc",
     "..:libdart_aotruntime",
     "../platform:libdart_platform_aotruntime",
   ]
+  if (dart_embed_icu_data) {
+    extra_deps += [":icudtl_cc"]
+  }
   extra_sources = [
     "builtin.cc",
     "gzip.cc",
diff --git a/runtime/runtime_args.gni b/runtime/runtime_args.gni
index fbcfeb157fb..061e8f74a5c 100644
--- a/runtime/runtime_args.gni
+++ b/runtime/runtime_args.gni
@@ -77,6 +77,9 @@ declare_args() {
 
   # Whether to support dynamic loading and interpretation of Dart bytecode.
   dart_dynamic_modules = false
+
+  # Whether to embed ICU data inside the runtime binary.
+  dart_embed_icu_data = true
 }
 
 declare_args() {