## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## RPMAUTOSPEC: autochangelog ## END: Set by rpmautospec ## ELECTRON README # This spec file is based on chromium.spec, as Electron is based on # Chromium. To keep things maintainable, the Electron version attempts # to track the chromium version released in Fedora where possible, and # the changes in this file are bracketed in `## ELECTRON` and `## END # ELECTRON` comments. Updates to the underlying Chromium version can # be achieved by merging in the changes to chromium.spec, or by # manually re-applying the Electron changes to the new Chromium spec. ## END ELECTRON # macro for el10 minor version %if 0%{?rhel} == 10 %global rhel_minor_version %(echo %{dist} | sed -n 's/.*el10_\\([0-9]\\+\\).*/\\1/p') %endif # Fix installation issue caused by the hard link in locales %define __os_install_post_hardlink %{nil} %define _lto_cflags %{nil} %global _default_patch_fuzz 2 # enable|disable system build flags %global system_build_flags 0 %global numjobs %{_smp_build_ncpus} # official builds have less debugging and go faster... but we have to shut some things off. %global official_build 1 # enable|disble use_custom_libcxx %global use_custom_libcxx 0 %if 0%{?rhel} # no libcxx in el %global use_custom_libcxx 1 %endif # enable|disble bootstrap %global bootstrap 0 # workaround for old gn on el9, it causes build error: unknown function filter_labels_include() %if 0%{?rhel} == 9 %global bootstrap 1 %endif # Fancy build status, so we at least know, where we are.. # %1 where # %2 what %global build_target() \ export NINJA_STATUS="[%2:%f/%t] " ; \ ninja -j %{numjobs} -C '%1' '%2' # enable|disable chrome_management_service %global build_chrome_management_service 1 %if 0%{?flatpak} %global build_chrome_management_service 0 %endif # enable|disable chromedriver %global build_chromedriver 1 %if 0%{?flatpak} %global build_chromedriver 0 %endif # enable|disable headless client build %global build_headless 1 %if 0%{?flatpak} %global build_headless 0 %endif # set nodejs_version %global nodejs_version v22.22.0 ## ELECTRON # Electron version %global electron_version 43.2.0 # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json %define abi_version 148 %global electron_path %{_libdir}/electron ## END ELECTRON %global system_nodejs 1 # RHEL 9 needs newer nodejs %if 0%{?rhel} == 9 %global system_nodejs 0 %endif ## ELECTRON # Electron has not been ported to GTK4; build with GTK3. # https://github.com/electron/electron/issues/33690 # https://github.com/electron/electron/issues/48580 %global gtk_version 3 %if 0 ## END ELECTRON # enable gtk4 for fedora and el>9 %global gtk_version 4 %if 0%{?rhel} == 9 %global gtk_version 3 %endif ## ELECTRON %endif ## END ELECTRON %if 0%{?rhel} == 8 %global chromium_pybin /usr/bin/python3.9 %else %global chromium_pybin %{__python3} %endif # va-api only supported in rhel >= 9 and fedora %global use_vaapi 1 # v4l2_codec only enable for fedora aarch64 %global use_v4l2_codec 0 # libva is too old on el8 %if 0%{?rhel} == 8 %global use_vaapi 0 %endif # enable v4l2 and disable vaapi for aarch64 platform %ifarch aarch64 %if 0%{?fedora} >= 36 %global use_vaapi 0 %global use_v4l2_codec 1 %endif %endif %if 0%{?fedora} >= 40 || 0%{?rhel} >= 9 %global noopenh264 1 %endif # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523 # Disable BTI until this is fixed upstream. %global disable_bti 0 %ifarch aarch64 %if 0%{?fedora} %global optflags %(echo %{optflags} | sed 's/-mbranch-protection=standard /-mbranch-protection=pac-ret /') %global disable_bti 1 %endif %endif # Disabled because of Google, starting with Chromium 88. %global userestrictedapikeys 0 # We can still use the api key though. For now. %global useapikey 1 # Leave this alone, please. %global chromebuilddir out/Release %global headlessbuilddir out/Headless %global remotingbuilddir out/Remoting # enable|disable debuginfo %global enable_debug 1 # disable debuginfo due to a bug in debugedit on el7 # error: canonicalization unexpectedly shrank by one character # https://bugzilla.redhat.com/show_bug.cgi?id=304121 %if ! %{enable_debug} %global debug_package %{nil} %global debug_level 0 %else %global debug_level 1 # workaround for the error empty file debugsource %undefine _debugsource_packages %endif %global chromium_menu_name Chromium %global chromium_path %{_libdir}/chromium-browser %global crd_path %{_libdir}/chrome-remote-desktop # We don't want any libs in these directories to generate Provides # Requires is trickier. ## ELECTRON # To generate this list, go into %%{buildroot}%%{electron_path} and run # for i in `find . -name "*.so" | sort`; do NAME=`basename -s .so $i`; printf "$NAME|"; done # for RHEL7, append libfontconfig to the end # make sure there is not a trailing | at the end of the list # We always filter provides. We only filter Requires when building shared. %global __provides_exclude_from ^(%{electron_path}/.*\\.so|%{electron_path}/.*\\.so.*)$ %global __requires_exclude ^(%{electron_path}/.*\\.so|%{electron_path}/.*\\.so.*)$ ## END ELECTRON # enable|disable control flow integrity support %global cfi 0 %ifarch x86_64 aarch64 %global cfi 1 %endif # enable qt backend %global enable_qt 1 %if %{enable_qt} %if 0%{?rhel} > 9 || 0%{?fedora} > 39 %global use_qt6 1 %global use_qt5 1 %else %global use_qt6 0 %global use_qt5 1 %endif %else %global use_qt6 0 %global use_qt5 0 %endif # bundle re2, jsoncpp, woff2 - build errors with use_custom_libcxx=true %global bundlere2 1 %global bundlejsoncpp 1 %global bundlewoff2 1 %global bundlelibaom 1 %global bundlelibavif 1 %global bundlesnappy 1 %global bundlezstd 1 %global bundleicu 1 %global bundledav1d 1 %global bundlebrotli 1 %global bundlelibwebp 1 %global bundlecrc32c 1 %global bundleharfbuzz 1 %global bundlelibpng 1 %global bundlelibjpeg 1 %global bundlefreetype 1 %global bundlelibdrm 1 %global bundlefontconfig 1 %global bundleffmpegfree 1 %global bundlehighway 1 # openjpeg2, need to update to 2.5.x %global bundlelibopenjpeg2 1 %global bundlelibtiff 1 # libxml2, need to update to 2.14.x for bz#2368923 %global bundlelibxml 1 %global bundlepylibs 0 %global bundlelibxslt 0 %global bundleflac 0 %global bundledoubleconversion 0 %global bundlelibXNVCtrl 0 %global bundlelibusbx 0 %global bundlelibsecret 0 %global bundleopus 0 %global bundlelcms2 0 %global bundlesimdutf 1 # workaround for build error # disable bundleminizip for Fedora > 39 due to switch to minizip-ng # disable bundleminizip for epel and Fedora39 due to old minizip version %global bundleminizip 1 %if 0%{?fedora} || 0%{?rhel} > 8 %global bundlezstd 0 %global bundlefontconfig 0 %global bundledav1d 0 %global bundlelibpng 0 %global bundlelibjpeg 0 %global bundlelibdrm 0 %global bundleffmpegfree 0 %global bundlefreetype 0 %if 0%{?fedora} > 41 || 0%{?rhel} > 10 # require libtiff-4.6.1 or newer, error: use of undeclared identifier 'TIFFOpenOptionsSetMaxCumulatedMemAlloc' %global bundlelibtiff 0 %endif %if 0%{?fedora} %global bundlecrc32c 0 %endif %if 0%{?fedora} || 0%{?rhel} > 9 %global bundlelibopenjpeg2 0 %global bundleharfbuzz 0 %global bundlebrotli 0 %global bundlelibwebp 0 %endif %endif ### From 2013 until early 2021, Google permitted distribution builds of ### Chromium to access Google APIs that added significant features to ### Chromium including, but not limited to, Sync and geolocation. ### As of March 15, 2021, any Chromium builds which pass client_id and/or ### client_secret during build will prevent end-users from signing into their ### Google account. ### With Chromium 88, I have removed the calls to "google_default_client_id" ### and "google_default_client_secret" to comply with their changes. ### Honestly, at this point, you might be better off looking for a different ### FOSS browser. ### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) ### Note: These are for Fedora use ONLY. ### For your own distribution, please get your own set of keys. ### http://lists.debian.org/debian-legal/2013/11/msg00006.html %if %{useapikey} %global api_key AIzaSyDUIXvzVrt5OkVsgXhQ6NFfvWlA44by-aw %else %global api_key %nil %endif %if %{userestrictedapikeys} %global default_client_id 449907151817.apps.googleusercontent.com %global default_client_secret miEreAep8nuvTdvLums6qyLK %global chromoting_client_id 449907151817-8vnlfih032ni8c4jjps9int9t86k546t.apps.googleusercontent.com %else %global default_client_id %nil %global default_client_secret %nil %global chromoting_client_id %nil %endif ## ELECTRON: Package metadata Name: nodejs-electron Version: %{electron_version} Release: 1%{?dist} Summary: Build cross-platform desktop apps with JavaScript, HTML, and CSS Url: https://github.com/electron/electron License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only) # Chromium version pinned by Electron DEPS %global chromium_version 150.0.7871.129 ## END ELECTRON # Use /etc/chromium for initial_prefs Patch1: chromium-115-initial_prefs-etc-path.patch # Try to load widevine from other places Patch8: chromium-117-widevine-other-locations.patch # debian patches # disable font-test Patch20: chromium-disable-font-tests.patch # don't download binary blob Patch21: chromium-123-screen-ai-service.patch # Fix link error when building with system libcxx Patch22: chromium-131-fix-qt-ui.pach # Workaround for build error: ERROR Unresolved dependencies. #//chrome/test:captured_sites_interactive_tests(//build/toolchain/linux/unbundle:default) # needs //third_party/libpng:libpng_for_testonly(//build/toolchain/linux/unbundle:default) Patch23: chromium-143-revert-libpng_for_testonly.patch # disable enterprise_companion_integration_tests due to Unresolved dependencies Patch31: chromium-145-disable-enterprise_companion_integration_tests.patch # patch for using system brotli Patch89: chromium-142-system-brotli.patch # patch for using system libxml Patch90: chromium-121-system-libxml.patch # patch for using system opus Patch91: chromium-108-system-opus.patch # patch for Failed NodeJS version check Patch92: chromium-138-checkversion-nodejs.patch # fix build error Patch93: chromium-141-csss_style_sheet.patch # revert the patch to fix the build error: "ld.lld: error: undefined symbol: __sanitizer_set_death_callback" Patch94: chromium-148-v8-sanitize-build-error.patch # FTBFS - error: cannot find attribute `sanitize` in this scope # --> ../../third_party/crabbyavif/src/src/capi/io.rs:210:41 # | # 210 | #[cfg_attr(feature = "disable_cfi", sanitize(cfi = "off"))] Patch96: chromium-142-crabbyavif-ftbfs-old-rust.patch # system ffmpeg # need for old ffmpeg 5.x on epel9 Patch128: chromium-138-el9-ffmpeg-deprecated-apis.patch Patch129: chromium-el9-ffmpeg-AV_CODEC_FLAG_COPY_OPAQUE.patch Patch130: chromium-148-el9-ffmpeg-build-error.patch # disable the check Patch131: chromium-107-proprietary-codecs.patch # fix tab crash with SIGTRAP error when using system ffmpeg Patch132: chromium-118-sigtrap_system_ffmpeg.patch # need for old ffmpeg 6.0/5.x on epel9 and fedora < 40 Patch133: chromium-142-el9-ffmpeg-5.1.x.patch # revert, it causes build error: use of undeclared identifier 'AVFMT_FLAG_NOH264PARSE' Patch135: chromium-133-disable-H.264-video-parser-during-demuxing.patch # Workaround for youtube stop working Patch136: chromium-133-workaround-system-ffmpeg-whitelist.patch # fatal error: 'third_party/ffmpeg/libavutil/rational.h' file not found Patch137: chromium-147-system-ffmpeg.patch # Workaround for missing AVDynamicHDRSmpte2094App5 in system ffmpeg Patch138: chromium-150-ffmpeg-AVDynamicHDRSmpte2094App5.patch # file conflict with old kernel on el8/el9 Patch141: chromium-118-dma_buf_export_sync_file-conflict.patch # Fix FTBFS with rustc-1.88 on el9 and epel10.1 Patch142: chromium-149-rust-1.88-build-error.patch # fix ftbfs caused by old rustc-1.88 on el9 and 10.1 Patch143: chromium-148-rust-1.88-enable-unstable_features.patch Patch144: chromium-146-rust-1.88-undefined-symbol.patch # Fix FTBFS with python-3.9 on el9 Patch146: chromium-148-el9-python-3.9-build-error.patch # add correct path for Qt6Gui header and libs Patch150: chromium-124-qt6.patch # fix FTBFS caused by missing include file on aarch64/ppc64le Patch300: chromium-145-swiftshader-missing-include.patch # Fix error with llwm < 21 on el9/el10.1/f42: invalid application of 'sizeof' to an incomplete type 'gfx::Transform' Patch302: chromium-145-static_assert.patch # Fix error: invalid suffix 'o666' on integer constant on el9/el10.1/f42 with llvm20 Patch303: chromium-146-ftfs-llvm-octal-notation.patch # Workaround for clang++ crash with llvm-20 on el9/el10.1/f42, clang++: error: clang frontend command failed with exit code 139 Patch304: chromium-146-llvm-crash.patch # disable memory tagging (epel8 on aarch64) due to new feature IFUNC-Resolver # it is not supported in old glibc < 2.30, error: fatal error: 'sys/ifunc.h' file not found Patch305: chromium-124-el8-arm64-memory_tagging.patch Patch306: chromium-127-el8-ifunc-header.patch # workaround for build error due to old atk version on el8 Patch307: chromium-134-el8-atk-compiler-error.patch # Fix build errors due to old clang18 in el8 Patch308: chromium-136-unsupport-clang-flags.patch Patch309: chromium-132-el8-unsupport-rustc-flags.patch # Fix rhbz#2387446, FTBFS with rust-1.89.0 Patch310: chromium-139-rust-FTBFS-suppress-warnings.patch # enable fstack-protector-strong Patch311: chromium-123-fstack-protector-strong.patch # Fix FTBFS: undefined symbol: __rust_no_alloc_shim_is_unstable on EL9 # Error: unsafe attribute used without unsafe # --> ../../build/rust/allocator/lib.rs:107:7 Patch312: chromium-143-el9-rust-no-alloc-shim-is-unstable.patch # old rust version causes build error on el8: # error[E0599]: no method named `is_none_or` found for enum `Option` in the current scope Patch314: chromium-136-rust-skrifa-build-error.patch # error with old rustc Patch315: chromium-145-rustc-ftbfs.patch # llvm <= 22 # clang++: error: unknown argument: '-fno-lifetime-dse' Patch316: chromium-149-clang++-unknown-argument.patch # unknown warning option -Wno-nontrivial-memcall Patch317: chromium-142-clang++-unknown-argument.patch Patch318: memory-allocator-dcheck-assert-fix.patch # compile swiftshader against llvm-16.0 Patch319: chromium-143-swiftshader-llvm-16.0.patch # Fix build error on fedora aarch64 Patch320: chromium-149-aarch64-log-error.patch # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523 # https://bugs.chromium.org/p/chromium/issues/detail?id=1145581#c60 # Disable BTI until this is fixed upstream. Patch352: chromium-117-workaround_for_crash_on_BTI_capable_system.patch # workaround for build error on aarch64 Patch353: chromium-127-aarch64-duplicate-case-value.patch # remove flag split-threshold-for-reg-with-hint, it's not supported in clang <= 17 Patch354: chromium-142-split-threshold-for-reg-with-hint.patch # fix build error: no member named 'hardware_destructive_interference_size' in namespace 'std' Patch355: chromium-130-hardware_destructive_interference_size.patch # fix build error: # ../../build/modules/linux-x64/module.modulemap:11:12: error: header '../../linux/debian_bullseye_amd64-sysroot/usr/include/alloca.h' not found Patch356: chromium-141-use_libcxx_modules.patch # error: no matching member function for call to 'Append' Patch357: chromium-134-type-mismatch-error.patch # set clang_lib path Patch358: chromium-144-rust-clanglib.patch # fix FTBFS with rustc 1.95 Patch359: chromium-148-rust-1.95-bytemuck-ftbfs.patch # PowerPC64 LE support # Timothy Pearson's patchset # https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches Patch360: add-ppc64-architecture-string.patch Patch361: 0001-sandbox-Enable-seccomp_bpf-for-ppc64.patch Patch376: 0001-third_party-angle-Include-missing-header-cstddef-in-.patch Patch377: 0001-Add-PPC64-support-for-boringssl.patch Patch378: 0001-third_party-libvpx-Disable-vsx-on-ppc64.patch Patch379: 0001-third_party-libvpx-Properly-generate-gni-on-ppc64.patch Patch380: 0001-third_party-pffft-Include-altivec.h-on-ppc64-with-SI.patch Patch381: 0002-Add-PPC64-generated-files-for-boringssl.patch Patch382: 0002-third_party-lss-kernel-structs.patch # error: undefined symbol: llvm::MCAsmInfoXCOFF::MCAsmInfoXCOFF() Patch383: 0001-swiftshader-fix-build.patch Patch384: Rtc_base-system-arch.h-PPC.patch Patch386: 0004-third_party-crashpad-port-curl-transport-ppc64.patch Patch387: HACK-third_party-libvpx-use-generic-gnu.patch Patch389: HACK-debian-clang-disable-base-musttail.patch Patch390: HACK-debian-clang-disable-pa-musttail.patch Patch391: 0001-Add-ppc64-target-to-libaom.patch Patch392: 0001-Add-pregenerated-config-for-libaom-on-ppc64.patch Patch393: 0002-third_party-libvpx-Remove-bad-ppc64-config.patch Patch394: 0003-third_party-libvpx-Add-ppc64-generated-config.patch # Enabling VSX causes artifacts to appear in VP9 videos Patch395: 0004-third_party-libvpx-work-around-ambiguous-vsx.patch # Enable VSX acceleration in Skia. Requires POWER8 or higher. Patch396: skia-vsx-instructions.patch Patch397: 0001-Implement-support-for-ppc64-on-Linux.patch Patch398: 0001-Implement-support-for-PPC64-on-Linux.patch Patch399: 0001-Force-baseline-POWER8-AltiVec-VSX-CPU-features-when-.patch Patch401: fix-rustc.patch Patch402: fix-rust-linking.patch Patch403: fix-breakpad-compile.patch Patch404: fix-partition-alloc-compile.patch Patch405: fix-study-crash.patch Patch407: fix-different-data-layouts.patch Patch408: 0002-Add-ppc64-trap-instructions.patch Patch409: fix-page-allocator-overflow.patch Patch410: 0001-Enable-ppc64-pointer-compression.patch Patch411: dawn-fix-ppc64le-detection.patch Patch412: add-ppc64-architecture-to-extensions.diff # Suppress harmless compiler warning messages that appear on ppc64 due to arch-specific warning flags being passed Patch413: fix-unknown-warning-option-messages.diff Patch415: add-ppc64-pthread-stack-size.patch Patch417: 0001-add-xnn-ppc64el-support.patch Patch418: 0002-regenerate-xnn-buildgn.patch Patch419: 0009-sandbox-ignore-byte-span-error.patch Patch420: 0005-blink-add-audio-vector-support.patch # Fix FTBSF with kernel-7.2.0 (fedora 45 and rhel-11) Patch450: chromium-150-pt_regs-kernel-7.2.0.patch # flatpak sandbox patches from # https://github.com/flathub/org.chromium.Chromium/tree/master/patches/chromium Patch500: flatpak-Add-initial-sandbox-support.patch Patch501: flatpak-Adjust-paths-for-the-sandbox.patch Patch502: flatpak-Expose-Widevine-into-the-sandbox.patch # nodejs patches %if ! %{system_nodejs} Patch510: 0001-Remove-unused-OpenSSL-config.patch Patch511: 0001-fips-disable-options.patch %endif # Patches from ungoogle chromium, https://github.com/ungoogled-software/ungoogled-chromium # remove rollup binary, build with wasm-rollup Patch520: build-with-wasm-rollup.patch Patch521: disable-ai.patch # Upstream patches Patch600: chromium-150-sysroot.patch Patch601: chromium-150-Omit-ar-from-inputs-when-resolved-via-PATH.patch Patch602: chromium-150-Fix-get_path_info-on-empty-ar-in-unbundle-toolchain.patch # Darkmode Patch603: chromium-150-Add-AutoDarkModeSkipImages-flag-to-bypass-image-dark-mode.patch Patch604: chromium-150-Make-dark-mode-apply-filter-to-images-irrespective-of-layout-zoom.patch Patch605: chromium-150-Use-64px-css-pixels-absolute-threshold-for-dark-image-classification.patch Patch606: chromium-150-Add-size-threshold-for-classifying-SVG-documents-for-auto-dark-mode.patch Patch607: chromium-150-Add-AutoDarkModeSVGSizeThreshold-kill-switch-flag.patch ## ELECTRON: patches Patch700: system-zstd-in-node.patch Patch701: system-ffmpeg.patch Patch702: reduce-gn-tree.patch ## END ELECTRON # Use chromium-latest.py to generate clean tarball from released build tarballs, found here: # http://build.chromium.org/buildbot/official/ # For Chromium Fedora use chromium-latest.py --stable --ffmpegclean --ffmpegarm # If you want to include the ffmpeg arm sources append the --ffmpegarm switch # https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%%{version}.tar.xz ## ELECTRON: Use %%{chromium_version} for tarball name Source0: chromium-%{chromium_version}-clean.tar.xz ## END ELECTRON Source1: README.fedora Source2: chromium.conf Source3: chromium-browser.sh Source4: chromium-browser.desktop # Also, only used if you want to reproduce the clean tarball. Source5: clean_ffmpeg.sh Source6: chromium-latest.py Source7: get_free_ffmpeg_source_files.py # Get the names of all tests (gtests) for Linux # Usage: get_linux_tests_name.py chromium-%%{version} --spec Source8: get_linux_tests_names.py # GNOME stuff Source9: chromium-browser.xml Source10: chromium-browser.appdata.xml Source11: master_preferences %if ! %{system_nodejs} # nodejs bundles openssl, but we use the system version in el9 # because openssl contains prohibited code, we remove openssl completely from # the tarball, using the script in Source13 # http://nodejs.org/dist/v${version}/node-${nodejs_version}.tar.gz Source12: node-%{nodejs_version}-stripped.tar.gz Source13: nodejs-sources.sh BuildRequires: openssl-devel %endif ## ELECTRON: overlay source (extracted on top of Chromium in %%prep) Source20: electron-%{electron_version}.tar.zst Source21: electron-sources.sh # RPM macros for building electron native module packages (installed in %%install) Source22: macros.electron ## END ELECTRON BuildRequires: clang BuildRequires: clang-tools-extra BuildRequires: llvm BuildRequires: lld %if ! %{use_custom_libcxx} BuildRequires: libcxx-devel %endif %if 0%{?rhel} && 0%{?rhel} <= 9 BuildRequires: gcc-toolset-14-libatomic-devel %endif BuildRequires: rustc BuildRequires: rustfmt BuildRequires: bindgen-cli %if ! %{bundlezstd} BuildRequires: libzstd-devel %endif # build with system ffmpeg-free %if ! %{bundleffmpegfree} BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavfilter) BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavutil) %endif %if 0%{?noopenh264} BuildRequires: pkgconfig(openh264) %endif # build with system libaom %if ! %{bundlelibaom} BuildRequires: libaom-devel %endif BuildRequires: alsa-lib-devel BuildRequires: atk-devel BuildRequires: bison BuildRequires: cups-devel BuildRequires: dbus-devel BuildRequires: desktop-file-utils BuildRequires: expat-devel BuildRequires: flex BuildRequires: fontconfig-devel BuildRequires: glib2-devel BuildRequires: glibc-devel BuildRequires: gperf %if %{use_qt5} BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Widgets) %endif %if %{use_qt6} BuildRequires: pkgconfig(Qt6Core) BuildRequires: pkgconfig(Qt6Widgets) %endif BuildRequires: compiler-rt %if ! %{bundleharfbuzz} BuildRequires: harfbuzz-devel >= 2.4.0 %endif BuildRequires: libatomic BuildRequires: libcap-devel BuildRequires: libcurl-devel %if ! %{bundlelibdrm} BuildRequires: libdrm-devel %endif BuildRequires: libgcrypt-devel BuildRequires: libudev-devel BuildRequires: libuuid-devel %if 0%{?fedora} >= 37 || 0%{?rhel} > 9 BuildRequires: libusb-compat-0.1-devel %else BuildRequires: libusb-devel %endif BuildRequires: libutempter-devel BuildRequires: libXdamage-devel BuildRequires: libXtst-devel BuildRequires: xcb-proto BuildRequires: mesa-libgbm-devel # Old Fedora (before 30) uses the 1.2 minizip by default. # Newer Fedora needs to use the compat package # Fedora > 39 uses minizip-ng %if ! %{bundleminizip} %if 0%{?fedora} > 39 || 0%{?rhel} > 9 # BuildRequires: minizip-ng-devel BuildRequires: minizip-compat-devel %else BuildRequires: minizip-compat-devel %endif %endif %if %{system_nodejs} BuildRequires: nodejs, /usr/bin/node ## ELECTRON BuildRequires: /usr/bin/npm # Without full ICU data, electron-typescript-definitions crashes: # https://github.com/nodejs/node/issues/51752 BuildRequires: nodejs-full-i18n ## END ELECTRON %endif %if ! %{bootstrap} BuildRequires: gn %endif BuildRequires: nss-devel >= 3.26 BuildRequires: pciutils-devel BuildRequires: pulseaudio-libs-devel # For screen sharing on Wayland # pipewire is old on el8, chromium needs new version, disable it temporary %if 0%{?fedora} || 0%{?rhel} > 8 BuildRequires: pipewire-devel %endif # for /usr/bin/appstream-util BuildRequires: libappstream-glib %if %{bootstrap} # gn needs these BuildRequires: libstdc++-static %endif # Fedora tries to use system libs whenever it can. BuildRequires: bzip2-devel BuildRequires: dbus-glib-devel # For eu-strip BuildRequires: elfutils BuildRequires: elfutils-libelf-devel %if ! %{bundleflac} BuildRequires: flac-devel %endif %if ! %{bundlefreetype} BuildRequires: freetype-devel %endif %if ! %{bundlecrc32c} BuildRequires: google-crc32c-devel %endif %if ! %{bundlewoff2} BuildRequires: woff2-devel %endif %if ! %{bundledav1d} BuildRequires: libdav1d-devel %endif %if ! %{bundlehighway} BuildRequires: highway-devel %endif %if ! %{bundlelibavif} BuildRequires: libavif-devel %endif %if ! %{bundlejsoncpp} BuildRequires: jsoncpp-devel %endif %if ! %{bundlelibsecret} BuildRequires: libsecret-devel %endif %if ! %{bundledoubleconversion} BuildRequires: double-conversion-devel %endif %if ! %{bundlesnappy} BuildRequires: snappy-devel %endif %if ! %{bundlelibXNVCtrl} BuildRequires: libXNVCtrl-devel %endif # One of the python scripts invokes git to look for a hash. So helpful. BuildRequires: git-core BuildRequires: hwdata BuildRequires: kernel-headers BuildRequires: libffi-devel %if ! %{bundleicu} # If this is true, we're using the bundled icu. # We'd like to use the system icu every time, but we cannot always do that. # Not newer than 54 (at least not right now) BuildRequires: libicu-devel >= 68 %endif %if ! %{bundlelibjpeg} # If this is true, we're using the bundled libjpeg # which we need to do because the RHEL 7 libjpeg doesn't work for chromium anymore BuildRequires: libjpeg-devel %endif %if ! %{bundlelibpng} # If this is true, we're using the bundled libpng # which we need to do because the RHEL 7 libpng doesn't work right anymore BuildRequires: libpng-devel %endif %if ! %{bundlelibopenjpeg2} BuildRequires: openjpeg2-devel %endif %if ! %{bundlelcms2} BuildRequires: lcms2-devel %endif %if ! %{bundlelibtiff} BuildRequires: libtiff-devel %endif BuildRequires: libudev-devel %if ! %{bundlelibusbx} Requires: libusbx >= 1.0.21-0.1.git448584a BuildRequires: libusbx-devel >= 1.0.21-0.1.git448584a %endif %if %{use_vaapi} BuildRequires: libva-devel %endif # We don't use libvpx anymore because Chromium loves to # use bleeding edge revisions here that break other things # ... so we just use the bundled libvpx. %if ! %{bundlelibwebp} BuildRequires: libwebp-devel %endif %if ! %{bundlelibxslt} BuildRequires: libxslt-devel %endif BuildRequires: libxshmfence-devel # Same here, it seems. # BuildRequires: libyuv-devel BuildRequires: mesa-libGL-devel %if ! %{bundleopus} BuildRequires: opus-devel %endif BuildRequires: %{chromium_pybin} %if %{gtk_version} == 4 BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xrender) BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xshmfence) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcb-dri3) BuildRequires: pkgconfig(xcb-proto) Requires: gtk4 %else BuildRequires: pkgconfig(gtk+-3.0) # GTK modules it expects to find for some reason. Requires: libcanberra-gtk3%{_isa} %endif # Build deps of Chromium proper which are often transitively pulled in by toolkits (GTK, Qt), # but are still required without them. BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(atk-bridge-2.0) BuildRequires: pkgconfig(pangocairo) BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xcomposite) BuildRequires: pkgconfig(xrandr) ## ELECTRON BuildRequires: pkgconfig(libnotify) ## END ELECTRON BuildRequires: wayland-devel %if ! %{bundlepylibs} %if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: python3-jinja2 %else BuildRequires: python-jinja2 %endif %endif %if ! %{bundlere2} Requires: re2 >= 20160401 BuildRequires: re2-devel >= 20160401 %endif %if ! %{bundlebrotli} BuildRequires: brotli-devel %endif BuildRequires: speech-dispatcher-devel BuildRequires: zlib-devel # remote desktop needs this BuildRequires: pam-devel BuildRequires: systemd # using the built from source version on aarch64 BuildRequires: ninja-build # Yes, java is needed as well.. %if %{build_headless} BuildRequires: java-openjdk-headless %endif BuildRequires: libevdev-devel %if ! %{bundlesimdutf} BuildRequires: simdutf-devel %endif # esbuild is needed BuildRequires: golang-github-evanw-esbuild # There is a hardcoded check for nss 3.26 in the chromium code (crypto/nss_util.cc) Requires: nss%{_isa} >= 3.26 Requires: nss-mdns%{_isa} %if 0%{?fedora} && %{undefined flatpak} # This enables support for u2f tokens Requires: u2f-hidraw-policy %endif ## ELECTRON Provides: electron = %{version} Provides: electron%{_isa} = %{version} Provides: electron%{_isa}(abi) = %{abi_version} ExclusiveArch: x86_64 aarch64 ## END ELECTRON # Bundled bits (I'm sure I've missed some) Provides: bundled(bintrees) = 1.0.1 # This is a fork of openssl. Provides: bundled(boringssl) %if %{bundlebrotli} Provides: bundled(brotli) = 222564a95d9ab58865a096b8d9f7324ea5f2e03e %endif %if %{bundlesimdutf} Provides: bundled(simdutf) = 7.0.0 %endif Provides: bundled(bspatch) = 465265d0d473d107b76e74d969199eaf2cdc8750 Provides: bundled(colorama) = 0.4.6 Provides: bundled(crashpad) = 8f131016b21d986c38ca4a0f091403dbb822d636 Provides: bundled(expat) = 2.7.1 Provides: bundled(fdmlibm) = c512d6173f33c6b8301d3fba9384edc9fc1f9e45 # Don't get too excited. MPEG and other legally problematic stuff is stripped out. %if %{bundleffmpegfree} Provides: bundled(ffmpeg) = 7.1.git %endif %if %{bundlelibaom} Provides: bundled(libaom) = 3.12.1 %endif %if %{bundlefontconfig} Provides: bundled(fontconfig) = 8cf0ce700a8abe0d97ace4bf7efc7f9534b729ba %endif %if %{bundlefreetype} Provides: bundled(freetype) = VER-2-13-3-230-ge07e56c7f %endif %if %{bundleharfbuzz} Provides: bundled(harfbuzz) = 11.0.0-97 %endif Provides: bundled(hunspell) = 6d7d19f %if %{bundleicu} Provides: bundled(icu) = 74-2 %endif Provides: bundled(leveldb) = 1.23 Provides: bundled(libaddressinput) = 2610f7b104 %if %{bundlelibdrm} Provides: bundled(libdrm) = 2.4.122 %endif Provides: bundled(libjingle) = 5493b8a59deb16cf0481e24707a0ed72d19047dc %if %{bundlelibjpeg} Provides: bundled(libjpeg-turbo) = 3.1.0 %endif Provides: bundled(libphonenumber) = 140dfeb81b753388e8a672900fb7a971e9a0d362 %if %{bundlelibpng} Provides: bundled(libpng) = 1.6.43 %endif Provides: bundled(libsrtp) = fd08747fa6800b321d53e15feb34da12dc697dee %if %{bundlelibusbx} Provides: bundled(libusbx) = 1.0.17 %endif Provides: bundled(libvpx) = 1.6.0 %if %{bundlelibwebp} Provides: bundled(libwebp) = 0.6.0 %endif %if %{bundlelibxml} Provides: bundled(libxml) = 2.14.2 %endif %if %{bundlelibXNVCtrl} Provides: bundled(libXNVCtrl) = 302.17 %endif Provides: bundled(libyuv) = 1909 Provides: bundled(lzma) = 24.09 %if %{bundleopus} Provides: bundled(opus) = 55513e81 %endif Provides: bundled(ots) = 8d70cffebbfa58f67a5c3ed0e9bc84dccdbc5bc0 Provides: bundled(protobuf) = 3.0.0.beta.3 Provides: bundled(qcms) = 4 %if %{bundlere2} Provides: bundled(re2) %endif Provides: bundled(sfntly) = 04740d2600193b14aa3ef24cd9fbb3d5996b9f77 Provides: bundled(skia) Provides: bundled(SMHasher) = 0 Provides: bundled(snappy) = 1.1.4-head Provides: bundled(speech-dispatcher) = 0.7.1 Provides: bundled(sqlite) = 3.17patched Provides: bundled(superfasthash) = 0 Provides: bundled(talloc) = 2.0.1 Provides: bundled(usrsctp) = 0 Provides: bundled(v8) = 5.9.211.31 Provides: bundled(webrtc) = 90usrsctp Provides: bundled(woff2) = 445f541996fe8376f3976d35692fd2b9a6eedf2d Provides: bundled(xdg-mime) Provides: bundled(xdg-user-dirs) # Provides: bundled(zlib) = 1.2.11 %if %{undefined flatpak} # For selinux scriptlet Requires(post): /usr/sbin/semanage Requires(post): /usr/sbin/restorecon %endif ## ELECTRON: Package description and subpackages %description Electron is a framework for building cross-platform desktop applications using JavaScript, HTML, and CSS. It embeds Chromium for rendering and Node.js for backend functionality. %package -n nodejs-electron-devel Summary: Electron development headers and macros Requires: nodejs-electron%{_isa} = %{version}-%{release} Requires: /usr/bin/npm %description -n nodejs-electron-devel Development headers for building native Node.js modules against Electron. %if %{use_qt5} %package qt5-ui Summary: Qt5 UI for Electron Requires: nodejs-electron%{_isa} = %{version}-%{release} Supplements: (nodejs-electron%{_isa} and qt5-qtbase-gui%{_isa}) %description qt5-ui Qt5 UI integration for Electron. %endif %if %{use_qt6} %package qt6-ui Summary: Qt6 UI for Electron Requires: nodejs-electron%{_isa} = %{version}-%{release} Supplements: (nodejs-electron%{_isa} and qt6-qtbase-gui%{_isa}) %description qt6-ui Qt6 UI integration for Electron. %endif ## END ELECTRON %prep ## ELECTRON: Extract Electron overlay on top of Chromium source %setup -q -n chromium-%{chromium_version} tar xf %{SOURCE20} # Check that abi_version macro matches the actual ABI test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = %abi_version # Create v8 symlinks needed by electron_node ln -srv v8/tools third_party/electron_node/deps/v8/tools ln -srv v8/include third_party/electron_node/deps/v8/include # config.json paths are relative to a parent dir with src/ prefix ln -s . src # Apply Electron's patches to the Chromium tree (before Fedora patches). # apply_all_patches.py uses git am, so each target needs a git repo. export GIT_COMMITTER_NAME="RPM Build" GIT_COMMITTER_EMAIL="rpm@build" export GIT_AUTHOR_NAME="RPM Build" GIT_AUTHOR_EMAIL="rpm@build" for repo in . third_party/boringssl/src third_party/devtools-frontend/src \ third_party/ffmpeg v8 third_party/electron_node third_party/nan \ third_party/perfetto third_party/webrtc third_party/sqlite/src; do if [ -d "$repo" ]; then git init "$repo" git -C "$repo" add -A git -C "$repo" commit -q -m "init" --allow-empty fi done python3 electron/script/apply_all_patches.py \ electron/patches/config.json rm -f src ## END ELECTRON ### Chromium Fedora Patches ### %patch -P1 -p1 -b .etc %patch -P8 -p1 -b .widevine-other-locations %patch -P20 -p1 -b .disable-font-test %patch -P21 -p1 -b .screen-ai-service %if ! %{use_custom_libcxx} %patch -P22 -p1 -b .fix-qt-ui %endif %patch -P23 -p1 -R -b .revert-libpng_for_testonly %patch -P31 -p1 -b .disable-enterprise_companion_integration_tests %if ! %{bundlebrotli} %patch -P89 -p1 -b .system-brotli %endif %if ! %{bundlelibxml} %if 0%{?fedora} && 0%{?fedora} < 40 || 0%{?rhel} && 0%{?rhel} < 10 %patch -P90 -p1 -b .system-libxml %endif %endif %if ! %{bundleopus} %patch -P91 -p1 -b .system-opus %endif %patch -P92 -p1 -b .nodejs-checkversion %patch -P93 -p1 -b .ftbfs-csss_style_sheet %patch -P94 -p1 -R -b .v8-sanitize-build-error %patch -P96 -p1 -b .crabbyavif-ftbfs-old-rust %if ! %{bundleffmpegfree} %if 0%{?rhel} == 9 %patch -P128 -p1 -b .el9-ffmpeg-deprecated-apis %patch -P129 -p1 -b .el9-ffmpeg-AV_CODEC_FLAG_COPY_OPAQUE %patch -P130 -p1 -b .el9-ffmpeg-build-error %patch -P133 -p1 -b .el9-ffmpeg-5.1.x %endif %patch -P131 -p1 -b .prop-codecs %patch -P132 -p1 -b .sigtrap_system_ffmpeg %patch -P135 -p1 -b .disable-H.264-video-parser-during-demuxing %patch -P136 -p1 -b .workaround-system-ffmpeg-whitelist %patch -P137 -p1 -b .system-ffmpeg %patch -P138 -p1 -b .workaround-system-ffmpeg-AVDynamicHDRSmpte2094App5 %endif %if 0%{?rhel} == 8 || 0%{?rhel} == 9 %patch -P141 -p1 -b .dma_buf_export_sync_file-conflict %endif %if (0%{?rhel} && 0%{?rhel} < 10) || (0%{?rhel} == 10 && 0%{?rhel_minor_version} < 2) %patch -P142 -p1 -b .rust-1.88-build-error %patch -P143 -p1 -b .rust-1.88-enable-unstable_features %patch -P144 -p1 -b .rust-1.88-undefined-symbol %endif %if 0%{?rhel} == 9 %patch -P146 -p1 -b .el9-python-3.9-build-error %endif %patch -P150 -p1 -b .qt6 %patch -P300 -p1 -b .swiftshader-missing-include # llvm version < 21 on f42/el9/epel10.1 %if (0%{?fedora} && 0%{?fedora} < 43) || (0%{?rhel} && 0%{?rhel} < 10) || (0%{?rhel} == 10 && 0%{?rhel_minor_version} < 2) %patch -P302 -p1 -b .static_assert %patch -P303 -p1 -b .ftfs-llvm-octal-notation %patch -P304 -p1 -b .llvm-crash %endif %if 0%{?rhel} == 8 %ifarch aarch64 %patch -P305 -p1 -b .el8-memory_tagging %patch -P306 -p1 -b .el8-ifunc-header %endif %patch -P307 -p1 -b .el8-atk-compiler-error %patch -P308 -p1 -b .unsupport-clang-flags %patch -P309 -p1 -b .el8-unsupport-rustc-flags %patch -P314 -p1 -b .rust-skrifa-build-error %endif %patch -P315 -p1 -b .rustc-ftbfs %patch -P310 -p1 -b .rust-FTBFS-suppress-warnings %patch -P311 -p1 -b .fstack-protector-strong %if 0%{?rhel} && 0%{?rhel} < 10 %patch -P354 -p1 -b .split-threshold-for-reg-with-hint %endif %patch -P316 -p1 -b .clang++-unknown-argument %if 0%{?fedora} && 0%{?fedora} < 42 || 0%{?rhel} && 0%{?rhel} < 10 %patch -P317 -p1 -b .clang++-unsupported-argument %endif %patch -P318 -p1 -b .memory-allocator-dcheck-assert-fix %patch -P319 -p1 -b .swiftshader-llvm-16.0 %ifarch aarch64 && 0%{?fedora} %patch -P320 -p1 -b .aarch64-log-error %endif %if %{disable_bti} %patch -P352 -p1 -b .workaround_for_crash_on_BTI_capable_system %endif %ifarch aarch64 && (0%{?fedora} > 40 || 0%{?rhel} > 10) %patch -P353 -p1 -b .duplicate-case-value %endif %patch -P355 -p1 -b .hardware_destructive_interference_size %patch -P356 -p1 -b .disable_use_libcxx_modules %patch -P357 -p1 -b .type-mismatch-error %patch -P358 -p1 -b .rust-clang_lib %if 0%{?fedora} > 41 || (0%{?rhel} == 10 && 0%{?rhel_minor_version} > 2) %patch -P359 -p1 -b .ftbfs-with-rustc-1.95 %endif %ifarch ppc64le %patch -P360 -p1 -b .add-ppc64-architecture-string %patch -P361 -p1 -b .0001-sandbox-Enable-seccomp_bpf-for-ppc64 %patch -P376 -p1 -b .0001-third_party-angle-Include-missing-header-cstddef-in- %patch -P377 -p1 -b .0001-Add-PPC64-support-for-boringssl %patch -P378 -p1 -b .0001-third_party-libvpx-Disable-vsx-on-ppc64 %patch -P379 -p1 -b .0001-third_party-libvpx-Properly-generate-gni-on-ppc64 %patch -P380 -p1 -b .0001-third_party-pffft-Include-altivec.h-on-ppc64-with-SI %patch -P381 -p1 -b .0002-Add-PPC64-generated-files-for-boringssl %patch -P382 -p1 -b .0002-third_party-lss-kernel-structs %patch -P383 -p1 -b .0001-swiftshader-fix-build %patch -P384 -p1 -b .Rtc_base-system-arch.h-PPC %patch -P386 -p1 -b .0004-third_party-crashpad-port-curl-transport-ppc64 %patch -P387 -p1 -b .HACK-third_party-libvpx-use-generic-gnu %patch -P389 -p1 -b .HACK-debian-clang-disable-base-musttail %patch -P390 -p1 -b .HACK-debian-clang-disable-pa-musttail %patch -P391 -p1 -b .0001-Add-ppc64-target-to-libaom %patch -P392 -p1 -b .0001-Add-pregenerated-config-for-libaom-on-ppc64 %patch -P393 -p1 -b .0002-third_party-libvpx-Remove-bad-ppc64-config %patch -P394 -p1 -b .0003-third_party-libvpx-Add-ppc64-generated-config %patch -P395 -p1 -b .0004-third_party-libvpx-work-around-ambiguous-vsx %patch -P396 -p1 -b .skia-vsx-instructions %patch -P397 -p1 -b .0001-Implement-support-for-ppc64-on-Linux %patch -P398 -p1 -b .0001-Implement-support-for-PPC64-on-Linux %patch -P399 -p1 -b .0001-Force-baseline-POWER8-AltiVec-VSX-CPU-features-when- %patch -P401 -p1 -b .fix-rustc %patch -P402 -p1 -b .fix-rust-linking %patch -P403 -p1 -b .fix-breakpad-compile %patch -P404 -p1 -b .fix-partition-alloc-compile %patch -P405 -p1 -b .fix-study-crash %patch -P407 -p1 -b .fix-different-data-layouts %patch -P408 -p1 -b .0002-Add-ppc64-trap-instructions %patch -P409 -p1 -b .fix-page-allocator-overflow %patch -P410 -p1 -b .0001-Enable-ppc64-pointer-compression %patch -P411 -p1 -b .dawn-fix-ppc64le-detection %patch -P412 -p1 -b .add-ppc64-architecture-to-extensions %patch -P413 -p1 -b .fix-unknown-warning-option-messages %patch -P415 -p1 -b .add-ppc64-pthread-stack-size %patch -P417 -p1 -b .0001-add-xnn-ppc64el-support %patch -P418 -p1 -b .0002-regenerate-xnn-buildgn %patch -P419 -p1 -b .0009-sandbox-ignore-byte-span-error %patch -P420 -p1 -b .0005-blink-add-audio-vector-support %patch -P450 -p1 -b .pt_regs-kernel-7.2.0 %endif %if 0%{?flatpak} %patch -P500 -p1 -b .flatpak-initial-sandbox %patch -P501 -p1 -b .flatpak-sandbox-paths %patch -P502 -p1 -b .flatpak-widevine %endif %patch -P520 -p1 -b .build-with-wasm-rollup %patch -P521 -p1 -b .disable-ai # Upstream patches %patch -P600 -p1 -b .sysroot %patch -P601 -p1 -b .Omit-ar-from-inputs-when-resolved-via-PATH %patch -P602 -p1 -b .Fix-get_path_info-on-empty-ar-in-unbundle-toolchain # Darkmode %patch -P603 -p1 -b .Add-AutoDarkModeSkipImages-flag-to-bypass-image-dark-mode %patch -P604 -p1 -b .Make-dark-mode-apply-filter-to-images-irrespective-of-layout-zoom %patch -P605 -p1 -b .Use-64px-css-pixels-absolute-threshold-for-dark-image-classification %patch -P606 -p1 -b .Add-size-threshold-for-classifying-SVG-documents-for-auto-dark-mode %patch -P607 -p1 -b .Add-AutoDarkModeSVGSizeThreshold-kill-switch-flag ## ELECTRON: patches %patch -P700 -p1 -b .system-zstd-in-node %patch -P701 -p1 -b .system-ffmpeg %patch -P702 -p1 -b .reduce-gn-tree ## END ELECTRON # Change shebang in all relevant files in this directory and all subdirectories # See `man find` for how the `-exec command {} +` syntax works find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{chromium_pybin}=' {} + # Add correct path for nodejs binary mkdir -p third_party/node/linux/node-linux-x64/bin %if ! %{system_nodejs} ln -s ../../../../../node-%{nodejs_version}/node third_party/node/linux/node-linux-x64/bin/node %else ln -s $(which node) third_party/node/linux/node-linux-x64/bin/node %endif ## ELECTRON # Add correct path for esbuild binary mkdir -p third_party/devtools-frontend/src/third_party/esbuild ln -sf $(which esbuild) third_party/devtools-frontend/src/third_party/esbuild/esbuild ## END ELECTRON # Remove bundle gn and replace it with a system gn or bootstrap gn as it is x86_64 and causes # FTBFS on other arch like aarch64/ppc64le mkdir -p buildtools/linux64/ %if %{bootstrap} ln -sf ../../%{chromebuilddir}/gn buildtools/linux64/gn %else ln -sf $(which gn) buildtools/linux64/gn %endif # Remove bundle gperf and replace it with system gperf mkdir -p third_party/gperf/cipd/bin ln -fs $(which gperf) third_party/gperf/cipd/bin/gperf # Remove bundle rustc and replace it with system rustc mkdir -p third_party/rust-toolchain/bin/ ln -fs $(which rustc) third_party/rust-toolchain/bin/rustc %if %{bundlelibusbx} # no hackity hack hack %else # hackity hack hack rm -rf third_party/libusb/src/libusb/libusb.h # we _shouldn't need to do this, but it looks like we do. cp -a $(pkg-config --variable=includedir libusb-1.0)/libusb-1.0/libusb.h third_party/libusb/src/libusb/libusb.h %endif # Hard code extra version sed -i 's/getenv("CHROME_VERSION_EXTRA")/"Fedora Project"/' chrome/common/channel_info_posix.cc # Fix hardcoded path in remoting code sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux_single_process.cc # bz#2265957, add correct platform sed -i "s/Linux x86_64/Linux %{_arch}/" components/embedder_support/user_agent_utils.cc %if ! %{bundlesimdutf} ln -sf %{_includedir}/simdutf.h third_party/simdutf/simdutf.h %endif %build %if ! %{system_nodejs} # Build nodejs and Replace bundle binary export CXX=c++ tar xf %{SOURCE12} pushd node-%{nodejs_version} patch -p1 < %{_sourcedir}/0001-Remove-unused-OpenSSL-config.patch patch -p1 < %{_sourcedir}/0001-fips-disable-options.patch ./configure --ninja --shared-openssl --openssl-is-fips --openssl-conf-name=openssl_conf --enable-static --prefix=node-%{nodejs_version}-linux-x64 ninja -j %{numjobs} -C %{chromebuilddir} make install popd %endif # reduce warnings FLAGS=' -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-unused-command-line-argument' FLAGS+=' -Wno-unused-but-set-variable -Wno-unused-result -Wno-unused-function -Wno-unused-variable' FLAGS+=' -Wno-unused-const-variable -Wno-unneeded-internal-declaration -Wno-unknown-attributes -Wno-unknown-pragmas' %if %{system_build_flags} CFLAGS=${CFLAGS/-fexceptions} CFLAGS=${CFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS} CFLAGS="$CFLAGS $FLAGS" CXXFLAGS="$CFLAGS" %else # override system build flags CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" %endif %ifarch ppc64le CXXFLAGS+=' -faltivec-src-compat=mixed -Wno-deprecated-altivec-src-compat' %endif %if ! %{use_custom_libcxx} LDFLAGS="${LDFLAGS} -stdlib=libc++" CXXFLAGS="${CXXFLAGS} -stdlib=libc++" %endif export CC=clang export CXX=clang++ export AR=llvm-ar export NM=llvm-nm export READELF=llvm-readelf export CFLAGS export CXXFLAGS export LDFLAGS # need for error: the option `Z` is only accepted on the nightly compiler export RUSTC_BOOTSTRAP=1 # set rustc version # Fix error: multiple input filenames provided, caused by rustc_wrapper rustc_version="$(rustc -V | cut -d' ' -f-2 | sed 's/ /-/')" # set rust bindgen root rust_bindgen_root="$(which bindgen | sed 's#/s\?bin/.*##')" rust_sysroot_absolute="$(rustc --print sysroot)" # set clang version clang_version="$(clang --version | sed -n 's/clang version //p' | cut -d. -f1)" %if 0%{?fedora} > 41 || 0%{?rhel} > 9 clang_base_path="$(PATH=/usr/bin:/usr/sbin which clang | sed 's#/bin/.*##')" %else clang_base_path="$(clang --version | grep InstalledDir | cut -d' ' -f2 | sed 's#/bin##')" %endif # Core defines are flags that are true for both the browser and headless. CHROMIUM_CORE_GN_DEFINES="" # using system toolchain CHROMIUM_CORE_GN_DEFINES+=' custom_toolchain="//build/toolchain/linux/unbundle:default"' CHROMIUM_CORE_GN_DEFINES+=' host_toolchain="//build/toolchain/linux/unbundle:default"' %if ! %{use_custom_libcxx} CHROMIUM_BROWSER_GN_DEFINES+=' use_custom_libcxx=false' %endif CHROMIUM_CORE_GN_DEFINES+=' is_debug=false dcheck_always_on=false dcheck_is_configurable=false' ## ELECTRON # enable_enterprise_companion is not defined in Electron's GN scope; # setting it produces a warning that breaks gn desc output. ## END ELECTRON CHROMIUM_CORE_GN_DEFINES+=' system_libdir="%{_lib}"' %if %{official_build} CHROMIUM_CORE_GN_DEFINES+=' is_official_build=true' sed -i 's|OFFICIAL_BUILD|GOOGLE_CHROME_BUILD|g' tools/generate_shim_headers/generate_shim_headers.py %endif CHROMIUM_CORE_GN_DEFINES+=' chrome_pgo_phase=0' %if ! %{cfi} CHROMIUM_CORE_GN_DEFINES+=' is_cfi=false use_thin_lto=false' %endif %if %{useapikey} CHROMIUM_CORE_GN_DEFINES+=' google_api_key="%{api_key}"' %endif %if %{userestrictedapikeys} CHROMIUM_CORE_GN_DEFINES+=' google_default_client_id="%{default_client_id}"' CHROMIUM_CORE_GN_DEFINES+=' google_default_client_secret="%{default_client_secret}"' %endif CHROMIUM_CORE_GN_DEFINES+=' is_clang=true' CHROMIUM_CORE_GN_DEFINES+=" clang_base_path=\"$clang_base_path\"" CHROMIUM_CORE_GN_DEFINES+=" clang_version=$clang_version" CHROMIUM_CORE_GN_DEFINES+=' clang_use_chrome_plugins=false' CHROMIUM_CORE_GN_DEFINES+=' use_lld=true' # enable system rust CHROMIUM_CORE_GN_DEFINES+=" rust_sysroot_absolute=\"$rust_sysroot_absolute\"" CHROMIUM_CORE_GN_DEFINES+=" rust_bindgen_root=\"$rust_bindgen_root\"" CHROMIUM_CORE_GN_DEFINES+=" rustc_version=\"$rustc_version\"" CHROMIUM_CORE_GN_DEFINES+=' use_sysroot=false' %ifarch aarch64 CHROMIUM_CORE_GN_DEFINES+=' target_cpu="arm64"' %endif %ifarch ppc64le CHROMIUM_CORE_GN_DEFINES+=' target_cpu="ppc64"' %endif CHROMIUM_CORE_GN_DEFINES+=' icu_use_data_file=true' CHROMIUM_CORE_GN_DEFINES+=' target_os="linux"' CHROMIUM_CORE_GN_DEFINES+=' current_os="linux"' CHROMIUM_CORE_GN_DEFINES+=' treat_warnings_as_errors=false' CHROMIUM_CORE_GN_DEFINES+=' enable_iterator_debugging=false' CHROMIUM_CORE_GN_DEFINES+=' enable_vr=false' CHROMIUM_CORE_GN_DEFINES+=' build_dawn_tests=false enable_perfetto_unittests=false' CHROMIUM_CORE_GN_DEFINES+=' disable_fieldtrial_testing_config=true' CHROMIUM_CORE_GN_DEFINES+=' symbol_level=0 blink_symbol_level=0' CHROMIUM_CORE_GN_DEFINES+=' angle_has_histograms=false' # drop unrar CHROMIUM_CORE_GN_DEFINES+=' safe_browsing_use_unrar=false' CHROMIUM_CORE_GN_DEFINES+=' v8_enable_backtrace=true' # disable devtools buildle CHROMIUM_CORE_GN_DEFINES+=' devtools_bundle=false' export CHROMIUM_CORE_GN_DEFINES # browser gn defines CHROMIUM_BROWSER_GN_DEFINES="" # if systemwide ffmpeg free is used, the proprietary codecs can be set to true to load the codecs from ffmpeg-free # the codecs computation is passed to ffmpeg-free in this case %if ! %{bundleffmpegfree} CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Chrome" proprietary_codecs=true is_component_ffmpeg=true enable_ffmpeg_video_decoders=true media_use_ffmpeg=true' %else CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Chromium" proprietary_codecs=false is_component_ffmpeg=false enable_ffmpeg_video_decoders=false media_use_ffmpeg=true' %endif # link against noopenh264 library %if 0%{?noopenh264} CHROMIUM_BROWSER_GN_DEFINES+=' media_use_openh264=true' CHROMIUM_BROWSER_GN_DEFINES+=' rtc_use_h264=true' %else CHROMIUM_BROWSER_GN_DEFINES+=' media_use_openh264=false' CHROMIUM_BROWSER_GN_DEFINES+=' rtc_use_h264=false' %endif CHROMIUM_BROWSER_GN_DEFINES+=' use_kerberos=true' # Workaround for FTBFS, error: no member named 'bPsnrY' in 'Source_Picture_s' CHROMIUM_BROWSER_GN_DEFINES+=' rtc_video_psnr=false' %if %{use_qt5} CHROMIUM_BROWSER_GN_DEFINES+=" use_qt5=true moc_qt5_path=\"$(%{_qt5_qmake} -query QT_HOST_BINS)\"" %else CHROMIUM_BROWSER_GN_DEFINES+=' use_qt5=false' %endif %if %{use_qt6} CHROMIUM_BROWSER_GN_DEFINES+=" use_qt6=true moc_qt6_path=\"$(%{_qt6_qmake} -query QT_HOST_LIBEXECS)\"" %else CHROMIUM_BROWSER_GN_DEFINES+=' use_qt6=false' %endif CHROMIUM_BROWSER_GN_DEFINES+=' use_gtk=true gtk_version=%{gtk_version}' CHROMIUM_BROWSER_GN_DEFINES+=' use_gio=true use_pulseaudio=true' CHROMIUM_BROWSER_GN_DEFINES+=' enable_hangout_services_extension=true' CHROMIUM_BROWSER_GN_DEFINES+=' enable_widevine=true' %if %{use_vaapi} CHROMIUM_BROWSER_GN_DEFINES+=' use_vaapi=true' %else CHROMIUM_BROWSER_GN_DEFINES+=' use_vaapi=false' %endif %if %{use_v4l2_codec} CHROMIUM_BROWSER_GN_DEFINES+=' use_v4l2_codec=true' %endif %if 0%{?fedora} || 0%{?rhel} > 8 CHROMIUM_BROWSER_GN_DEFINES+=' rtc_use_pipewire=true rtc_link_pipewire=true' %else CHROMIUM_BROWSER_GN_DEFINES+=' rtc_use_pipewire=false rtc_link_pipewire=false' %endif %if ! %{bundlelibjpeg} CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libjpeg=true' %endif %if ! %{bundlelibpng} CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libpng=true' %endif %if ! %{bundleharfbuzz} CHROMIUM_BROWSER_GN_DEFINES+=' use_system_harfbuzz=true' %endif %if ! %{bundlelibopenjpeg2} CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libopenjpeg2=true' %endif %if ! %{bundlelcms2} CHROMIUM_BROWSER_GN_DEFINES+=' use_system_lcms2=true' %endif %if ! %{bundlelibtiff} CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libtiff=true' %endif CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libffi=true' export CHROMIUM_BROWSER_GN_DEFINES # headless gn defines CHROMIUM_HEADLESS_GN_DEFINES="" CHROMIUM_HEADLESS_GN_DEFINES+=' use_ozone=true ozone_auto_platforms=false ozone_platform="headless" ozone_platform_headless=true' CHROMIUM_HEADLESS_GN_DEFINES+=' angle_enable_vulkan=true angle_enable_swiftshader=true headless_use_embedded_resources=false' CHROMIUM_HEADLESS_GN_DEFINES+=' headless_use_prefs=false headless_use_policy=false' CHROMIUM_HEADLESS_GN_DEFINES+=' v8_use_external_startup_data=false enable_print_preview=false enable_remoting=false' CHROMIUM_HEADLESS_GN_DEFINES+=' use_alsa=false use_bluez=false use_cups=false use_dbus=false use_gio=false use_kerberos=false' CHROMIUM_HEADLESS_GN_DEFINES+=' use_libpci=false use_pulseaudio=false use_udev=false rtc_use_pipewire=false' CHROMIUM_HEADLESS_GN_DEFINES+=' v8_enable_lazy_source_positions=false use_glib=false use_gtk=false use_pangocairo=false' CHROMIUM_HEADLESS_GN_DEFINES+=' use_qt5=false use_qt6=false is_component_build=false enable_ffmpeg_video_decoders=false media_use_ffmpeg=false' CHROMIUM_HEADLESS_GN_DEFINES+=' media_use_libvpx=false proprietary_codecs=false' export CHROMIUM_HEADLESS_GN_DEFINES # use system libraries system_libs=() %if ! %{bundlelibaom} system_libs+=(libaom) %endif %if ! %{bundlelibavif} system_libs+=(libavif) %endif %if ! %{bundlebrotli} system_libs+=(brotli) %endif %if ! %{bundlecrc32c} system_libs+=(crc32c) %endif %if ! %{bundledav1d} system_libs+=(dav1d) %endif %if ! %{bundlehighway} system_libs+=(highway) %endif %if ! %{bundlefontconfig} system_libs+=(fontconfig) %endif %if ! %{bundleffmpegfree} system_libs+=(ffmpeg) %endif %if ! %{bundlefreetype} system_libs+=(freetype) %endif %if ! %{bundleharfbuzz} system_libs+=(harfbuzz) %endif %if ! %{bundleicu} system_libs+=(icu) %endif %if ! %{bundlelibdrm} system_libs+=(libdrm) %endif %if ! %{bundlelibjpeg} system_libs+=(libjpeg) %endif %if ! %{bundlelibpng} system_libs+=(libpng) %endif %if ! %{bundlelibusbx} system_libs+=(libusb) %endif %if ! %{bundlelibwebp} system_libs+=(libwebp) %endif %if ! %{bundlelibxml} system_libs+=(libxml) %endif %if ! %{bundlelibxslt} system_libs+=(libxslt) %endif %if ! %{bundleopus} system_libs+=(opus) %endif %if ! %{bundlere2} system_libs+=(re2) %endif %if ! %{bundlewoff2} system_libs+=(woff2) %endif %if ! %{bundleminizip} system_libs+=(zlib) %endif %if ! %{bundlejsoncpp} system_libs+=(jsoncpp) %endif %if ! %{bundledoubleconversion} system_libs+=(double-conversion) %endif %if ! %{bundlelibsecret} system_libs+=(libsecret) %endif %if ! %{bundlesnappy} system_libs+=(snappy) %endif %if ! %{bundlelibXNVCtrl} system_libs+=(libXNVCtrl) %endif %if ! %{bundleflac} system_libs+=(flac) %endif %if ! %{bundlezstd} system_libs+=(zstd) %endif %if 0%{?noopenh264} system_libs+=(openh264) %endif %if ! %{bundlesimdutf} system_libs+=(simdutf) %endif build/linux/unbundle/replace_gn_files.py --system-libraries ${system_libs[@]} # Check that there is no system 'google' module, shadowing bundled ones: if python3 -c 'import google ; print google.__path__' 2> /dev/null ; then \ echo "Python 3 'google' module is defined, this will shadow modules of this build"; \ exit 1 ; \ fi %if %{bootstrap} tools/gn/bootstrap/bootstrap.py --gn-gen-args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %else mkdir -p %{chromebuilddir} && cp -a $(which gn) %{chromebuilddir}/ %endif ## ELECTRON: GN defines and build targets ### ELECTRON_GN_DEFINES="" ELECTRON_GN_DEFINES+=' override_electron_version="%{electron_version}"' ELECTRON_GN_DEFINES+=' use_v8_context_snapshot=true' ELECTRON_GN_DEFINES+=' v8_use_external_startup_data=true' ELECTRON_GN_DEFINES+=' v8_enable_sandbox=false' ELECTRON_GN_DEFINES+=' enable_screen_ai_service=false' ELECTRON_GN_DEFINES+=' enable_screen_ai_browsertests=false' ELECTRON_GN_DEFINES+=' use_fake_screen_ai=true' ELECTRON_GN_DEFINES+=' enable_widevine=false' ELECTRON_GN_DEFINES+=' v8_builtins_profiling_log_file=""' ELECTRON_GN_DEFINES+=' angle_use_custom_libvulkan=false' export ELECTRON_OUT_DIR=Release %{chromebuilddir}/gn --script-executable=%{chromium_pybin} gen \ --root-target=//electron:electron_app \ --root-pattern=//electron:electron_app \ --root-pattern=//electron:chromium_licenses \ --root-pattern=//electron:copy_node_headers \ --root-pattern=//electron:electron_version_file \ --args="import(\"//electron/build/args/release.gn\") $CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES $ELECTRON_GN_DEFINES" \ %{chromebuilddir} %build_target %{chromebuilddir} v8_context_snapshot_generator %build_target %{chromebuilddir} chromium_licenses %build_target %{chromebuilddir} copy_node_headers %build_target %{chromebuilddir} version %build_target %{chromebuilddir} electron ## END ELECTRON %install rm -rf %{buildroot} ## ELECTRON mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{electron_path} mkdir -p %{buildroot}%{_includedir}/electron # Install electron binary and runtime deps via gn desc pushd %{chromebuilddir} install -pm 0644 version -t %{buildroot}%{electron_path}/ # gn desc may emit warnings to stdout; filter to paths only (no spaces) gn desc \ --root-target=//electron:electron_app \ --root-pattern=//electron:electron_app \ --root-pattern=//electron:chromium_licenses \ --root-pattern=//electron:copy_node_headers \ --root-pattern=//electron:electron_version_file \ . //electron:electron_app runtime_deps \ | grep -v ' ' | grep -v ^gen/ | sort -u \ | xargs cp -a --parents -t %{buildroot}%{electron_path}/ -- popd # Install node headers for native module development cp -lrvT %{chromebuilddir}/gen/node_headers %{buildroot}%{_includedir}/electron # Launcher script cat > %{buildroot}%{_bindir}/electron << 'EOF' #!/bin/sh exec %{electron_path}/electron "$@" EOF chmod 0755 %{buildroot}%{_bindir}/electron # electron-node wrappers for native module rebuilds mkdir -p %{buildroot}%{_libexecdir}/electron-node cat > %{buildroot}%{_libexecdir}/electron-node/node << 'EOF' #!/bin/sh ELECTRON_RUN_AS_NODE=1 exec %{electron_path}/electron "$@" EOF cat > %{buildroot}%{_libexecdir}/electron-node/npm << 'EOF' #!/bin/sh exec %{_libexecdir}/electron-node/node %{_bindir}/npm "$@" EOF cat > %{buildroot}%{_libexecdir}/electron-node/npx << 'EOF' #!/bin/sh exec %{_libexecdir}/electron-node/node %{_bindir}/npx "$@" EOF cat > %{buildroot}%{_libexecdir}/electron-node/yarn << 'EOF' #!/bin/sh exec %{_libexecdir}/electron-node/node %{_bindir}/yarn "$@" EOF chmod 0755 %{buildroot}%{_libexecdir}/electron-node/* # RPM macros for electron native module packages (see Source22: macros.electron). # Bake in the macros that describe files provided by this electron build; leave # %%{buildroot} literal so it resolves against the consuming package's tree. mkdir -p %{buildroot}%{_rpmmacrodir} sed -e 's|%%{abi_version}|%{abi_version}|g' \ -e 's|%%{_isa}|%{_isa}|g' \ -e 's|%%{_libexecdir}|%{_libexecdir}|g' \ -e 's|%%{_includedir}|%{_includedir}|g' \ -e 's|%%{_libdir}|%{_libdir}|g' \ %{SOURCE22} > %{buildroot}%{_rpmmacrodir}/macros.electron chmod 0644 %{buildroot}%{_rpmmacrodir}/macros.electron ## END ELECTRON # README.fedora cp %{SOURCE1} . %files ## ELECTRON: file list %doc AUTHORS README.fedora %license LICENSE electron/LICENSE %{chromebuilddir}/LICENSES.chromium.html %{_bindir}/electron %dir %{electron_path}/ %{electron_path}/electron %{electron_path}/version %{electron_path}/chrome_100_percent.pak %{electron_path}/chrome_200_percent.pak %{electron_path}/chrome_crashpad_handler %{electron_path}/resources.pak %{electron_path}/libEGL.so %{electron_path}/libGLESv2.so %{electron_path}/libvk_swiftshader.so %{electron_path}/libvulkan.so.1 %{electron_path}/vk_swiftshader_icd.json %{electron_path}/snapshot_blob.bin %{electron_path}/v8_context_snapshot.bin %if %{bundleicu} %{electron_path}/icudtl.dat %endif %dir %{electron_path}/resources/ %{electron_path}/resources/default_app.asar %dir %{electron_path}/locales/ %{electron_path}/locales/*.pak %{electron_path}/pyproto/ %files -n nodejs-electron-devel %{_includedir}/electron/ %{_rpmmacrodir}/macros.electron %dir %{_libexecdir}/electron-node/ %{_libexecdir}/electron-node/* %if %{use_qt5} %files qt5-ui %{electron_path}/libqt5_shim.so %endif %if %{use_qt6} %files qt6-ui %{electron_path}/libqt6_shim.so %endif ## END ELECTRON %changelog ## START: Generated by rpmautospec * Sat Sep 05 2026 Gordon Messmer - 43.2.0-1 - Initial import (rhbz#2512679) ## END: Generated by rpmautospec