1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00

- Add more useful comments to make Makefile more readable

- Fix TEST option allow running basic tests and skip tests that must be verified
  if they are supported before being added back to TEST_TARGETS
- Add patches that fixes crash with non-MESA drivers fall back to scanning PCI
  devices. Ideally, we'd like to use libpci but the current version calculates
  device class wrong for non-root users (patch submitted to libpci author), so
  a workaround would be messy. Instead, use direct access to /dev/pci. Once the
  upstream fixes the bug generic libpci code can be used [1]

  Tested by: Oleh Hushchenkov <gor@clogic.com.ua>, Jonathan Chen <jonc@chen.org.nz>

- Bump PORTREVISION

PR:		230450 [1]
Submitted by:	gonzo [1]
Reported by:	Oleh Hushchenkov, Jonathan Chen [1]
This commit is contained in:
Carlos J. Puga Medina 2018-08-22 09:58:18 +00:00
parent c5b4143a39
commit c03810c215
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=477781
9 changed files with 146 additions and 47 deletions

View File

@ -3,9 +3,10 @@
PORTNAME= chromium
PORTVERSION= 68.0.3440.106
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES?= www
MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/
MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \
LOCAL/cpm/chromium/:fonts
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER?= chromium@FreeBSD.org
@ -195,9 +196,9 @@ SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false
.endif
.include "Makefile.tests"
TEST_ALL_TARGET= ${TEST_TARGETS}
TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX}
TEST_ALL_TARGET= base_unittests
TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX} \
test_fonts${EXTRACT_SUFX}:fonts
.include <bsd.port.options.mk>
@ -223,6 +224,10 @@ pre-everything::
@${ECHO_MSG} "and ${WANTSPACE}."
@${ECHO_MSG}
post-extract-TEST-on:
@${MKDIR} ${WRKSRC}/third_party/test_fonts/test_fonts
@${MV} ${WRKDIR}/test_fonts ${WRKSRC}/third_party/test_fonts/
post-patch:
@${REINPLACE_CMD} -e 's|@@PACKAGE@@|chromium|' \
-e 's|@@MENUNAME@@|Chromium Web Browser|' \
@ -290,9 +295,13 @@ do-install:
${INSTALL_SCRIPT} ${WRKDIR}/chrome ${STAGEDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/chrome/tools/build/linux/chrome-wrapper \
${STAGEDIR}${DATADIR}
# ANGLE
.for f in libEGL.so libGLESv2.so
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
.endfor
# SwiftShader
@${MKDIR} ${STAGEDIR}${DATADIR}/swiftshader
.for g in libEGL.so libGLESv2.so
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/swiftshader/${g} \

View File

@ -1,20 +0,0 @@
#$FreeBSD$
#net_unittests : fatal error: 'sys/epoll.h' file not found
#telemetry_unittests : unknown ninja target
TEST_TARGETS= base_unittests \
crypto_unittests \
cacheinvalidation_unittests \
gpu_unittests \
printing_unittests \
sql_unittests \
content_unittests \
cc_unittests \
url_unittests \
compositor_unittests \
ipc_tests \
dbus_unittests \
media_unittests \
chromedriver_unittests \
chromedriver_tests \
browser_tests \
unit_tests

View File

@ -1,5 +1,7 @@
TIMESTAMP = 1533765819
TIMESTAMP = 1534764533
SHA256 (chromium-68.0.3440.106.tar.xz) = 7021040635a0a0d47f699bdb22e3ef5c91482e4f51b428d1de3016da95f0e698
SIZE (chromium-68.0.3440.106.tar.xz) = 630289544
SHA256 (chromium-68.0.3440.106-testdata.tar.xz) = 2a736b339f7cbf9fd26901666f17f53b51f7191ed2f64ea65fb8afe638a1633b
SIZE (chromium-68.0.3440.106-testdata.tar.xz) = 310263984
SHA256 (test_fonts.tar.xz) = cf9cbe3b7f1c4c42d426bddc65ec178d333ad7e205a36fe0a606a3c0c545ece1
SIZE (test_fonts.tar.xz) = 200040

View File

@ -1,5 +1,5 @@
--- base/process/memory_unittest.cc.orig 2017-09-05 21:05:11.000000000 +0200
+++ base/process/memory_unittest.cc 2017-09-06 16:53:33.919374000 +0200
--- base/process/memory_unittest.cc.orig 2018-08-08 21:10:31.000000000 +0200
+++ base/process/memory_unittest.cc 2018-08-20 13:06:25.303428000 +0200
@@ -104,7 +104,7 @@
// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
// configurations: only test the real allocator.
@ -9,9 +9,9 @@
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
namespace {
@@ -507,5 +507,5 @@
@@ -529,5 +529,5 @@
EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
EXPECT_TRUE(value_ == NULL);
EXPECT_TRUE(value_ == nullptr);
}
-#endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
+#endif // !defined(OS_BSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&

View File

@ -1,13 +1,22 @@
--- chrome/test/base/in_process_browser_test.cc.orig 2017-06-05 19:03:04 UTC
+++ chrome/test/base/in_process_browser_test.cc
@@ -95,6 +95,10 @@
namespace {
--- chrome/test/base/in_process_browser_test.cc.orig 2018-08-08 21:10:43.000000000 +0200
+++ chrome/test/base/in_process_browser_test.cc 2018-08-21 00:58:24.257483000 +0200
@@ -69,6 +69,10 @@
#include "chrome/test/base/scoped_bundle_swizzler_mac.h"
#endif
+#if defined(OS_FREEBSD)
+#include <signal.h>
+#endif
+
// Passed as value of kTestType.
const char kBrowserTestType[] = "browser";
#if defined(OS_WIN)
#include "base/win/scoped_com_initializer.h"
#include "base/win/windows_version.h"
@@ -88,7 +92,7 @@
#include "chrome/test/base/default_ash_event_generator_delegate.h"
#endif // defined(OS_CHROMEOS)
-#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
+#if !defined(OS_CHROMEOS) && (defined(OS_LINUX) || defined(OS_BSD))
#include "ui/views/test/test_desktop_screen_x11.h"
#endif

View File

@ -1,6 +1,6 @@
--- third_party/angle/src/gpu_info_util/SystemInfo_internal.h.orig 2017-09-10 02:31:40.635170000 +0200
+++ third_party/angle/src/gpu_info_util/SystemInfo_internal.h 2017-09-10 02:32:27.153701000 +0200
@@ -14,6 +14,8 @@
--- third_party/angle/src/gpu_info_util/SystemInfo_internal.h.orig 2018-08-08 12:13:09.000000000 -0700
+++ third_party/angle/src/gpu_info_util/SystemInfo_internal.h 2018-08-20 09:43:56.141492000 -0700
@@ -14,8 +14,13 @@
namespace angle
{
@ -8,4 +8,9 @@
+
// Defined in SystemInfo_libpci when GPU_INFO_USE_LIBPCI is defined.
bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices);
+#if defined(__FreeBSD__)
+bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices);
+#endif
// Defined in SystemInfo_x11 when GPU_INFO_USE_X11 is defined.
bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version);

