Blame chromium-67.0.3396.62-gn-system.patch

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