 +component("node_lib") {
 +  deps = [
 +    ":node_js2c",
-+    "deps/cares",
-+    "deps/histogram",
 +    "deps/googletest:gtest",
-+    "deps/llhttp",
-+    "deps/nghttp2",
 +    "deps/uvwasi",
 +    "//third_party/zlib",
 +    "//third_party/brotli:dec",
 +    "//third_party/brotli:enc",
 +    "//v8:v8_libplatform",
 +  ]
++  if (use_system_cares) {
++    configs += [ ":cares" ]
++  } else {
++    deps += [ "deps/cares" ]
++  }
++  if (use_system_nghttp2) {
++    configs += [ ":nghttp2" ]
++  } else {
++    deps += [ "deps/nghttp2" ]
++  }
 +  public_deps = [
 +    "deps/uv",
 +    "//electron:electron_js2c",


diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..9e34a074cfa7dec61c4e11821ba5f1969f393dfb
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,403 @@
+import("//v8/gni/v8.gni")
+import("node.gni")
+

+
+  # Allows embedders to override the NODE_MODULE_VERSION define
+  node_module_version = ""
+
+  # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries.
+  use_system_cares = false
+  use_system_nghttp2 = false
+  use_system_llhttp = false
+  use_system_histogram = false
+}
+
+if (is_linux) {
+ import("//build/config/linux/pkg_config.gni")
+ if (use_system_cares) {
+  pkg_config("cares") {
+    packages = [ "libcares" ]
+  }
+ }
+ if (use_system_nghttp2) {
+  pkg_config("nghttp2") {
+    packages = [ "libnghttp2" ]
+  }
+ }
+}
+
+assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
