diff --git a/devel/electron33/Makefile b/devel/electron33/Makefile index b188734ea46d..afe315f7cdbe 100644 --- a/devel/electron33/Makefile +++ b/devel/electron33/Makefile @@ -1,455 +1,454 @@ PORTNAME= electron DISTVERSIONPREFIX= v DISTVERSION= ${ELECTRON_VER} -PORTREVISION= 4 PULSEMV= 16 PULSEV= ${PULSEMV}.1 CATEGORIES= devel MASTER_SITES= https://github.com/tagattie/FreeBSD-Electron/releases/download/v33.3.2/:chromium \ https://freedesktop.org/software/pulseaudio/releases/:pulseaudio PKGNAMESUFFIX= ${ELECTRON_VER_MAJOR} DISTFILES= chromium-${CHROMIUM_VER}${EXTRACT_SUFX}.0:chromium \ chromium-${CHROMIUM_VER}${EXTRACT_SUFX}.1:chromium \ chromium-${CHROMIUM_VER}${EXTRACT_SUFX}.2:chromium \ pulseaudio-${PULSEV}.tar.gz:pulseaudio \ electron-yarn-cache-${ELECTRON_VER}${EXTRACT_SUFX}:prefetch DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= chromium-${CHROMIUM_VER}${EXTRACT_SUFX} \ ${DISTFILES:C/:[^:]+$//:C/chromium-${CHROMIUM_VER}${EXTRACT_SUFX}\.[0-9]//} MAINTAINER= tagattie@FreeBSD.org COMMENT= Build cross-platform desktop apps with JavaScript, HTML, and CSS WWW= https://electronjs.org/ LICENSE= BSD3CLAUSE LGPL21 MPL11 MIT LICENSE_COMB= multi LICENSE_FILE= ${WRKSRC}/electron/LICENSE ONLY_FOR_ARCHS= aarch64 amd64 i386 FETCH_DEPENDS= yarn${NODEJS_SUFFIX}>0:www/yarn${NODEJS_SUFFIX} EXTRACT_DEPENDS=yarn${NODEJS_SUFFIX}>0:www/yarn${NODEJS_SUFFIX} PATCH_DEPENDS= git:devel/git \ jq:textproc/jq BUILD_DEPENDS= gperf:devel/gperf \ bindgen:devel/rust-bindgen-cli \ yasm:devel/yasm \ ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri \ rustc:lang/rust \ ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat \ node${NODEJS_VERSION}>0:www/node${NODEJS_VERSION} \ npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX} LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-core \ libatspi.so:accessibility/at-spi2-core \ libFLAC.so:audio/flac \ libopus.so:audio/opus \ libdbus-1.so:devel/dbus \ libicuuc.so:devel/icu \ libepoll-shim.so:devel/libepoll-shim \ libevent.so:devel/libevent \ libffi.so:devel/libffi \ libnotify.so:devel/libnotify \ libpci.so:devel/libpci \ libnspr4.so:devel/nspr \ libre2.so:devel/re2 \ libdrm.so:graphics/libdrm \ libpng.so:graphics/png \ libwayland-client.so:graphics/wayland \ libwebp.so:graphics/webp \ libdav1d.so:multimedia/dav1d \ libva.so:multimedia/libva \ libopenh264.so:multimedia/openh264 \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libsecret-1.so:security/libsecret \ libnss3.so:security/nss \ libexpat.so:textproc/expat2 \ libxkbcommon.so:x11/libxkbcommon \ libxshmfence.so:x11/libxshmfence \ libfontconfig.so:x11-fonts/fontconfig RUN_DEPENDS= xdg-open:devel/xdg-utils TEST_DEPENDS= git:devel/git \ ${PYTHON_PKGNAMEPREFIX}python-dbusmock>0:devel/py-python-dbusmock@${PY_FLAVOR} \ npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX} USES= bison compiler:c++17-lang cpe gettext-tools gl gmake gnome \ iconv:wchar_t jpeg localbase:ldflags ninja nodejs:20,build \ pkgconfig python:build,test shebangfix tar:xz xorg CPE_VENDOR= electronjs USE_GITHUB= yes GH_TUPLE= nodejs:node:v${NODE_VER}:node \ nodejs:nan:${NAN_VER}:nan \ Squirrel:Squirrel.Mac:${SQUIRREL_MAC_VER}:squirrel_mac \ ReactiveCocoa:ReactiveObjC:${REACTIVEOBJC_VER}:reactiveobjc \ Mantle:Mantle:${MANTLE_VER}:mantle \ EngFlow:reclient-configs:${ENGFLOW_RECLIENT_CONFIGS_VER}:reclient_configs USE_GL= gbm gl glesv2 USE_GNOME= atk cairo gdkpixbuf2 gtk30 libxml2 libxslt pango USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xrandr \ xrender xscrnsaver xtst SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper buildtools/linux64/clang-format MAKE_ARGS= -C out/${BUILDTYPE} MAKE_ENV+= C_INCLUDE_PATH=${LOCALBASE}/include \ CPLUS_INCLUDE_PATH=${LOCALBASE}/include ALL_TARGET= electron electron:node_headers POST_BUILD_TARGETS= licenses version POST_BUILD_DIST_TARGETS=electron_dist_zip electron_chromedriver_zip \ electron_mksnapshot_zip DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX} BINARY_ALIAS= python3=${PYTHON_CMD} BUNDLE_LIBS= yes NO_WRKSUBDIR= yes WRKSRC_SUBDIR= src GN_ARGS+= clang_use_chrome_plugins=false \ enable_backup_ref_ptr_support=false \ enable_hangout_services_extension=true \ enable_log_error_not_reached=true \ enable_nacl=false \ enable_remoting=false \ fatal_linker_warnings=false \ icu_use_data_file=false \ is_clang=true \ optimize_webui=true \ toolkit_views=true \ treat_warnings_as_errors=false \ use_allocator_shim=false \ use_aura=true \ use_custom_libcxx=true \ use_custom_libunwind=true \ use_lld=true \ use_partition_alloc=true \ use_partition_alloc_as_malloc=false \ use_sysroot=false \ use_system_freetype=false \ use_system_harfbuzz=true \ use_system_libffi=true \ use_system_libjpeg=true \ use_udev=false \ chrome_pgo_phase=0 \ extra_cflags="${CFLAGS}" \ extra_cxxflags="${CXXFLAGS} -I${LOCALBASE}/include/libepoll-shim ${PINCLUDES}" \ extra_ldflags="${LDFLAGS}" \ ffmpeg_branding="${FFMPEG_BRAND}" \ override_electron_version="${ELECTRON_VER}" # TODO: investigate building with these options: # use_system_minigbm GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles PLIST_SUB= ELECTRON_VER=${ELECTRON_VER} \ ELECTRON_VER_MAJOR=${ELECTRON_VER_MAJOR} OPTIONS_DEFINE= CODECS CUPS DEBUG DIST DRIVER KERBEROS LTO PIPEWIRE OPTIONS_DEFAULT= CODECS CUPS DRIVER KERBEROS PIPEWIRE ALSA PULSEAUDIO SNDIO OPTIONS_EXCLUDE_aarch64=LTO OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO OPTIONS_RADIO= KERBEROS OPTIONS_RADIO_KERBEROS= HEIMDAL HEIMDAL_BASE MIT OPTIONS_SUB= yes CODECS_DESC= Compile and enable patented codecs like H.264 DIST_DESC= Build distribution zip files DRIVER_DESC= Install chromedriver HEIMDAL_BASE_DESC= Heimdal Kerberos (base) HEIMDAL_DESC= Heimdal Kerberos (security/heimdal) MIT_DESC= MIT Kerberos (security/krb5) PIPEWIRE_DESC= Screen capture via PipeWire 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+=proprietary_codecs=true \ FFMPEG_BRAND="Chrome" CODECS_VARS_OFF= GN_ARGS+=proprietary_codecs=false \ FFMPEG_BRAND="Chromium" CUPS_LIB_DEPENDS= libcups.so:print/cups CUPS_VARS= GN_ARGS+=use_cups=true CUPS_VARS_OFF= GN_ARGS+=use_cups=false DEBUG_BUILD_DEPENDS= esbuild:devel/esbuild DEBUG_VARS= BUILDTYPE=Debug \ GN_FILE=testing.gn \ GN_ARGS+=is_debug=true \ GN_ARGS+=is_component_build=false \ GN_ARGS+=symbol_level=1 \ GN_BOOTSTRAP_FLAGS+=--debug \ WANTSPACE="21 GB" DEBUG_VARS_OFF= BUILDTYPE=Release \ GN_FILE=release.gn \ GN_ARGS+=blink_symbol_level=0 \ GN_ARGS+=is_debug=false \ GN_ARGS+=is_official_build=true \ GN_ARGS+=symbol_level=0 \ WANTSPACE="14 GB" DIST_IMPLIES= DRIVER DRIVER_MAKE_ARGS= chromedriver HEIMDAL_LIB_DEPENDS= libkrb5.so.26:security/heimdal KERBEROS_VARS= GN_ARGS+=use_kerberos=true KERBEROS_VARS_OFF= GN_ARGS+=use_kerberos=false LTO_VARS= GN_ARGS+=use_thin_lto=true \ GN_ARGS+=thin_lto_enable_optimizations=true \ WANTSPACE="14 GB" LTO_VARS_OFF= GN_ARGS+=use_thin_lto=false MIT_LIB_DEPENDS= libkrb5.so.3:security/krb5 PIPEWIRE_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire PIPEWIRE_VARS= GN_ARGS+=rtc_use_pipewire=true \ GN_ARGS+=rtc_link_pipewire=true PIPEWIRE_VARS_OFF= GN_ARGS+=rtc_use_pipewire=false \ GN_ARGS+=rtc_link_pipewire=false PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true \ PINCLUDES="-I${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/pulseaudio-${PULSEV}/src -DPA_MAJOR=${PULSEMV}" PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_VARS= GN_ARGS+=use_sndio=true SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false # See ${WRKSRC}/electron/DEPS for CHROMIUM_VER CHROMIUM_VER= 130.0.6723.191 # See ${WRKSRC}/electron/DEPS for NODE_VER -NODE_VER= 20.18.1 +NODE_VER= 20.18.3 # See ${WRKSRC}/electron/DEPS for NAN_VER NAN_VER= e14bdcd1f72d62bca1d541b66da43130384ec213 # See ${WRKSRC}/electron/DEPS for SQUIRREL_MAC_VER SQUIRREL_MAC_VER= 0e5d146ba13101a1302d59ea6e6e0b3cace4ae38 # See ${WRKSRC}/electron/DEPS for REACTIVEOBJC_VER REACTIVEOBJC_VER= 74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76 # See ${WRKSRC}/electron/DEPS for MANTLE_VER MANTLE_VER= 78d3966b3c331292ea29ec38661b25df0a245948 # See ${WRKSRC}/electron/DEPS for ENGFLOW_RECLIENT_CONFIGS_VER ENGFLOW_RECLIENT_CONFIGS_VER= 955335c30a752e9ef7bff375baab5e0819b6c00d YARN_TIMESTAMP= 61171200 .include "Makefile.version" .include .if ${PORT_OPTIONS:MHEIMDAL_BASE} && !exists(/usr/lib/libkrb5.so) IGNORE= you have selected HEIMDAL_BASE but do not have Heimdal installed in base .endif LLVM_DEFAULT= 19 BUILD_DEPENDS+= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} BINARY_ALIAS+= cpp=${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} \ cc=${LOCALBASE}/bin/clang${LLVM_DEFAULT} \ c++=${LOCALBASE}/bin/clang++${LLVM_DEFAULT} \ ar=${LOCALBASE}/bin/llvm-ar${LLVM_DEFAULT} \ nm=${LOCALBASE}/bin/llvm-nm${LLVM_DEFAULT} \ ld=${LOCALBASE}/bin/ld.lld${LLVM_DEFAULT} CFLAGS+= -Wno-error=implicit-function-declaration .if ${ARCH} == "aarch64" PLIST_SUB+= AARCH64="" \ AMD64="@comment " \ I386="@comment " \ NOT_AARCH64="@comment " FFMPEG_TARGET= arm64 .elif ${ARCH} == "amd64" BUILD_DEPENDS+= nasm:devel/nasm PLIST_SUB+= AARCH64="@comment " \ AMD64="" \ I386="@comment " \ NOT_AARCH64="" FFMPEG_TARGET= x64 .elif ${ARCH} == "i386" BUILD_DEPENDS+= nasm:devel/nasm PLIST_SUB+= AARCH64="@comment " \ AMD64="@comment " \ I386="" \ NOT_AARCH64="" FFMPEG_TARGET= ia32 .endif FFMPEG_BDIR= ${WRKSRC}/third_party/ffmpeg/build.${FFMPEG_TARGET}.freebsd/${FFMPEG_BRAND} FFMPEG_CDIR= ${WRKSRC}/third_party/ffmpeg/chromium/config/${FFMPEG_BRAND}/freebsd/${FFMPEG_TARGET} # Allow relocations against read-only segments (override lld default) LDFLAGS_i386= -Wl,-znotext # 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 # rust RUSTC_VERSION!= rustc -V 2>/dev/null || true MAKE_ENV+= RUSTC_BOOTSTRAP=1 GN_ARGS+= enable_rust=true \ rust_sysroot_absolute="${LOCALBASE}" \ rustc_version="${RUSTC_VERSION}" pre-everything:: @${ECHO_MSG} @${ECHO_MSG} "To build electron, you should have around 2GB of memory" @${ECHO_MSG} "and around ${WANTSPACE} of free disk space." @${ECHO_MSG} pre-fetch: @${MKDIR} ${DISTDIR}/${DIST_SUBDIR} if [ ! -f ${DISTDIR}/${DIST_SUBDIR}/electron-yarn-cache-${ELECTRON_VER}${EXTRACT_SUFX} ]; \ then ${MKDIR} ${WRKDIR}; \ ${ECHO_CMD} 'yarn-offline-mirror "./yarn-offline-cache"' >> \ ${WRKDIR}/.yarnrc; \ ${CP} ${FILESDIR}/package.json ${FILESDIR}/yarn.lock ${WRKDIR}; \ cd ${WRKDIR} && ${SETENV} HOME=${WRKDIR} XDG_CACHE_HOME=${WRKDIR}/.cache \ yarn --frozen-lockfile --ignore-scripts; \ ${MTREE_CMD} -cbnSp yarn-offline-cache | ${MTREE_CMD} -C | ${SED} \ -e 's:time=[0-9.]*:time=${YARN_TIMESTAMP}.000000000:' \ -e 's:\([gu]id\)=[0-9]*:\1=0:g' \ -e 's:mode=\([0-9]\)7[0-9][0-9]:mode=\1755:' \ -e 's:mode=\([0-9]\)6[0-9][0-9]:mode=\1644:' \ -e 's:flags=.*:flags=none:' \ -e 's:^\.:./yarn-offline-cache:' > yarn-offline-cache.mtree; \ ${TAR} cJf ${DISTDIR}/${DIST_SUBDIR}/electron-yarn-cache-${ELECTRON_VER}${EXTRACT_SUFX} \ @yarn-offline-cache.mtree; \ ${RM} -r ${WRKDIR}; \ fi post-fetch: @if [ ! -f ${DISTDIR}/${DIST_SUBDIR}/chromium-${CHROMIUM_VER}${EXTRACT_SUFX} ]; then \ ${CAT} ${DISTDIR}/${DIST_SUBDIR}/chromium-${CHROMIUM_VER}${EXTRACT_SUFX}.? > \ ${DISTDIR}/${DIST_SUBDIR}/chromium-${CHROMIUM_VER}${EXTRACT_SUFX}; \ fi post-extract: # Move extracted sources to appropriate locations ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/chromium-${CHROMIUM_VER} ${WRKSRC} ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${PORTNAME}-${ELECTRON_VER} ${WRKSRC}/electron ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_nan}-${NAN_VER} \ ${WRKSRC}/third_party/nan ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_node}-${NODE_VER} \ ${WRKSRC}/third_party/electron_node ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_squirrel_mac}-${SQUIRREL_MAC_VER} \ ${WRKSRC}/third_party/squirrel.mac ${MKDIR} ${WRKSRC}/third_party/squirrel.mac/vendor ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_reactiveobjc}-${REACTIVEOBJC_VER} \ ${WRKSRC}/third_party/squirrel.mac/vendor/ReactiveObjC ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_mantle}-${MANTLE_VER} \ ${WRKSRC}/third_party/squirrel.mac/vendor/Mantle ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/${GH_PROJECT_reclient_configs}-${ENGFLOW_RECLIENT_CONFIGS_VER} \ ${WRKSRC}/third_party/engflow-reclient-configs # Install node modules for electron ${MV} ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/yarn-offline-cache ${WRKDIR} ${ECHO_CMD} 'yarn-offline-mirror "../../../yarn-offline-cache"' >> ${WRKSRC}/electron/.yarnrc ${MV} ${WRKSRC}/electron/package.json ${WRKSRC}/electron/package.json.bak ${CP} ${FILESDIR}/package.json ${WRKSRC}/electron cd ${WRKSRC}/electron && \ ${SETENV} HOME=${WRKDIR} XDG_CACHE_HOME=${WRKDIR}/.cache yarn --frozen-lockfile --offline pre-patch: ${SH} ${FILESDIR}/apply-electron-patches.sh ${WRKSRC} # ${FIND} ${WRKSRC} -type f -name '*.orig' -print -delete # ${FIND} ${WRKSRC} -type f -name '*~' -print -delete 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 \ dav1d flac fontconfig freetype harfbuzz-ng icu libdrm libevent \ libpng libusb libwebp libxml libxslt openh264 opus || ${FALSE} # Chromium uses an unreleased version of FFmpeg, so configure it cd ${WRKSRC}/media/ffmpeg && \ ${PYTHON_CMD} scripts/build_ffmpeg.py freebsd ${FFMPEG_TARGET} \ --config-only --branding=${FFMPEG_BRAND} cd ${FFMPEG_BDIR} && ${GMAKE} ffversion.h ${MKDIR} ${FFMPEG_CDIR} .for _e in config.h config.asm config_components.h libavcodec libavformat libavutil -${CP} -pR ${FFMPEG_BDIR}/${_e} ${FFMPEG_CDIR} .endfor touch ${WRKDIR}/${PORTNAME}-${ELECTRON_VER}/pulseaudio-${PULSEV}/src/pulse/version.h @${REINPLACE_CMD} -e 's|$${LOCALBASE}|${LOCALBASE}|;s|$${MODCLANG_VERSION}|${LLVM_DEFAULT}|' \ ${WRKSRC}/build/rust/rust_bindgen.gni 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} cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./out/${BUILDTYPE}/gn gen out/${BUILDTYPE} \ --args='import("//electron/build/args/${GN_FILE}") ${GN_ARGS}' # Setup nodejs dependency @${MKDIR} ${WRKSRC}/third_party/node/freebsd/node-freebsd/bin ${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/freebsd/node-freebsd/bin/node # Setup buildtools/freebsd @${MKDIR} ${WRKSRC}/buildtools/freebsd ${LN} -sf ${WRKSRC}/buildtools/linux64/clang-format ${WRKSRC}/buildtools/freebsd ${LN} -sf ${WRKSRC}/out/${BUILDTYPE}/gn ${WRKSRC}/buildtools/freebsd ${LN} -sf /usr/bin/strip ${WRKSRC}/buildtools/freebsd/strip post-build: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ ${MAKE_CMD} ${MAKE_ARGS} ${POST_BUILD_TARGETS} post-build-DIST-on: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ ${MAKE_CMD} ${MAKE_ARGS} ${POST_BUILD_DIST_TARGETS} cd ${WRKSRC}/out/${BUILDTYPE} && \ ${CP} chromedriver.zip chromedriver-v${ELECTRON_VER}-freebsd-${ARCH:S/amd64/x64/:S/i386/ia32/}.zip && \ ${CP} dist.zip electron-v${ELECTRON_VER}-freebsd-${ARCH:S/amd64/x64/:S/i386/ia32/}.zip && \ ${CP} mksnapshot.zip mksnapshot-v${ELECTRON_VER}-freebsd-${ARCH:S/amd64/x64/:S/i386/ia32/}.zip && \ ${SHA256} -r *-v${ELECTRON_VER}-freebsd-*.zip | ${SED} -e 's/ / */' > SHASUMS256.txt do-install: ${MKDIR} ${STAGEDIR}${DATADIR} .for f in electron mksnapshot v8_context_snapshot_generator ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR} .endfor .for f in libEGL.so libGLESv2.so libffmpeg.so libvk_swiftshader.so ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR} .endfor ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvulkan.so.1 ${STAGEDIR}${DATADIR}/libvulkan.so .for f in LICENSE LICENSES.chromium.html snapshot_blob.bin v8_context_snapshot.bin version vk_swiftshader_icd.json ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR} .endfor .for f in chrome_100_percent.pak chrome_200_percent.pak resources.pak ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR} .endfor ${MKDIR} ${STAGEDIR}${DATADIR}/locales ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/locales/*.pak ${STAGEDIR}${DATADIR}/locales ${MKDIR} ${STAGEDIR}${DATADIR}/resources .for f in default_app.asar ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/resources/${f} ${STAGEDIR}${DATADIR}/resources .endfor cd ${WRKSRC}/out/${BUILDTYPE}/gen && ${COPYTREE_SHARE} node_headers ${STAGEDIR}${DATADIR} cd ${WRKSRC}/out/${BUILDTYPE} && ${COPYTREE_SHARE} gen/electron/buildflags ${STAGEDIR}${DATADIR} cd ${WRKSRC}/out/${BUILDTYPE} && ${COPYTREE_SHARE} gen/v8/embedded.S ${STAGEDIR}${DATADIR} ${RLN} ${STAGEDIR}${DATADIR}/electron ${STAGEDIR}${PREFIX}/bin/electron${PKGNAMESUFFIX} post-install-DIST-on: ${MKDIR} ${STAGEDIR}${DATADIR}/releases ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/SHASUMS256.txt ${STAGEDIR}${DATADIR}/releases ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*-v${ELECTRON_VER}-freebsd-*.zip ${STAGEDIR}${DATADIR}/releases post-install-DRIVER-on: ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chromedriver.unstripped \ ${STAGEDIR}${DATADIR}/chromedriver do-test: # Note 1: "npm install" will run before actual tests are executed # Note 2: Xvfb or something similar is necessary for headless testing cd ${WRKSRC}/electron && \ ${SETENV} ${TEST_ENV} ELECTRON_OUT_DIR=${BUILDTYPE} LOCAL_GIT_DIRECTORY=${LOCALBASE} \ npm run test -- --ci .include diff --git a/devel/electron33/Makefile.version b/devel/electron33/Makefile.version index a82073ea05cb..98f1871aea2c 100644 --- a/devel/electron33/Makefile.version +++ b/devel/electron33/Makefile.version @@ -1,2 +1,2 @@ -ELECTRON_VER= 33.4.0 +ELECTRON_VER= 33.4.3 ELECTRON_VER_MAJOR= ${ELECTRON_VER:C/\..*//} diff --git a/devel/electron33/distinfo b/devel/electron33/distinfo index 0281e8dd80f1..9d6222829a16 100644 --- a/devel/electron33/distinfo +++ b/devel/electron33/distinfo @@ -1,25 +1,25 @@ -TIMESTAMP = 1738909368 +TIMESTAMP = 1741441766 SHA256 (electron/chromium-130.0.6723.191.tar.xz.0) = 5d75efea5a8e43b99e7fd86e20835218a2b80115e55f261e31d7c3723ebe067a SIZE (electron/chromium-130.0.6723.191.tar.xz.0) = 2000000000 SHA256 (electron/chromium-130.0.6723.191.tar.xz.1) = adf26a3c24a77e0eb119ddb3932c0ee4f9127a1b7e63c7881047d482742d716a SIZE (electron/chromium-130.0.6723.191.tar.xz.1) = 2000000000 SHA256 (electron/chromium-130.0.6723.191.tar.xz.2) = 16a8c26a52ed95dae9a5a0d69606f2847b267a2ee3fe55d319d26ea527b9db1e SIZE (electron/chromium-130.0.6723.191.tar.xz.2) = 417583932 SHA256 (electron/pulseaudio-16.1.tar.gz) = 027266c62f2a84422ac45fa721a649508f0f1628fb1fd9242315ac54ce2d7c92 SIZE (electron/pulseaudio-16.1.tar.gz) = 2763111 -SHA256 (electron/electron-yarn-cache-33.4.0.tar.xz) = fbfce89a9781eba6a8dc2582fcc979f2cb4adbd95c42a09f595c7dfa45a47fdf -SIZE (electron/electron-yarn-cache-33.4.0.tar.xz) = 32181868 -SHA256 (electron/electron-electron-v33.4.0_GH0.tar.gz) = 4e3aa5a1e31961c62f2b97c105e0a4ef1f3aeceec1f158dd35f3a04557b8dcf3 -SIZE (electron/electron-electron-v33.4.0_GH0.tar.gz) = 14706722 -SHA256 (electron/nodejs-node-v20.18.1_GH0.tar.gz) = e52a6d719db786fffdc7ac3dc623023803336d8ce7a1dd61d9f68bd851d2a921 -SIZE (electron/nodejs-node-v20.18.1_GH0.tar.gz) = 115585611 +SHA256 (electron/electron-yarn-cache-33.4.3.tar.xz) = fbfce89a9781eba6a8dc2582fcc979f2cb4adbd95c42a09f595c7dfa45a47fdf +SIZE (electron/electron-yarn-cache-33.4.3.tar.xz) = 32181868 +SHA256 (electron/electron-electron-v33.4.3_GH0.tar.gz) = 66fecb1b4420e7ade252027e44a32fdf0fe7267b91707b293b4fe991e2482c8a +SIZE (electron/electron-electron-v33.4.3_GH0.tar.gz) = 14847331 +SHA256 (electron/nodejs-node-v20.18.3_GH0.tar.gz) = a2049a1607fbc5b9ec4336d9d04faeeb9b8efdc9ec853e8ddf7cf419be9dbb3d +SIZE (electron/nodejs-node-v20.18.3_GH0.tar.gz) = 115601859 SHA256 (electron/nodejs-nan-e14bdcd1f72d62bca1d541b66da43130384ec213_GH0.tar.gz) = 02edf8d5b3fef9af94d8a1355da60564a57e7f2c99cb422bce042400607ed2eb SIZE (electron/nodejs-nan-e14bdcd1f72d62bca1d541b66da43130384ec213_GH0.tar.gz) = 180646 SHA256 (electron/Squirrel-Squirrel.Mac-0e5d146ba13101a1302d59ea6e6e0b3cace4ae38_GH0.tar.gz) = f4ebb40a8d85dbb7ef02aa0571b2f8e22182c6d73b6992484a53c90047779d01 SIZE (electron/Squirrel-Squirrel.Mac-0e5d146ba13101a1302d59ea6e6e0b3cace4ae38_GH0.tar.gz) = 2112918 SHA256 (electron/ReactiveCocoa-ReactiveObjC-74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76_GH0.tar.gz) = 88e65f116c7a06fccedb43970fba63080a57a4e5dc29147d2cdfe1ee58dd0546 SIZE (electron/ReactiveCocoa-ReactiveObjC-74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76_GH0.tar.gz) = 1136238 SHA256 (electron/Mantle-Mantle-78d3966b3c331292ea29ec38661b25df0a245948_GH0.tar.gz) = a365df6d83e0be3cc000b70bd39734d80c28f0d9983ebe44698337a2ca464bb1 SIZE (electron/Mantle-Mantle-78d3966b3c331292ea29ec38661b25df0a245948_GH0.tar.gz) = 62962 SHA256 (electron/EngFlow-reclient-configs-955335c30a752e9ef7bff375baab5e0819b6c00d_GH0.tar.gz) = c148f76220fc41a89ffeaf370c2cc175577be184688b12aa6fec5f8ac6c714c4 SIZE (electron/EngFlow-reclient-configs-955335c30a752e9ef7bff375baab5e0819b6c00d_GH0.tar.gz) = 13014 diff --git a/devel/electron33/files/patch-electron_script_spec-runner.js b/devel/electron33/files/patch-electron_script_spec-runner.js index d96c16be320f..6576a68e4d55 100644 --- a/devel/electron33/files/patch-electron_script_spec-runner.js +++ b/devel/electron33/files/patch-electron_script_spec-runner.js @@ -1,11 +1,11 @@ ---- electron/script/spec-runner.js.orig 2025-01-22 18:19:12 UTC +--- electron/script/spec-runner.js.orig 2025-02-26 12:19:50 UTC +++ electron/script/spec-runner.js -@@ -197,7 +197,7 @@ async function runTestUsingElectron (specDir, testName +@@ -200,7 +200,7 @@ async function runTestUsingElectron (specDir, testName exe = path.resolve(BASE, utils.getElectronExec()); } const runnerArgs = [`electron/${specDir}`, ...unknownArgs.slice(2)]; - if (process.platform === 'linux') { + if (process.platform === 'linux' || process.platform === 'freebsd') { runnerArgs.unshift(path.resolve(__dirname, 'dbus_mock.py'), exe); exe = 'python3'; } diff --git a/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.cc b/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.cc index 918aa6f62a78..f923bb97e8dc 100644 --- a/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.cc +++ b/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.cc @@ -1,77 +1,77 @@ ---- electron/shell/browser/api/electron_api_web_contents.cc.orig 2024-11-27 04:18:00 UTC +--- electron/shell/browser/api/electron_api_web_contents.cc.orig 2025-02-26 12:19:50 UTC +++ electron/shell/browser/api/electron_api_web_contents.cc @@ -155,11 +155,11 @@ #include "ui/base/cocoa/defaults_utils.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "ui/linux/linux_ui.h" #endif -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) #include "ui/aura/window.h" #include "ui/gfx/font_render_params.h" #endif @@ -190,7 +190,7 @@ #include "content/public/browser/plugin_service.h" #endif -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) #include "chrome/browser/hang_monitor/hang_crash_dump.h" // nogncheck #endif -@@ -515,7 +515,7 @@ std::optional GetCursorBlinkInterval( +@@ -518,7 +518,7 @@ std::optional GetCursorBlinkInterval( ui::TextInsertionCaretBlinkPeriodFromDefaults()); if (system_value) return *system_value; -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (auto* linux_ui = ui::LinuxUi::instance()) return linux_ui->GetCursorBlinkInterval(); #elif BUILDFLAG(IS_WIN) -@@ -885,7 +885,7 @@ void WebContents::InitWithSessionAndOptions( +@@ -888,7 +888,7 @@ void WebContents::InitWithSessionAndOptions( accept_languages.pop_back(); prefs->accept_languages = accept_languages; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) // Update font settings. static const gfx::FontRenderParams params( gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); -@@ -2667,13 +2667,13 @@ void WebContents::ForcefullyCrashRenderer() { +@@ -2678,13 +2678,13 @@ void WebContents::ForcefullyCrashRenderer() { content::RenderProcessHost* rph = rwh->GetProcess(); if (rph) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // A generic |CrashDumpHungChildProcess()| is not implemented for Linux. // Instead we send an explicit IPC to crash on the renderer's IO thread. rph->ForceCrash(); #else // Try to generate a crash report for the hung process. -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) CrashDumpHungChildProcess(rph->GetProcess().Handle()); #endif rph->Shutdown(content::RESULT_CODE_HUNG); -@@ -3346,7 +3346,7 @@ void WebContents::Focus() { +@@ -3357,7 +3357,7 @@ void WebContents::Focus() { void WebContents::Focus() { // Focusing on WebContents does not automatically focus the window on macOS // and Linux, do it manually to match the behavior on Windows. -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (owner_window()) owner_window()->Focus(true); #endif -@@ -4222,7 +4222,7 @@ ui::ImageModel WebContents::GetDevToolsWindowIcon() { +@@ -4233,7 +4233,7 @@ ui::ImageModel WebContents::GetDevToolsWindowIcon() { } #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) void WebContents::GetDevToolsWindowWMClass(std::string* name, std::string* class_name) { *class_name = Browser::Get()->GetName(); diff --git a/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.h b/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.h index ac277a65d9cd..d199bbc849f4 100644 --- a/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.h +++ b/devel/electron33/files/patch-electron_shell_browser_api_electron__api__web__contents.h @@ -1,11 +1,11 @@ ---- electron/shell/browser/api/electron_api_web_contents.h.orig 2025-02-05 15:28:01 UTC +--- electron/shell/browser/api/electron_api_web_contents.h.orig 2025-02-26 12:19:50 UTC +++ electron/shell/browser/api/electron_api_web_contents.h -@@ -772,7 +772,7 @@ class WebContents final : public ExclusiveAccessContex +@@ -770,7 +770,7 @@ class WebContents final : public ExclusiveAccessContex #if defined(TOOLKIT_VIEWS) && !BUILDFLAG(IS_MAC) ui::ImageModel GetDevToolsWindowIcon() override; #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) void GetDevToolsWindowWMClass(std::string* name, std::string* class_name) override; #endif diff --git a/devel/electron33/files/patch-electron_shell_browser_electron__browser__main__parts.cc b/devel/electron33/files/patch-electron_shell_browser_electron__browser__main__parts.cc index 3fa5da967b43..e56067566439 100644 --- a/devel/electron33/files/patch-electron_shell_browser_electron__browser__main__parts.cc +++ b/devel/electron33/files/patch-electron_shell_browser_electron__browser__main__parts.cc @@ -1,84 +1,84 @@ ---- electron/shell/browser/electron_browser_main_parts.cc.orig 2024-10-22 02:29:46 UTC +--- electron/shell/browser/electron_browser_main_parts.cc.orig 2025-02-26 12:19:50 UTC +++ electron/shell/browser/electron_browser_main_parts.cc @@ -76,7 +76,7 @@ #include "ui/wm/core/wm_state.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/environment.h" #include "chrome/browser/ui/views/dark_mode_manager_linux.h" #include "device/bluetooth/bluetooth_adapter_factory.h" @@ -129,7 +129,7 @@ namespace { namespace { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) class LinuxUiGetterImpl : public ui::LinuxUiGetter { public: LinuxUiGetterImpl() = default; @@ -209,7 +209,7 @@ int ElectronBrowserMainParts::PreEarlyInitialization() #if BUILDFLAG(IS_POSIX) HandleSIGCHLD(); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) DetectOzonePlatform(); ui::OzonePlatform::PreEarlyInitialization(); #endif -@@ -299,7 +299,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { +@@ -300,7 +300,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { // happen before the ResourceBundle is loaded if (locale.empty()) l10n_util::OverrideLocaleWithCocoaLocale(); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // l10n_util::GetApplicationLocaleInternal uses g_get_language_names(), // which keys off of getenv("LC_ALL"). // We must set this env first to make ui::ResourceBundle accept the custom -@@ -330,7 +330,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { +@@ -331,7 +331,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { ElectronBrowserClient::SetApplicationLocale(app_locale); fake_browser_process_->SetApplicationLocale(app_locale); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Reset to the original LC_ALL since we should not be changing it. if (!locale.empty()) { if (lc_all) -@@ -390,7 +390,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() { +@@ -391,7 +391,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() { } void ElectronBrowserMainParts::ToolkitInitialized() { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto* linux_ui = ui::GetDefaultLinuxUi(); CHECK(linux_ui); linux_ui_getter_ = std::make_unique(); -@@ -496,7 +496,7 @@ void ElectronBrowserMainParts::PostCreateMainMessageLo +@@ -497,7 +497,7 @@ void ElectronBrowserMainParts::PostCreateMainMessageLo } void ElectronBrowserMainParts::PostCreateMainMessageLoop() { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_BSD) std::string app_name = electron::Browser::Get()->GetName(); #endif #if BUILDFLAG(IS_LINUX) -@@ -508,7 +508,9 @@ void ElectronBrowserMainParts::PostCreateMainMessageLo +@@ -509,7 +509,9 @@ void ElectronBrowserMainParts::PostCreateMainMessageLo if (!bluez::BluezDBusManager::IsInitialized()) bluez::DBusBluezManagerWrapperLinux::Initialize(); +#endif +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Set up crypt config. This needs to be done before anything starts the // network service, as the raw encryption key needs to be shared with the // network service for encrypted cookie storage. -@@ -609,7 +611,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun( +@@ -610,7 +612,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun( fake_browser_process_->PostMainMessageLoopRun(); content::DevToolsAgentHost::StopRemoteDebuggingPipeHandler(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) ui::OzonePlatform::GetInstance()->PostMainMessageLoopRun(); #endif } diff --git a/devel/electron33/files/patch-electron_shell_browser_javascript__environment.cc b/devel/electron33/files/patch-electron_shell_browser_javascript__environment.cc new file mode 100644 index 000000000000..5d54f349d6d9 --- /dev/null +++ b/devel/electron33/files/patch-electron_shell_browser_javascript__environment.cc @@ -0,0 +1,11 @@ +--- electron/shell/browser/javascript_environment.cc.orig 2025-03-05 11:51:09 UTC ++++ electron/shell/browser/javascript_environment.cc +@@ -93,7 +93,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop + auto* cmd = base::CommandLine::ForCurrentProcess(); + // --js-flags. + std::string js_flags = "--no-freeze-flags-after-init "; +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // See https://issues.chromium.org/issues/378017037 - fixed in M134. + js_flags.append("--nodecommit_pooled_pages "); + #endif diff --git a/devel/electron33/files/patch-electron_shell_browser_native__window__views.cc b/devel/electron33/files/patch-electron_shell_browser_native__window__views.cc index 41003d1a94f6..498e1cc31c78 100644 --- a/devel/electron33/files/patch-electron_shell_browser_native__window__views.cc +++ b/devel/electron33/files/patch-electron_shell_browser_native__window__views.cc @@ -1,200 +1,200 @@ ---- electron/shell/browser/native_window_views.cc.orig 2024-11-27 04:18:00 UTC +--- electron/shell/browser/native_window_views.cc.orig 2025-02-26 12:19:50 UTC +++ electron/shell/browser/native_window_views.cc @@ -49,7 +49,7 @@ #include "ui/wm/core/shadow_types.h" #include "ui/wm/core/window_util.h" -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/strings/string_util.h" #include "shell/browser/browser.h" #include "shell/browser/linux/unity_service.h" @@ -293,7 +293,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: params.parent = parent->GetNativeWindow(); params.native_widget = new ElectronDesktopNativeWidgetAura(this); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) std::string name = Browser::Get()->GetName(); // Set WM_WINDOW_ROLE. params.wm_role_name = "browser-window"; @@ -319,7 +319,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: std::string window_type; options.Get(options::kType, &window_type); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. bool use_dark_theme = false; if (options.Get(options::kDarkTheme, &use_dark_theme) && use_dark_theme) { @@ -421,7 +421,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: if (window) window->AddPreTargetHandler(this); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // On linux after the widget is initialized we might have to force set the // bounds if the bounds are smaller than the current display SetBounds(gfx::Rect(GetPosition(), bounds.size()), false); @@ -457,7 +457,7 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool us } void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (IsX11()) { const std::string color = use_dark_theme ? "dark" : "light"; auto* connection = x11::Connection::Get(); @@ -519,7 +519,7 @@ void NativeWindowViews::Show() { NotifyWindowShow(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (global_menu_bar_) global_menu_bar_->OnWindowMapped(); @@ -535,7 +535,7 @@ void NativeWindowViews::ShowInactive() { NotifyWindowShow(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (global_menu_bar_) global_menu_bar_->OnWindowMapped(); @@ -554,7 +554,7 @@ void NativeWindowViews::Hide() { NotifyWindowHide(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (global_menu_bar_) global_menu_bar_->OnWindowUnmapped(); #endif @@ -585,7 +585,7 @@ bool NativeWindowViews::IsEnabled() const { bool NativeWindowViews::IsEnabled() const { #if BUILDFLAG(IS_WIN) return ::IsWindowEnabled(GetAcceleratedWidget()); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (IsX11()) return !event_disabler_.get(); NOTIMPLEMENTED(); @@ -641,7 +641,7 @@ void NativeWindowViews::SetEnabledInternal(bool enable #endif } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) void NativeWindowViews::Maximize() { if (IsVisible()) { widget()->Maximize(); -@@ -781,7 +781,7 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bou +@@ -790,7 +790,7 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bou } #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // On Linux and Windows the minimum and maximum size should be updated with // window size when window is not resizable. if (!resizable_) { -@@ -1039,7 +1039,7 @@ bool NativeWindowViews::IsClosable() const { +@@ -1048,7 +1048,7 @@ bool NativeWindowViews::IsClosable() const { return false; } return !(info.fState & MFS_DISABLED); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return true; #endif } -@@ -1079,7 +1079,7 @@ void NativeWindowViews::Center() { +@@ -1088,7 +1088,7 @@ void NativeWindowViews::Center() { // for now to avoid breaking API contract, but should consider the long // term plan for this aligning with upstream. void NativeWindowViews::Center() { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) auto display = display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeWindow()); gfx::Rect window_bounds_in_screen = display.work_area(); -@@ -1302,7 +1302,7 @@ void NativeWindowViews::SetMenu(ElectronMenuModel* men +@@ -1311,7 +1311,7 @@ void NativeWindowViews::SetMenu(ElectronMenuModel* men } void NativeWindowViews::SetMenu(ElectronMenuModel* menu_model) { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Remove global menu bar. if (global_menu_bar_ && menu_model == nullptr) { global_menu_bar_.reset(); -@@ -1357,7 +1357,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* +@@ -1366,7 +1366,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* void NativeWindowViews::SetParentWindow(NativeWindow* parent) { NativeWindow::SetParentWindow(parent); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (IsX11()) { auto* connection = x11::Connection::Get(); connection->SetProperty( -@@ -1403,7 +1403,7 @@ void NativeWindowViews::SetProgressBar(double progress +@@ -1412,7 +1412,7 @@ void NativeWindowViews::SetProgressBar(double progress NativeWindow::ProgressState state) { #if BUILDFLAG(IS_WIN) taskbar_host_.SetProgressBar(GetAcceleratedWidget(), progress, state); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (unity::IsRunning()) { unity::SetProgressFraction(progress); } -@@ -1474,7 +1474,7 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() con +@@ -1483,7 +1483,7 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() con } bool NativeWindowViews::IsVisibleOnAllWorkspaces() const { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (IsX11()) { // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to // determine whether the current window is visible on all workspaces. -@@ -1497,7 +1497,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopM +@@ -1506,7 +1506,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopM #if BUILDFLAG(IS_WIN) window_handle = reinterpret_cast(accelerated_widget); -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) window_handle = static_cast(accelerated_widget); #endif aura::WindowTreeHost* const host = -@@ -1595,7 +1595,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HIC +@@ -1604,7 +1604,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HIC SendMessage(hwnd, WM_SETICON, ICON_BIG, reinterpret_cast(app_icon_.get())); } -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) void NativeWindowViews::SetIcon(const gfx::ImageSkia& icon) { auto* tree_host = views::DesktopWindowTreeHostLinux::GetHostForWidget( GetAcceleratedWidget()); -@@ -1691,7 +1691,7 @@ bool NativeWindowViews::CanMinimize() const { +@@ -1700,7 +1700,7 @@ bool NativeWindowViews::CanMinimize() const { bool NativeWindowViews::CanMinimize() const { #if BUILDFLAG(IS_WIN) return minimizable_; -#elif BUILDFLAG(IS_LINUX) +#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) return true; #endif } -@@ -1747,7 +1747,7 @@ void NativeWindowViews::HandleKeyboardEvent( +@@ -1756,7 +1756,7 @@ void NativeWindowViews::HandleKeyboardEvent( if (widget_destroyed_) return; -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (event.windows_key_code == ui::VKEY_BROWSER_BACK) NotifyWindowExecuteAppCommand(kBrowserBackward); else if (event.windows_key_code == ui::VKEY_BROWSER_FORWARD) -@@ -1766,7 +1766,7 @@ void NativeWindowViews::OnMouseEvent(ui::MouseEvent* e +@@ -1775,7 +1775,7 @@ void NativeWindowViews::OnMouseEvent(ui::MouseEvent* e // Alt+Click should not toggle menu bar. root_view_.ResetAltState(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) if (event->changed_button_flags() == ui::EF_BACK_MOUSE_BUTTON) NotifyWindowExecuteAppCommand(kBrowserBackward); else if (event->changed_button_flags() == ui::EF_FORWARD_MOUSE_BUTTON) diff --git a/devel/electron33/files/patch-electron_shell_common_api_electron__bindings.cc b/devel/electron33/files/patch-electron_shell_common_api_electron__bindings.cc index 40748364fcd4..1c8d9e37600b 100644 --- a/devel/electron33/files/patch-electron_shell_common_api_electron__bindings.cc +++ b/devel/electron33/files/patch-electron_shell_common_api_electron__bindings.cc @@ -1,11 +1,11 @@ ---- electron/shell/common/api/electron_bindings.cc.orig 2024-10-22 02:29:46 UTC +--- electron/shell/common/api/electron_bindings.cc.orig 2025-02-26 12:19:50 UTC +++ electron/shell/common/api/electron_bindings.cc -@@ -254,7 +254,7 @@ void ElectronBindings::DidReceiveMemoryDump( +@@ -253,7 +253,7 @@ void ElectronBindings::DidReceiveMemoryDump( if (target_pid == dump.pid()) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); const auto& osdump = dump.os_dump(); -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD) dict.Set("residentSet", osdump.resident_set_kb); #endif dict.Set("private", osdump.private_footprint_kb); diff --git a/devel/electron33/files/patch-electron_spec_api-browser-window-spec.ts b/devel/electron33/files/patch-electron_spec_api-browser-window-spec.ts index 02bbad7c373a..8f708facec2e 100644 --- a/devel/electron33/files/patch-electron_spec_api-browser-window-spec.ts +++ b/devel/electron33/files/patch-electron_spec_api-browser-window-spec.ts @@ -1,173 +1,173 @@ ---- electron/spec/api-browser-window-spec.ts.orig 2025-01-22 18:19:12 UTC +--- electron/spec/api-browser-window-spec.ts.orig 2025-02-26 12:19:50 UTC +++ electron/spec/api-browser-window-spec.ts @@ -69,7 +69,7 @@ describe('BrowserWindow module', () => { }).not.to.throw(); }); - ifit(process.platform === 'linux')('does not crash when setting large window icons', async () => { + ifit(process.platform === 'linux' || process.platform === 'freebsd')('does not crash when setting large window icons', async () => { const appPath = path.join(fixtures, 'apps', 'xwindow-icon'); const appProcess = childProcess.spawn(process.execPath, [appPath]); await once(appProcess, 'exit'); @@ -1131,7 +1131,7 @@ describe('BrowserWindow module', () => { describe('BrowserWindow.minimize()', () => { // TODO(codebytere): Enable for Linux once maximize/minimize events work in CI. - ifit(process.platform !== 'linux')('should not be visible when the window is minimized', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('should not be visible when the window is minimized', async () => { const minimize = once(w, 'minimize'); w.minimize(); await minimize; @@ -1148,7 +1148,7 @@ describe('BrowserWindow module', () => { }); // TODO(dsanders11): Enable for Linux once CI plays nice with these kinds of tests - ifit(process.platform !== 'linux')('should not restore maximized windows', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('should not restore maximized windows', async () => { const maximize = once(w, 'maximize'); const shown = once(w, 'show'); w.maximize(); @@ -1213,7 +1213,7 @@ describe('BrowserWindow module', () => { expect(w.isFocused()).to.equal(true); }); - ifit(process.platform !== 'linux')('acquires focus status from the other windows', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('acquires focus status from the other windows', async () => { const w1 = new BrowserWindow({ show: false }); const w2 = new BrowserWindow({ show: false }); const w3 = new BrowserWindow({ show: false }); @@ -1314,7 +1314,7 @@ describe('BrowserWindow module', () => { expect(w.isFocused()).to.equal(false); }); - ifit(process.platform !== 'linux')('transfers focus status to the next window', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('transfers focus status to the next window', async () => { const w1 = new BrowserWindow({ show: false }); const w2 = new BrowserWindow({ show: false }); const w3 = new BrowserWindow({ show: false }); @@ -1773,7 +1773,7 @@ describe('BrowserWindow module', () => { }); }); - ifdescribe(process.platform !== 'linux')('Maximized state', () => { + ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('Maximized state', () => { it('checks normal bounds when maximized', async () => { const bounds = w.getBounds(); const maximize = once(w, 'maximize'); @@ -1983,7 +1983,7 @@ describe('BrowserWindow module', () => { }); }); - ifdescribe(process.platform !== 'linux')('Minimized state', () => { + ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('Minimized state', () => { it('checks normal bounds when minimized', async () => { const bounds = w.getBounds(); const minimize = once(w, 'minimize'); @@ -2946,7 +2946,7 @@ describe('BrowserWindow module', () => { describe('BrowserWindow.setOpacity(opacity)', () => { afterEach(closeAllWindows); - ifdescribe(process.platform !== 'linux')(('Windows and Mac'), () => { + ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')(('Windows and Mac'), () => { it('make window with initial opacity', () => { const w = new BrowserWindow({ show: false, opacity: 0.5 }); expect(w.getOpacity()).to.equal(0.5); @@ -2972,7 +2972,7 @@ describe('BrowserWindow module', () => { }); }); - ifdescribe(process.platform === 'linux')(('Linux'), () => { + ifdescribe(process.platform === 'linux' || process.platform === 'freebsd')(('Linux'), () => { it('sets 1 regardless of parameter', () => { const w = new BrowserWindow({ show: false }); w.setOpacity(0); @@ -3183,7 +3183,7 @@ describe('BrowserWindow module', () => { expect(overlayRectPreMax.height).to.equal(size); // 'maximize' event is not emitted on Linux in CI. - if (process.platform !== 'linux' && !w.isMaximized()) { + if ((process.platform !== 'linux' && process.platform !== 'freebsd') && !w.isMaximized()) { const maximize = once(w, 'maximize'); w.show(); w.maximize(); @@ -3249,7 +3249,7 @@ describe('BrowserWindow module', () => { expect(preMaxHeight).to.equal(size); // 'maximize' event is not emitted on Linux in CI. - if (process.platform !== 'linux' && !w.isMaximized()) { + if ((process.platform !== 'linux' && process.platform !== 'freebsd') && !w.isMaximized()) { const maximize = once(w, 'maximize'); w.show(); w.maximize(); @@ -3914,7 +3914,7 @@ describe('BrowserWindow module', () => { expect(test.nodeTimers).to.equal(true); expect(test.nodeUrl).to.equal(true); - if (process.platform === 'linux' && test.osSandbox) { + if ((process.platform === 'linux' || process.platform === 'freebsd') && test.osSandbox) { expect(test.creationTime).to.be.null('creation time'); expect(test.systemMemoryInfo).to.be.null('system memory info'); } else { @@ -4419,7 +4419,7 @@ describe('BrowserWindow module', () => { }); }); - ifdescribe(process.platform !== 'linux')('max/minimize events', () => { + ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('max/minimize events', () => { afterEach(closeAllWindows); it('emits an event when window is maximized', async () => { const w = new BrowserWindow({ show: false }); @@ -4690,7 +4690,7 @@ describe('BrowserWindow module', () => { // TODO(zcbenz): // This test does not run on Linux CI. See: // https://github.com/electron/electron/issues/28699 - ifit(process.platform === 'linux' && !process.env.CI)('should bring a minimized maximized window back to maximized state', async () => { + ifit((process.platform === 'linux' || process.platform === 'freebsd') && !process.env.CI)('should bring a minimized maximized window back to maximized state', async () => { const w = new BrowserWindow({}); const maximize = once(w, 'maximize'); w.maximize(); @@ -4707,7 +4707,7 @@ describe('BrowserWindow module', () => { }); // TODO(dsanders11): Enable once maximize event works on Linux again on CI - ifdescribe(process.platform !== 'linux')('BrowserWindow.maximize()', () => { + ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('BrowserWindow.maximize()', () => { afterEach(closeAllWindows); it('should show the window if it is not currently shown', async () => { const w = new BrowserWindow({ show: false }); @@ -4744,7 +4744,7 @@ describe('BrowserWindow module', () => { // TODO(dsanders11): Enable once minimize event works on Linux again. // See https://github.com/electron/electron/issues/28699 - ifit(process.platform !== 'linux')('should not restore a minimized window', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('should not restore a minimized window', async () => { const w = new BrowserWindow(); const minimize = once(w, 'minimize'); w.minimize(); @@ -5218,7 +5218,7 @@ describe('BrowserWindow module', () => { }); // On Linux there is no "resizable" property of a window. - ifit(process.platform !== 'linux')('does affect maximizability when disabled and enabled', () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('does affect maximizability when disabled and enabled', () => { const w = new BrowserWindow({ show: false }); expect(w.resizable).to.be.true('resizable'); @@ -5357,7 +5357,7 @@ describe('BrowserWindow module', () => { }); }); - ifdescribe(process.platform !== 'linux')('window states (excluding Linux)', () => { + ifdescribe(process.platform !== 'linux' && process.platform !== 'freebsd')('window states (excluding Linux)', () => { // Not implemented on Linux. afterEach(closeAllWindows); -@@ -6570,7 +6570,7 @@ describe('BrowserWindow module', () => { +@@ -6571,7 +6571,7 @@ describe('BrowserWindow module', () => { describe('"transparent" option', () => { afterEach(closeAllWindows); - ifit(process.platform !== 'linux')('correctly returns isMaximized() when the window is maximized then minimized', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('correctly returns isMaximized() when the window is maximized then minimized', async () => { const w = new BrowserWindow({ frame: false, transparent: true diff --git a/devel/electron33/files/patch-electron_spec_api-utility-process-spec.ts b/devel/electron33/files/patch-electron_spec_api-utility-process-spec.ts index f656d69ed5d7..c26573f1b16b 100644 --- a/devel/electron33/files/patch-electron_spec_api-utility-process-spec.ts +++ b/devel/electron33/files/patch-electron_spec_api-utility-process-spec.ts @@ -1,20 +1,20 @@ ---- electron/spec/api-utility-process-spec.ts.orig 2024-11-27 04:18:00 UTC +--- electron/spec/api-utility-process-spec.ts.orig 2025-02-26 12:19:50 UTC +++ electron/spec/api-utility-process-spec.ts -@@ -453,7 +453,7 @@ describe('utilityProcess module', () => { +@@ -455,7 +455,7 @@ describe('utilityProcess module', () => { expect(output).to.include(result); }); - ifit(process.platform !== 'linux')('can access exposed main process modules from the utility process', async () => { + ifit(process.platform !== 'linux' && process.platform !== 'freebsd')('can access exposed main process modules from the utility process', async () => { const message = 'Message from utility process'; const child = utilityProcess.fork(path.join(fixturesPath, 'expose-main-process-module.js')); await once(child, 'spawn'); -@@ -490,7 +490,7 @@ describe('utilityProcess module', () => { +@@ -492,7 +492,7 @@ describe('utilityProcess module', () => { await closeWindow(w); }); - ifit(process.platform === 'linux')('allows executing a setuid binary with child_process', async () => { + ifit(process.platform === 'linux' || process.platform === 'freebsd')('allows executing a setuid binary with child_process', async () => { const child = utilityProcess.fork(path.join(fixturesPath, 'suid.js')); await once(child, 'spawn'); const [data] = await once(child, 'message'); diff --git a/devel/electron33/files/patch-third__party_electron__node_deps_cares_BUILD.gn b/devel/electron33/files/patch-third__party_electron__node_deps_cares_BUILD.gn index aaeadc0424b5..c42cc0b43a57 100644 --- a/devel/electron33/files/patch-third__party_electron__node_deps_cares_BUILD.gn +++ b/devel/electron33/files/patch-third__party_electron__node_deps_cares_BUILD.gn @@ -1,18 +1,18 @@ ---- third_party/electron_node/deps/cares/BUILD.gn.orig 2024-10-16 06:04:29 UTC +--- third_party/electron_node/deps/cares/BUILD.gn.orig 2025-03-05 11:48:39 UTC +++ third_party/electron_node/deps/cares/BUILD.gn -@@ -159,9 +159,14 @@ static_library("cares") { +@@ -172,9 +172,14 @@ static_library("cares") { defines += [ "HAVE_CONFIG_H" ] } - if (is_linux) { + if (is_linux && !is_bsd) { include_dirs += [ "config/linux" ] sources += [ "config/linux/ares_config.h" ] + } + + if (is_freebsd) { + include_dirs += [ "config/freebsd" ] + sources += [ "config/freebsd/ares_config.h" ] } if (is_mac) { diff --git a/devel/electron33/files/patch-third__party_lzma__sdk_C_CpuArch.c b/devel/electron33/files/patch-third__party_lzma__sdk_C_CpuArch.c index e5faa231f03f..2ff4e154026b 100644 --- a/devel/electron33/files/patch-third__party_lzma__sdk_C_CpuArch.c +++ b/devel/electron33/files/patch-third__party_lzma__sdk_C_CpuArch.c @@ -1,44 +1,37 @@ ---- third_party/lzma_sdk/C/CpuArch.c.orig 2022-09-04 11:56:14 UTC +--- third_party/lzma_sdk/C/CpuArch.c.orig 2025-03-08 14:05:07 UTC +++ third_party/lzma_sdk/C/CpuArch.c -@@ -412,12 +412,40 @@ BoolInt CPU_IsSupported_SHA1(void) { return APPLE_CRYP +@@ -854,6 +854,34 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP BoolInt CPU_IsSupported_SHA2(void) { return APPLE_CRYPTO_SUPPORT_VAL; } BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } +#elif defined(__OpenBSD__) - ++ +#include +#include +#include +#include + +BoolInt CPU_IsSupported_NEON() { return 1; } + +#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \ + BoolInt CPU_IsSupported_ ## name1() { \ + int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 }; \ + size_t len = sizeof(uint64_t); \ + uint64_t cpu_id = 0; \ + if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) < 0) \ + return 0; \ + if (ID_AA64ISAR0_ ## name2(cpu_id) >= ID_AA64ISAR0_## name2 ##_BASE) \ + return 1; \ + return 0; \ + } + +#define MY_HWCAP_CHECK_FUNC(name) \ + MY_HWCAP_CHECK_FUNC_2(name, name) + +MY_HWCAP_CHECK_FUNC (CRC32) +MY_HWCAP_CHECK_FUNC (SHA1) +MY_HWCAP_CHECK_FUNC (SHA2) +MY_HWCAP_CHECK_FUNC (AES) -+ - #else // __APPLE__ - - #include --#if !defined(ARMV8_OS_FUCHSIA) -+#if !defined(ARMV8_OS_FUCHSIA) && !defined(__FreeBSD__) - #define USE_HWCAP - #endif // !defined(ARMV8_OS_FUCHSIA) + #else // __APPLE__