aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorCarlos J. Puga Medina <cpm@FreeBSD.org>2017-06-28 00:36:33 +0000
committerCarlos J. Puga Medina <cpm@FreeBSD.org>2017-06-28 00:36:33 +0000
commit2189bd23d3405d883eb4d1b46f54ac6aa5a44931 (patch)
tree01fbcd0decdfb73486454d52de2a1d87a0867a58 /www
parentede441917ea7ffb892d05f1c5525ae9595fcc0a1 (diff)
downloadports-2189bd23d3405d883eb4d1b46f54ac6aa5a44931.tar.gz
ports-2189bd23d3405d883eb4d1b46f54ac6aa5a44931.zip
www/chromium: update to 59.0.3071.115
- Add my LOCAL to MASTER_SITES to provide FreeType source. This makes possible to build chromium from this tarball. - Backport several patches from OpenBSD to enable SwiftShader. Changelog: https://chromium.googlesource.com/chromium/src/+log/59.0.3071.109..59.0.3071.115?pretty=fuller&n=10000
Notes
Notes: svn path=/head/; revision=444531
Diffstat (limited to 'www')
-rw-r--r--www/chromium/Makefile13
-rw-r--r--www/chromium/distinfo12
-rw-r--r--www/chromium/files/patch-base_i18n_icu__util.cc20
-rw-r--r--www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc32
-rw-r--r--www/chromium/files/patch-third__party_skia_src_ports_SkFontHost_FreeType_common.cpp140
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_BUILD.gn10
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_Common_MutexLock.hpp11
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_Common_SharedLibrary.hpp11
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_Common_Socket.cpp10
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_Display.cpp47
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_EGLSurface.cpp20
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.cpp38
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.hpp11
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLES_CM_libGLES_CM.hpp11
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLESv2_libGLESv2.hpp11
-rw-r--r--www/chromium/files/patch-third__party_swiftshader_third_party_llvm-subzero_build_Linux_include_llvm_Config_config.h29
-rw-r--r--www/chromium/files/patch-v8_src_trap-handler_handler-inside.cc16
17 files changed, 419 insertions, 23 deletions
diff --git a/www/chromium/Makefile b/www/chromium/Makefile
index 86554d1137cc..2adfd0cda90a 100644
--- a/www/chromium/Makefile
+++ b/www/chromium/Makefile
@@ -2,10 +2,12 @@
# $FreeBSD$
PORTNAME= chromium
-PORTVERSION= 59.0.3071.109
+PORTVERSION= 59.0.3071.115
CATEGORIES= www
-MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX} # default, but needed to get distinfo correct if TEST is on
+MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/:source1 \
+ LOCAL/cpm:source2
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:source1 \
+ ${PORTNAME}-freetype2${EXTRACT_SUFX}:source2
MAINTAINER= chromium@FreeBSD.org
COMMENT= Google web browser based on WebKit
@@ -139,7 +141,7 @@ SNDIO_VARS= GN_ARGS+=use_sndio=true
SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false
DRIVER_MAKE_ARGS=chromedriver
-TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX}
+TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX}:source1
.include <bsd.port.options.mk>
@@ -223,6 +225,9 @@ pre-everything::
.endif
@${ECHO_MSG}
+post-extract:
+ @${MV} ${WRKDIR}/freetype2 ${WRKSRC}/third_party/freetype/src
+
post-patch-SNDIO-on:
@${MKDIR} ${WRKSRC}/media/audio/sndio ${WRKSRC}/media/audio/openbsd
@${CP} ${FILESDIR}/sndio_output.* ${WRKSRC}/media/audio/sndio
diff --git a/www/chromium/distinfo b/www/chromium/distinfo
index dde69044cd9c..9bfa013f3972 100644
--- a/www/chromium/distinfo
+++ b/www/chromium/distinfo
@@ -1,5 +1,7 @@
-TIMESTAMP = 1498132680
-SHA256 (chromium-59.0.3071.109.tar.xz) = 83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9
-SIZE (chromium-59.0.3071.109.tar.xz) = 531839168
-SHA256 (chromium-59.0.3071.109-testdata.tar.xz) = 211447bd78861623329ab39f6611b7caccc69c483d616adcd9610def524699b0
-SIZE (chromium-59.0.3071.109-testdata.tar.xz) = 124235432
+TIMESTAMP = 1498576960
+SHA256 (chromium-59.0.3071.115.tar.xz) = 37cbc9955ae3b25cd4e9851a82ea97a0035021cc90658902938ad1c20f263170
+SIZE (chromium-59.0.3071.115.tar.xz) = 530808448
+SHA256 (chromium-freetype2.tar.xz) = 5bcb3d3da82905b2077ae0dcca52b99a25344c7e8dbdcd52691d69ab269356e3
+SIZE (chromium-freetype2.tar.xz) = 22847212
+SHA256 (chromium-59.0.3071.115-testdata.tar.xz) = a66e7b4a8f6002fe64b2b5609deb6eff2a0da442cb68e22ce404023021f20852
+SIZE (chromium-59.0.3071.115-testdata.tar.xz) = 124229320
diff --git a/www/chromium/files/patch-base_i18n_icu__util.cc b/www/chromium/files/patch-base_i18n_icu__util.cc
new file mode 100644
index 000000000000..2c3a369483b6
--- /dev/null
+++ b/www/chromium/files/patch-base_i18n_icu__util.cc
@@ -0,0 +1,20 @@
+--- base/i18n/icu_util.cc.orig 2017-06-09 16:50:47.670684000 +0200
++++ base/i18n/icu_util.cc 2017-06-09 16:52:10.911955000 +0200
+@@ -20,7 +20,7 @@
+ #include "build/build_config.h"
+ #include "third_party/icu/source/common/unicode/putil.h"
+ #include "third_party/icu/source/common/unicode/udata.h"
+-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
+ #include "third_party/icu/source/i18n/unicode/timezone.h"
+ #endif
+
+@@ -298,7 +298,7 @@
+ // TODO(jungshik): Some callers do not care about tz at all. If necessary,
+ // add a boolean argument to this function to init'd the default tz only
+ // when requested.
+-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
+ if (result)
+ std::unique_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
+ #endif
diff --git a/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc b/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc
index 58351d044b58..e31738b4a296 100644
--- a/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc
+++ b/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc
@@ -1,6 +1,6 @@
---- chrome/browser/ui/webui/about_ui.cc.orig 2017-06-05 19:03:03 UTC
-+++ chrome/browser/ui/webui/about_ui.cc
-@@ -420,7 +420,7 @@ std::string ChromeURLs() {
+--- chrome/browser/ui/webui/about_ui.cc.orig 2017-06-21 00:03:13.000000000 +0200
++++ chrome/browser/ui/webui/about_ui.cc 2017-06-27 01:22:41.801626000 +0200
+@@ -420,7 +420,7 @@
return html;
}
@@ -9,7 +9,7 @@
const char kAboutDiscardsRunCommand[] = "run";
-@@ -539,7 +539,7 @@ std::string AboutDiscards(const std::string& path) {
+@@ -539,11 +539,13 @@
output.append(base::StringPrintf("<a href='%s%s'>Discard tab now</a>",
chrome::kChromeUIDiscardsURL,
kAboutDiscardsRunCommand));
@@ -17,16 +17,20 @@
+#if !defined(OS_BSD)
base::SystemMemoryInfoKB meminfo;
base::GetSystemMemoryInfo(&meminfo);
++#endif
output.append("<h3>System memory information in MB</h3>");
-@@ -551,6 +551,7 @@ std::string AboutDiscards(const std::string& path) {
- "Free",
- base::IntToString(base::SysInfo::AmountOfAvailablePhysicalMemory() /
- 1024 / 1024)));
+ output.append("<table>");
++#if !defined(OS_BSD)
+ // Start with summary statistics.
+ output.append(AddStringRow(
+ "Total", base::IntToString(meminfo.total / 1024)));
+@@ -575,12 +577,13 @@
+ output.append(AddStringRow(
+ "Graphics", base::IntToString(meminfo.gem_size / 1024 / 1024)));
+ #endif // OS_CHROMEOS
+#endif
- #if defined(OS_CHROMEOS)
- int mem_allocated_kb = meminfo.active_anon + meminfo.inactive_anon;
- #if defined(ARCH_CPU_ARM_FAMILY)
-@@ -580,7 +581,7 @@ std::string AboutDiscards(const std::string& path) {
+ output.append("</table>");
+ AppendFooter(&output);
return output;
}
@@ -35,7 +39,7 @@
// AboutDnsHandler bounces the request back to the IO thread to collect
// the DNS information.
-@@ -642,7 +643,7 @@ class AboutDnsHandler : public base::RefCountedThreadS
+@@ -642,7 +645,7 @@
DISALLOW_COPY_AND_ASSIGN(AboutDnsHandler);
};
@@ -44,7 +48,7 @@
std::string AboutLinuxProxyConfig() {
std::string data;
AppendHeader(&data, 0,
-@@ -717,14 +718,14 @@ void AboutUIHTMLSource::StartDataRequest(
+@@ -717,14 +720,14 @@
} else {
response = raw_response.as_string();
}
diff --git a/www/chromium/files/patch-third__party_skia_src_ports_SkFontHost_FreeType_common.cpp b/www/chromium/files/patch-third__party_skia_src_ports_SkFontHost_FreeType_common.cpp
new file mode 100644
index 000000000000..e0347b4f862c
--- /dev/null
+++ b/www/chromium/files/patch-third__party_skia_src_ports_SkFontHost_FreeType_common.cpp
@@ -0,0 +1,140 @@
+--- third_party/skia/src/ports/SkFontHost_FreeType_common.cpp.orig 2017-06-27 15:42:02.870865000 +0200
++++ third_party/skia/src/ports/SkFontHost_FreeType_common.cpp 2017-06-27 15:55:12.348145000 +0200
+@@ -395,8 +395,6 @@
+ switch ( face->glyph->format ) {
+ case FT_GLYPH_FORMAT_OUTLINE: {
+ FT_Outline* outline = &face->glyph->outline;
+- FT_BBox bbox;
+- FT_Bitmap target;
+
+ int dx = 0, dy = 0;
+ if (fRec.fFlags & SkScalerContext::kSubpixelPositioning_Flag) {
+@@ -405,36 +403,97 @@
+ // negate dy since freetype-y-goes-up and skia-y-goes-down
+ dy = -dy;
+ }
+- FT_Outline_Get_CBox(outline, &bbox);
+- /*
+- what we really want to do for subpixel is
+- offset(dx, dy)
+- compute_bounds
+- offset(bbox & !63)
+- but that is two calls to offset, so we do the following, which
+- achieves the same thing with only one offset call.
+- */
+- FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63),
+- dy - ((bbox.yMin + dy) & ~63));
+
++ memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);
++
+ if (SkMask::kLCD16_Format == glyph.fMaskFormat) {
++ FT_Outline_Translate(outline, dx, dy);
+ FT_Error err = FT_Render_Glyph(face->glyph, doVert ? FT_RENDER_MODE_LCD_V :
+ FT_RENDER_MODE_LCD);
+ if (err) {
+ SK_TRACEFTR(err, "Could not render glyph.");
+- sk_bzero(glyph.fImage, glyph.computeImageSize());
+ return;
+ }
++
+ SkMask mask;
+ glyph.toMask(&mask);
++#ifdef SK_SHOW_TEXT_BLIT_COVERAGE
++ memset(mask.fImage, 0x80, mask.fBounds.height() * mask.fRowBytes);
++#endif
++ FT_GlyphSlotRec& ftGlyph = *face->glyph;
++
++ if (!SkIRect::Intersects(mask.fBounds,
++ SkIRect::MakeXYWH( ftGlyph.bitmap_left,
++ -ftGlyph.bitmap_top,
++ ftGlyph.bitmap.width,
++ ftGlyph.bitmap.rows)))
++ {
++ return;
++ }
++
++ // If the FT_Bitmap extent is larger, discard bits of the bitmap outside the mask.
++ // If the SkMask extent is larger, shrink mask to fit bitmap (clearing discarded).
++ unsigned char* origBuffer = ftGlyph.bitmap.buffer;
++ // First align the top left (origin).
++ if (-ftGlyph.bitmap_top < mask.fBounds.fTop) {
++ int32_t topDiff = mask.fBounds.fTop - (-ftGlyph.bitmap_top);
++ ftGlyph.bitmap.buffer += ftGlyph.bitmap.pitch * topDiff;
++ ftGlyph.bitmap.rows -= topDiff;
++ ftGlyph.bitmap_top = -mask.fBounds.fTop;
++ }
++ if (ftGlyph.bitmap_left < mask.fBounds.fLeft) {
++ int32_t leftDiff = mask.fBounds.fLeft - ftGlyph.bitmap_left;
++ ftGlyph.bitmap.buffer += leftDiff;
++ ftGlyph.bitmap.width -= leftDiff;
++ ftGlyph.bitmap_left = mask.fBounds.fLeft;
++ }
++ if (mask.fBounds.fTop < -ftGlyph.bitmap_top) {
++ mask.fImage += mask.fRowBytes * (-ftGlyph.bitmap_top - mask.fBounds.fTop);
++ mask.fBounds.fTop = -ftGlyph.bitmap_top;
++ }
++ if (mask.fBounds.fLeft < ftGlyph.bitmap_left) {
++ mask.fImage += sizeof(uint16_t) * (ftGlyph.bitmap_left - mask.fBounds.fLeft);
++ mask.fBounds.fLeft = ftGlyph.bitmap_left;
++ }
++ // Origins aligned, clean up the width and height.
++ int ftVertScale = (doVert ? 3 : 1);
++ int ftHoriScale = (doVert ? 1 : 3);
++ if (mask.fBounds.height() * ftVertScale < SkToInt(ftGlyph.bitmap.rows)) {
++ ftGlyph.bitmap.rows = mask.fBounds.height() * ftVertScale;
++ }
++ if (mask.fBounds.width() * ftHoriScale < SkToInt(ftGlyph.bitmap.width)) {
++ ftGlyph.bitmap.width = mask.fBounds.width() * ftHoriScale;
++ }
++ if (SkToInt(ftGlyph.bitmap.rows) < mask.fBounds.height() * ftVertScale) {
++ mask.fBounds.fBottom = mask.fBounds.fTop + ftGlyph.bitmap.rows / ftVertScale;
++ }
++ if (SkToInt(ftGlyph.bitmap.width) < mask.fBounds.width() * ftHoriScale) {
++ mask.fBounds.fRight = mask.fBounds.fLeft + ftGlyph.bitmap.width / ftHoriScale;
++ }
+ if (fPreBlend.isApplicable()) {
+- copyFT2LCD16<true>(face->glyph->bitmap, mask, doBGR,
++ copyFT2LCD16<true>(ftGlyph.bitmap, mask, doBGR,
+ fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
+ } else {
+- copyFT2LCD16<false>(face->glyph->bitmap, mask, doBGR,
++ copyFT2LCD16<false>(ftGlyph.bitmap, mask, doBGR,
+ fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
+ }
++ // Restore the buffer pointer so FreeType can properly free it.
++ ftGlyph.bitmap.buffer = origBuffer;
+ } else {
++ FT_BBox bbox;
++ FT_Bitmap target;
++ FT_Outline_Get_CBox(outline, &bbox);
++ /*
++ what we really want to do for subpixel is
++ offset(dx, dy)
++ compute_bounds
++ offset(bbox & !63)
++ but that is two calls to offset, so we do the following, which
++ achieves the same thing with only one offset call.
++ */
++ FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63),
++ dy - ((bbox.yMin + dy) & ~63));
++
+ target.width = glyph.fWidth;
+ target.rows = glyph.fHeight;
+ target.pitch = glyph.rowBytes();
+@@ -442,8 +501,15 @@
+ target.pixel_mode = compute_pixel_mode( (SkMask::Format)fRec.fMaskFormat);
+ target.num_grays = 256;
+
+- memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);
+ FT_Outline_Get_Bitmap(face->glyph->library, outline, &target);
++#ifdef SK_SHOW_TEXT_BLIT_COVERAGE
++ for (int y = 0; y < glyph.fHeight; ++y) {
++ for (int x = 0; x < glyph.fWidth; ++x) {
++ uint8_t& a = ((uint8_t*)glyph.fImage)[(glyph.rowBytes() * y) + x];
++ a = SkTMax<uint8_t>(a, 0x20);
++ }
++ }
++#endif
+ }
+ } break;
+
diff --git a/www/chromium/files/patch-third__party_swiftshader_BUILD.gn b/www/chromium/files/patch-third__party_swiftshader_BUILD.gn
new file mode 100644
index 000000000000..3d3fcc58a22c
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_BUILD.gn
@@ -0,0 +1,10 @@
+--- third_party/swiftshader/BUILD.gn.orig 2017-06-26 22:05:22.958335000 +0200
++++ third_party/swiftshader/BUILD.gn 2017-06-26 22:05:34.834212000 +0200
+@@ -85,7 +85,6 @@
+
+ if (is_linux) {
+ ldflags = [
+- "-Wl,--hash-style=both",
+ "-Wl,--gc-sections",
+ ]
+ }
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_Common_MutexLock.hpp b/www/chromium/files/patch-third__party_swiftshader_src_Common_MutexLock.hpp
new file mode 100644
index 000000000000..59e590f9ac26
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_Common_MutexLock.hpp
@@ -0,0 +1,11 @@
+--- third_party/swiftshader/src/Common/MutexLock.hpp.orig 2017-06-26 22:06:54.283201000 +0200
++++ third_party/swiftshader/src/Common/MutexLock.hpp 2017-06-26 22:07:18.656810000 +0200
+@@ -17,7 +17,7 @@
+
+ #include "Thread.hpp"
+
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD__)
+ // Use a pthread mutex on Linux. Since many processes may use SwiftShader
+ // at the same time it's best to just have the scheduler overhead.
+ #include <pthread.h>
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_Common_SharedLibrary.hpp b/www/chromium/files/patch-third__party_swiftshader_src_Common_SharedLibrary.hpp
new file mode 100644
index 000000000000..361633849208
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_Common_SharedLibrary.hpp
@@ -0,0 +1,11 @@
+--- third_party/swiftshader/src/Common/SharedLibrary.hpp.orig 2017-06-26 22:08:50.265243000 +0200
++++ third_party/swiftshader/src/Common/SharedLibrary.hpp 2017-06-26 22:10:22.637465000 +0200
+@@ -92,7 +92,7 @@
+
+ inline void *getLibraryHandle(const char *path)
+ {
+- #ifdef __ANDROID__
++ #if defined( __ANDROID__) || defined(__FreeBSD__)
+ // bionic doesn't support RTLD_NOLOAD before L
+ return dlopen(path, RTLD_NOW | RTLD_LOCAL);
+ #else
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_Common_Socket.cpp b/www/chromium/files/patch-third__party_swiftshader_src_Common_Socket.cpp
new file mode 100644
index 000000000000..ab9908ed5af0
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_Common_Socket.cpp
@@ -0,0 +1,10 @@
+--- third_party/swiftshader/src/Common/Socket.cpp.orig 2017-06-26 22:11:33.917807000 +0200
++++ third_party/swiftshader/src/Common/Socket.cpp 2017-06-26 22:11:54.516354000 +0200
+@@ -20,6 +20,7 @@
+ #include <unistd.h>
+ #include <netdb.h>
+ #include <netinet/in.h>
++ #include <sys/select.h>
+ #endif
+
+ namespace sw
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_Display.cpp b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_Display.cpp
new file mode 100644
index 000000000000..9fd97b77dd46
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_Display.cpp
@@ -0,0 +1,47 @@
+--- third_party/swiftshader/src/OpenGL/libEGL/Display.cpp.orig 2017-06-26 22:14:07.363371000 +0200
++++ third_party/swiftshader/src/OpenGL/libEGL/Display.cpp 2017-06-26 22:15:57.992270000 +0200
+@@ -30,7 +30,7 @@
+ #include <sys/ioctl.h>
+ #include <linux/fb.h>
+ #include <fcntl.h>
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD__)
+ #include "Main/libX11.hpp"
+ #elif defined(__APPLE__)
+ #include "OSXUtils.hpp"
+@@ -53,7 +53,7 @@
+
+ static void *nativeDisplay = nullptr;
+
+- #if defined(__linux__) && !defined(__ANDROID__)
++ #if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ // Even if the application provides a native display handle, we open (and close) our own connection
+ if(!nativeDisplay && dpy != HEADLESS_DISPLAY && libX11 && libX11->XOpenDisplay)
+ {
+@@ -76,7 +76,7 @@
+ {
+ terminate();
+
+- #if defined(__linux__) && !defined(__ANDROID__)
++ #if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ if(nativeDisplay && libX11->XCloseDisplay)
+ {
+ libX11->XCloseDisplay((::Display*)nativeDisplay);
+@@ -550,7 +550,7 @@
+ return false;
+ }
+ return true;
+- #elif defined(__linux__)
++ #elif defined(__linux__) || defined(__FreeBSD__)
+ if(nativeDisplay)
+ {
+ XWindowAttributes windowAttributes;
+@@ -707,7 +707,7 @@
+
+ // No framebuffer device found, or we're in user space
+ return sw::FORMAT_X8B8G8R8;
+- #elif defined(__linux__)
++ #elif defined(__linux__) || defined(__FreeBSD__)
+ if(nativeDisplay)
+ {
+ Screen *screen = libX11->XDefaultScreenOfDisplay((::Display*)nativeDisplay);
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_EGLSurface.cpp b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_EGLSurface.cpp
new file mode 100644
index 000000000000..3344e1bb5677
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_EGLSurface.cpp
@@ -0,0 +1,20 @@
+--- third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.cpp.orig 2017-06-26 22:17:25.800342000 +0200
++++ third_party/swiftshader/src/OpenGL/libEGL/EGLSurface.cpp 2017-06-26 22:18:03.230149000 +0200
+@@ -26,7 +26,7 @@
+ #include "common/debug.h"
+ #include "Main/FrameBuffer.hpp"
+
+-#if defined(__linux__) && !defined(__ANDROID__)
++#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ #include "Main/libX11.hpp"
+ #elif defined(_WIN32)
+ #include <tchar.h>
+@@ -278,7 +278,7 @@
+ #elif defined(__ANDROID__)
+ int windowWidth; window->query(window, NATIVE_WINDOW_WIDTH, &windowWidth);
+ int windowHeight; window->query(window, NATIVE_WINDOW_HEIGHT, &windowHeight);
+- #elif defined(__linux__)
++ #elif defined(__linux__) || defined(__FreeBSD__)
+ XWindowAttributes windowAttributes;
+ libX11->XGetWindowAttributes((::Display*)display->getNativeDisplay(), window, &windowAttributes);
+
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.cpp b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.cpp
new file mode 100644
index 000000000000..8a6a917821c8
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.cpp
@@ -0,0 +1,38 @@
+--- third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp.orig 2017-06-26 22:19:30.621745000 +0200
++++ third_party/swiftshader/src/OpenGL/libEGL/libEGL.cpp 2017-06-26 22:21:00.530994000 +0200
+@@ -25,7 +25,7 @@
+
+ #if defined(__ANDROID__)
+ #include <system/window.h>
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD__)
+ #include "Main/libX11.hpp"
+ #endif
+
+@@ -118,7 +118,7 @@
+ // FIXME: Check if display_id is the default display
+ }
+
+- #if defined(__linux__) && !defined(__ANDROID__)
++ #if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ if(!libX11)
+ {
+ return success(HEADLESS_DISPLAY);
+@@ -171,7 +171,7 @@
+ {
+ TRACE("(EGLDisplay dpy = %p, EGLint name = %d)", dpy, name);
+
+- #if defined(__linux__) && !defined(__ANDROID__)
++ #if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ if(dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS)
+ {
+ return success("EGL_KHR_platform_gbm "
+@@ -1043,7 +1043,7 @@
+ {
+ TRACE("(EGLenum platform = 0x%X, void *native_display = %p, const EGLint *attrib_list = %p)", platform, native_display, attrib_list);
+
+- #if defined(__linux__) && !defined(__ANDROID__)
++ #if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ switch(platform)
+ {
+ case EGL_PLATFORM_X11_EXT: break;
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.hpp b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.hpp
new file mode 100644
index 000000000000..e486741b0e40
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libEGL_libEGL.hpp
@@ -0,0 +1,11 @@
+--- third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp.orig 2017-06-26 22:22:21.418803000 +0200
++++ third_party/swiftshader/src/OpenGL/libEGL/libEGL.hpp 2017-06-26 22:22:37.089147000 +0200
+@@ -106,7 +106,7 @@
+ #else
+ const char *libEGL_lib[] = {"/vendor/lib/egl/libEGL_swiftshader.so"};
+ #endif
+- #elif defined(__linux__)
++ #elif defined(__linux__) || defined(__FreeBSD__)
+ #if defined(__LP64__)
+ const char *libEGL_lib[] = {"lib64EGL_translator.so", "libEGL.so.1", "libEGL.so"};
+ #else
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLES_CM_libGLES_CM.hpp b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLES_CM_libGLES_CM.hpp
new file mode 100644
index 000000000000..977c5641f2d2
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLES_CM_libGLES_CM.hpp
@@ -0,0 +1,11 @@
+--- third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp.orig 2017-06-26 22:23:31.609734000 +0200
++++ third_party/swiftshader/src/OpenGL/libGLES_CM/libGLES_CM.hpp 2017-06-26 22:23:56.904096000 +0200
+@@ -267,7 +267,7 @@
+ #else
+ const char *libGLES_CM_lib[] = {"/vendor/lib/egl/libGLESv1_CM_swiftshader.so"};
+ #endif
+- #elif defined(__linux__)
++ #elif defined(__linux__) || defined(__FreeBSD__)
+ #if defined(__LP64__)
+ const char *libGLES_CM_lib[] = {"lib64GLES_CM_translator.so", "libGLES_CM.so.1", "libGLES_CM.so"};
+ #else
diff --git a/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLESv2_libGLESv2.hpp b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLESv2_libGLESv2.hpp
new file mode 100644
index 000000000000..157eebf3aa06
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_src_OpenGL_libGLESv2_libGLESv2.hpp
@@ -0,0 +1,11 @@
+--- third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp.orig 2017-06-26 22:26:03.983772000 +0200
++++ third_party/swiftshader/src/OpenGL/libGLESv2/libGLESv2.hpp 2017-06-26 22:26:31.197604000 +0200
+@@ -290,7 +290,7 @@
+ #else
+ const char *libGLESv2_lib[] = {"/vendor/lib/egl/libGLESv2_swiftshader.so"};
+ #endif
+- #elif defined(__linux__)
++ #elif defined(__linux__) || defined(__FreeBSD__)
+ #if defined(__LP64__)
+ const char *libGLESv2_lib[] = {"lib64GLES_V2_translator.so", "libGLESv2.so.2", "libGLESv2.so"};
+ #else
diff --git a/www/chromium/files/patch-third__party_swiftshader_third_party_llvm-subzero_build_Linux_include_llvm_Config_config.h b/www/chromium/files/patch-third__party_swiftshader_third_party_llvm-subzero_build_Linux_include_llvm_Config_config.h
new file mode 100644
index 000000000000..5d2ea390314f
--- /dev/null
+++ b/www/chromium/files/patch-third__party_swiftshader_third_party_llvm-subzero_build_Linux_include_llvm_Config_config.h
@@ -0,0 +1,29 @@
+--- third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h.orig 2017-06-26 22:28:18.140795000 +0200
++++ third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h 2017-06-26 22:30:40.465311000 +0200
+@@ -121,7 +121,7 @@
+ #define HAVE_LINK_H 1
+
+ /* Define to 1 if you have the `lseek64' function. */
+-#define HAVE_LSEEK64 1
++/* #undef HAVE_LSEEK64 */
+
+ /* Define to 1 if you have the <mach/mach.h> header file. */
+ /* #undef HAVE_MACH_MACH_H */
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+@@ -154,7 +154,7 @@
+ /* #undef HAVE_NDIR_H */
+
+ /* Define to 1 if you have the `posix_fallocate' function. */
+-#define HAVE_POSIX_FALLOCATE 1
++/* #undef HAVE_POSIX_FALLOCATE */
+
+ /* Define to 1 if you have the `posix_spawn' function. */
+ #define HAVE_POSIX_SPAWN 1
diff --git a/www/chromium/files/patch-v8_src_trap-handler_handler-inside.cc b/www/chromium/files/patch-v8_src_trap-handler_handler-inside.cc
new file mode 100644
index 000000000000..6bc21316965f
--- /dev/null
+++ b/www/chromium/files/patch-v8_src_trap-handler_handler-inside.cc
@@ -0,0 +1,16 @@
+--- v8/src/trap-handler/handler-inside.cc.orig 2017-06-27 01:24:28.401955000 +0200
++++ v8/src/trap-handler/handler-inside.cc 2017-06-27 01:25:16.190737000 +0200
+@@ -36,11 +36,13 @@
+
+ namespace {
+
++#if V8_TRAP_HANDLER_SUPPORTED && V8_OS_LINUX
+ bool IsKernelGeneratedSignal(siginfo_t* info) {
+ return info->si_code > 0 && info->si_code != SI_USER &&
+ info->si_code != SI_QUEUE && info->si_code != SI_TIMER &&
+ info->si_code != SI_ASYNCIO && info->si_code != SI_MESGQ;
+ }
++#endif
+
+ #if V8_TRAP_HANDLER_SUPPORTED
+ class SigUnmaskStack {