Last active
June 4, 2021 08:21
-
-
Save prash-wghats/89be1ee069d2acf23c289e9c606616e1 to your computer and use it in GitHub Desktop.
Notes for Building Electron and VSCode in FreeBSD11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copy all the files to the build directory. | |
Copy icudtl.dat to the build directory. (you can find it in the vscode downloads ex for linux). | |
chromium version in port is 52.0.2743.116. | |
This was built with FreeBSD 11.0-RELEASE-p1. If building with other versions probably need to change | |
the freebsd versions in diff files (ex. freebsd11 => freebsd10) | |
Installed | |
node => v6.9.1 | |
npm => 3.9.2 | |
>chmod 755 vscode_build.sh | |
>./vscode_build.sh | |
VSCODE should not be built as root, or npm will fail. | |
Changes: | |
12/10/2016 - made changes to electronv1.diff <atom/common/node_bindings_linux.cc> | |
13/10/2016 - electronv1.diff <script/lib/config.py, script/create-dist.py> | |
2/11/2016 - vscodev1.diff <src/vs/base/common/platform.ts, src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/brightray.gyp b/brightray.gyp | |
index d089dba..2c443f8 100644 | |
--- a/brightray.gyp | |
+++ b/brightray.gyp | |
@@ -1,7 +1,8 @@ | |
{ | |
'variables': { | |
# The libraries brightray will be compiled to. | |
- 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss' | |
+ 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss', | |
+ 'freebsd_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss', | |
}, | |
'includes': [ | |
'filenames.gypi', | |
@@ -38,6 +39,74 @@ | |
'sources': [ '<@(brightray_sources)' ], | |
'conditions': [ | |
# Link with libraries of libchromiumcontent. | |
+ ['OS=="freebsd" and libchromiumcontent_component==0', { | |
+ # On Linux we have to use "--whole-archive" to force executable | |
+ # to include all symbols, otherwise we will have plenty of | |
+ # unresolved symbols errors. | |
+ 'direct_dependent_settings': { | |
+ 'libraries': [ | |
+ '-Wl,--start-group', | |
+ '<@(libchromiumcontent_libraries)', | |
+ '<@(libchromiumcontent_v8_libraries)', | |
+ '-Wl,--end-group', | |
+ ], | |
+ }, | |
+ }], # (Normal builds) | |
+ ['OS=="freebsd"', { | |
+ 'direct_dependent_settings': { | |
+ 'cflags': [ | |
+ '<!@(<(pkg-config) --cflags <(freebsd_system_libraries))', | |
+ ], | |
+ }, | |
+ 'link_settings': { | |
+ 'ldflags': [ | |
+ '<!@(<(pkg-config) --libs-only-L --libs-only-other <(freebsd_system_libraries))', | |
+ ], | |
+ 'libraries': [ | |
+ '-lpthread', | |
+ '<!@(<(pkg-config) --libs-only-l <(freebsd_system_libraries))', | |
+ '-lexecinfo -lkvm -licui18n -licuuc -licudata -lgconf-2 -lgio-2.0 ', | |
+ '-lxml2 -lfontconfig -lfreetype -lexpat -lharfbuzz -lpng16 -lcups ', | |
+ '-lspeechd -lm -lz -lrt -lwebp -lwebpdemux -levent -ljpeg -lre2 ', | |
+ '-lasound -lsnappy -lxslt -lcups -lspeechd -ldbus-1 -lFLAC ' | |
+ ], | |
+ }, | |
+ 'cflags': [ | |
+ '<!@(<(pkg-config) --cflags <(freebsd_system_libraries))', | |
+ ], | |
+ 'conditions': [ | |
+ ['libchromiumcontent_component', { | |
+ 'link_settings': { | |
+ 'libraries': [ | |
+ # Following libraries are always linked statically. | |
+ '<(libchromiumcontent_dir)/libgtk2ui.a', | |
+ '<(libchromiumcontent_dir)/libdevtools_discovery.a', | |
+ '<(libchromiumcontent_dir)/libdevtools_http_handler.a', | |
+ '<(libchromiumcontent_dir)/libhttp_server.a', | |
+ '<(libchromiumcontent_dir)/libdesktop_capture.a', | |
+ '<(libchromiumcontent_dir)/libdesktop_capture_differ_sse2.a', | |
+ '<(libchromiumcontent_dir)/libsystem_wrappers.a', | |
+ '<(libchromiumcontent_dir)/librtc_base.a', | |
+ '<(libchromiumcontent_dir)/librtc_base_approved.a', | |
+ '<(libchromiumcontent_dir)/libwebrtc_common.a', | |
+ '<(libchromiumcontent_dir)/libyuv.a', | |
+ '<(libchromiumcontent_dir)/libcdm_renderer.a', | |
+ '<(libchromiumcontent_dir)/libsecurity_state.a', | |
+ ], | |
+ }, | |
+ }, { | |
+ 'link_settings': { | |
+ 'libraries': [ | |
+ # Link with ffmpeg. | |
+ '<(libchromiumcontent_dir)/libffmpeg.so', | |
+ # Following libraries are required by libchromiumcontent: | |
+ '-lexpat', | |
+ ], | |
+ }, | |
+ }], | |
+ ], | |
+ }], # (Normal builds) | |
+ | |
['OS=="linux" and libchromiumcontent_component==0', { | |
# On Linux we have to use "--whole-archive" to force executable | |
# to include all symbols, otherwise we will have plenty of | |
@@ -51,7 +121,9 @@ | |
} | |
}, { # (Release build on Linux) | |
'link_settings': { | |
- 'libraries': [ '<@(libchromiumcontent_libraries)' ] | |
+ 'libraries': [ | |
+ '<@(libchromiumcontent_libraries)' , | |
+ ] | |
}, | |
}], # (Normal builds) | |
# Linux specific link settings. | |
diff --git a/browser/brightray_paths.h b/browser/brightray_paths.h | |
index 14c51ca..4a3d9dd 100644 | |
--- a/browser/brightray_paths.h | |
+++ b/browser/brightray_paths.h | |
@@ -25,7 +25,7 @@ enum { | |
DIR_USER_DATA = PATH_START, // Directory where user data can be written. | |
DIR_USER_CACHE, // Directory where user cache can be written. | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
DIR_APP_DATA, // Application Data directory under the user profile. | |
#else | |
DIR_APP_DATA = base::DIR_APP_DATA, | |
diff --git a/browser/views/views_delegate.cc b/browser/views/views_delegate.cc | |
index a18d52a..f60ece6 100644 | |
--- a/browser/views/views_delegate.cc | |
+++ b/browser/views/views_delegate.cc | |
@@ -7,7 +7,7 @@ | |
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | |
#include "ui/views/widget/native_widget_aura.h" | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
#include "ui/views/linux_ui/linux_ui.h" | |
#endif | |
@@ -59,7 +59,7 @@ bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow window) const { | |
return false; | |
} | |
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
+#elif (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS) | |
gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const { | |
return NULL; | |
} | |
@@ -105,7 +105,7 @@ base::TimeDelta ViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { | |
} | |
bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) { | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// On Ubuntu Unity, the system always provides a title bar for maximized | |
// windows. | |
views::LinuxUI* ui = views::LinuxUI::instance(); | |
diff --git a/browser/views/views_delegate.h b/browser/views/views_delegate.h | |
index 157660a..f665a95 100644 | |
--- a/browser/views/views_delegate.h | |
+++ b/browser/views/views_delegate.h | |
@@ -38,7 +38,7 @@ class ViewsDelegate : public views::ViewsDelegate { | |
HICON GetDefaultWindowIcon() const override; | |
HICON GetSmallWindowIcon() const override; | |
bool IsWindowInMetro(gfx::NativeWindow window) const override; | |
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
+#elif (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS) | |
gfx::ImageSkia* GetDefaultWindowIcon() const override; | |
#endif | |
views::NonClientFrameView* CreateDefaultNonClientFrameView( | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/script/download b/script/download | |
index 5fa3efb..1f6a7f4 100755 | |
--- a/script/download | |
+++ b/script/download | |
@@ -18,6 +18,7 @@ PLATFORM_KEY = { | |
'cygwin': 'win', | |
'darwin': 'osx', | |
'linux2': 'linux', | |
+ 'freebsd11': 'freebsd', | |
'win32': 'win', | |
}[sys.platform] | |
@@ -57,11 +58,11 @@ def main(): | |
else: | |
platform = PLATFORM_KEY | |
base_url = '{0}/{1}/{2}'.format(args.url, platform, args.target_arch) | |
- download_if_needed(args.path, base_url, commit, SHARED_LIBRARY_FILENAME, | |
- args.force) | |
- if (args.static and | |
- not os.path.exists(os.path.join(args.path, 'static_library'))): | |
- download(args.path, base_url, commit, STATIC_LIBRARY_FILENAME) | |
+ #download_if_needed(args.path, base_url, commit, SHARED_LIBRARY_FILENAME, | |
+ # args.force) | |
+ #if (args.static and | |
+ # not os.path.exists(os.path.join(args.path, 'static_library'))): | |
+ # download(args.path, base_url, commit, STATIC_LIBRARY_FILENAME) | |
generate_filenames_gypi(os.path.join(args.path, 'filenames.gypi'), | |
os.path.join(args.path, 'src'), | |
os.path.join(args.path, 'shared_library'), | |
diff --git a/tools/generate_filenames_gypi.py b/tools/generate_filenames_gypi.py | |
index 9cc5861..887fa8b 100755 | |
--- a/tools/generate_filenames_gypi.py | |
+++ b/tools/generate_filenames_gypi.py | |
@@ -9,17 +9,20 @@ TARGET_PLATFORM = { | |
'cygwin': 'win32', | |
'darwin': 'darwin', | |
'linux2': 'linux', | |
+ 'freebsd11': 'freebsd', | |
'win32': 'win32', | |
}[sys.platform] | |
SHARED_LIBRARY_SUFFIX = { | |
'darwin': 'dylib', | |
'linux': 'so', | |
+ 'freebsd': 'so', | |
'win32': 'dll', | |
}[TARGET_PLATFORM] | |
STATIC_LIBRARY_SUFFIX = { | |
'darwin': 'a', | |
'linux': 'a', | |
+ 'freebsd': 'a', | |
'win32': 'lib', | |
}[TARGET_PLATFORM] | |
@@ -31,6 +34,10 @@ EXCLUDE_SHARED_LIBRARIES = { | |
'libwidevinecdm.so', | |
'libwidevinecdmadapter.so', | |
], | |
+ 'freebsd': [ | |
+ 'libwidevinecdm.so', | |
+ 'libwidevinecdmadapter.so', | |
+ ], | |
'win32': [ | |
'd3dcompiler_47.dll', | |
'libEGL.dll', | |
@@ -53,6 +60,14 @@ EXCLUDE_STATIC_LIBRARIES = { | |
'libv8_nosnapshot.a', | |
'libtranslator_static.a', | |
], | |
+ 'freebsd': [ | |
+ 'libffmpeg_yasm.a', | |
+ 'libppapi_cpp.a', | |
+ 'libprotobuf_full_do_not_use.a', | |
+ 'libgenperf_libs.a', | |
+ 'libv8_nosnapshot.a', | |
+ 'libtranslator_static.a', | |
+ ], | |
'win32': [ | |
'ffmpeg.dll.lib', | |
'ffmpeg_yasm.lib', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/native_mate/converter.cc b/native_mate/converter.cc | |
index 97fa455..9edf940 100644 | |
--- a/native_mate/converter.cc | |
+++ b/native_mate/converter.cc | |
@@ -32,7 +32,7 @@ bool Converter<bool>::FromV8(Isolate* isolate, Local<Value> val, bool* out) { | |
return true; | |
} | |
-#if !defined(OS_LINUX) | |
+#if !defined(OS_LINUX) && !defined(OS_FREEBSD) | |
Local<Value> Converter<unsigned long>::ToV8(Isolate* isolate, | |
unsigned long val) { | |
return MATE_INTEGER_NEW(isolate, val); | |
diff --git a/native_mate/converter.h b/native_mate/converter.h | |
index ebb6273..d5606e4 100644 | |
--- a/native_mate/converter.h | |
+++ b/native_mate/converter.h | |
@@ -49,7 +49,7 @@ struct Converter<bool> { | |
bool* out); | |
}; | |
-#if !defined(OS_LINUX) | |
+#if !defined(OS_LINUX) && !defined(OS_FREEBSD) | |
template<> | |
struct Converter<unsigned long> { | |
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/atom/app/atom_main.cc b/atom/app/atom_main.cc | |
index 9c255db..6ebb03f 100644 | |
--- a/atom/app/atom_main.cc | |
+++ b/atom/app/atom_main.cc | |
@@ -20,7 +20,7 @@ | |
#include "base/win/windows_version.h" | |
#include "content/public/app/sandbox_helper_win.h" | |
#include "sandbox/win/src/sandbox_types.h" | |
-#elif defined(OS_LINUX) // defined(OS_WIN) | |
+#elif defined(OS_LINUX) || defined(OS_FREEBSD) // defined(OS_WIN) | |
#include "atom/app/atom_main_delegate.h" // NOLINT | |
#include "content/public/app/content_main.h" | |
#else // defined(OS_LINUX) | |
@@ -115,7 +115,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { | |
return content::ContentMain(params); | |
} | |
-#elif defined(OS_LINUX) // defined(OS_WIN) | |
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)// defined(OS_WIN) | |
int main(int argc, const char* argv[]) { | |
if (IsEnvSet(kRunAsNode)) { | |
diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc | |
index 2d31b1c..b54f16a 100644 | |
--- a/atom/app/atom_main_delegate.cc | |
+++ b/atom/app/atom_main_delegate.cc | |
@@ -85,7 +85,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { | |
// Enable convient stack printing. | |
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING"); | |
-#if defined(DEBUG) && defined(OS_LINUX) | |
+#if defined(DEBUG) && (defined(OS_LINUX) || defined(OS_FREEBSD)) | |
enable_stack_dumping = true; | |
#endif | |
if (enable_stack_dumping) | |
diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc | |
index 751293e..f10ce99 100644 | |
--- a/atom/browser/api/atom_api_app.cc | |
+++ b/atom/browser/api/atom_api_app.cc | |
@@ -617,7 +617,7 @@ void App::SetPath(mate::Arguments* args, | |
} | |
void App::SetDesktopName(const std::string& desktop_name) { | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
std::unique_ptr<base::Environment> env(base::Environment::Create()); | |
env->SetVar("CHROME_DESKTOP", desktop_name); | |
#endif | |
@@ -845,7 +845,7 @@ void App::BuildPrototype( | |
.SetMethod("getJumpListSettings", &App::GetJumpListSettings) | |
.SetMethod("setJumpList", &App::SetJumpList) | |
#endif | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
.SetMethod("isUnityRunning", | |
base::Bind(&Browser::IsUnityRunning, browser)) | |
#endif | |
diff --git a/atom/browser/atom_browser_main_parts_posix.cc b/atom/browser/atom_browser_main_parts_posix.cc | |
index 8c96f91..22b4784 100644 | |
--- a/atom/browser/atom_browser_main_parts_posix.cc | |
+++ b/atom/browser/atom_browser_main_parts_posix.cc | |
@@ -183,6 +183,9 @@ void AtomBrowserMainParts::HandleShutdownSignals() { | |
g_pipe_pid = getpid(); | |
g_shutdown_pipe_read_fd = pipefd[0]; | |
g_shutdown_pipe_write_fd = pipefd[1]; | |
+#if defined (__FreeBSD__) | |
+ const size_t kShutdownDetectorThreadStackSize = 0; | |
+#else | |
#if !defined(ADDRESS_SANITIZER) && !defined(KEEP_SHADOW_STACKS) | |
const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2; | |
#else | |
@@ -191,6 +194,7 @@ void AtomBrowserMainParts::HandleShutdownSignals() { | |
// size to avoid hitting the guard page. | |
const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4; | |
#endif | |
+#endif | |
// TODO(viettrungluu,willchan): crbug.com/29675 - This currently leaks, so | |
// if you change this, you'll probably need to change the suppression. | |
if (!base::PlatformThread::CreateNonJoinable( | |
diff --git a/atom/browser/browser.h b/atom/browser/browser.h | |
index 5bb2500..28654f5 100644 | |
--- a/atom/browser/browser.h | |
+++ b/atom/browser/browser.h | |
@@ -167,7 +167,7 @@ class Browser : public WindowListObserver { | |
PCWSTR GetAppUserModelID(); | |
#endif // defined(OS_WIN) | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// Whether Unity launcher is running. | |
bool IsUnityRunning(); | |
#endif // defined(OS_LINUX) | |
diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc | |
index 3b836d9..02d154a 100644 | |
--- a/atom/browser/native_window.cc | |
+++ b/atom/browser/native_window.cc | |
@@ -40,7 +40,7 @@ | |
#include "ui/gfx/geometry/size_conversions.h" | |
#include "ui/gl/gpu_switching_manager.h" | |
-#if defined(OS_LINUX) || defined(OS_WIN) | |
+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_FREEBSD) | |
#include "content/public/common/renderer_preferences.h" | |
#include "ui/gfx/font_render_params.h" | |
#endif | |
@@ -72,7 +72,7 @@ NativeWindow::NativeWindow( | |
if (parent) | |
options.Get("modal", &is_modal_); | |
-#if defined(OS_LINUX) || defined(OS_WIN) | |
+#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_FREEBSD) | |
auto* prefs = web_contents()->GetMutableRendererPrefs(); | |
// Update font settings. | |
diff --git a/atom/browser/relauncher_linux.cc b/atom/browser/relauncher_linux.cc | |
index 6d60b07..838fcbf 100644 | |
--- a/atom/browser/relauncher_linux.cc | |
+++ b/atom/browser/relauncher_linux.cc | |
@@ -6,8 +6,10 @@ | |
#include <fcntl.h> | |
#include <signal.h> | |
+#if !defined(__FreeBSD__) | |
#include <sys/prctl.h> | |
#include <sys/signalfd.h> | |
+#endif | |
#include "base/files/file_util.h" | |
#include "base/files/scoped_file.h" | |
@@ -31,6 +33,10 @@ void RelauncherSynchronizeWithParent() { | |
return; | |
} | |
+#if defined(__FreeBSD__) | |
+ PLOG(ERROR) <<"signalfd & prctl"; | |
+ fprintf(stderr, "Not Implemented ignalfd & prctl in atom/browser/relauncher_linux.cc"); | |
+#else | |
// Create a signalfd that watches for SIGUSR2. | |
int usr2_fd = signalfd(-1, &mask, 0); | |
if (usr2_fd < 0) { | |
@@ -53,6 +59,7 @@ void RelauncherSynchronizeWithParent() { | |
// Wait the SIGUSR2 signal to happen. | |
struct signalfd_siginfo si; | |
HANDLE_EINTR(read(usr2_fd, &si, sizeof(si))); | |
+#endif | |
} | |
int LaunchProgram(const StringVector& relauncher_args, | |
diff --git a/atom/browser/ui/views/submenu_button.cc b/atom/browser/ui/views/submenu_button.cc | |
index ca06d7d..d0d99cc 100644 | |
--- a/atom/browser/ui/views/submenu_button.cc | |
+++ b/atom/browser/ui/views/submenu_button.cc | |
@@ -35,7 +35,7 @@ SubmenuButton::SubmenuButton(views::ButtonListener* listener, | |
text_width_(0), | |
text_height_(0), | |
underline_color_(SK_ColorBLACK) { | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// Dont' use native style border. | |
SetBorder(std::move(CreateDefaultBorder())); | |
#endif | |
diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc | |
index 184a70c..b15a271 100644 | |
--- a/atom/common/api/atom_api_crash_reporter.cc | |
+++ b/atom/common/api/atom_api_crash_reporter.cc | |
@@ -34,11 +34,13 @@ namespace { | |
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | |
v8::Local<v8::Context> context, void* priv) { | |
mate::Dictionary dict(context->GetIsolate(), exports); | |
+#if !defined(OS_FREEBSD) | |
auto report = base::Unretained(CrashReporter::GetInstance()); | |
dict.SetMethod("start", | |
base::Bind(&CrashReporter::Start, report)); | |
dict.SetMethod("_getUploadedReports", | |
base::Bind(&CrashReporter::GetUploadedReports, report)); | |
+#endif | |
} | |
} // namespace | |
diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc | |
index cf80d64..f6592ea 100644 | |
--- a/atom/common/api/atom_bindings.cc | |
+++ b/atom/common/api/atom_bindings.cc | |
@@ -53,6 +53,7 @@ v8::Local<v8::Value> GetProcessMemoryInfo(v8::Isolate* isolate) { | |
v8::Local<v8::Value> GetSystemMemoryInfo(v8::Isolate* isolate, | |
mate::Arguments* args) { | |
+#if !defined(OS_FREEBSD) | |
base::SystemMemoryInfoKB mem_info; | |
if (!base::GetSystemMemoryInfo(&mem_info)) { | |
args->ThrowError("Unable to retrieve system memory information"); | |
@@ -69,6 +70,13 @@ v8::Local<v8::Value> GetSystemMemoryInfo(v8::Isolate* isolate, | |
dict.Set("swapFree", mem_info.swap_free); | |
#endif | |
+#else //!OS_FREEBSD | |
+ mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); | |
+ dict.Set("total", 0); | |
+ dict.Set("free", 0); | |
+ dict.Set("swapTotal", 0); | |
+ dict.Set("swapFree", 0); | |
+#endif | |
return dict.GetHandle(); | |
} | |
diff --git a/atom/common/atom_command_line.cc b/atom/common/atom_command_line.cc | |
index 08880ff..3fa8d79 100644 | |
--- a/atom/common/atom_command_line.cc | |
+++ b/atom/common/atom_command_line.cc | |
@@ -35,7 +35,7 @@ void AtomCommandLine::InitW(int argc, const wchar_t* const* argv) { | |
} | |
#endif | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// static | |
void AtomCommandLine::InitializeFromCommandLine() { | |
argv_ = base::CommandLine::ForCurrentProcess()->argv(); | |
diff --git a/atom/common/atom_command_line.h b/atom/common/atom_command_line.h | |
index a834ce9..b5adc00 100644 | |
--- a/atom/common/atom_command_line.h | |
+++ b/atom/common/atom_command_line.h | |
@@ -24,7 +24,7 @@ class AtomCommandLine { | |
static std::vector<std::wstring> wargv() { return wargv_; } | |
#endif | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// On Linux the command line has to be read from base::CommandLine since | |
// it is using zygote. | |
static void InitializeFromCommandLine(); | |
diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc | |
index d6ad804..91134af 100644 | |
--- a/atom/common/node_bindings.cc | |
+++ b/atom/common/node_bindings.cc | |
@@ -130,7 +130,7 @@ void NodeBindings::Initialize() { | |
node::g_standalone_mode = is_browser_; | |
node::g_upstream_node_mode = false; | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// Get real command line in renderer process forked by zygote. | |
if (!is_browser_) | |
AtomCommandLine::InitializeFromCommandLine(); | |
diff --git a/atom/common/node_bindings_linux.cc b/atom/common/node_bindings_linux.cc | |
index 34b9ea9..cf2bc26 100644 | |
--- a/atom/common/node_bindings_linux.cc | |
+++ b/atom/common/node_bindings_linux.cc | |
@@ -3,19 +3,34 @@ | |
// found in the LICENSE file. | |
#include "atom/common/node_bindings_linux.h" | |
- | |
+#if !defined(OS_FREEBSD) | |
#include <sys/epoll.h> | |
+#else | |
+#include <errno.h> | |
+#include <sys/select.h> | |
+#include <sys/sysctl.h> | |
+#include <sys/time.h> | |
+#include <sys/types.h> | |
+ | |
+#endif | |
namespace atom { | |
NodeBindingsLinux::NodeBindingsLinux(bool is_browser) | |
+#if !defined(OS_FREEBSD) | |
: NodeBindings(is_browser), | |
- epoll_(epoll_create(1)) { | |
+ epoll_(epoll_create(1)) { | |
+#else | |
+ : NodeBindings(is_browser) { | |
+#endif | |
+#if !defined(OS_FREEBSD) | |
int backend_fd = uv_backend_fd(uv_loop_); | |
+ | |
struct epoll_event ev = { 0 }; | |
ev.events = EPOLLIN; | |
ev.data.fd = backend_fd; | |
epoll_ctl(epoll_, EPOLL_CTL_ADD, backend_fd, &ev); | |
+#endif | |
} | |
NodeBindingsLinux::~NodeBindingsLinux() { | |
@@ -39,14 +54,37 @@ | |
} | |
void NodeBindingsLinux::PollEvents() { | |
+#if !defined(OS_FREEBSD) | |
int timeout = uv_backend_timeout(uv_loop_); | |
// Wait for new libuv events. | |
int r; | |
+ | |
do { | |
struct epoll_event ev; | |
r = epoll_wait(epoll_, &ev, 1, timeout); | |
+ | |
+ } while (r == -1 && errno == EINTR); | |
+#else | |
+struct timeval tv; | |
+ int timeout = uv_backend_timeout(uv_loop_); | |
+ if (timeout != -1) { | |
+ tv.tv_sec = timeout / 1000; | |
+ tv.tv_usec = (timeout % 1000) * 1000; | |
+ } | |
+ | |
+ fd_set readset; | |
+ int fd = uv_backend_fd(uv_loop_); | |
+ FD_ZERO(&readset); | |
+ FD_SET(fd, &readset); | |
+ | |
+ // Wait for new libuv events. | |
+ int r; | |
+ do { | |
+ r = select(fd + 1, &readset, nullptr, nullptr, | |
+ timeout == -1 ? nullptr : &tv); | |
} while (r == -1 && errno == EINTR); | |
+#endif | |
} | |
// static | |
diff --git a/atom/renderer/api/atom_api_spell_check_client.cc b/atom/renderer/api/atom_api_spell_check_client.cc | |
index 08f36ef..fa7f6fc 100644 | |
--- a/atom/renderer/api/atom_api_spell_check_client.cc | |
+++ b/atom/renderer/api/atom_api_spell_check_client.cc | |
@@ -11,7 +11,7 @@ | |
#include "base/logging.h" | |
#include "native_mate/converter.h" | |
#include "native_mate/dictionary.h" | |
-#include "third_party/icu/source/common/unicode/uscript.h" | |
+#include "unicode/uscript.h" | |
#include "third_party/WebKit/public/web/WebTextCheckingCompletion.h" | |
#include "third_party/WebKit/public/web/WebTextCheckingResult.h" | |
diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc | |
index bb999fb..22f7eda 100644 | |
--- a/chromium_src/chrome/browser/process_singleton_posix.cc | |
+++ b/chromium_src/chrome/browser/process_singleton_posix.cc | |
@@ -82,7 +82,7 @@ | |
#include "net/base/network_interfaces.h" | |
#include "ui/base/l10n/l10n_util.h" | |
-#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
+#if defined(TOOLKIT_VIEWS) && (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS) | |
#include "ui/views/linux_ui/linux_ui.h" | |
#endif | |
@@ -856,7 +856,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( | |
// The other process is shutting down, it's safe to start a new process. | |
return PROCESS_NONE; | |
} else if (strncmp(buf, kACKToken, arraysize(kACKToken) - 1) == 0) { | |
-#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
+#if defined(TOOLKIT_VIEWS) && (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS) | |
// Likely NULL in unit tests. | |
views::LinuxUI* linux_ui = views::LinuxUI::instance(); | |
if (linux_ui) | |
diff --git a/chromium_src/chrome/common/chrome_paths.cc b/chromium_src/chrome/common/chrome_paths.cc | |
index 293ea26..ae4431c 100644 | |
--- a/chromium_src/chrome/common/chrome_paths.cc | |
+++ b/chromium_src/chrome/common/chrome_paths.cc | |
@@ -51,7 +51,7 @@ const base::FilePath::CharType kFlashSystemPluginName[] = | |
const base::FilePath::CharType kInternalNaClPluginFileName[] = | |
FILE_PATH_LITERAL("internal-nacl-plugin"); | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
// The path to the external extension <id>.json files. | |
// /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ | |
const base::FilePath::CharType kFilepathSinglePrefExtensions[] = | |
@@ -177,7 +177,7 @@ bool PathProvider(int key, base::FilePath* result) { | |
return false; | |
break; | |
case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: | |
-#if defined(OS_WIN) || defined(OS_LINUX) | |
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD) | |
if (!GetUserDownloadsDirectorySafe(&cur)) | |
return false; | |
break; | |
@@ -419,7 +419,7 @@ bool PathProvider(int key, base::FilePath* result) { | |
break; | |
#endif | |
#if defined(ENABLE_SUPERVISED_USERS) | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
case chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS: | |
if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur)) | |
return false; | |
@@ -493,7 +493,7 @@ bool PathProvider(int key, base::FilePath* result) { | |
break; | |
} | |
#endif | |
-#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(CHROMIUM_BUILD)) || \ | |
+#if defined(OS_CHROMEOS) || ((defined(OS_LINUX) || defined(OS_FREEBSD)) && defined(CHROMIUM_BUILD)) || \ | |
(defined(OS_MACOSX) && !defined(OS_IOS)) | |
case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | |
if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | |
@@ -502,7 +502,7 @@ bool PathProvider(int key, base::FilePath* result) { | |
break; | |
} | |
#endif | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { | |
cur = base::FilePath(kFilepathSinglePrefExtensions); | |
break; | |
@@ -537,7 +537,7 @@ bool PathProvider(int key, base::FilePath* result) { | |
#endif | |
break; | |
-#if defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS)) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) || (defined(OS_MACOSX) && !defined(OS_IOS)) | |
case chrome::DIR_NATIVE_MESSAGING: | |
#if defined(OS_MACOSX) | |
#if defined(GOOGLE_CHROME_BUILD) | |
@@ -571,7 +571,7 @@ bool PathProvider(int key, base::FilePath* result) { | |
cur = cur.Append(kGCMStoreDirname); | |
break; | |
#endif // !defined(OS_ANDROID) | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
case chrome::FILE_COMPONENT_FLASH_HINT: | |
if (!PathService::Get(chrome::DIR_COMPONENT_UPDATED_PEPPER_FLASH_PLUGIN, | |
&cur)) { | |
diff --git a/chromium_src/chrome/common/chrome_paths.h b/chromium_src/chrome/common/chrome_paths.h | |
index 581fdc0..83747c7 100644 | |
--- a/chromium_src/chrome/common/chrome_paths.h | |
+++ b/chromium_src/chrome/common/chrome_paths.h | |
@@ -50,7 +50,7 @@ enum { | |
DIR_USER_APPLICATIONS, // ~/Applications | |
DIR_USER_LIBRARY, // ~/Library | |
#endif | |
-#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && defined(CHROMIUM_BUILD)) || \ | |
+#if defined(OS_CHROMEOS) || ((defined(OS_LINUX) || defined(OS_FREEBSD)) && defined(CHROMIUM_BUILD)) || \ | |
(defined(OS_MACOSX) && !defined(OS_IOS)) | |
DIR_USER_EXTERNAL_EXTENSIONS, // Directory for per-user external extensions | |
// on Chrome Mac and Chromium Linux. | |
@@ -59,7 +59,7 @@ enum { | |
// create it. | |
#endif | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
DIR_STANDALONE_EXTERNAL_EXTENSIONS, // Directory for 'per-extension' | |
// definition manifest files that | |
// describe extensions which are to be | |
@@ -117,7 +117,7 @@ enum { | |
DIR_SUPERVISED_USER_INSTALLED_WHITELISTS, // Directory where sanitized | |
// supervised user whitelists are | |
// installed. | |
-#if defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS)) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) || (defined(OS_MACOSX) && !defined(OS_IOS)) | |
DIR_NATIVE_MESSAGING, // System directory where native messaging host | |
// manifest files are stored. | |
DIR_USER_NATIVE_MESSAGING, // Directory with Native Messaging Hosts | |
@@ -132,7 +132,7 @@ enum { | |
DIR_GEN_TEST_DATA, // Directory where generated test data resides. | |
DIR_TEST_DATA, // Directory where unit test data resides. | |
DIR_TEST_TOOLS, // Directory where unit test tools reside. | |
-#if defined(OS_LINUX) | |
+#if defined(OS_LINUX) || defined(OS_FREEBSD) | |
FILE_COMPONENT_FLASH_HINT, // A file in a known location that points to | |
// the component updated flash plugin. | |
#endif // defined(OS_LINUX) | |
diff --git a/chromium_src/chrome/common/chrome_paths_internal.h b/chromium_src/chrome/common/chrome_paths_internal.h | |
index ae1cd62..3205337 100644 | |
--- a/chromium_src/chrome/common/chrome_paths_internal.h | |
+++ b/chromium_src/chrome/common/chrome_paths_internal.h | |
@@ -39,7 +39,7 @@ void GetUserCacheDirectory(const base::FilePath& profile_dir, base::FilePath* re | |
// Get the path to the user's documents directory. | |
bool GetUserDocumentsDirectory(base::FilePath* result); | |
-#if defined(OS_WIN) || defined(OS_LINUX) | |
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD) | |
// Gets the path to a safe default download directory for a user. | |
bool GetUserDownloadsDirectorySafe(base::FilePath* result); | |
#endif | |
diff --git a/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.cc b/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.cc | |
index c109709..976279c 100644 | |
--- a/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.cc | |
+++ b/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.cc | |
@@ -14,7 +14,7 @@ | |
#include "ppapi/proxy/ppapi_messages.h" | |
#include "ppapi/proxy/serialized_structs.h" | |
-#if defined(OS_LINUX) || defined(OS_OPENBSD) | |
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) | |
#include "content/public/common/child_process_sandbox_support_linux.h" | |
#elif defined(OS_WIN) | |
#include "third_party/skia/include/ports/SkFontMgr.h" | |
@@ -27,7 +27,7 @@ PepperFlashFontFileHost::PepperFlashFontFileHost( | |
const ppapi::proxy::SerializedFontDescription& description, | |
PP_PrivateFontCharset charset) | |
: ResourceHost(host->GetPpapiHost(), instance, resource) { | |
-#if defined(OS_LINUX) || defined(OS_OPENBSD) | |
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) | |
fd_.reset(content::MatchFontWithFallback( | |
description.face.c_str(), | |
description.weight >= PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD, | |
@@ -62,7 +62,7 @@ bool PepperFlashFontFileHost::GetFontData(uint32_t table, | |
void* buffer, | |
size_t* length) { | |
bool result = false; | |
-#if defined(OS_LINUX) || defined(OS_OPENBSD) | |
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) | |
int fd = fd_.get(); | |
if (fd != -1) | |
result = content::GetFontTable(fd, table, 0 /* offset */, | |
diff --git a/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.h b/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.h | |
index 0205a69..a2e0d8f 100644 | |
--- a/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.h | |
+++ b/chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.h | |
@@ -8,7 +8,7 @@ | |
#include "ppapi/c/private/pp_private_font_charset.h" | |
#include "ppapi/host/resource_host.h" | |
-#if defined(OS_LINUX) || defined(OS_OPENBSD) | |
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) | |
#include "base/files/scoped_file.h" | |
#elif defined(OS_WIN) | |
#include "third_party/skia/include/core/SkRefCnt.h" | |
@@ -44,7 +44,7 @@ class PepperFlashFontFileHost : public ppapi::host::ResourceHost { | |
uint32_t table); | |
bool GetFontData(uint32_t table, void* buffer, size_t* length); | |
-#if defined(OS_LINUX) || defined(OS_OPENBSD) | |
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) | |
base::ScopedFD fd_; | |
#elif defined(OS_WIN) | |
sk_sp<SkTypeface> typeface_; | |
diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.h b/chromium_src/chrome/renderer/printing/print_web_view_helper.h | |
index 0a00f2e..b1f1f8f 100644 | |
--- a/chromium_src/chrome/renderer/printing/print_web_view_helper.h | |
+++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.h | |
@@ -175,7 +175,7 @@ class PrintWebViewHelper | |
void FinishFramePrinting(); | |
// Prints the page listed in |params|. | |
-#if defined(OS_LINUX) || defined(OS_ANDROID) | |
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) | |
void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | |
blink::WebFrame* frame, | |
PdfMetafileSkia* metafile); | |
diff --git a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc | |
index 46465f4..425e76e 100644 | |
--- a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc | |
+++ b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc | |
@@ -13,10 +13,10 @@ | |
#include "base/logging.h" | |
#include "base/strings/stringprintf.h" | |
#include "base/strings/utf_string_conversions.h" | |
-#include "third_party/icu/source/common/unicode/normlzr.h" | |
-#include "third_party/icu/source/common/unicode/schriter.h" | |
-#include "third_party/icu/source/common/unicode/uscript.h" | |
-#include "third_party/icu/source/i18n/unicode/ulocdata.h" | |
+#include "unicode/normlzr.h" | |
+#include "unicode/schriter.h" | |
+#include "unicode/uscript.h" | |
+#include "unicode/ulocdata.h" | |
// SpellcheckCharAttribute implementation: | |
diff --git a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h | |
index 7e07d29..f90c8a1 100644 | |
--- a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h | |
+++ b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h | |
@@ -14,7 +14,7 @@ | |
#include "base/macros.h" | |
#include "base/strings/string16.h" | |
-#include "third_party/icu/source/common/unicode/uscript.h" | |
+#include "unicode/uscript.h" | |
namespace base { | |
namespace i18n { | |
diff --git a/chromium_src/library_loaders/libspeechd.h b/chromium_src/library_loaders/libspeechd.h | |
index f7b2762..57224a9 100644 | |
--- a/chromium_src/library_loaders/libspeechd.h | |
+++ b/chromium_src/library_loaders/libspeechd.h | |
@@ -4,7 +4,7 @@ | |
#ifndef LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBSPEECHD_H | |
#define LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBSPEECHD_H | |
-#include "third_party/speech-dispatcher/libspeechd.h" | |
+#include "speech-dispatcher/libspeechd.h" | |
#define LIBRARY_LOADER_OUT_RELEASE_GEN_LIBRARY_LOADERS_LIBSPEECHD_H_DLOPEN | |
diff --git a/electron.gyp b/electron.gyp | |
index 96cb6b9..4d38b2e 100644 | |
--- a/electron.gyp | |
+++ b/electron.gyp | |
@@ -164,9 +164,44 @@ | |
], | |
}, { | |
'dependencies': [ | |
- 'vendor/breakpad/breakpad.gyp:dump_syms#host', | |
+ # 'vendor/breakpad/breakpad.gyp:dump_syms#host', | |
], | |
}], # OS=="win" | |
+ ['OS=="freebsd"', { | |
+ 'copies': [ | |
+ { | |
+ 'variables': { | |
+ 'conditions': [ | |
+ ['libchromiumcontent_component', { | |
+ 'copied_libraries': [ | |
+ '<(PRODUCT_DIR)/lib/libnode.so', | |
+ '<@(libchromiumcontent_shared_libraries)', | |
+ '<@(libchromiumcontent_shared_v8_libraries)', | |
+ ], | |
+ }, { | |
+ 'copied_libraries': [ | |
+ '<(PRODUCT_DIR)/lib/libnode.so', | |
+ '<(libchromiumcontent_dir)/libffmpeg.so', | |
+ ], | |
+ }], | |
+ ], | |
+ }, | |
+ 'destination': '<(PRODUCT_DIR)', | |
+ 'files': [ | |
+ '<@(copied_libraries)', | |
+ '<(libchromiumcontent_dir)/locales', | |
+ '<(libchromiumcontent_dir)/icudtl.dat', | |
+ '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak', | |
+ '<(libchromiumcontent_dir)/content_resources_200_percent.pak', | |
+ '<(libchromiumcontent_dir)/content_shell.pak', | |
+ '<(libchromiumcontent_dir)/ui_resources_200_percent.pak', | |
+ '<(libchromiumcontent_dir)/views_resources_200_percent.pak', | |
+ '<(libchromiumcontent_dir)/natives_blob.bin', | |
+ '<(libchromiumcontent_dir)/snapshot_blob.bin', | |
+ ], | |
+ }, | |
+ ], | |
+ }], # OS=="freebsd" | |
['OS=="linux"', { | |
'copies': [ | |
{ | |
@@ -319,6 +354,17 @@ | |
'atom/common/crash_reporter/crash_reporter_mac.mm', | |
], | |
}], # OS=="mac" and mas_build==1 | |
+ ['OS=="freebsd"', { | |
+ 'sources': [ | |
+ '<@(lib_sources_nss)', | |
+ ], | |
+ 'sources!': [ | |
+ 'atom/common/crash_reporter/crash_reporter_linux.h', | |
+ 'atom/common/crash_reporter/crash_reporter_linux.cc', | |
+ 'atom/common/crash_reporter/linux/crash_dump_handler.cc', | |
+ 'atom/common/crash_reporter/linux/crash_dump_handler.h', | |
+ ], | |
+ }], # OS=="freebsd" | |
['OS=="linux"', { | |
'sources': [ | |
'<@(lib_sources_nss)', | |
diff --git a/script/bootstrap.py b/script/bootstrap.py | |
index 37f4ec21..f5521b7 100755 | |
--- a/script/bootstrap.py | |
+++ b/script/bootstrap.py | |
@@ -60,8 +60,8 @@ def main(): | |
libcc_source_path, libcc_shared_library_path, | |
libcc_static_library_path) | |
- if PLATFORM == 'linux': | |
- download_sysroot(args.target_arch) | |
+ #if PLATFORM == 'linux': | |
+ # download_sysroot(args.target_arch) | |
create_chrome_version_h() | |
touch_config_gypi() | |
diff --git a/script/build.py b/script/build.py | |
index 1a7378b..1209b25 100755 | |
--- a/script/build.py | |
+++ b/script/build.py | |
@@ -22,7 +22,7 @@ def main(): | |
ninja = os.path.join('vendor', 'depot_tools', 'ninja') | |
if sys.platform == 'win32': | |
ninja += '.exe' | |
- | |
+ ninja='ninja' | |
args = parse_args() | |
for config in args.configuration: | |
build_path = os.path.join('out', config[0]) | |
diff --git a/script/create-dist.py b/script/create-dist.py | |
index 9d97744..3bdb266 100755 | |
--- a/script/create-dist.py | |
+++ b/script/create-dist.py | |
@@ -59,6 +59,19 @@ TARGET_BINARIES = { | |
'natives_blob.bin', | |
'snapshot_blob.bin', | |
], | |
+ 'freebsd': [ | |
+ PROJECT_NAME, # 'electron' | |
+ 'content_shell.pak', | |
+ 'icudtl.dat', | |
+ 'libffmpeg.so', | |
+ 'libnode.so', | |
+ 'blink_image_resources_200_percent.pak', | |
+ 'content_resources_200_percent.pak', | |
+ 'ui_resources_200_percent.pak', | |
+ 'views_resources_200_percent.pak', | |
+ 'natives_blob.bin', | |
+ 'snapshot_blob.bin', | |
+ ], | |
} | |
TARGET_DIRECTORIES = { | |
'darwin': [ | |
@@ -72,6 +85,10 @@ TARGET_DIRECTORIES = { | |
'resources', | |
'locales', | |
], | |
+ 'freebsd': [ | |
+ 'resources', | |
+ 'locales', | |
+ ], | |
} | |
@@ -80,7 +97,7 @@ def main(): | |
os.makedirs(DIST_DIR) | |
force_build() | |
- create_symbols() | |
+ #create_symbols() | |
copy_binaries() | |
copy_chrome_binary('chromedriver') | |
copy_chrome_binary('mksnapshot') | |
@@ -94,7 +111,7 @@ def main(): | |
create_chrome_binary_zip('chromedriver', get_chromedriver_version()) | |
create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION) | |
create_ffmpeg_zip() | |
- create_symbols_zip() | |
+ #create_symbols_zip() | |
def force_build(): | |
@@ -196,6 +213,8 @@ def create_ffmpeg_zip(): | |
ffmpeg_name = 'libffmpeg.dylib' | |
elif PLATFORM == 'linux': | |
ffmpeg_name = 'libffmpeg.so' | |
+ elif PLATFORM == 'freebsd': | |
+ ffmpeg_name = 'libffmpeg.so' | |
elif PLATFORM == 'win32': | |
ffmpeg_name = 'ffmpeg.dll' | |
diff --git a/script/lib/config.py b/script/lib/config.py | |
index 5ea60fc..217372a 100644 | |
--- a/script/lib/config.py | |
+++ b/script/lib/config.py | |
@@ -15,6 +15,7 @@ PLATFORM = { | |
'cygwin': 'win32', | |
'darwin': 'darwin', | |
'linux2': 'linux', | |
+ 'freebsd11': 'freebsd', | |
'win32': 'win32', | |
}[sys.platform] | |
diff --git a/toolchain.gypi b/toolchain.gypi | |
index 1c5f8a7..a733b2e 100644 | |
--- a/toolchain.gypi | |
+++ b/toolchain.gypi | |
@@ -101,8 +101,11 @@ | |
['CXX.host', '$(CXX)'], | |
], | |
'target_defaults': { | |
- 'cflags_cc': [ | |
- '-std=c++11', | |
+ 'cflags_c' : [ | |
+ '-isystem/usr/local/include/ -fPIC', | |
+ ], | |
+ 'cflags_cc': [ | |
+ ' -I/usr/local/include -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fno-rtti -pthread -std=c++11 -fPIC', | |
], | |
'xcode_settings': { | |
'CC': '<(make_clang_dir)/bin/clang', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur a/chromiumcontent/chromiumcontent.gyp b/chromiumcontent/chromiumcontent.gyp | |
--- a/chromiumcontent/chromiumcontent.gyp 2016-10-06 22:17:31.590038000 +0400 | |
+++ b/chromiumcontent/chromiumcontent.gyp 2016-10-06 22:20:09.221832000 +0400 | |
@@ -20,6 +20,11 @@ | |
'chromiumviews', | |
], | |
}], | |
+ ['OS=="freebsd"', { | |
+ 'dependencies': [ | |
+ 'chromiumviews', | |
+ ], | |
+ }], | |
], | |
}, | |
{ | |
@@ -58,7 +63,7 @@ | |
}, | |
], | |
'conditions': [ | |
- ['OS in ["win", "linux"]', { | |
+ ['OS in ["win", "linux", "freebsd"]', { | |
'targets': [ | |
{ | |
'target_name': 'chromiumviews', | |
@@ -72,7 +77,7 @@ | |
'<(DEPTH)/ui/wm/wm.gyp:wm', | |
], | |
'conditions': [ | |
- ['OS=="linux"', { | |
+ ['OS=="linux" or OS=="freebsd"', { | |
'dependencies': [ | |
'<(DEPTH)/chrome/browser/ui/libgtk2ui/libgtk2ui.gyp:gtk2ui', | |
], | |
diff -ur a/patches/allow_new_privs.patch b/patches/allow_new_privs.patch | |
--- a/patches/allow_new_privs.patch 2016-10-06 21:53:12.121271000 +0400 | |
+++ b/patches/allow_new_privs.patch 2016-10-06 21:53:35.226768000 +0400 | |
@@ -4,10 +4,10 @@ | |
+++ b/base/process/launch.cc | |
@@ -27,7 +27,7 @@ LaunchOptions::LaunchOptions() | |
new_process_group(false) | |
- #if defined(OS_LINUX) | |
+ #if defined(OS_LINUX) || defined(OS_FREEBSD) | |
, clone_flags(0) | |
- , allow_new_privs(false) | |
+ , allow_new_privs(true) | |
, kill_on_parent_death(false) | |
- #endif // OS_LINUX | |
+ #endif // OS_LINUX || OS_FREEBSD | |
#if defined(OS_POSIX) | |
diff -ur a/patches/no_test_data.patch b/patches/no_test_data.patch | |
--- a/patches/no_test_data.patch 2016-10-06 22:01:24.435340000 +0400 | |
+++ b/patches/no_test_data.patch 2016-10-06 22:00:15.364929000 +0400 | |
@@ -2,7 +2,7 @@ | |
index f3fc15a..0145322 100644 | |
--- a/chrome/chrome_resources.gyp | |
+++ b/chrome/chrome_resources.gyp | |
-@@ -713,16 +713,6 @@ | |
+@@ -715,16 +715,6 @@ | |
# GN version: //chrome/test/data/resources:webui_test_resources | |
'target_name': 'webui_test_resources', | |
'type': 'none', | |
diff -ur a/script/create-dist b/script/create-dist | |
--- a/script/create-dist | |
+++ b/script/create-dist | |
@@ -27,17 +27,20 @@ TARGET_PLATFORM = { | |
'cygwin': 'win32', | |
'darwin': 'darwin', | |
'linux2': 'linux', | |
+ 'freebsd11': 'freebsd', | |
'win32': 'win32', | |
}[sys.platform] | |
SHARED_LIBRARY_SUFFIX = { | |
'darwin': 'dylib', | |
'linux': 'so', | |
+ 'freebsd': 'so', | |
'win32': 'dll', | |
}[TARGET_PLATFORM] | |
STATIC_LIBRARY_SUFFIX = { | |
'darwin': 'a', | |
'linux': 'a', | |
+ 'freebsd': 'a', | |
'win32': 'lib', | |
}[TARGET_PLATFORM] | |
@@ -91,6 +94,25 @@ BINARIES = { | |
'libsecurity_state.a', | |
os.path.join('lib', 'libffmpeg.so'), | |
], | |
+ 'freebsd': [ | |
+ 'chromedriver', | |
+ 'mksnapshot', | |
+ # 'libosmesa.so', | |
+ 'libgtk2ui.a', | |
+ 'libdevtools_discovery.a', | |
+ 'libdevtools_http_handler.a', | |
+ 'libhttp_server.a', | |
+ 'libdesktop_capture.a', | |
+ 'libdesktop_capture_differ_sse2.a', | |
+ 'librtc_base.a', | |
+ 'librtc_base_approved.a', | |
+ 'libwebrtc_common.a', | |
+ 'libyuv.a', | |
+ 'libsystem_wrappers.a', | |
+ 'libcdm_renderer.a', | |
+ 'libsecurity_state.a', | |
+ os.path.join('lib', 'libffmpeg.so'), | |
+ ], | |
'win32': [ | |
'chromedriver.exe', | |
'd3dcompiler_47.dll', | |
@@ -199,6 +221,9 @@ SYMBOLS = { | |
'linux': [ | |
'libosmesa.so.dbg', | |
], | |
+ 'freebsd': [ | |
+ 'libosmesa.so.dbg', | |
+ ], | |
'win32': [ | |
'libGLESv2.dll.pdb', | |
], | |
@@ -260,6 +285,10 @@ INCLUDE_DIRS = [ | |
'dbus', | |
'third_party/speech-dispatcher', | |
], | |
+ 'freebsd': [ | |
+ 'dbus', | |
+ 'third_party/speech-dispatcher', | |
+ ], | |
'win32': [], | |
}[TARGET_PLATFORM] | |
GENERATED_INCLUDE_DIRS = [ | |
@@ -361,7 +390,7 @@ def copy_binaries(target_arch, component, output_dir): | |
for filename in fnmatch.filter(filenames, '*.pdb'): | |
copy_with_blacklist(target_arch, os.path.join(root, filename), target_dir) | |
- if TARGET_PLATFORM == 'linux': | |
+ if TARGET_PLATFORM == 'linux' or TARGET_PLATFORM == 'freebsd': | |
if component == 'shared_library': | |
# out/Release/lib/*.so | |
for library in glob.glob(os.path.join(config_dir, 'lib', '*.so')): | |
@@ -420,6 +449,8 @@ def copy_ffmpeg(target_arch): | |
binary = 'libffmpeg.dylib' | |
elif TARGET_PLATFORM == 'linux': | |
binary = os.path.join('lib', 'libffmpeg.so') | |
+ elif TARGET_PLATFORM == 'freebsd': | |
+ binary = os.path.join('lib', 'libffmpeg.so') | |
elif TARGET_PLATFORM == 'win32': | |
binary = 'ffmpeg.dll' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur a/base/base.gypi b/base/base.gypi | |
--- a/base/base.gypi 2016-10-06 22:13:43.437076000 +0400 | |
+++ b/base/base.gypi 2016-10-06 22:11:48.345209000 +0400 | |
@@ -1041,6 +1041,7 @@ | |
['exclude', '^process/process_linux\\.cc$'], | |
['exclude', '^sys_info_linux\\.cc$'], | |
['exclude', '^process/process_iterator_linux\\.cc$'], | |
+ ['exclude', '^process/process_handle_linux\\.cc$'], | |
['exclude', '^process/process_metrics_linux\\.cc$'], | |
['exclude', '^files/file_path_watcher_fsevents\\.cc$'], | |
['exclude', '^files/file_path_watcher_fsevents\\.h$'], | |
diff -ur a/content/content_browser.gypi b/content/content_browser.gypi | |
--- a/content/content_browser.gypi 2016-10-07 01:18:11.194702000 +0400 | |
+++ b/content/content_browser.gypi 2016-10-07 01:17:51.547945000 +0400 | |
@@ -829,8 +829,6 @@ | |
'browser/gamepad/raw_input_data_fetcher_win.h', | |
'browser/gamepad/xbox_data_fetcher_mac.cc', | |
'browser/gamepad/xbox_data_fetcher_mac.h', | |
- 'browser/geolocation/empty_wifi_data_provider.cc', | |
- 'browser/geolocation/empty_wifi_data_provider.h', | |
'browser/geolocation/geolocation_provider_impl.cc', | |
'browser/geolocation/geolocation_provider_impl.h', | |
'browser/geolocation/geolocation_service_context.cc', | |
diff -ur a/content/content_common.gypi b/content/content_common.gypi | |
--- a/content/content_common.gypi 2016-10-06 22:39:43.569912000 +0400 | |
+++ b/content/content_common.gypi 2016-10-06 22:41:35.886332000 +0400 | |
@@ -589,11 +589,11 @@ | |
}], | |
['os_bsd==1', { | |
'sources!': [ | |
- 'common/sandbox_linux.cc', | |
- 'common/sandbox_linux.h', | |
- 'common/sandbox_init_linux.cc', | |
- 'common/sandbox_seccomp_bpf_linux.cc', | |
- 'common/sandbox_seccomp_bpf_linux.h', | |
+ 'common/sandbox_linux/sandbox_linux.cc', | |
+ 'common/sandbox_linux/sandbox_linux.h', | |
+ 'common/sandbox_linux/sandbox_init_linux.cc', | |
+ 'common/sandbox_linux/sandbox_seccomp_bpf_linux.cc', | |
+ 'common/sandbox_linux/sandbox_seccomp_bpf_linux.h', | |
'common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc', | |
'common/sandbox_linux/bpf_gpu_policy_linux.cc', | |
'common/sandbox_linux/bpf_ppapi_policy_linux.cc', | |
diff -ur a/media/capture.gypi b/media/capture.gypi | |
--- a/media/capture.gypi 2016-10-07 01:16:35.406635000 +0400 | |
+++ b/media/capture.gypi 2016-10-07 01:15:50.810658000 +0400 | |
@@ -44,8 +44,6 @@ | |
'capture/video/linux/video_capture_device_chromeos.h', | |
'capture/video/linux/video_capture_device_factory_linux.cc', | |
'capture/video/linux/video_capture_device_factory_linux.h', | |
- 'capture/video/linux/video_capture_device_linux.cc', | |
- 'capture/video/linux/video_capture_device_linux.h', | |
'capture/video/mac/video_capture_device_avfoundation_mac.h', | |
'capture/video/mac/video_capture_device_avfoundation_mac.mm', | |
'capture/video/mac/video_capture_device_decklink_mac.h', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/node_modules/pty.js/src/unix/pty.cc 2016-10-11 09:22:03.629111000 +0400 | |
+++ b/node_modules/pty.js/src/unix/pty.cc 2016-10-11 09:21:47.968578000 +0400 | |
@@ -203,7 +203,7 @@ | |
// termios | |
struct termios* term = new termios(); | |
- term->c_iflag = ICRNL | IXON | IXANY | IMAXBEL | BRKINT | IUTF8; | |
+ term->c_iflag = ICRNL | IXON | IXANY | IMAXBEL | BRKINT | UTF8; | |
term->c_oflag = OPOST | ONLCR; | |
term->c_cflag = CREAD | CS8 | HUPCL; | |
term->c_lflag = ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOK | ECHOKE | ECHOCTL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
set -e | |
export BUILDROOT=`pwd` | |
set -x | |
#Building LIBCHROMIUMCONTENT ... | |
echo "Building LIBCHROMIUMCONTENT ..." | |
sudo make -C /usr/ports/www/chromium/ configure | |
git clone https://github.com/atom/libchromiumcontent.git | |
cd libchromiumcontent/ | |
git checkout c5cf295ef9 | |
cd vendor/python-patch/ | |
git submodule update --init --recursive | |
cd ../../ | |
patch -p1 < ../libchromiumcontent.diff | |
ln -s /usr/ports/www/chromium/work/chromium-52.0.2743.116/ src | |
set +e | |
sudo rm src/base/process/launch.cc.orig | |
sudo rm src/content/app/content_main_runner.cc.orig | |
sudo rm src/chrome/chrome_resources.gyp.orig | |
rm -rf patches/third_party/icu/ | |
set -e | |
sudo script/apply-patches | |
sudo cp -R chromiumcontent/ src/chromiumcontent | |
sudo patch -p1 -d src/ < ../libchromiumcontent_src.diff | |
sudo rm -rf src/out/ | |
cd src | |
sudo /usr/bin/env CC="cc" CXX="c++" GYP_GENERATORS=ninja GYP_GENERATOR_FLAGS="output_dir=out" GYP_DEFINES="clang_use_chrome_plugins=0 component=static_library linux_breakpad=0 linux_use_heapchecker=0 linux_strip_binary=1 use_aura=1 mac_mas_build=1 test_isolation_mode=noop disable_nacl=1 enable_extensions=1 enable_one_click_signin=1 enable_openmax=1 enable_webrtc=1 werror= no_gc_sections=1 OS=freebsd os_ver=1100122 prefix_dir=/usr/local python_ver=2.7 use_allocator=none use_cups=1 linux_link_gsettings=1 linux_link_libpci=1 linux_link_libspeechd=1 libspeechd_h_prefix=speech-dispatcher/ usb_ids_path=/usr/local/share/usbids/usb.ids want_separate_host_toolset=0 use_system_bzip2=1 use_system_flac=1 use_system_harfbuzz=1 use_system_icu=1 use_system_jsoncpp=1 use_system_libevent=1 use_system_libexif=1 use_system_libjpeg=1 use_system_libpng=1 use_system_libusb=1 use_system_libwebp=1 use_system_libxml=1 use_system_libxslt=1 use_system_nspr=1 use_system_protobuf=0 use_system_re2=1 use_system_snappy=1 use_system_speex=1 use_system_xdg_utils=1 use_system_yasm=1 v8_use_external_startup_data=1 google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 google_default_client_id=996322985003.apps.googleusercontent.com google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn ffmpeg_branding=Chrome proprietary_codecs=1 use_gconf=1 use_pulseaudio=0 clang=1" ac_cv_path_PERL=/usr/local/bin/perl ac_cv_path_PERL_PATH=/usr/local/bin/perl PKG_CONFIG=pkgconf PYTHON="/usr/local/bin/python2.7" AR=/usr/bin/ar CFLAGS="-O2 -pipe -isystem/usr/local/include -I/usr/local/include/atk-1.0 -Wno-unknown-warning-option -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fstack-protector -fno-strict-aliasing" CPPFLAGS="" CXXFLAGS="-O2 -pipe -isystem/usr/local/include -I/usr/local/include/atk-1.0 -Wno-unknown-warning-option -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fstack-protector -fno-strict-aliasing " LDFLAGS=" -fstack-protector" XDG_DATA_HOME=/usr/ports/www/chromium/work XDG_CONFIG_HOME=/usr/ports/www/chromium/work HOME=/usr/ports/www/chromium/work SHELL=/bin/sh CONFIG_SHELL=/bin/sh /usr/local/bin/python2.7 build/gyp_chromium --depth . -Ichromiumcontent/chromiumcontent.gypi chromiumcontent/chromiumcontent.gyp | |
sudo /usr/bin/env CC="cc" CXX="c++" GYP_GENERATORS=ninja GYP_GENERATOR_FLAGS="output_dir=out_component" GYP_DEFINES="clang_use_chrome_plugins=0 component=shared_library linux_breakpad=0 linux_use_heapchecker=0 linux_strip_binary=1 use_aura=1 mac_mas_build=1 test_isolation_mode=noop disable_nacl=1 enable_extensions=1 enable_one_click_signin=1 enable_openmax=1 enable_webrtc=1 werror= no_gc_sections=1 OS=freebsd os_ver=1100122 prefix_dir=/usr/local python_ver=2.7 use_allocator=none use_cups=1 linux_link_gsettings=1 linux_link_libpci=1 linux_link_libspeechd=1 libspeechd_h_prefix=speech-dispatcher/ usb_ids_path=/usr/local/share/usbids/usb.ids want_separate_host_toolset=0 use_system_bzip2=1 use_system_flac=1 use_system_harfbuzz=1 use_system_icu=1 use_system_jsoncpp=1 use_system_libevent=1 use_system_libexif=1 use_system_libjpeg=1 use_system_libpng=1 use_system_libusb=1 use_system_libwebp=1 use_system_libxml=1 use_system_libxslt=1 use_system_nspr=1 use_system_protobuf=0 use_system_re2=1 use_system_snappy=1 use_system_speex=1 use_system_xdg_utils=1 use_system_yasm=1 v8_use_external_startup_data=1 google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 google_default_client_id=996322985003.apps.googleusercontent.com google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn ffmpeg_branding=Chrome proprietary_codecs=1 use_gconf=1 use_pulseaudio=0 clang=1" ac_cv_path_PERL=/usr/local/bin/perl ac_cv_path_PERL_PATH=/usr/local/bin/perl PKG_CONFIG=pkgconf PYTHON="/usr/local/bin/python2.7" AR=/usr/bin/ar CFLAGS="-O2 -pipe -isystem/usr/local/include -I/usr/local/include/atk-1.0 -Wno-unknown-warning-option -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fstack-protector -fno-strict-aliasing" CPPFLAGS="" CXXFLAGS="-O2 -pipe -isystem/usr/local/include -I/usr/local/include/atk-1.0 -Wno-unknown-warning-option -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fstack-protector -fno-strict-aliasing " LDFLAGS=" -fstack-protector" XDG_DATA_HOME=/usr/ports/www/chromium/work XDG_CONFIG_HOME=/usr/ports/www/chromium/work HOME=/usr/ports/www/chromium/work SHELL=/bin/sh CONFIG_SHELL=/bin/sh /usr/local/bin/python2.7 build/gyp_chromium --depth . -Ichromiumcontent/chromiumcontent.gypi chromiumcontent/chromiumcontent.gyp | |
sudo /usr/bin/env CC="cc" CXX="c++" GYP_GENERATORS=ninja GYP_GENERATOR_FLAGS="output_dir=out_ffmpeg" GYP_DEFINES="clang_use_chrome_plugins=0 linux_breakpad=0 linux_use_heapchecker=0 linux_strip_binary=1 use_aura=1 mac_mas_build=1 test_isolation_mode=noop disable_nacl=1 enable_extensions=1 enable_one_click_signin=1 enable_openmax=1 enable_webrtc=1 werror= no_gc_sections=1 OS=freebsd os_ver=1100122 prefix_dir=/usr/local python_ver=2.7 use_allocator=none use_cups=1 linux_link_gsettings=1 linux_link_libpci=1 linux_link_libspeechd=1 libspeechd_h_prefix=speech-dispatcher/ usb_ids_path=/usr/local/share/usbids/usb.ids want_separate_host_toolset=0 use_system_bzip2=1 use_system_flac=1 use_system_harfbuzz=1 use_system_icu=1 use_system_jsoncpp=1 use_system_libevent=1 use_system_libexif=1 use_system_libjpeg=1 use_system_libpng=1 use_system_libusb=1 use_system_libwebp=1 use_system_libxml=1 use_system_libxslt=1 use_system_nspr=1 use_system_protobuf=0 use_system_re2=1 use_system_snappy=1 use_system_speex=1 use_system_xdg_utils=1 use_system_yasm=1 v8_use_external_startup_data=1 google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 google_default_client_id=996322985003.apps.googleusercontent.com google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn ffmpeg_branding=Chromium proprietary_codecs=1 use_gconf=1 use_pulseaudio=0 clang=1" ac_cv_path_PERL=/usr/local/bin/perl ac_cv_path_PERL_PATH=/usr/local/bin/perl PKG_CONFIG=pkgconf PYTHON="/usr/local/bin/python2.7" AR=/usr/bin/ar CFLAGS="-O2 -pipe -isystem/usr/local/include -I/usr/local/include/atk-1.0 -Wno-unknown-warning-option -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fstack-protector -fno-strict-aliasing" CPPFLAGS="" CXXFLAGS="-O2 -pipe -isystem/usr/local/include -I/usr/local/include/atk-1.0 -Wno-unknown-warning-option -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -fstack-protector -fno-strict-aliasing " LDFLAGS=" -fstack-protector" XDG_DATA_HOME=/usr/ports/www/chromium/work XDG_CONFIG_HOME=/usr/ports/www/chromium/work HOME=/usr/ports/www/chromium/work SHELL=/bin/sh CONFIG_SHELL=/bin/sh /usr/local/bin/python2.7 build/gyp_chromium --depth . -Ichromiumcontent/chromiumcontent.gypi chromiumcontent/chromiumcontent.gyp | |
sudo ninja -C out/Release chromiumcontent_all | |
sudo ninja -C out_component/Release chromiumcontent_all | |
sudo ninja -C out_ffmpeg/Release ffmpeg | |
cd out/Release | |
sudo find . -name "lib*.a" -exec cp {} . \; | |
cd ../../out_component/Release | |
sudo find . -name "lib*.a" -exec cp {} . \; | |
cd $BUILDROOT/libchromiumcontent/ | |
#get icudtl.dat from vscode linux download and copy it to build root folder | |
sudo cp ../icudtl.dat src/out/Release | |
sudo cp ../icudtl.dat src/out_component/Release | |
./script/create-dist | |
cd $BUILDROOT | |
#Building ELECTRON ... | |
echo "Building ELECTRON ..." | |
git clone https://github.com/electron/electron.git | |
cd electron/ | |
git checkout v1.3.7 | |
patch -p1 < ../electronv1.diff | |
set +e | |
#this will fail when it tries to download libchromiumcontent library | |
script/bootstrap.py -v --clang_dir=/usr | |
set -e | |
patch -p1 -d vendor/native_mate/ < ../electron_vendor_native_matev1.diff | |
patch -p1 -d vendor/brightray/ < ../electron_vendor_brightrayv1.diff | |
patch -p1 -d vendor/brightray/vendor/libchromiumcontent/ < ../electron_vendor_libchromiumcontentv1.diff | |
unzip ../libchromiumcontent/libchromiumcontent.zip -d vendor/brightray/vendor/download/libchromiumcontent/ | |
unzip ../libchromiumcontent/libchromiumcontent-static.zip -d vendor/brightray/vendor/download/libchromiumcontent/ | |
script/bootstrap.py -v --clang_dir=/usr | |
script/build.py | |
script/create-dist.py | |
cd $BUILDROOT | |
#Building VSCODE | |
echo "Building VSCODE" | |
git clone https://github.com/microsoft/vscode | |
cd vscode/ | |
#v1.7.0 | |
git checkout translation/20161014.01 | |
patch -p1 < ../vscodev1.diff | |
scripts/npm.sh install --arch=x64 | |
patch -p1 < ../vscode.pty.cc.diff | |
gmake -C node_modules/pty.js/build/ | |
./node_modules/.bin/gulp compile | |
# If the above command fails in monaco, run, | |
#./node_modules/.bin/gulp watch | |
#./node_modules/.bin/gulp compile | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUILDROOT/electron/dist/ | |
../electron/dist/electron . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/product.json b/product.json | |
index 8b4de36..7c4d14e 100644 | |
--- a/product.json | |
+++ b/product.json | |
@@ -12,5 +12,69 @@ | |
"win32AppUserModelId": "Microsoft.CodeOSS", | |
"darwinBundleIdentifier": "com.visualstudio.code.oss", | |
"reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new", | |
- "urlProtocol": "code-oss" | |
+ "urlProtocol": "code-oss", | |
+ "win32SetupExeBasename": "VSCodeSetup", | |
+ "downloadUrl": "https://code.visualstudio.com", | |
+ "welcomePage": "https://go.microsoft.com/fwlink/?LinkId=723048", | |
+ "updateUrl": "https://vscode-update.azurewebsites.net", | |
+ "quality": "stable", | |
+ "extensionsGallery": { | |
+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", | |
+ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", | |
+ "itemUrl": "https://marketplace.visualstudio.com/items" | |
+ }, | |
+ "extensionTips": { | |
+ "ms-vscode.csharp": "{**/*.cs,**/project.json,**/global.json,**/*.csproj,**/*.sln}", | |
+ "ms-vscode.mono-debug": "{**/*.cs,**/*.csproj,**/*.sln}", | |
+ "msjsdiag.debugger-for-chrome": "{**/*.ts,**/*.tsx**/*.js,**/*.jsx,**/*.es6}", | |
+ "lukehoban.Go": "**/*.go", | |
+ "ms-vscode.PowerShell": "{**/*.ps,**/*.ps1}", | |
+ "Ionide.Ionide-fsharp": "{**/*.fsx,**/*.fsi,**/*.fs,**/*.ml,**/*.mli}", | |
+ "dbaeumer.vscode-eslint": "{**/*.js,**/*.jsx,**/*.es6}", | |
+ "eg2.tslint": "{**/*.ts,**/*.tsx}", | |
+ "Kasik96.format-indent": "{**/*.php}", | |
+ "felixfbecker.php-debug": "{**/*.php}", | |
+ "linyang95.phpmd": "{**/*.php}", | |
+ "ikappas.phpcs": "{**/*.php}", | |
+ "HvyIndustries.crane": "{**/*.php}", | |
+ "tht13.python": "{**/*.py}", | |
+ "donjayamanne.python": "{**/*.py}", | |
+ "magicstack.MagicPython": "{**/*.py}", | |
+ "saviorisdead.RustyCode": "{**/*.rs,**/*.rslib}", | |
+ "austin.code-gnu-global": "{**/*.c,**/*.cpp,**/*.h}", | |
+ "hars.CppSnippets": "{**/*.cpp,**/*.cc,**/*.h}", | |
+ "mitaki28.vscode-clang": "{**/*.cpp,**/*.cc,**/*.h}", | |
+ "ms-vscode.cpptools": "{**/*.c,**/*.cpp,**/*.cc,**/.cxx,**/*.hh,**/*.hpp,**/*.hxx,**/*.h}", | |
+ "seanmcbreen.Spell": "{**/*.md}", | |
+ "cssho.vscode-svgviewer": "{**/*.svg}", | |
+ "ms-vscode.latex": "{**/*.tex}", | |
+ "mathiasfrohlich.latexcompile": "{**/*.tex}", | |
+ "EditorConfig.EditorConfig": "{**/.editorconfig}", | |
+ "donjayamanne.githistory": "{**/.gitignore}", | |
+ "Unity.unity-debug": "{**/*.meta}", | |
+ "donjayamanne.javadebugger": "{**/*.java}", | |
+ "rebornix.Ruby": "{**/*.rb}", | |
+ "hoovercj.ruby-linter": "{**/*.rb}", | |
+ "misogi.ruby-rubocop": "{**/*.rb}", | |
+ "CraigMaslowski.erb": "{**/*.erb}", | |
+ "groksrc.haml": "{**/*.haml}" | |
+ }, | |
+ "extensionImportantTips": { | |
+ "ms-vscode.csharp": "**/*.cs", | |
+ "lukehoban.Go": "**/*.go", | |
+ "donjayamanne.python": "{**/*.py}", | |
+ "ms-vscode.PowerShell": "{**/*.ps,**/*.ps1}", | |
+ "ms-vscode.cpptools": "{**/*.c,**/*.cpp,**/*.cc,**/.cxx,**/*.hh,**/*.hpp,**/*.hxx,**/*.h}" | |
+ }, | |
+ "sendASmile": { | |
+ "reportIssueUrl": "https://go.microsoft.com/fwlink/?LinkId=534872", | |
+ "requestFeatureUrl": "https://go.microsoft.com/fwlink/?LinkID=533482" | |
+ }, | |
+ "documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode", | |
+ "releaseNotesUrl": "https://go.microsoft.com/fwlink/?LinkID=533483#vscode", | |
+ "twitterUrl": "https://go.microsoft.com/fwlink/?LinkID=533687", | |
+ "requestFeatureUrl": "https://go.microsoft.com/fwlink/?LinkID=533482", | |
+ "privacyStatementUrl": "https://go.microsoft.com/fwlink/?LinkId=786907", | |
+ "npsSurveyUrl": "https://www.research.net/r/Z2RMYRJ", | |
+ "date": "2016-10-11T013:57:52.000Z" | |
} | |
\ No newline at end of file | |
diff --git a/scripts/code-cli.sh b/scripts/code-cli.sh | |
index 9a4c03e..3f62048 100755 | |
--- a/scripts/code-cli.sh | |
+++ b/scripts/code-cli.sh | |
@@ -17,7 +17,7 @@ function code() { | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
test -d .build/electron/Code\ -\ OSS.app || ./node_modules/.bin/gulp electron | |
else | |
- test -d .build/electron/code-oss || ./node_modules/.bin/gulp electron | |
+ test -d ../electron/dist/electron || ./node_modules/.bin/gulp electron | |
fi | |
# Build | |
@@ -26,7 +26,7 @@ function code() { | |
# Launch Code | |
[[ "$OSTYPE" == "darwin"* ]] \ | |
&& ELECTRON=.build/electron/Code\ -\ OSS.app/Contents/MacOS/Electron \ | |
- || ELECTRON=.build/electron/code-oss | |
+ || ELECTRON=../electron/dist/electron | |
CLI="$ROOT/out/cli.js" | |
diff --git a/scripts/code.sh b/scripts/code.sh | |
index 1e5b334..3db57d7 100755 | |
--- a/scripts/code.sh | |
+++ b/scripts/code.sh | |
@@ -15,7 +15,8 @@ function code() { | |
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron" | |
else | |
NAME=`node -p "require('./product.json').applicationName"` | |
- CODE=".build/electron/$NAME" | |
+ #CODE=".build/electron/$NAME" | |
+ CODE="../electron/dist/electron" | |
fi | |
# Node modules | |
diff --git a/scripts/npm.sh b/scripts/npm.sh | |
index 9d95978..e1a8abf 100755 | |
--- a/scripts/npm.sh | |
+++ b/scripts/npm.sh | |
@@ -1,4 +1,4 @@ | |
-#!/bin/bash | |
+#!/usr/local/bin/bash | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } | |
diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh | |
index fc7b94b..690bcc1 100755 | |
--- a/scripts/test-integration.sh | |
+++ b/scripts/test-integration.sh | |
@@ -1,4 +1,4 @@ | |
-#!/bin/bash | |
+#!/usr/local/bin/bash | |
set -e | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
diff --git a/scripts/test.sh b/scripts/test.sh | |
index 59bd561..3efb9fb 100755 | |
--- a/scripts/test.sh | |
+++ b/scripts/test.sh | |
@@ -1,4 +1,4 @@ | |
-#!/bin/bash | |
+#!/usr/local/bin/bash | |
set -e | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
@@ -15,7 +15,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then | |
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron" | |
else | |
NAME=`node -p "require('./product.json').applicationName"` | |
- CODE=".build/electron/$NAME" | |
+ #CODE=".build/electron/$NAME" | |
+ CODE="../electron/dist/electron" | |
fi | |
# Node modules | |
diff --git a/src/paths.js b/src/paths.js | |
index 6935478..c783530 100644 | |
--- a/src/paths.js | |
+++ b/src/paths.js | |
@@ -12,6 +12,7 @@ function getAppDataPath(platform) { | |
case 'win32': return process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming'); | |
case 'darwin': return path.join(os.homedir(), 'Library', 'Application Support'); | |
case 'linux': return process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config'); | |
+ case 'freebsd': return process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config'); | |
default: throw new Error('Platform not supported'); | |
} | |
} | |
diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts | |
index 3075beb..97e6957 100644 | |
--- a/src/vs/base/common/platform.ts | |
+++ b/src/vs/base/common/platform.ts | |
@@ -47,6 +47,7 @@ if (typeof process === 'object') { | |
_isWindows = (process.platform === 'win32'); | |
_isMacintosh = (process.platform === 'darwin'); | |
_isLinux = (process.platform === 'linux'); | |
+ _isLinux = (process.platform === 'freebsd'); | |
_isRootUser = !_isWindows && (process.getuid() === 0); | |
let rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; | |
if (rawNlsConfig) { | |
diff --git a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts b/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts | |
index 85db4d3..3f5c71a 100644 | |
--- a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts | |
+++ b/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts | |
@@ -23,7 +23,7 @@ export class SelectionClipboard extends Disposable implements IEditorContributio | |
constructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { | |
super(); | |
- if (platform.isLinux) { | |
+ if (0) { | |
var isEnabled = editor.getConfiguration().contribInfo.selectionClipboard; | |
this._register(editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { |
Would be awesome to see the changes to electron upstreamed!
Great work but wouldn't it be possible to minimalize all those if/case for OS names? If other OS like NetBSD or OpenBSD would like to adopt, adding more OS name would seem silly...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're the best!