ports/devel/electron25/files/patch-base_BUILD.gn
Hiroki Tagato 611c0053ff devel/electron25: add port: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build cross platform desktop apps with JavaScript, HTML, and CSS.

It's easier than you think.

If you can build a website, you can build a desktop app. Electron is a
framework for creating native applications with web technologies like
JavaScript, HTML, and CSS. It takes care of the hard parts so you can
focus on the core of your application.

WWW: https://electronjs.org/
2023-06-27 16:12:40 +09:00

143 lines
4.5 KiB
Text

--- base/BUILD.gn.orig 2023-06-07 04:52:06 UTC
+++ base/BUILD.gn
@@ -197,7 +197,7 @@ buildflag_header("ios_cronet_buildflags") {
flags = [ "CRONET_BUILD=$is_cronet_build" ]
}
-enable_message_pump_epoll = is_linux || is_chromeos || is_android
+enable_message_pump_epoll = (is_linux || is_chromeos || is_android) && !is_bsd
buildflag_header("message_pump_buildflags") {
header = "message_pump_buildflags.h"
header_dir = "base/message_loop"
@@ -1101,11 +1101,23 @@ component("base") {
# Needed for <atomic> if using newer C++ library than sysroot, except if
# building inside the cros_sdk environment - use host_toolchain as a
# more robust check for this.
- if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos)) &&
+ if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos && !is_bsd)) &&
host_toolchain != "//build/toolchain/cros:host") {
libs += [ "atomic" ]
}
+ # *BSD needs libkvm
+ if (is_bsd) {
+ libs += [ "kvm" ]
+ }
+
+ if (is_freebsd) {
+ libs += [
+ "execinfo",
+ "util",
+ ]
+ }
+
if (use_allocator_shim) {
sources += [
"allocator/partition_allocator/shim/allocator_shim.cc",
@@ -1133,7 +1145,7 @@ component("base") {
]
configs += [ "//base/allocator:mac_no_default_new_delete_symbols" ]
}
- if (is_chromeos || is_linux) {
+ if (is_chromeos || (is_linux && !is_bsd)) {
sources += [
"allocator/partition_allocator/shim/allocator_shim_override_cpp_symbols.h",
"allocator/partition_allocator/shim/allocator_shim_override_glibc_weak_symbols.h",
@@ -1174,7 +1186,7 @@ component("base") {
# Allow more direct string conversions on platforms with native utf8
# strings
- if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) {
+ if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia || is_bsd) {
defines += [ "SYSTEM_NATIVE_UTF8" ]
}
@@ -2128,6 +2140,43 @@ component("base") {
}
}
+ if (is_bsd) {
+ sources -= [
+ "files/file_path_watcher_inotify.cc",
+ "files/scoped_file_linux.cc",
+ "process/process_linux.cc",
+ "system/sys_info_linux.cc",
+ "process/process_iterator_linux.cc",
+ "process/process_metrics_linux.cc",
+ "process/process_handle_linux.cc",
+ "profiler/stack_copier_signal.cc",
+ "profiler/stack_copier_signal.h",
+ "profiler/thread_delegate_posix.cc",
+ "profiler/thread_delegate_posix.h",
+ ]
+ sources += [
+ "files/file_path_watcher_kqueue.cc",
+ "files/file_path_watcher_kqueue.h",
+ "files/file_path_watcher_bsd.cc",
+ ]
+ }
+
+ if (is_openbsd) {
+ sources += [
+ "process/process_handle_openbsd.cc",
+ "process/process_iterator_openbsd.cc",
+ "process/process_metrics_openbsd.cc",
+ "system/sys_info_openbsd.cc",
+ ]
+ } else if (is_freebsd) {
+ sources += [
+ "process/process_handle_freebsd.cc",
+ "process/process_iterator_freebsd.cc",
+ "process/process_metrics_freebsd.cc",
+ "system/sys_info_freebsd.cc",
+ ]
+ }
+
# iOS
if (is_ios) {
sources += [
@@ -2237,7 +2286,7 @@ component("base") {
}
if (dep_libevent) {
- deps += [ "//third_party/libevent" ]
+ public_deps += [ "//third_party/libevent" ]
}
if (use_libevent) {
@@ -3560,7 +3609,7 @@ test("base_unittests") {
]
}
- if (is_linux || is_chromeos) {
+ if ((is_linux || is_chromeos) && !is_bsd) {
sources += [
"debug/proc_maps_linux_unittest.cc",
"files/scoped_file_linux_unittest.cc",
@@ -3609,7 +3658,7 @@ test("base_unittests") {
"posix/file_descriptor_shuffle_unittest.cc",
"posix/unix_domain_socket_unittest.cc",
]
- if (!is_nacl && !is_apple) {
+ if (!is_nacl && !is_apple && !is_bsd) {
sources += [
"profiler/stack_base_address_posix_unittest.cc",
"profiler/stack_copier_signal_unittest.cc",
@@ -3620,7 +3669,7 @@ test("base_unittests") {
# Allow more direct string conversions on platforms with native utf8
# strings
- if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) {
+ if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia || is_bsd) {
defines += [ "SYSTEM_NATIVE_UTF8" ]
}
@@ -3844,7 +3893,7 @@ test("base_unittests") {
}
}
- if (is_fuchsia || is_linux || is_chromeos) {
+ if ((is_fuchsia || is_linux || is_chromeos) && !is_bsd) {
sources += [
"debug/elf_reader_unittest.cc",
"debug/test_elf_image_builder.cc",