use-system-libraries-in-node.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --- a/third_party/electron_node/BUILD.gn
  2. +++ b/third_party/electron_node/BUILD.gn
  3. @@ -42,6 +42,18 @@
  4. node_module_version = ""
  5. }
  6. +if (is_linux) {
  7. + import("//build/config/linux/pkg_config.gni")
  8. +
  9. + pkg_config("cares") {
  10. + packages = [ "libcares" ]
  11. + }
  12. +
  13. + pkg_config("nghttp2") {
  14. + packages = [ "libnghttp2" ]
  15. + }
  16. +}
  17. +
  18. assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
  19. assert(!node_use_etw, "node_use_etw not supported in GN")
  20. @@ -182,11 +194,9 @@
  21. component("node_lib") {
  22. deps = [
  23. ":node_js2c",
  24. - "deps/cares",
  25. "deps/histogram",
  26. "deps/googletest:gtest",
  27. "deps/llhttp",
  28. - "deps/nghttp2",
  29. "deps/uvwasi",
  30. "//third_party/zlib",
  31. "//third_party/brotli:dec",
  32. @@ -202,6 +212,19 @@
  33. public_configs = [ ":node_lib_config" ]
  34. include_dirs = [ "src" ]
  35. libs = []
  36. + if (is_linux) {
  37. + configs += [
  38. + ":cares",
  39. + ":nghttp2",
  40. + ]
  41. + libs += [ "http_parser" ]
  42. + } else {
  43. + deps += [
  44. + "deps/cares",
  45. + "deps/http_parser",
  46. + "deps/nghttp2",
  47. + ]
  48. + }
  49. frameworks = []
  50. cflags_cc = [
  51. "-Wno-deprecated-declarations",