29aa9da
diff -up chromium-60.0.3112.78/build/linux/unbundle/libjpeg.gn.gnsystem chromium-60.0.3112.78/build/linux/unbundle/libjpeg.gn
29aa9da
--- chromium-60.0.3112.78/build/linux/unbundle/libjpeg.gn.gnsystem	2017-07-25 15:04:48.000000000 -0400
29aa9da
+++ chromium-60.0.3112.78/build/linux/unbundle/libjpeg.gn	2017-07-31 10:38:25.879951641 -0400
29aa9da
@@ -16,6 +16,10 @@ source_set("libjpeg") {
29aa9da
   libs = [ "jpeg" ]
29aa9da
 }
29aa9da
 
29aa9da
+config("system_libjpeg") {
29aa9da
+  defines = [ "USE_SYSTEM_LIBJPEG=1" ]
29aa9da
+}
29aa9da
+
29aa9da
 source_set("simd") {
29aa9da
 }
29aa9da
 
29aa9da
diff -up chromium-60.0.3112.78/build/linux/unbundle/libusb.gn.gnsystem chromium-60.0.3112.78/build/linux/unbundle/libusb.gn
29aa9da
--- chromium-60.0.3112.78/build/linux/unbundle/libusb.gn.gnsystem	2017-07-31 10:38:25.880951622 -0400
29aa9da
+++ chromium-60.0.3112.78/build/linux/unbundle/libusb.gn	2017-07-31 10:38:25.879951641 -0400
29aa9da
@@ -0,0 +1,24 @@
29aa9da
+# Copyright 2016 The Chromium Authors. All rights reserved.
29aa9da
+# Use of this source code is governed by a BSD-style license that can be
29aa9da
+# found in the LICENSE file.
29aa9da
+
29aa9da
+import("//build/config/linux/pkg_config.gni")
29aa9da
+import("//build/shim_headers.gni")
29aa9da
+
29aa9da
+pkg_config("system_libusb") {
29aa9da
+  packages = [ "libusb-1.0" ]
29aa9da
+}
29aa9da
+
29aa9da
+shim_headers("libusb_shim") {
29aa9da
+  root_path = "src/libusb"
29aa9da
+  headers = [
29aa9da
+    "libusb.h",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+source_set("libusb") {
29aa9da
+  deps = [
29aa9da
+    ":libusb_shim",
29aa9da
+  ]
29aa9da
+  public_configs = [ ":system_libusb" ]
29aa9da
+}
29aa9da
diff -up chromium-60.0.3112.78/build/linux/unbundle/opus.gn.gnsystem chromium-60.0.3112.78/build/linux/unbundle/opus.gn
29aa9da
--- chromium-60.0.3112.78/build/linux/unbundle/opus.gn.gnsystem	2017-07-25 15:04:48.000000000 -0400
29aa9da
+++ chromium-60.0.3112.78/build/linux/unbundle/opus.gn	2017-07-31 10:38:25.880951622 -0400
29aa9da
@@ -1,3 +1,164 @@
29aa9da
+# Copyright 2016 The Chromium Authors. All rights reserved.
29aa9da
+# Use of this source code is governed by a BSD-style license that can be
29aa9da
+# found in the LICENSE file.
29aa9da
+
29aa9da
+import("//build/config/linux/pkg_config.gni")
29aa9da
+import("//build/shim_headers.gni")
29aa9da
+import("//testing/test.gni")
29aa9da
+
29aa9da
+pkg_config("system_opus") {
29aa9da
+  packages = [ "opus" ]
29aa9da
+}
29aa9da
+
29aa9da
+shim_headers("opus_shim") {
29aa9da
+  root_path = "src/include"
29aa9da
+  headers = [
29aa9da
+    "opus_custom.h",
29aa9da
+    "opus_defines.h",
29aa9da
+    "opus_multistream.h",
29aa9da
+    "opus_types.h",
29aa9da
+    "opus.h",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+source_set("opus") {
29aa9da
+  deps = [
29aa9da
+    ":opus_shim",
29aa9da
+  ]
29aa9da
+  public_configs = [ ":system_opus" ]
29aa9da
+}
29aa9da
+
29aa9da
+config("opus_test_config") {
29aa9da
+  include_dirs = [
29aa9da
+    "src/celt",
29aa9da
+    "src/silk",
29aa9da
+  ]
29aa9da
+
29aa9da
+  if (is_win) {
29aa9da
+    defines = [ "inline=__inline" ]
29aa9da
+  }
29aa9da
+  if (is_android) {
29aa9da
+    libs = [ "log" ]
29aa9da
+  }
29aa9da
+  if (is_clang) {
29aa9da
+    cflags = [ "-Wno-absolute-value" ]
29aa9da
+  }
29aa9da
+}
29aa9da
+
29aa9da
+executable("opus_compare") {
29aa9da
+  sources = [
29aa9da
+    "src/src/opus_compare.c",
29aa9da
+  ]
29aa9da
+
29aa9da
+  configs -= [ "//build/config/compiler:chromium_code" ]
29aa9da
+  configs += [
29aa9da
+    "//build/config/compiler:no_chromium_code",
29aa9da
+    ":opus_test_config",
29aa9da
+  ]
29aa9da
+
29aa9da
+  deps = [
29aa9da
+    ":opus",
29aa9da
+    "//build/config/sanitizers:deps",
29aa9da
+    "//build/win:default_exe_manifest",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+executable("opus_demo") {
29aa9da
+  sources = [
29aa9da
+    "src/src/opus_demo.c",
29aa9da
+  ]
29aa9da
+
29aa9da
+  configs -= [ "//build/config/compiler:chromium_code" ]
29aa9da
+  configs += [
29aa9da
+    "//build/config/compiler:no_chromium_code",
29aa9da
+    ":opus_test_config",
29aa9da
+  ]
29aa9da
+
29aa9da
+  deps = [
29aa9da
+    ":opus",
29aa9da
+    "//build/config/sanitizers:deps",
29aa9da
+    "//build/win:default_exe_manifest",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+test("test_opus_api") {
29aa9da
+  sources = [
29aa9da
+    "src/tests/test_opus_api.c",
29aa9da
+  ]
29aa9da
+
29aa9da
+  configs -= [ "//build/config/compiler:chromium_code" ]
29aa9da
+  configs += [
29aa9da
+    "//build/config/compiler:no_chromium_code",
29aa9da
+    ":opus_test_config",
29aa9da
+  ]
29aa9da
+
29aa9da
+  deps = [
29aa9da
+    ":opus",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+test("test_opus_encode") {
29aa9da
+  sources = [
29aa9da
+    "src/tests/test_opus_encode.c",
29aa9da
+  ]
29aa9da
+
29aa9da
+  configs -= [ "//build/config/compiler:chromium_code" ]
29aa9da
+  configs += [
29aa9da
+    "//build/config/compiler:no_chromium_code",
29aa9da
+    ":opus_test_config",
29aa9da
+  ]
29aa9da
+
29aa9da
+  deps = [
29aa9da
+    ":opus",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+# GN orders flags on a target before flags from configs. The default config
29aa9da
+# adds -Wall, and this flag have to be after -Wall -- so they need to
29aa9da
+# come from a config and can't be on the target directly.
29aa9da
+config("test_opus_decode_config") {
29aa9da
+  # test_opus_decode passes a null pointer to opus_decode() for an argument
29aa9da
+  # marked as requiring a non-null value by the nonnull function attribute,
29aa9da
+  # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid
29aa9da
+  # a compilation error if -Werror is specified.
29aa9da
+  if (is_posix) {
29aa9da
+    cflags = [ "-Wno-nonnull" ]
29aa9da
+  }
29aa9da
+}
29aa9da
+
29aa9da
+test("test_opus_decode") {
29aa9da
+  sources = [
29aa9da
+    "src/tests/test_opus_decode.c",
29aa9da
+  ]
29aa9da
+
29aa9da
+  configs -= [ "//build/config/compiler:chromium_code" ]
29aa9da
+  configs += [
29aa9da
+    "//build/config/compiler:no_chromium_code",
29aa9da
+    ":opus_test_config",
29aa9da
+    ":test_opus_decode_config",
29aa9da
+  ]
29aa9da
+
29aa9da
+  deps = [
29aa9da
+    ":opus",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
+test("test_opus_padding") {
29aa9da
+  sources = [
29aa9da
+    "src/tests/test_opus_padding.c",
29aa9da
+  ]
29aa9da
+
29aa9da
+  configs -= [ "//build/config/compiler:chromium_code" ]
29aa9da
+  configs += [
29aa9da
+    "//build/config/compiler:no_chromium_code",
29aa9da
+    ":opus_test_config",
29aa9da
+  ]
29aa9da
+
29aa9da
+  deps = [
29aa9da
+    ":opus",
29aa9da
+  ]
29aa9da
+}
29aa9da
+
29aa9da
 # Copyright 2017 The Chromium Authors. All rights reserved.
29aa9da
 # Use of this source code is governed by a BSD-style license that can be
29aa9da
 # found in the LICENSE file.
29aa9da
diff -up chromium-60.0.3112.78/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-60.0.3112.78/build/linux/unbundle/replace_gn_files.py
29aa9da
--- chromium-60.0.3112.78/build/linux/unbundle/replace_gn_files.py.gnsystem	2017-07-31 10:38:25.880951622 -0400
29aa9da
+++ chromium-60.0.3112.78/build/linux/unbundle/replace_gn_files.py	2017-07-31 10:39:58.067159914 -0400
29aa9da
@@ -26,6 +26,7 @@ REPLACEMENTS = {
29aa9da
   'libevent': 'base/third_party/libevent/BUILD.gn',
29aa9da
   'libjpeg': 'build/secondary/third_party/libjpeg_turbo/BUILD.gn',
29aa9da
   'libpng': 'third_party/libpng/BUILD.gn',
29aa9da
+  'libusb': 'third_party/libusb/BUILD.gn',
29aa9da
   'libvpx': 'third_party/libvpx/BUILD.gn',
29aa9da
   'libwebp': 'third_party/libwebp/BUILD.gn',
29aa9da
   'libxml': 'third_party/libxml/BUILD.gn',