View File

@ -0,0 +1,90 @@
--- third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp.orig 2018-08-20 10:00:10.885543000 -0700
+++ third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp 2018-08-20 09:50:32.387980000 -0700
@@ -12,6 +12,11 @@
#include <pci/pci.h>
#include <unistd.h>
+#if defined(__FreeBSD__)
+#include <fcntl.h>
+#include <sys/pciio.h>
+#endif
+
#include "common/angleutils.h"
#include "common/debug.h"
@@ -82,6 +87,75 @@
};
} // anonymous namespace
+
+#if defined(__FreeBSD__)
+// Adds an entry per PCI GPU found and fills the device and vendor ID.
+bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices)
+{
+ int fd;
+ struct pci_conf_io conf;
+ struct pci_conf *matches;
+ uint32_t offset = 0;
+
+ fd = open("/dev/pci", O_RDONLY);
+ if (fd < 0)
+ return false;
+
+ matches = new struct pci_conf[32];
+ conf.generation = 0;
+ do {
+ conf.pat_buf_len = 0;
+ conf.num_patterns = 0;
+ conf.patterns = NULL;
+ conf.match_buf_len = 32 * sizeof(struct pci_conf);
+ conf.num_matches = 32;
+ conf.matches = matches;
+ conf.offset = offset;
+ conf.status = PCI_GETCONF_ERROR;
+ if (ioctl(fd, PCIOCGETCONF, &conf) < 0) {
+ if (errno == ENODEV)
+ break;
+ }
+ /* PCI_GETCONF_LIST_CHANGED would require us to start over. */
+ if (conf.status == PCI_GETCONF_ERROR || conf.status == PCI_GETCONF_LIST_CHANGED) {
+ break;
+ }
+
+ for (unsigned int i = 0; i < conf.num_matches; i++) {
+ uint16_t device_class = (matches[i].pc_class << 8) | matches[i].pc_subclass;
+
+ // Skip non-GPU devices
+ switch (device_class)
+ {
+ case PCI_CLASS_DISPLAY_VGA:
+ case PCI_CLASS_DISPLAY_XGA:
+ case PCI_CLASS_DISPLAY_3D:
+ break;
+ default:
+ continue;
+ }
+
+ // Skip unknown devices
+ if (matches[i].pc_vendor == 0 || matches[i].pc_device == 0) {
+ continue;
+ }
+
+ GPUDeviceInfo info;
+ info.vendorId = matches[i].pc_vendor;
+ info.deviceId = matches[i].pc_device;
+
+ devices->push_back(info);
+ }
+ offset += conf.num_matches;
+ } while (conf.status == PCI_GETCONF_MORE_DEVS);
+
+ delete[] matches;
+
+ close(fd);
+
+ return true;
+}
+#endif
// Adds an entry per PCI GPU found and fills the device and vendor ID.
bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices)

