[Fuchsia] Replace downloading gn SDK with core SDK

Bug: chromium:1432399
Change-Id: I99524dfc0a18d3cf5f5a1817524b42811127c6fd
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/108630
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Chong Gu <chonggu@google.com>
diff --git a/.gitignore b/.gitignore
index 74e23ca..7260681 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@
 /third_party/cpu_features/src
 /third_party/depot_tools
 /third_party/freetype/src
+/third_party/fuchsia-gn-sdk
 /third_party/fuchsia-sdk/images
 /third_party/fuchsia-sdk/images-internal
 /third_party/fuchsia-sdk/sdk
diff --git a/DEPS b/DEPS
index 3980724..0c75028 100644
--- a/DEPS
+++ b/DEPS
@@ -25,7 +25,7 @@
   'checkout_v8': 'checkout_configuration != "minimal"',
 
   # By default, download the fuchsia sdk from the public sdk directory.
-  'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/gn/',
+  'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/core/',
 
   'chromium_git': 'https://chromium.googlesource.com',
   'pdfium_git': 'https://pdfium.googlesource.com',
@@ -76,6 +76,10 @@
   # and whatever else without interference from each other.
   'freetype_revision': '80a507a6b8e3d2906ad2c8ba69329bd2fb2a85ef',
   # Three lines of non-changing comments so that
+  # the commit queue can handle CLs rolling freetype
+  # and whatever else without interference from each other.
+  'fuchsia_gn_sdk_revision': '0d6902558d92fe3d49ba9a8f638ddea829be595b',
+  # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Fuchsia sdk
   # and whatever else without interference from each other.
   'fuchsia_version': 'version:12.20230601.1.1',
@@ -289,15 +293,11 @@
     Var('chromium_git') + '/chromium/src/third_party/freetype2.git@' +
         Var('freetype_revision'),
 
-  'third_party/fuchsia-sdk/sdk': {
-      'packages': [
-          {
-              'package': Var('fuchsia_sdk_cipd_prefix') + '${{platform}}',
-              'version': Var('fuchsia_version'),
-          },
-      ],
-      'condition': 'checkout_fuchsia',
-      'dep_type': 'cipd',
+  'third_party/fuchsia-gn-sdk': {
+    'url': Var('chromium_git') +
+        '/chromium/src/third_party/fuchsia-gn-sdk.git@' +
+        Var('fuchsia_gn_sdk_revision'),
+    'condition': 'checkout_fuchsia',
   },
 
   'third_party/googletest/src':
@@ -662,4 +662,15 @@
     'action': ['python3', 'build/util/lastchange.py',
                '-o', 'build/util/LASTCHANGE'],
   },
+  {
+    'name': 'Download Fuchsia SDK from GCS',
+    'pattern': '.',
+    'condition': 'checkout_fuchsia',
+    'action': [
+      'python3',
+      'build/fuchsia/update_sdk.py',
+      '--cipd-prefix={fuchsia_sdk_cipd_prefix}',
+      '--version={fuchsia_version}',
+    ],
+  },
 ]