Index: head/www/chromium/Makefile.tests =================================================================== --- head/www/chromium/Makefile.tests (revision 477780) +++ head/www/chromium/Makefile.tests (nonexistent) @@ -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 Property changes on: head/www/chromium/Makefile.tests ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/chromium/Makefile =================================================================== --- head/www/chromium/Makefile (revision 477780) +++ head/www/chromium/Makefile (revision 477781) @@ -1,313 +1,322 @@ # Created by: Florent Thoumie # $FreeBSD$ 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 COMMENT?= Google web browser based on WebKit LICENSE= BSD3CLAUSE LGPL21 MPL11 LICENSE_COMB= multi BUILD_DEPENDS= bash:shells/bash \ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} \ .if !defined(GN_ONLY) BUILD_DEPENDS+= gperf:devel/gperf \ yasm:devel/yasm \ ffmpeg>=3.2.2,1:multimedia/ffmpeg \ flock:sysutils/flock \ node:www/node \ ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat \ ${LOCALBASE}/share/usbids/usb.ids:misc/usbids \ ${PYTHON_PKGNAMEPREFIX}html5lib>0:www/py-html5lib@${PY_FLAVOR} .endif .if !defined(GN_ONLY) LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \ libspeechd.so:accessibility/speech-dispatcher \ libsnappy.so:archivers/snappy \ libFLAC.so:audio/flac \ libopus.so:audio/opus \ libspeex.so:audio/speex \ libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ libicuuc.so:devel/icu \ libjsoncpp.so:devel/jsoncpp \ libpci.so:devel/libpci \ libnspr4.so:devel/nspr \ libre2.so:devel/re2 \ libcairo.so:graphics/cairo \ libdrm.so:graphics/libdrm \ libexif.so:graphics/libexif \ libpng.so:graphics/png \ libwebp.so:graphics/webp \ libavcodec.so:multimedia/ffmpeg \ libopenh264.so:multimedia/openh264 \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libharfbuzz-icu.so:print/harfbuzz-icu \ libgcrypt.so:security/libgcrypt \ libsecret-1.so:security/libsecret \ libnss3.so:security/nss \ libexpat.so:textproc/expat2 \ libfontconfig.so:x11-fonts/fontconfig RUN_DEPENDS= xdg-open:devel/xdg-utils \ noto-lite>0:x11-fonts/noto-lite BROKEN_FreeBSD_11_aarch64= components/safe_browsing_db/v4_rice.cc:120:18: use of overloaded operator '&' is ambiguous ONLY_FOR_ARCHS= aarch64 amd64 i386 .endif .if defined(GN_ONLY) USES= compiler:c++14-lang ninja pkgconfig python:2.7,build shebangfix tar:xz .else USES= bison cpe desktop-file-utils jpeg ninja perl5 pkgconfig \ python:2.7,build shebangfix tar:xz .endif MAKE_ARGS= -C out/${BUILDTYPE} BINARY_ALIAS= python=${PYTHON_CMD} .if !defined(GN_ONLY) CPE_VENDOR= google CPE_PRODUCT= chrome USE_GL= gl USE_LDCONFIG= ${DATADIR} USE_PERL5= build USE_XORG= x11 xcb xcomposite xcursor xext xdamage xfixes xi \ xorgproto xrandr xrender xscrnsaver xtst USE_GNOME= atk dconf glib20 gtk30 libxml2 libxslt SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper ALL_TARGET= chrome INSTALLS_ICONS= yes .endif EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang # TODO bz@ : install libwidevinecdm.so (see third_party/widevine/cdm/BUILD.gn) # # Run "./out/${BUILDTYPE}/gn args out/${BUILDTYPE} --list" for all variables. # Some parts don't have use_system_* flag, and can be turned on/off by using # replace_gn_files.py script, some parts just turned on/off for target host # OS "target_os == is_bsd", like libusb, libpci. GN_ARGS+= clang_use_chrome_plugins=false \ enable_nacl=false \ enable_one_click_signin=true \ enable_remoting=false \ fieldtrial_testing_like_official_build=true \ is_clang=true \ toolkit_views=true \ treat_warnings_as_errors=false \ use_allocator="none" \ use_allocator_shim=false \ use_aura=true \ use_bundled_fontconfig=false \ use_custom_libcxx=false \ use_gnome_keyring=false \ use_gtk3=true \ use_lld=true \ use_sysroot=false \ use_system_freetype=true \ use_system_harfbuzz=true \ use_system_libjpeg=true \ extra_cxxflags="-I${LOCALBASE}/include" \ extra_ldflags="-L${LOCALBASE}/lib" # TODO: investigate building with these options: # use_system_minigbm GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild # FreeBSD Chromium Api Key # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . # Note: these are for FreeBSD use ONLY. For your own distribution, # please get your own set of keys. GN_ARGS+= google_api_key="AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8" \ google_default_client_id="996322985003.apps.googleusercontent.com" \ google_default_client_secret="IR1za9-1VK0zZ0f_O8MVFicn" .if !defined(GN_ONLY) SUB_FILES= chromium-browser.desktop chrome pkg-message SUB_LIST+= COMMENT="${COMMENT}" OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS TEST CODECS_DESC= Compile and enable patented codecs like H.264 DRIVER_DESC= Install chromedriver OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO OPTIONS_DEFAULT= ALSA CODECS CUPS DRIVER KERBEROS OPTIONS_SUB= yes ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \ alsa-lib>=1.1.1_1:audio/alsa-lib ALSA_VARS= GN_ARGS+=use_alsa=true ALSA_VARS_OFF= GN_ARGS+=use_alsa=false CODECS_VARS= GN_ARGS+=ffmpeg_branding="Chrome" \ GN_ARGS+=proprietary_codecs=true \ GN_ARGS+=enable_hevc_demuxing=true CODECS_VARS_OFF= GN_ARGS+=ffmpeg_branding="Chromium" \ GN_ARGS+=proprietary_codecs=false \ GN_ARGS+=enable_hevc_demuxing=false CUPS_LIB_DEPENDS= libcups.so:print/cups CUPS_VARS= GN_ARGS+=use_cups=true CUPS_VARS_OFF= GN_ARGS+=use_cups=false DEBUG_VARS= BUILDTYPE=Debug \ GN_ARGS+=is_debug=true \ GN_ARGS+=is_component_build=false \ GN_BOOTSTRAP_FLAGS+=--debug \ WANTSPACE="lots of free disk space (~ 13GB)" DEBUG_VARS_OFF= BUILDTYPE=Release \ GN_ARGS+=is_debug=false \ GN_ARGS+=is_official_build=true \ GN_ARGS+=symbol_level=0 \ GN_ARGS+=remove_webcore_debug_symbols=true \ WANTSPACE="a fair amount of free disk space (~ 6.5GB)" DRIVER_BUILD_DEPENDS= git:devel/git DRIVER_MAKE_ARGS= chromedriver KERBEROS_VARS= GN_ARGS+=use_kerberos=true KERBEROS_VARS_OFF= GN_ARGS+=use_kerberos=false PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false # With SNDIO=on we exclude audio_manager_linux from the build (see # media/audio/BUILD.gn) and use audio_manager_openbsd which does not # support falling back to ALSA or PulseAudio. SNDIO_PREVENTS= ALSA PULSEAUDIO SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_VARS= GN_ARGS+=use_sndio=true 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 .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1101513 BUILD_DEPENDS+= clang60:devel/llvm60 CC= clang60 CXX= clang++60 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-llvm-port .else BUILD_DEPENDS+= ${LOCALBASE}/bin/ar:devel/binutils EXTRA_PATCHES+= ${FILESDIR}/extra-patch-llvm-base .endif # TODO: -isystem, would be just as ugly as this approach, but more reliably # build would fail without C_INCLUDE_PATH/CPLUS_INCLUDE_PATH env var set. MAKE_ENV+= C_INCLUDE_PATH=${LOCALBASE}/include \ CPLUS_INCLUDE_PATH=${LOCALBASE}/include .if !defined(GN_ONLY) pre-everything:: @${ECHO_MSG} @${ECHO_MSG} "To build Chromium, you should have around 2GB of memory" @${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|' \ ${WRKSRC}/chrome/app/resources/manpage.1.in post-patch-SNDIO-on: @${MKDIR} ${WRKSRC}/media/audio/sndio ${WRKSRC}/media/audio/openbsd @${CP} ${FILESDIR}/sndio_output.* ${WRKSRC}/media/audio/sndio @${CP} ${FILESDIR}/sndio_input.* ${WRKSRC}/media/audio/sndio @${CP} ${FILESDIR}/audio_manager_openbsd.* ${WRKSRC}/media/audio/openbsd pre-configure: # We used to remove bundled libraries to be sure that chromium uses # system libraries and not shipped ones. # cd ${WRKSRC} && ${PYTHON_CMD} \ #./build/linux/unbundle/remove_bundled_libraries.py [list of preserved] cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \ ./build/linux/unbundle/replace_gn_files.py --system-libraries \ ffmpeg flac freetype harfbuzz-ng libdrm libusb libwebp libxml libxslt openh264 opus snappy yasm || ${FALSE} .endif do-configure: # GN generator bootstrapping and generating ninja files cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} CC=${CC} CXX=${CXX} LD=${CXX} \ READELF=${READELF} AR=${AR} NM=${NM} ${PYTHON_CMD} \ ./tools/gn/bootstrap/bootstrap.py ${GN_BOOTSTRAP_FLAGS} .if !defined(GN_ONLY) cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./out/${BUILDTYPE}/gn \ gen --args='${GN_ARGS}' out/${BUILDTYPE} # Setup nodejs dependency @${MKDIR} ${WRKSRC}/third_party/node/freebsd/node-freebsd-x64/bin ${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/freebsd/node-freebsd-x64/bin/node .endif do-test-TEST-on: .for t in ${TEST_TARGETS} cd ${WRKSRC}/out/${BUILDTYPE} && ${SETENV} LC_ALL=en_US.UTF-8 \ ./${t} --gtest_filter=-${EXCLUDE_${t}:ts:} || ${TRUE} .endfor .if !defined(GN_ONLY) do-install: @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_MAN} ${WRKSRC}/chrome/app/resources/manpage.1.in \ ${STAGEDIR}${MANPREFIX}/man/man1/chrome.1 ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.service ${STAGEDIR}${DATADIR} .for s in 22 24 48 64 128 256 @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps ${INSTALL_DATA} ${WRKSRC}/chrome/app/theme/chromium/product_logo_${s}.png \ ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps/chrome.png .endfor ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.png ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.pak ${STAGEDIR}${DATADIR} .for d in protoc icudtl.dat mksnapshot natives_blob.bin snapshot_blob.bin v8_context_snapshot.bin ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${d} ${STAGEDIR}${DATADIR} .endfor ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chrome \ ${STAGEDIR}${DATADIR} cd ${WRKSRC}/out/${BUILDTYPE} && \ ${COPYTREE_SHARE} "locales resources" ${STAGEDIR}${DATADIR} @${MKDIR} ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/chromium-browser.desktop \ ${STAGEDIR}${DESKTOPDIR} ${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} \ ${STAGEDIR}${DATADIR}/swiftshader .endfor post-install-DEBUG-on: ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/*.so \ ${STAGEDIR}${DATADIR} ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/character_data_generator \ ${STAGEDIR}${DATADIR} post-install-DRIVER-on: ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chromedriver \ ${STAGEDIR}${PREFIX}/bin .endif .include Index: head/www/chromium/distinfo =================================================================== --- head/www/chromium/distinfo (revision 477780) +++ head/www/chromium/distinfo (revision 477781) @@ -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 Index: head/www/chromium/files/patch-base_process_memory__unittest.cc =================================================================== --- head/www/chromium/files/patch-base_process_memory__unittest.cc (revision 477780) +++ head/www/chromium/files/patch-base_process_memory__unittest.cc (revision 477781) @@ -1,18 +1,18 @@ ---- 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. // Windows only supports these tests with the allocator shim in place. -#if !defined(OS_OPENBSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \ +#if !defined(OS_BSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \ !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) && // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) Index: head/www/chromium/files/patch-chrome_test_base_in__process__browser__test.cc =================================================================== --- head/www/chromium/files/patch-chrome_test_base_in__process__browser__test.cc (revision 477780) +++ head/www/chromium/files/patch-chrome_test_base_in__process__browser__test.cc (revision 477781) @@ -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 @@ +--- 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 - namespace { - +#if defined(OS_FREEBSD) +#include +#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 Index: head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h =================================================================== --- head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h (revision 477780) +++ head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h (revision 477781) @@ -1,11 +1,16 @@ ---- 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 { +bool CollectMesaCardInfo(std::vector *devices); + // Defined in SystemInfo_libpci when GPU_INFO_USE_LIBPCI is defined. bool GetPCIDevicesWithLibPCI(std::vector *devices); ++#if defined(__FreeBSD__) ++bool GetPCIDevicesFreeBSD(std::vector *devices); ++#endif // Defined in SystemInfo_x11 when GPU_INFO_USE_X11 is defined. + bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version); + Index: head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp =================================================================== --- head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp (nonexistent) +++ head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp (revision 477781) @@ -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 + #include + ++#if defined(__FreeBSD__) ++#include ++#include ++#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 *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 *devices) Property changes on: head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp =================================================================== --- head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp (revision 477780) +++ head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp (revision 477781) @@ -1,20 +1,21 @@ ---- 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))) { return false; } +#endif if (info->gpus.size() == 0) { Index: head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp =================================================================== --- head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp (revision 477780) +++ head/www/chromium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp (revision 477781) @@ -1,52 +1,55 @@ ---- 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" +#include +#include #include #include "common/debug.h" -@@ -18,8 +20,40 @@ +@@ -18,8 +20,43 @@ #error SystemInfo_x11.cpp compiled without GPU_INFO_USE_X11 #endif +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 + namespace angle { + +bool CollectMesaCardInfo(std::vector *devices) +{ + + unsigned int vid[3], did[3]; + + Display *display = XOpenDisplay(NULL); + if (!display) { + return false; + } + + PFNGLXQUERYRENDERERINTEGERMESAPROC queryInteger = + (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 = + queryInteger(display, 0, 0, GLX_RENDERER_DEVICE_ID_MESA, did); + + if (vendor_ret && device_ret) { + GPUDeviceInfo info; + info.vendorId = vid[0]; + info.deviceId = did[0]; + devices->push_back(info); + } + + return true; +} bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version) {