View File

@ -1,13 +1,14 @@
--- third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp.orig 2017-09-10 02:34:01.568975000 +0200
+++ third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp 2017-09-10 02:35:52.870068000 +0200
@@ -71,10 +71,17 @@
--- third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp.orig 2018-08-08 12:13:09.000000000 -0700
+++ third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp 2018-08-20 09:50:36.331947000 -0700
@@ -71,10 +71,18 @@
bool GetSystemInfo(SystemInfo *info)
{
+#if defined(__FreeBSD__)
+ if (!CollectMesaCardInfo(&(info->gpus)))
+ {
+ return false;
+ if (!GetPCIDevicesFreeBSD(&(info->gpus)))
+ return false;
+ }
+#else
if (!GetPCIDevicesWithLibPCI(&(info->gpus)))

View File

@ -1,5 +1,5 @@
--- third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp.orig 2017-12-15 02:05:36.000000000 +0100
+++ third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp 2017-12-30 05:11:53.917801000 +0100
--- third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp.orig 2018-08-08 12:13:09.000000000 -0700
+++ third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp 2018-08-20 09:34:48.052352000 -0700
@@ -8,6 +8,8 @@
#include "gpu_info_util/SystemInfo_internal.h"
@ -9,7 +9,7 @@
#include <X11/Xlib.h>
#include "common/debug.h"
@@ -18,8 +20,40 @@
@@ -18,8 +20,43 @@
#error SystemInfo_x11.cpp compiled without GPU_INFO_USE_X11
#endif
@ -33,6 +33,9 @@
+ (PFNGLXQUERYRENDERERINTEGERMESAPROC) glXGetProcAddressARB((const GLubyte *)
+ "glXQueryRendererIntegerMESA");
+
+ if (!queryInteger)
+ return false;
+
+ bool vendor_ret =
+ queryInteger(display, 0, 0, GLX_RENDERER_VENDOR_ID_MESA, vid);
+ bool device_ret =