forked from firka/flutter
[fuchsia] Add sysroot and clang libs to package (flutter/engine#10082)
* [fuchsia] Add sysroot deps * bundle in clang stuff too * fix host_os
This commit is contained in:
@@ -6,6 +6,7 @@ assert(is_fuchsia)
|
||||
|
||||
import("//build/fuchsia/sdk.gni")
|
||||
import("$flutter_root/shell/gpu/gpu.gni")
|
||||
import("$flutter_root/tools/fuchsia/clang.gni")
|
||||
import("$flutter_root/tools/fuchsia/package_dir.gni")
|
||||
|
||||
shell_gpu_configuration("fuchsia_gpu_configuration") {
|
||||
@@ -193,7 +194,9 @@ template("jit_runner") {
|
||||
},
|
||||
]
|
||||
|
||||
fuchsia_sdk_lib = "//fuchsia/sdk/$host_os/arch/$host_cpu/lib"
|
||||
fuchsia_sdk_base = "//fuchsia/sdk/$host_os/arch/$host_cpu"
|
||||
fuchsia_sdk_lib = "$fuchsia_sdk_base/lib"
|
||||
sysroot_lib = "$fuchsia_sdk_base/sysroot/lib"
|
||||
|
||||
libraries = [
|
||||
{
|
||||
@@ -220,6 +223,27 @@ template("jit_runner") {
|
||||
name = "libvulkan.so"
|
||||
path = rebase_path("$fuchsia_sdk_lib")
|
||||
},
|
||||
{
|
||||
name = "libzircon.so"
|
||||
path = rebase_path("$sysroot_lib")
|
||||
},
|
||||
{
|
||||
name = "libc.so"
|
||||
path = rebase_path("$sysroot_lib")
|
||||
},
|
||||
|
||||
# Note, we use the md5 hashes here because of gn limitations of json parsing.
|
||||
# This is a hack, and we can migrate to a better way soon.
|
||||
{
|
||||
name = "libc++.so.2"
|
||||
path = rebase_path(
|
||||
"$clang_base/${clang_manifest_json.md5_33bfe15b05ada4ed326fbc33adb39b95}")
|
||||
},
|
||||
{
|
||||
name = "libc++abi.so.1"
|
||||
path = rebase_path(
|
||||
"$clang_base/${clang_manifest_json.md5_916c01a85e3353f124776599819ecb1c}")
|
||||
},
|
||||
]
|
||||
|
||||
meta = [
|
||||
|
||||
33
engine/src/flutter/tools/fuchsia/clang.gni
Normal file
33
engine/src/flutter/tools/fuchsia/clang.gni
Normal file
@@ -0,0 +1,33 @@
|
||||
# Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
declare_args() {
|
||||
# The default clang toolchain provided by the prebuilt. This variable is
|
||||
# additionally consumed by the Go toolchain.
|
||||
clang_base = rebase_path("//fuchsia/toolchain/$host_os/lib")
|
||||
}
|
||||
|
||||
if (current_cpu == "arm64") {
|
||||
clang_cpu = "aarch64"
|
||||
} else if (current_cpu == "x64") {
|
||||
clang_cpu = "x86_64"
|
||||
} else {
|
||||
assert(false, "CPU not supported")
|
||||
}
|
||||
|
||||
if (is_fuchsia) {
|
||||
clang_target = "${clang_cpu}-fuchsia"
|
||||
} else if (is_linux) {
|
||||
clang_target = "${clang_cpu}-linux-gnu"
|
||||
} else if (is_mac) {
|
||||
clang_target = "${clang_cpu}-apple-darwin"
|
||||
} else {
|
||||
assert(false, "OS not supported")
|
||||
}
|
||||
|
||||
clang_manifest = rebase_path("$clang_base/${clang_target}.manifest")
|
||||
clang_manifest_json =
|
||||
exec_script("$flutter_root/tools/fuchsia/parse_manifest.py",
|
||||
[ "--input=${clang_manifest}" ],
|
||||
"json")
|
||||
@@ -3,7 +3,7 @@
|
||||
# Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
""" Gather all the fuchsia artifacts to a destination directory.
|
||||
""" Copies paths, creates if they do not exist.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@@ -41,7 +41,7 @@ def CopyPath(src, dst):
|
||||
except OSError as exc:
|
||||
if exc.errno == errno.ENOTDIR:
|
||||
if not SameFile(src, dst):
|
||||
shutil.copy(src, dst)
|
||||
shutil.copyfile(src, dst)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
41
engine/src/flutter/tools/fuchsia/parse_manifest.py
Executable file
41
engine/src/flutter/tools/fuchsia/parse_manifest.py
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
""" Parses manifest file and dumps it to json.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import hashlib
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
'--input', dest='file_path', action='store', required=True)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
files = open(args.file_path, 'r')
|
||||
lines = files.read().split()
|
||||
|
||||
output = {}
|
||||
|
||||
for line in lines:
|
||||
key, val = line.strip().split('=')
|
||||
md5 = hashlib.md5(key.encode()).hexdigest()
|
||||
hash_key = 'md5_%s' % md5
|
||||
output[hash_key] = os.path.dirname(val)
|
||||
|
||||
print(json.dumps(output))
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user