2021-07-01 05:05:47 +00:00
#
2021-06-29 20:42:56 +00:00
# spec file for package nodejs-electron
#
2022-01-27 22:16:50 +00:00
# Copyright (c) 2022 SUSE LLC
2022-01-29 19:59:26 +00:00
# Copyright (c) 2021-2022 Andreas Schneider <asn@cryptomilk.org>
2021-06-29 20:42:56 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
2022-02-17 22:40:10 +00:00
%undefine _package_note_file
2022-03-18 15:41:41 +00:00
# https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck
%undefine _auto_set_build_flags
2022-02-17 22:40:10 +00:00
2021-06-29 20:42:56 +00:00
%define mod_name electron
2022-09-21 09:00:14 +00:00
# https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
2022-10-04 19:13:55 +00:00
%define abi_version 109
2022-07-04 09:07:38 +00:00
# Do not provide libEGL.so, etc…
%define __provides_exclude ^lib.*\\.so.*$
2022-08-08 08:46:02 +00:00
# Double DWZ memory limits
%define _dwz_low_mem_die_limit 20000000
%define _dwz_max_die_limit 100000000
2022-07-04 09:07:38 +00:00
#x86 requires SSE2
2022-09-21 09:00:14 +00:00
#see v8/src/codegen/ia32/assembler-ia32.cc
2022-07-04 09:07:38 +00:00
%ifarch %ix86
ExclusiveArch : i586 i686
BuildArch : i686
%{expand:%%global optflags %(echo " % o p t f l a g s " ) -march=pentium4 -mtune=generic}
%endif
2021-06-29 20:42:56 +00:00
%bcond_without pipewire
2022-07-04 09:07:38 +00:00
2022-09-21 09:00:14 +00:00
%ifarch %ix86 x86_64 %arm
2022-07-04 09:07:38 +00:00
#Use subzero as swiftshader backend instead of LLVM
%bcond_without subzero
2021-06-29 20:42:56 +00:00
%else
2022-07-04 09:07:38 +00:00
%bcond_with subzero
2021-06-29 20:42:56 +00:00
%endif
2022-07-04 09:07:38 +00:00
%ifarch x86_64 %ix86 aarch64
%bcond_without vaapi
2021-10-07 22:05:47 +00:00
%else
2022-07-04 09:07:38 +00:00
%bcond_with vaapi
2021-10-07 22:05:47 +00:00
%endif
2022-07-04 09:07:38 +00:00
%if %{with vaapi}
#vaapi still requires bundled libvpx
2021-06-29 20:42:56 +00:00
%bcond_with system_vpx
2021-12-01 19:47:04 +00:00
%else
2022-07-04 09:07:38 +00:00
%bcond_without system_vpx
2021-12-01 19:47:04 +00:00
%endif
2022-07-04 09:07:38 +00:00
%bcond_with clang
2022-10-13 09:38:43 +00:00
%if %{with clang}
%global toolchain clang
%else
2022-08-08 08:46:02 +00:00
# Linker selection. GCC only. Default is BFD.
# arm64 reports relocation errors with BFD.
2022-10-18 12:07:55 +00:00
%ifarch x86_64 aarch64
%bcond_without gold
%else
2022-08-08 08:46:02 +00:00
%bcond_with gold
2022-10-18 12:07:55 +00:00
%endif
2022-08-08 08:46:02 +00:00
# Both BFD and Gold run out of memory on 32-bit.
%ifarch %ix86 %arm
%bcond_without lld
%else
%bcond_with lld
%endif
2022-10-13 09:38:43 +00:00
%endif #with clang
2022-08-08 08:46:02 +00:00
#Mold succeeds on ix86 but seems to produce corrupt binaries (no build-id)
%bcond_with mold
2022-10-26 04:51:48 +00:00
%ifnarch %ix86 %arm aarch64
# OBS does not have enough powerful machines to build with LTO on aarch64.
2022-10-04 19:13:55 +00:00
2022-10-26 04:51:48 +00:00
%if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora})
%bcond_without lto
%else
2022-09-23 06:20:34 +00:00
%bcond_with lto
2022-10-26 04:51:48 +00:00
%endif
2022-09-23 06:20:34 +00:00
%else
2022-10-26 04:51:48 +00:00
%bcond_with lto
2022-09-23 06:20:34 +00:00
%endif
2022-07-04 09:07:38 +00:00
2022-10-04 19:13:55 +00:00
2022-07-04 09:07:38 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150400 || 0%{?fedora}
2022-01-29 19:59:26 +00:00
%bcond_without system_harfbuzz
%else
%bcond_with system_harfbuzz
2022-10-04 19:13:55 +00:00
%endif
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500 || 0%{?fedora} >= 37
%bcond_without system_avif
%else
2022-09-21 09:00:14 +00:00
%bcond_with system_avif
2022-01-29 19:59:26 +00:00
%endif
2022-07-04 09:07:38 +00:00
%bcond_without system_freetype
2022-09-15 04:57:08 +00:00
%bcond_without system_nghttp2
2022-09-21 09:00:14 +00:00
%bcond_without system_double_conversion
%bcond_without system_woff2
2022-07-04 09:07:38 +00:00
2022-09-15 04:57:08 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora} >= 37
2022-07-07 08:02:56 +00:00
%bcond_without system_aom
2022-09-21 09:00:14 +00:00
%bcond_without icu_71
%bcond_without ffmpeg_5
%bcond_without system_dav1d
%bcond_without system_spirv
2022-07-07 08:02:56 +00:00
%else
2022-07-04 09:07:38 +00:00
%bcond_with system_aom
2022-09-21 09:00:14 +00:00
%bcond_with icu_71
%bcond_with ffmpeg_5
%bcond_with system_dav1d
%bcond_with system_spirv
2022-07-07 08:02:56 +00:00
%endif
2022-07-04 09:07:38 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500 || 0%{?fedora_version}
%bcond_without system_crc32c
2022-08-08 08:46:02 +00:00
%bcond_without system_nvctrl
2022-07-04 09:07:38 +00:00
%else
%bcond_with system_crc32c
2022-08-08 08:46:02 +00:00
%bcond_with system_nvctrl
2022-07-04 09:07:38 +00:00
%endif
2022-08-29 08:58:56 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora_version}
%bcond_without system_jxl
%else
%bcond_with system_jxl
%endif
2022-07-04 09:07:38 +00:00
2022-08-08 08:46:02 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500
%bcond_without system_yuv
2022-07-04 09:07:38 +00:00
%else
2022-08-08 08:46:02 +00:00
%bcond_with system_yuv
2022-07-04 09:07:38 +00:00
%endif
2022-09-21 09:00:14 +00:00
2022-07-04 09:07:38 +00:00
2022-08-08 08:46:02 +00:00
2022-07-04 09:07:38 +00:00
%if 0%{?fedora}
2022-08-08 08:46:02 +00:00
2022-07-07 08:02:56 +00:00
%bcond_without system_llhttp
%bcond_without system_histogram
2022-07-04 09:07:38 +00:00
%else
2022-08-08 08:46:02 +00:00
2022-07-07 08:02:56 +00:00
%bcond_with system_llhttp
%bcond_with system_histogram
2022-07-04 09:07:38 +00:00
%endif
2022-09-15 04:57:08 +00:00
# Abseil is broken in Leap
# enable this when boo#1203378 and boo#1203379 get fixed
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora} >= 37
2022-07-04 09:07:38 +00:00
%if %{without clang}
%bcond_without system_abseil
%else
2022-10-13 09:38:43 +00:00
# Clang has several problems with std::optional used by system abseil
2022-07-04 09:07:38 +00:00
%bcond_with system_abseil
%endif
%else
%bcond_with system_abseil
%endif
2022-07-07 08:56:30 +00:00
# We always ship the following bundled libraries as part of Electron despite a system version being available in either openSUSE or Fedora:
2022-07-07 08:02:56 +00:00
# Name | Path in tarball | Reason
# -------------+-----------------------------------+---------------------------------------
2022-07-07 08:56:30 +00:00
# boringssl | third_party/boringssl | The openSUSE package is unmaintained.
2022-07-07 08:02:56 +00:00
# hunspell | third_party/hunspell/src | Fork.
# leveldb | third_party/leveldatabase/src | Internal api use.
# protobuf | third_party/protobuf | Fork.
# rnnoise | third_party/rnnoise | Internal api use.
# sqlite | third_party/sqlite | Fork.
# srtp / srtp2 | third_party/libsrtp | Api matches neither version 1 nor 2 of this library.
# uv | third_party/electron_node/deps/uv | Heavily modified version which is exposed as part of Electron's public ABI.
2022-08-08 08:46:02 +00:00
2022-07-04 09:07:38 +00:00
2021-06-29 20:42:56 +00:00
Name : nodejs-electron
2022-11-05 11:17:41 +00:00
Version : 21.2.2
2021-06-29 20:42:56 +00:00
Release : 0
Summary : Build cross platform desktop apps with JavaScript, HTML, and CSS
2022-09-15 04:57:08 +00:00
License : AFL-2.0 AND Apache-2.0 AND blessing AND BSD-2-Clause AND BSD-3-Clause AND BSD-Protection AND BSD-Source-Code AND bzip2-1.0.6 AND IJG AND ISC AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND MIT-CMU AND MIT-open-group AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later) AND MPL-2.0 AND OpenSSL AND SGI-B-2.0 AND SUSE-Public-Domain AND X11
Group : Development/Languages/NodeJS
2021-06-29 20:42:56 +00:00
URL : https://github.com/electron/electron
2022-08-29 08:58:56 +00:00
Source0 : %{mod_name} -%{version} .tar.xz
2021-06-29 20:42:56 +00:00
Source1 : create_tarball.sh
Source10 : electron-launcher.sh
Source11 : electron.desktop
Source12 : electron-logo-symbolic.svg
2022-07-04 09:07:38 +00:00
# Shim generators for unbundling libraries
2022-08-08 08:46:02 +00:00
Source50 : flatbuffers.gn
Source51 : libsecret.gn
2022-07-04 09:36:24 +00:00
2022-09-21 09:00:14 +00:00
# Reverse upstream changes to be able to build against ffmpeg-4
2022-07-04 09:07:38 +00:00
Source400 : ffmpeg-new-channel-layout.patch
2022-10-04 19:13:55 +00:00
Source401 : audio_file_reader-ffmpeg-AVFrame-duration.patch
2022-09-21 09:00:14 +00:00
# …and against icu-69
2022-10-04 19:13:55 +00:00
Source410 : NumberFormat-icu71-incrementExact.patch
Source411 : intl-objects-icu71-UNUM_APPROXIMATELY_SIGN_FIELD.patch
#Reverse upstream changes to build against system libavif.
#All of this patch is dead code, so it can be reversed unconditionally.
Source420 : avif_image_decoder-AVIF_PIXEL_FORMAT_COUNT.patch
2022-09-21 09:00:14 +00:00
2022-08-01 08:25:54 +00:00
# PATCHES for openSUSE-specific things
2022-07-04 09:07:38 +00:00
Patch0 : chromium-102-compiler.patch
2022-10-26 04:51:48 +00:00
Patch1 : fpic.patch
2022-01-27 22:16:50 +00:00
Patch3 : gcc-enable-lto.patch
Patch5 : chromium-norar.patch
Patch6 : chromium-vaapi.patch
2021-06-29 20:42:56 +00:00
Patch7 : chromium-91-java-only-allowed-in-android-builds.patch
2022-01-27 22:16:50 +00:00
Patch9 : chromium-86-fix-vaapi-on-intel.patch
2021-06-29 20:42:56 +00:00
# Always disable use_thin_lto which is an lld feature
Patch21 : electron-13-fix-use-thin-lto.patch
2022-01-29 19:59:26 +00:00
# Fix common.gypi to include /usr/include/electron
Patch25 : electron-16-system-node-headers.patch
2022-07-04 09:07:38 +00:00
# https://sources.debian.org/patches/chromium/102.0.5005.115-1/debianization/support-i386.patch/
Patch39 : support-i386.patch
2022-08-01 08:25:54 +00:00
# from https://sources.debian.org/patches/chromium/103.0.5060.53-1/disable/catapult.patch/
Patch67 : disable-catapult.patch
2022-08-08 08:46:02 +00:00
Patch68 : do-not-build-libvulkan.so.patch
Patch69 : nasm-generate-debuginfo.patch
2022-10-04 19:13:55 +00:00
Patch70 : disable-fuses.patch
2022-10-29 19:25:58 +00:00
Patch71 : enable-jxl.patch
2022-11-02 11:16:40 +00:00
Patch72 : electron-version-from-env.patch
2022-08-01 08:25:54 +00:00
# PATCHES to use system libs
Patch1002 : chromium-system-libusb.patch
Patch1017 : system-libdrm.patch
# http://svnweb.mageia.org/packages/updates/7/chromium-browser-stable/current/SOURCES/chromium-74-pdfium-system-libopenjpeg2.patch?view=markup
Patch1038 : pdfium-fix-system-libs.patch
2022-07-04 09:07:38 +00:00
# https://sources.debian.org/patches/chromium/102.0.5005.115-1/system/jsoncpp.patch/
2022-08-01 08:25:54 +00:00
Patch1040 : system-jsoncpp.patch
2022-07-04 09:07:38 +00:00
# https://sources.debian.org/patches/chromium/102.0.5005.115-1/system/zlib.patch/
2022-08-01 08:25:54 +00:00
Patch1041 : system-zlib.patch
Patch1043 : node-system-libs.patch
Patch1044 : replace_gn_files-system-libs.patch
Patch1045 : angle-system-xxhash.patch
2022-07-04 09:07:38 +00:00
# https://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-99-pdfium-system-libtiff-libpng.patch
2022-08-01 08:25:54 +00:00
Patch1046 : chromium-99-pdfium-system-libtiff.patch
Patch1047 : cares_public_headers.patch
Patch1048 : chromium-remove-bundled-roboto-font.patch
Patch1053 : swiftshader-use-system-llvm.patch
Patch1054 : thread_annotations-fix-build-with-system-abseil.patch
Patch1063 : system-libbsd.patch
Patch1065 : base-system-nspr.patch
Patch1066 : system-gtest.patch
Patch1067 : breakpad-system-curl.patch
2022-08-08 08:46:02 +00:00
Patch1068 : system-six.patch
Patch1069 : system-usb_ids.patch
Patch1070 : skia-system-vulkan-headers.patch
Patch1071 : system-pydeps.patch
Patch1072 : node-system-icu.patch
Patch1073 : system-nasm.patch
Patch1074 : no-zlib-headers.patch
2022-10-04 19:13:55 +00:00
Patch1075 : system-abseil-missing-shims.patch
Patch1076 : crashpad-use-system-abseil.patch
2022-08-01 08:25:54 +00:00
# PATCHES to fix interaction with third-party software
Patch2004 : chromium-gcc11.patch
Patch2010 : chromium-93-ffmpeg-4.4.patch
Patch2011 : chromium-ffmpeg-first-dts.patch
# Fix building sql recover_module
Patch2020 : electron-13-fix-sql-virtualcursor-type.patch
# Fixe builds with older clang versions that do not allow
# nomerge attributes on declaration. Otherwise, the following error
# is produced:
# 'nomerge' attribute cannot be applied to a declaration
# See https://reviews.llvm.org/D92800
Patch2022 : electron-13-fix-base-check-nomerge.patch
# Fix electron patched code
Patch2024 : electron-16-std-vector-non-const.patch
Patch2029 : electron-16-webpack-fix-openssl-3.patch
2022-10-04 19:13:55 +00:00
Patch2030 : v8-icu69-FormattedNumberRange-no-default-constructible.patch
2022-10-07 13:16:29 +00:00
Patch2031 : partition_alloc-no-lto.patch
2022-10-26 04:51:48 +00:00
Patch2032 : seccomp_bpf-no-lto.patch
2022-08-01 08:25:54 +00:00
# PATCHES that should be submitted upstream verbatim or near-verbatim
Patch3016 : chromium-98-EnumTable-crash.patch
# Fix blink nodestructor
Patch3023 : electron-13-blink-gcc-ambiguous-nodestructor.patch
Patch3027 : electron-16-freetype-visibility-list.patch
Patch3028 : electron-16-third_party-symbolize-missing-include.patch
# From https://git.droidware.info/wchen342/ungoogled-chromium-fedora
Patch3033 : chromium-94.0.4606.71-InkDropHost-crash.patch
Patch3056 : async_shared_storage_database_impl-missing-absl-WrapUnique.patch
2022-07-04 09:07:38 +00:00
# https://salsa.debian.org/chromium-team/chromium/-/blob/456851fc808b2a5b5c762921699994e957645917/debian/patches/upstream/nested-nested-nested-nested-nested-nested-regex-patterns.patch
2022-08-01 08:25:54 +00:00
Patch3064 : nested-nested-nested-nested-nested-nested-regex-patterns.patch
# Fedora patch to fix build with python3.11
Patch3066 : chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch
2022-09-06 13:05:31 +00:00
Patch3067 : reproducible-config.gypi.patch
2022-09-21 09:00:14 +00:00
Patch3068 : content_language_parser-missing-string.patch
Patch3069 : aggregatable_attribution_utils-do-not-assume-abseil-ABI.patch
Patch3072 : attribution_response_parsing-do-not-assume-abseil-ABI.patch
Patch3073 : common.gypi-cpp-version.patch
2022-10-04 19:13:55 +00:00
Patch3074 : pending_beacon_dispatcher-virtual-functions-cannot-be-constexpr.patch
Patch3075 : std_lib_extras-missing-intptr_t.patch
2022-10-05 05:50:20 +00:00
Patch3076 : gtk_ui_platform_stub-incomplete-type-LinuxInputMethodContext.patch
2022-10-07 13:16:29 +00:00
Patch3077 : argument_spec-missing-isnan-isinf.patch
2022-10-26 04:51:48 +00:00
Patch3078 : select_file_dialog_linux_kde-Wodr.patch
Patch3079 : web_contents_impl-Wsubobject-linkage.patch
Patch3080 : compact_enc_det_generated_tables-Wnarrowing.patch
Patch3081 : string_hasher-type-pun-UB-causes-heap-corruption.patch
Patch3082 : ipcz-buffer_id-Wnarrowing.patch
Patch3083 : swiftshader-Half-Wstrict-aliasing.patch
Patch3084 : swiftshader-Constants-Wstrict-aliasing.patch
Patch3085 : half_float-Wstrict-aliasing.patch
Patch3086 : unzip-Wsubobject-linkage.patch
Patch3087 : v8_initializer-PageAllocator-fpermissive.patch
2022-11-02 11:16:40 +00:00
Patch3089 : ipcz-safe_math-Wuninitialized.patch
Patch3090 : passwords_counter-Wsubobject-linkage.patch
Patch3091 : vector_math_impl-Wstrict-aliasing.patch
Patch3092 : webgl_image_conversion-Wstrict-aliasing.patch
Patch3093 : xr_cube_map-Wstrict-aliasing.patch
Patch3094 : static_constructors-Wstrict-aliasing.patch
2022-08-01 08:25:54 +00:00
2022-07-04 09:07:38 +00:00
%if %{with clang}
BuildRequires : clang
BuildRequires : lld
2022-08-01 08:25:54 +00:00
BuildRequires : llvm
2022-10-13 09:38:43 +00:00
%if 0%{?suse_version} && 0%{?suse_version} < 1550
BuildRequires : gcc11
BuildRequires : libstdc++6-devel-gcc11
%endif
2022-07-04 09:07:38 +00:00
%endif
%if %{with gold}
2021-06-29 20:42:56 +00:00
BuildRequires : binutils-gold
2022-07-04 09:07:38 +00:00
%endif
BuildRequires : brotli
%if %{with system_cares}
BuildRequires : c-ares-devel
%endif
%if %{with system_crc32c}
BuildRequires : cmake(Crc32c)
%endif
%if %{with system_double_conversion}
BuildRequires : double-conversion-devel
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : desktop-file-utils
BuildRequires : fdupes
2022-08-08 08:46:02 +00:00
%if 0%{?fedora}
BuildRequires : flatbuffers-compiler
%endif
BuildRequires : flatbuffers-devel
2022-07-04 09:07:38 +00:00
BuildRequires : git-core
2021-06-29 20:42:56 +00:00
BuildRequires : gn >= 0.1807
BuildRequires : gperf
2022-07-07 08:02:56 +00:00
%if %{with system_histogram}
BuildRequires : HdrHistogram_c-devel
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : hicolor-icon-theme
2022-08-08 08:46:02 +00:00
BuildRequires : hwdata
2022-07-04 09:07:38 +00:00
%if 0%{?fedora}
BuildRequires : libatomic
2021-07-01 05:05:47 +00:00
%endif
2022-07-07 08:02:56 +00:00
%if %{with system_aom}
BuildRequires : libaom-devel >= 3.4
%endif
2022-07-04 09:07:38 +00:00
BuildRequires : libbsd-devel
2021-06-29 20:42:56 +00:00
BuildRequires : libpng-devel
2022-07-04 09:07:38 +00:00
%if %{with system_nvctrl}
BuildRequires : libXNVCtrl-devel
%endif
2022-07-07 08:02:56 +00:00
%if %{with system_llhttp}
BuildRequires : llhttp-devel
%endif
2022-08-08 08:46:02 +00:00
%if %{with lld}
BuildRequires : lld
%endif
2022-09-21 09:00:14 +00:00
%if %{without subzero}
2022-07-04 09:07:38 +00:00
BuildRequires : llvm-devel
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : memory-constraints
2022-08-08 08:46:02 +00:00
%if %{with mold}
BuildRequires : mold
%endif
2022-10-29 19:25:58 +00:00
%ifarch %ix86 x86_64
2022-08-08 08:46:02 +00:00
BuildRequires : nasm
2022-10-29 19:25:58 +00:00
%endif
2021-07-01 05:05:47 +00:00
%if 0%{?suse_version}
2021-06-29 20:42:56 +00:00
BuildRequires : ninja >= 1.7.2
2022-07-04 09:07:38 +00:00
%else
2021-07-01 05:05:47 +00:00
BuildRequires : ninja-build >= 1.7.2
%endif
2022-08-01 10:51:40 +00:00
%if 0%{?sle_version} == 150300
BuildRequires : nodejs16
BuildRequires : npm16
%else
2022-08-01 08:25:54 +00:00
BuildRequires : nodejs >= 16
2021-06-29 20:42:56 +00:00
BuildRequires : npm
2022-08-01 10:51:40 +00:00
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig
2022-08-08 08:46:02 +00:00
BuildRequires : plasma-wayland-protocols
BuildRequires : python3-json5
BuildRequires : python3-mako
BuildRequires : python3-ply
2022-07-07 08:02:56 +00:00
BuildRequires : python3-six
2021-06-29 20:42:56 +00:00
BuildRequires : rsync
BuildRequires : snappy-devel
2021-07-01 05:05:47 +00:00
%if 0%{?suse_version}
2021-06-29 20:42:56 +00:00
BuildRequires : update-desktop-files
2021-07-01 05:05:47 +00:00
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : util-linux
2022-08-08 08:46:02 +00:00
BuildRequires : vulkan-headers
2022-07-04 09:07:38 +00:00
%if %{with system_abseil}
BuildRequires : pkgconfig(absl_algorithm_container) >= 20211000
BuildRequires : pkgconfig(absl_base)
BuildRequires : pkgconfig(absl_bind_front)
BuildRequires : pkgconfig(absl_bits)
BuildRequires : pkgconfig(absl_btree)
BuildRequires : pkgconfig(absl_cleanup)
BuildRequires : pkgconfig(absl_config)
BuildRequires : pkgconfig(absl_cord)
BuildRequires : pkgconfig(absl_core_headers)
BuildRequires : pkgconfig(absl_failure_signal_handler)
BuildRequires : pkgconfig(absl_fixed_array)
BuildRequires : pkgconfig(absl_flags)
BuildRequires : pkgconfig(absl_flags_parse)
BuildRequires : pkgconfig(absl_flags_usage)
BuildRequires : pkgconfig(absl_flat_hash_map)
BuildRequires : pkgconfig(absl_flat_hash_set)
BuildRequires : pkgconfig(absl_hash)
BuildRequires : pkgconfig(absl_inlined_vector)
BuildRequires : pkgconfig(absl_int128)
BuildRequires : pkgconfig(absl_memory)
BuildRequires : pkgconfig(absl_node_hash_map)
BuildRequires : pkgconfig(absl_node_hash_set)
BuildRequires : pkgconfig(absl_optional)
BuildRequires : pkgconfig(absl_random_random)
BuildRequires : pkgconfig(absl_span)
BuildRequires : pkgconfig(absl_stacktrace)
BuildRequires : pkgconfig(absl_status)
BuildRequires : pkgconfig(absl_statusor)
BuildRequires : pkgconfig(absl_strings)
BuildRequires : pkgconfig(absl_str_format)
BuildRequires : pkgconfig(absl_symbolize)
BuildRequires : pkgconfig(absl_synchronization)
BuildRequires : pkgconfig(absl_time)
BuildRequires : pkgconfig(absl_type_traits)
2022-09-21 09:00:14 +00:00
BuildRequires : pkgconfig(absl_utility)
2022-07-04 09:07:38 +00:00
BuildRequires : pkgconfig(absl_variant)
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(alsa)
BuildRequires : pkgconfig(cairo) >= 1.6
2022-07-04 09:07:38 +00:00
%if %{with system_dav1d}
BuildRequires : pkgconfig(dav1d) >= 1
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(dbus-1)
BuildRequires : pkgconfig(dri)
BuildRequires : pkgconfig(expat)
BuildRequires : pkgconfig(flac++)
2022-01-29 19:59:26 +00:00
%if %{with system_freetype}
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(freetype2)
2022-01-29 19:59:26 +00:00
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(gbm)
BuildRequires : pkgconfig(glib-2.0)
BuildRequires : pkgconfig(glproto)
2022-08-01 08:25:54 +00:00
BuildRequires : pkgconfig(gtest)
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(gtk+-3.0)
2022-01-29 19:59:26 +00:00
%if %{with system_harfbuzz}
2022-07-04 09:07:38 +00:00
BuildRequires : pkgconfig(harfbuzz) >= 3
2022-01-29 19:59:26 +00:00
%endif
2022-10-04 19:13:55 +00:00
2022-09-21 09:00:14 +00:00
%if %{with icu_71}
BuildRequires : pkgconfig(icu-i18n) >= 71
2021-10-07 22:05:47 +00:00
%else
2022-10-04 19:13:55 +00:00
%if 0%{?fedora}
BuildRequires : libicu-devel < 70
%else
BuildRequires : icu.691-devel
2021-10-07 22:05:47 +00:00
%endif
2022-10-04 19:13:55 +00:00
2022-07-04 09:07:38 +00:00
%endif
2022-10-04 19:13:55 +00:00
BuildRequires : pkgconfig(jsoncpp)
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(krb5)
2022-07-04 09:07:38 +00:00
BuildRequires : pkgconfig(lcms2)
2022-09-21 09:00:14 +00:00
%if %{with ffmpeg_5}
BuildRequires : pkgconfig(libavcodec) >= 59
BuildRequires : pkgconfig(libavformat) >= 59
BuildRequires : pkgconfig(libavutil) >= 57
%else
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(libavcodec)
BuildRequires : pkgconfig(libavformat) >= 58
BuildRequires : pkgconfig(libavutil)
2022-09-21 09:00:14 +00:00
%endif
2022-07-04 09:07:38 +00:00
%if %{with system_avif}
BuildRequires : pkgconfig(libavif)
%endif
BuildRequires : pkgconfig(libbrotlidec)
BuildRequires : pkgconfig(libbrotlienc)
BuildRequires : pkgconfig(libcares)
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(libcurl)
BuildRequires : pkgconfig(libdrm)
BuildRequires : pkgconfig(libevent)
2022-07-04 09:07:38 +00:00
%if %{with system_jxl}
BuildRequires : pkgconfig(libjxl)
%endif
%if %{with system_nghttp2}
BuildRequires : pkgconfig(libnghttp2)
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(libnotify)
2022-07-04 09:07:38 +00:00
BuildRequires : pkgconfig(libopenjp2)
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(libpci)
BuildRequires : pkgconfig(libpulse)
2022-08-08 08:46:02 +00:00
BuildRequires : pkgconfig(libsecret-1)
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(libva)
BuildRequires : pkgconfig(libwebp) >= 0.4.0
2022-07-04 09:07:38 +00:00
%if %{with system_woff2}
BuildRequires : pkgconfig(libwoff2dec)
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(libxml-2.0) >= 2.9.5
BuildRequires : pkgconfig(libxslt)
2022-07-04 09:07:38 +00:00
BuildRequires : pkgconfig(libxxhash)
2022-08-08 08:46:02 +00:00
%if %{with system_yuv}
BuildRequires : pkgconfig(libyuv)
%endif
2022-01-29 19:59:26 +00:00
%if 0%{?fedora}
2021-07-15 22:00:36 +00:00
BuildRequires : minizip-compat-devel
%else
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(minizip)
2021-07-15 22:00:36 +00:00
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(nspr) >= 4.9.5
BuildRequires : pkgconfig(nss) >= 3.26
BuildRequires : pkgconfig(opus) >= 1.3.1
2022-07-04 09:07:38 +00:00
BuildRequires : pkgconfig(pangocairo)
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(re2)
2022-07-04 09:07:38 +00:00
%if %{with system_spirv}
%if 0%{?suse_version}
BuildRequires : spirv-headers
%else
BuildRequires : spirv-headers-devel
%endif
BuildRequires : pkgconfig(SPIRV-Tools) >= 2022.2
%endif
2021-06-29 20:42:56 +00:00
BuildRequires : pkgconfig(xkbcommon)
BuildRequires : pkgconfig(xshmfence)
BuildRequires : pkgconfig(zlib)
%if 0%{?suse_version}
BuildRequires : libjpeg-devel >= 8.1
%else
BuildRequires : libjpeg-turbo-devel
%endif
%if %{with system_vpx}
BuildRequires : pkgconfig(vpx) >= 1.8.2
%endif
%if %{without clang}
2022-08-29 08:58:56 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora}
2022-10-26 04:51:48 +00:00
BuildRequires : gcc >= 11
BuildRequires : gcc-c++ >= 11
2021-06-29 20:42:56 +00:00
%else
2022-10-26 04:51:48 +00:00
BuildRequires : gcc11-PIE
BuildRequires : gcc11-c++
2021-06-29 20:42:56 +00:00
%endif
%endif
%if %{with pipewire}
BuildRequires : pkgconfig(libpipewire-0.3)
BuildRequires : pkgconfig(libspa-0.2)
%endif
2022-07-04 09:07:38 +00:00
Requires : hicolor-icon-theme
Requires : google-roboto-fonts
2021-06-29 20:42:56 +00:00
Recommends: noto-coloremoji-fonts
2022-07-04 09:07:38 +00:00
# This required library is dlopened
%ifarch %ix86 %arm
Requires : libvulkan.so.1
%else
Requires : libvulkan.so.1()(64bit)
%endif
2021-06-29 20:42:56 +00:00
Provides : electron
2022-09-21 09:00:14 +00:00
Provides : electron%{_isa}(abi) = %{abi_version}
2021-06-29 20:42:56 +00:00
Obsoletes : nodejs-electron-prebuilt < %{version}
Provides : nodejs-electron-prebuilt = %{version}
%description
Nodejs application: Build cross platform desktop apps with JavaScript, HTML, and CSS
2022-01-29 19:59:26 +00:00
%package devel
Summary : Electron development headers
Group : Development/Libraries/C and C++
2022-08-08 08:46:02 +00:00
Requires : nodejs-electron%{?_isa} = %{version}
Requires : pkgconfig(zlib)
2022-01-29 19:59:26 +00:00
2022-10-04 19:13:55 +00:00
%if %{without icu_71}
#SUSE patched code includes icu headers
%if 0%{?fedora}
Requires : libicu-devel%{?_isa}
%else
Requires : icu.691-devel%{?_isa}
%endif
%endif
2022-01-29 19:59:26 +00:00
%description devel
Development headers for Electron projects.
2022-10-04 19:13:55 +00:00
%package doc
Summary : Electron API documentation
Group : Documentation/Other
Enhances: nodejs-electron-devel = %{version}
BuildArch : noarch
%description doc
Development documentation for the Electron runtime.
2021-06-29 20:42:56 +00:00
%prep
2022-10-13 09:38:43 +00:00
%if %{with clang}
clang -v
%endif
2021-06-29 20:42:56 +00:00
2022-07-04 09:07:38 +00:00
# Use stable path to source to make use of ccache
%autosetup -n src -p1
2022-09-21 09:00:14 +00:00
# Sanity check if macro corresponds to the actual ABI
test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //' ) = %abi_version
2022-10-04 19:13:55 +00:00
%if %{without system_abseil}
patch -R -p1 < %PATCH1054
patch -R -p1 < %PATCH1076
%endif
2022-09-21 09:00:14 +00:00
%if %{without ffmpeg_5}
patch -R -p1 < %SOURCE400
%endif
%if %{without icu_71}
2022-10-04 19:13:55 +00:00
patch -R -p1 < %SOURCE410
patch -R -p1 < %SOURCE411
%else
patch -R -p1 < %PATCH2030
2022-09-21 09:00:14 +00:00
%endif
2022-07-04 09:07:38 +00:00
2022-10-04 19:13:55 +00:00
# This one depends on an ffmpeg nightly, reverting unconditionally.
patch -R -p1 < %SOURCE401
# This one is dead code, we cen revert it even when using bundled avif.
patch -R -p1 < %SOURCE420
2022-07-04 09:07:38 +00:00
2022-08-08 08:46:02 +00:00
# Link system wayland-protocols-devel into where chrome expects them
mkdir -p third_party/wayland-protocols/kde/src
#ln -svfT %{_datadir}/wayland-protocols third_party/wayland-protocols/src
ln -svfT %{_datadir} /plasma-wayland-protocols third_party/wayland-protocols/kde/src/protocols
2022-07-04 09:07:38 +00:00
# Shim generators for replace_gn_files.py
cp -lv %{_sourcedir} /*.gn build/linux/unbundle/
2021-06-29 20:42:56 +00:00
2021-07-01 05:05:47 +00:00
# Fix the path to nodejs binary
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -sf %{_bindir} /node third_party/node/linux/node-linux-x64/bin/node
2022-01-27 22:16:50 +00:00
# Fix eu-strip
2022-08-01 08:25:54 +00:00
mkdir -p buildtools/third_party/eu-strip/bin
ln -sf %{_bindir} /eu-strip buildtools/third_party/eu-strip/bin/eu-strip
2022-01-27 22:16:50 +00:00
2021-06-29 20:42:56 +00:00
# Fix shim header generation
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
tools/generate_shim_headers/generate_shim_headers.py
2021-11-27 22:42:32 +00:00
2021-06-29 20:42:56 +00:00
%build
# GN sets lto on its own and we need just ldflag options, not cflags
%define _lto_cflags %{nil}
2022-11-02 11:16:40 +00:00
# see electron-version-from-env.patch
export SUSE_ELECTRON_VERSION=%{version}
2022-08-01 08:25:54 +00:00
2022-01-27 22:16:50 +00:00
# Make sure python is python3
install -d -m 0755 python3-path
ln -sf %{_bindir} /python3 " $ ( p w d ) / p y t h o n 3 - p a t h / p y t h o n "
export PATH=" $ ( p w d ) / p y t h o n 3 - p a t h : $ { P A T H } "
2021-07-15 22:00:36 +00:00
2022-10-13 09:38:43 +00:00
2022-08-08 08:46:02 +00:00
#some Fedora ports still try to build with LTO
ARCH_FLAGS=$(echo " % o p t f l a g s " |sed 's/-f[^ ]*lto[^ ]*//g' )
2022-07-04 09:07:38 +00:00
2022-10-26 04:51:48 +00:00
#Work around an upstream ODR issue.
#Remove this once https://bugs.chromium.org/p/chromium/issues/detail?id=1375049 gets fixed.
ARCH_FLAGS=" $ A R C H _ F L A G S - D I S _ S E R I A L _ E N A B L E D _ P L A T F O R M "
2022-10-18 12:07:55 +00:00
2022-07-04 09:07:38 +00:00
%if 0%{?fedora}
# Fix base/allocator/allocator_shim.cc:408:2: error: #error This code cannot be
# used when exceptions are turned on.
ARCH_FLAGS=" $ ( e c h o $ A R C H _ F L A G S | s e d - e ' s / - f e x c e p t i o n s / / g ' ) "
%endif
2022-10-13 09:38:43 +00:00
%if %{with clang}
#RPM debugedit cannot handle clang's default dwarf-5
ARCH_FLAGS=" $ A R C H _ F L A G S - f d e b u g - d e f a u l t - v e r s i o n = 4 "
%endif
2022-07-04 09:07:38 +00:00
2021-06-29 20:42:56 +00:00
# for wayland
2022-07-04 09:07:38 +00:00
export CXXFLAGS=" $ { A R C H _ F L A G S } - I / u s r / i n c l u d e / w a y l a n d - I / u s r / i n c l u d e / l i b x k b c o m m o n "
2022-08-01 08:25:54 +00:00
export CFLAGS=" $ { C X X F L A G S } "
# Google has a bad coding style, using a macro `NOTREACHED()` that is not properly detected by GCC
2022-10-26 04:51:48 +00:00
# multiple times throughout the codebase (including generated code). It is not possible to redefine the macro to __builtin_unreachable,
2022-08-01 08:25:54 +00:00
# as it has an astonishing syntax, behaving like an ostream (in debug builds it is supposed to trap and print an error message)
export CXXFLAGS=" $ { C X X F L A G S } - W n o - e r r o r = r e t u r n - t y p e "
2022-10-26 04:51:48 +00:00
# [ 8947s] gen/third_party/blink/renderer/bindings/modules/v8/v8_gpu_sampler_descriptor.h:212:39: error: narrowing conversion of '4294967295' from 'unsigned int' to 'float' [-Wnarrowing]
# [ 8947s] 212 | float member_lod_max_clamp_{0xffffffff};
# I have no idea where this code is generated, and it is not something that needs a critical fix.
# Remove this once upstream issues a proper patch.
export CXXFLAGS=" $ { C X X F L A G S } - W n o - e r r o r = n a r r o w i n g "
# A bunch of memcpy'ing of JSObject in V8 runs us into “Logfile got too big, killed job.”
export CXXFLAGS=" $ { C X X F L A G S } - W n o - c l a s s - m e m a c c e s s "
2022-08-01 08:25:54 +00:00
2022-08-08 08:46:02 +00:00
# REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch
export CXXFLAGS=" $ ( e c h o $ { C X X F L A G S } | s e d - e ' s / - g / / g ' - e ' s / - g $ / / g ' ) "
2022-10-26 04:51:48 +00:00
%ifnarch x86_64
2022-08-08 08:46:02 +00:00
export CFLAGS=" $ ( e c h o $ { C F L A G S } | s e d - e ' s / - g / - g 1 / g ' - e ' s / - g $ / - g 1 / g ' ) "
%endif
2022-08-01 08:25:54 +00:00
2022-07-04 09:07:38 +00:00
export LDFLAGS=" %{?build_ldflags} "
2021-06-29 20:42:56 +00:00
%if %{with clang}
2022-08-01 08:25:54 +00:00
2021-06-29 20:42:56 +00:00
export CC=clang
export CXX=clang++
2022-08-01 08:25:54 +00:00
export AR=llvm-ar
export NM=llvm-nm
export RANLIB=llvm-ranlib
2021-06-29 20:42:56 +00:00
# else with clang
%else
2022-04-19 08:14:15 +00:00
2022-07-04 09:07:38 +00:00
%ifarch %ix86 %arm
#try to reduce memory
2022-10-29 19:25:58 +00:00
%if %{without lld} && %{without mold}
2022-10-26 04:51:48 +00:00
%if %{with gold}
export LDFLAGS=" $ { L D F L A G S } - W l , - - n o - m a p - w h o l e - f i l e s - W l , - - n o - k e e p - m e m o r y - W l , - - n o - k e e p - f i l e s - m a p p e d "
%else
export LDFLAGS=" $ { L D F L A G S } - W l , - - n o - k e e p - m e m o r y - W l , - - h a s h - s i z e = 3 0 - W l , - - r e d u c e - m e m o r y - o v e r h e a d s "
2021-07-15 22:00:36 +00:00
%endif
2021-06-29 20:42:56 +00:00
2022-10-26 04:51:48 +00:00
%endif #without lld
%endif #ifarch ix86 arm
2022-07-04 09:07:38 +00:00
2021-06-29 20:42:56 +00:00
2021-07-01 05:05:47 +00:00
2022-08-29 08:58:56 +00:00
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora}
2021-06-29 20:42:56 +00:00
export CC=gcc
export CXX=g++
2022-08-01 08:25:54 +00:00
export AR=gcc-ar
export NM=gcc-nm
export RANLIB=gcc-ranlib
2021-07-01 05:05:47 +00:00
%else
2022-10-26 04:51:48 +00:00
export CC=gcc-11
export CXX=g++-11
export AR=gcc-ar-11
export NM=gcc-nm-11
export RANLIB=gcc-ranlib-11
2021-07-01 05:05:47 +00:00
%endif
2021-06-29 20:42:56 +00:00
# endif with clang
%endif
2022-08-08 08:46:02 +00:00
%if %{with lld}
export LDFLAGS=" $ { L D F L A G S } - W l , - - a s - n e e d e d - f u s e - l d = l l d "
%endif
%if %{with mold}
export LDFLAGS=" $ { L D F L A G S } - W l , - - a s - n e e d e d - f u s e - l d = m o l d "
%endif
2021-06-29 20:42:56 +00:00
# do not eat all memory
2022-08-08 08:46:02 +00:00
%ifarch %ix86 %arm
%limit_build -m 1200
%else
2021-06-29 20:42:56 +00:00
%limit_build -m 2600
2022-08-08 08:46:02 +00:00
%endif
2021-06-29 20:42:56 +00:00
2022-09-23 06:20:34 +00:00
%if %{with lto} && %{without clang}
# reduce the threads for linking even more due to LTO eating ton of memory
_link_threads=$(((%{jobs} - 2)))
2022-10-26 04:51:48 +00:00
2022-10-04 19:13:55 +00:00
%ifarch aarch64
_link_threads=1
2022-10-26 04:51:48 +00:00
2022-10-29 19:25:58 +00:00
%if %{without mold}
2022-10-26 04:51:48 +00:00
%if %{with gold}
export LDFLAGS=" $ { L D F L A G S } - W l , - - n o - m a p - w h o l e - f i l e s - W l , - - n o - k e e p - m e m o r y - W l , - - n o - k e e p - f i l e s - m a p p e d "
%else
export LDFLAGS=" $ { L D F L A G S } - W l , - - n o - k e e p - m e m o r y - W l , - - h a s h - s i z e = 3 0 - W l , - - r e d u c e - m e m o r y - o v e r h e a d s "
%endif
2022-10-29 19:25:58 +00:00
%endif
2022-10-26 04:51:48 +00:00
2022-10-04 19:13:55 +00:00
%endif
2022-09-23 06:20:34 +00:00
test " $ _ l i n k _ t h r e a d s " -le 0 && _link_threads=1
2022-10-13 09:38:43 +00:00
export LDFLAGS=" $ L D F L A G S - f l t o = $ _ l i n k _ t h r e a d s - - p a r a m l t o - m a x - s t r e a m i n g - p a r a l l e l i s m = 1 "
2022-09-23 06:20:34 +00:00
%endif
2021-06-29 20:42:56 +00:00
gn_system_libraries=(
2022-07-04 09:07:38 +00:00
brotli
ffmpeg
2021-06-29 20:42:56 +00:00
flac
2022-08-08 08:46:02 +00:00
flatbuffers
2021-06-29 20:42:56 +00:00
fontconfig
2022-09-21 09:00:14 +00:00
icu
2021-06-29 20:42:56 +00:00
libdrm
libevent
libjpeg
libpng
2022-08-08 08:46:02 +00:00
libsecret
2021-06-29 20:42:56 +00:00
libusb
libwebp
libxml
libxslt
opus
re2
snappy
zlib
)
2022-07-04 09:07:38 +00:00
%if %{with system_abseil}
2022-08-08 08:46:02 +00:00
find third_party/abseil-cpp -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=(
absl_algorithm
absl_base
absl_cleanup
absl_container
absl_debugging
absl_flags
absl_functional
absl_hash
absl_memory
absl_meta
absl_numeric
absl_random
absl_status
absl_strings
absl_synchronization
absl_time
absl_types
2022-09-21 09:00:14 +00:00
absl_utility
2022-07-04 09:07:38 +00:00
)
%endif
%if %{with system_aom}
2022-08-08 08:46:02 +00:00
find third_party/libaom -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( libaom )
%endif
%if %{with system_avif}
2022-08-08 08:46:02 +00:00
find third_party/libavif -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( libavif )
%endif
%if %{with system_crc32c}
2022-08-08 08:46:02 +00:00
find third_party/crc32c -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( crc32c )
%endif
%if %{with system_jxl}
2022-08-08 08:46:02 +00:00
find third_party/highway -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
find third_party/libjxl -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( libjxl )
%endif
%if %{with system_dav1d}
2022-08-08 08:46:02 +00:00
find third_party/dav1d -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( dav1d )
%endif
%if %{with system_double_conversion}
2022-08-08 08:46:02 +00:00
find base/third_party/double_conversion -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( double-conversion )
%endif
%if %{with system_nvctrl}
2022-08-08 08:46:02 +00:00
find third_party/angle/src/third_party/libXNVCtrl/ -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( libXNVCtrl )
%endif
%if %{with system_spirv}
2022-08-08 08:46:02 +00:00
rm -rf third_party/swiftshader/third_party/SPIRV-Headers/include
find third_party/swiftshader/third_party/SPIRV-Tools/ -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
rm -rf third_party/vulkan-deps/spirv-headers/src/include
find third_party/vulkan-deps/spirv-tools/ -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=(
swiftshader-SPIRV-Headers
swiftshader-SPIRV-Tools
#The following can only be unbundled if you don't build DAWN (WebGPU)
vulkan-SPIRV-Headers
vulkan-SPIRV-Tools
)
%endif
2022-01-29 19:59:26 +00:00
%if %{with system_harfbuzz}
2022-08-08 08:46:02 +00:00
find third_party/harfbuzz-ng -type f ! -name " * . g n " -a ! -name " * . g n i " -a ! -path " t h i r d _ p a r t y / h a r f b u z z - n g / u t i l s / h b _ s c o p e d . h " -delete
2022-01-29 19:59:26 +00:00
gn_system_libraries+=( harfbuzz-ng )
%endif
%if %{with system_freetype}
2022-08-08 08:46:02 +00:00
find third_party/freetype -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-01-29 19:59:26 +00:00
gn_system_libraries+=( freetype )
%endif
2021-06-29 20:42:56 +00:00
%if %{with system_vpx}
2022-08-08 08:46:02 +00:00
find third_party/libvpx -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2021-06-29 20:42:56 +00:00
gn_system_libraries+=( libvpx )
%endif
2022-07-04 09:07:38 +00:00
%if %{with system_woff2}
2022-08-08 08:46:02 +00:00
find third_party/woff2 -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
2022-07-04 09:07:38 +00:00
gn_system_libraries+=( woff2 )
%endif
2022-08-08 08:46:02 +00:00
%if %{with system_yuv}
find third_party/libyuv -type f ! -name " * . g n " -a ! -name " * . g n i " -delete
gn_system_libraries+=( libyuv )
%endif
2021-06-29 20:42:56 +00:00
build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]}
2022-08-08 08:46:02 +00:00
2022-07-04 09:07:38 +00:00
%if %{with system_nghttp2}
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/nghttp2 -type f ! -name " * . g n " -a ! -name " * . g n i " -a ! -name " * . g y p " -a ! -name " * . g y p i " -delete
2022-07-04 09:07:38 +00:00
%endif
2022-07-07 08:02:56 +00:00
%if %{with system_llhttp}
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/llhttp -type f ! -name " * . g n " -a ! -name " * . g n i " -a ! -name " * . g y p " -a ! -name " * . g y p i " -delete
2022-07-07 08:02:56 +00:00
%endif
%if %{with system_histogram}
2022-08-08 08:46:02 +00:00
find third_party/electron_node/deps/histogram -type f ! -name " * . g n " -a ! -name " * . g n i " -a ! -name " * . g y p " -a ! -name " * . g y p i " -delete
2022-07-07 08:02:56 +00:00
%endif
2022-07-04 09:07:38 +00:00
2021-06-29 20:42:56 +00:00
# Create the configuration for GN
# Available options: out/Release/gn args --list out/Release/
myconf_gn=" "
myconf_gn+=" c u s t o m _ t o o l c h a i n = \" / / b u i l d / t o o l c h a i n / l i n u x / u n b u n d l e : d e f a u l t \" "
myconf_gn+=" h o s t _ t o o l c h a i n = \" / / b u i l d / t o o l c h a i n / l i n u x / u n b u n d l e : d e f a u l t \" "
myconf_gn+=" u s e _ c u s t o m _ l i b c x x = f a l s e "
2022-07-04 09:07:38 +00:00
%ifarch %ix86
myconf_gn+=" h o s t _ c p u = \" x 8 6 \" "
%endif
2022-01-27 22:16:50 +00:00
%ifarch x86_64
myconf_gn+=" h o s t _ c p u = \" x 6 4 \" "
%endif
%ifarch aarch64
myconf_gn+=" h o s t _ c p u = \" a r m 6 4 \" "
2022-10-04 19:13:55 +00:00
#default is "standard" which does not work with gcc
#This does not raise the cpu requirements according to https://developer.arm.com/documentation/101754/0616/armclang-Reference/armclang-Command-line-Options/-mbranch-protection
myconf_gn+=" a r m _ c o n t r o l _ f l o w _ i n t e g r i t y = \" p a c \" "
2022-01-27 22:16:50 +00:00
%endif
2022-07-04 09:07:38 +00:00
%ifarch %arm
myconf_gn+=" h o s t _ c p u = \" a r m \" "
2022-09-21 09:00:14 +00:00
#openSUSE only supports armhf
%ifarch armv7hl armv7hnl
myconf_gn+=" a r m _ v e r s i o n = 7 "
%endif
%ifarch armv6hl
myconf_gn+=" a r m _ v e r s i o n = 6 "
%endif
myconf_gn+=" a r m _ f l o a t _ a b i = \" h a r d \" "
2022-07-04 09:07:38 +00:00
# Disable requirement of neon instructions
2022-09-21 09:00:14 +00:00
%ifarch armv7hnl armv8hnl armv8hcnl
myconf_gn+=" a r m _ u s e _ n e o n = t r u e "
%else
myconf_gn+=" a r m _ u s e _ n e o n = f a l s e "
2022-07-04 09:07:38 +00:00
%endif
2022-09-21 09:00:14 +00:00
%endif #ifarch arm
2022-10-04 19:13:55 +00:00
2022-01-27 22:16:50 +00:00
myconf_gn+=" h o s t _ o s = \" l i n u x \" "
2021-06-29 20:42:56 +00:00
myconf_gn+=" i s _ d e b u g = f a l s e "
2022-01-27 22:16:50 +00:00
myconf_gn+=" d c h e c k _ a l w a y s _ o n = f a l s e "
2021-06-29 20:42:56 +00:00
myconf_gn+=" e n a b l e _ n a c l = f a l s e "
2022-07-04 09:07:38 +00:00
%if %{with subzero}
2021-06-29 20:42:56 +00:00
myconf_gn+=" u s e _ s w i f t s h a d e r _ w i t h _ s u b z e r o = t r u e "
2022-07-04 09:07:38 +00:00
%else
myconf_gn+=" u s e _ s w i f t s h a d e r _ w i t h _ s u b z e r o = f a l s e "
2021-06-29 20:42:56 +00:00
%endif
myconf_gn+=" i s _ c o m p o n e n t _ f f m p e g = t r u e "
myconf_gn+=" u s e _ c u p s = t r u e "
myconf_gn+=" u s e _ a u r a = t r u e "
2022-08-01 08:25:54 +00:00
2022-10-04 19:13:55 +00:00
# always load system libvulkan.so
myconf_gn+=" a n g l e _ u s e _ c u s t o m _ l i b v u l k a n = f a l s e "
# do not build PDF support
myconf_gn+=" e n a b l e _ p d f = f a l s e "
myconf_gn+=" e n a b l e _ p d f _ v i e w e r = f a l s e "
myconf_gn+=" e n a b l e _ p r i n t _ p r e v i e w = f a l s e "
myconf_gn+=" e n a b l e _ b a s i c _ p r i n t i n g = f a l s e "
2022-10-29 19:25:58 +00:00
#do not build chrome pepper plugins support
myconf_gn+=" e n a b l e _ p l u g i n s = f a l s e "
myconf_gn+=" e n a b l e _ p p a p i = f a l s e "
2022-10-04 19:13:55 +00:00
2022-08-08 08:46:02 +00:00
# This requires the non-free closure_compiler.jar. If we ever need to build chrome with JS typecheck,
# we would need to package it separately and compile it from sources, since the chrome git repo
# provides only a compiled binary.
myconf_gn+=" e n a b l e _ j s _ t y p e _ c h e c k = f a l s e "
2022-08-01 08:25:54 +00:00
2022-08-08 08:46:02 +00:00
# The option below get overriden by whatever is in CFLAGS/CXXFLAGS, so they affect only C++ code.
2022-03-18 15:41:41 +00:00
# symbol_level=2 is full debug
# symbol_level=1 is enough info for stacktraces
2022-10-29 19:25:58 +00:00
# symbol_level=0 no debuginfo (only function names in private symbols)
2022-08-08 08:46:02 +00:00
# blink (HTML engine) and v8 (js engine) are template-heavy, trying to compile them with full debug leads to linker errors
%ifnarch %ix86 %arm aarch64
2022-10-26 04:51:48 +00:00
%if %{without lto}
2022-08-08 08:46:02 +00:00
myconf_gn+=" s y m b o l _ l e v e l = 2 "
2022-10-26 04:51:48 +00:00
%else
myconf_gn+=" s y m b o l _ l e v e l = 1 "
%endif
2022-08-08 08:46:02 +00:00
myconf_gn+=" b l i n k _ s y m b o l _ l e v e l = 1 "
myconf_gn+=" v 8 _ s y m b o l _ l e v e l = 1 "
%endif
2022-10-29 19:25:58 +00:00
%ifarch %ix86 %arm
#Sorry, no debug on 32bit.
myconf_gn+=" s y m b o l _ l e v e l = 0 "
myconf_gn+=" b l i n k _ s y m b o l _ l e v e l = 0 "
myconf_gn+=" v 8 _ s y m b o l _ l e v e l = 0 "
2022-08-08 08:46:02 +00:00
%endif
%ifarch aarch64 #“No space left on device” with symbol level 2
myconf_gn+=" s y m b o l _ l e v e l = 1 "
myconf_gn+=" b l i n k _ s y m b o l _ l e v e l = 1 "
myconf_gn+=" v 8 _ s y m b o l _ l e v e l = 1 "
%endif
2022-08-01 08:25:54 +00:00
2021-06-29 20:42:56 +00:00
myconf_gn+=" u s e _ k e r b e r o s = t r u e "
2022-10-26 04:51:48 +00:00
# do not build some chrome features not used by electron
2021-06-29 20:42:56 +00:00
myconf_gn+=" e n a b l e _ v r = f a l s e "
myconf_gn+=" o p t i m i z e _ w e b u i = f a l s e "
myconf_gn+=" e n a b l e _ r e a d i n g _ l i s t = f a l s e "
2022-07-04 09:07:38 +00:00
myconf_gn+=" e n a b l e _ r e p o r t i n g = f a l s e "
myconf_gn+=" b u i l d _ w i t h _ t f l i t e _ l i b = f a l s e "
myconf_gn+=" s a f e _ b r o w s i n g _ m o d e = 0 "
2022-10-26 04:51:48 +00:00
myconf_gn+=" e n a b l e _ c a p t i v e _ p o r t a l _ d e t e c t i o n = f a l s e "
myconf_gn+=" e n a b l e _ b r o w s e r _ s p e e c h _ s e r v i c e = f a l s e "
myconf_gn+=" e n a b l e _ s p e e c h _ s e r v i c e = f a l s e "
myconf_gn+=" e n a b l e _ s c r e e n _ a i _ s e r v i c e = f a l s e "
2022-11-05 11:17:41 +00:00
myconf_gn+=" i n c l u d e _ t r a n s p o r t _ s e c u r i t y _ s t a t e _ p r e l o a d _ l i s t = f a l s e "
2022-07-04 09:07:38 +00:00
#Do not build Chromecast
2022-10-04 19:13:55 +00:00
myconf_gn+=" e n a b l e _ r e m o t i n g = f a l s e "
2022-07-04 09:07:38 +00:00
myconf_gn+=" e n a b l e _ m e d i a _ r e m o t i n g = f a l s e "
myconf_gn+=" e n a b l e _ l i b r a r y _ c d m s = f a l s e "
2021-06-29 20:42:56 +00:00
myconf_gn+=" u s e _ p u l s e a u d i o = t r u e l i n k _ p u l s e a u d i o = t r u e "
myconf_gn+=" i s _ c o m p o n e n t _ b u i l d = f a l s e "
myconf_gn+=" u s e _ s y s r o o t = f a l s e "
myconf_gn+=" f a t a l _ l i n k e r _ w a r n i n g s = f a l s e "
2022-01-27 22:16:50 +00:00
myconf_gn+=" u s e _ a l l o c a t o r = \" p a r t i t i o n \" "
myconf_gn+=" u s e _ a l l o c a t o r _ s h i m = t r u e "
myconf_gn+=" u s e _ p a r t i t i o n _ a l l o c = t r u e "
2022-10-07 13:16:29 +00:00
2022-01-27 22:16:50 +00:00
myconf_gn+=" d i s a b l e _ f i e l d t r i a l _ t e s t i n g _ c o n f i g = t r u e "
2021-06-29 20:42:56 +00:00
myconf_gn+=" u s e _ g n o m e _ k e y r i n g = f a l s e "
myconf_gn+=" u s e _ u n o f f i c i a l _ v e r s i o n _ n u m b e r = f a l s e "
myconf_gn+=" u s e _ l l d = f a l s e "
2022-07-04 09:07:38 +00:00
%if %{with vaapi}
2021-06-29 20:42:56 +00:00
myconf_gn+=" u s e _ v a a p i = t r u e "
2022-07-04 09:07:38 +00:00
%endif
2021-06-29 20:42:56 +00:00
myconf_gn+=" t r e a t _ w a r n i n g s _ a s _ e r r o r s = f a l s e "
myconf_gn+=" u s e _ d b u s = t r u e "
myconf_gn+=" e n a b l e _ v u l k a n = t r u e "
myconf_gn+=" i c u _ u s e _ d a t a _ f i l e = f a l s e "
2021-11-11 20:37:54 +00:00
myconf_gn+=" m e d i a _ u s e _ o p e n h 2 6 4 = f a l s e "
myconf_gn+=" r t c _ u s e _ h 2 6 4 = f a l s e "
2022-01-27 22:16:50 +00:00
myconf_gn+=" u s e _ v 8 _ c o n t e x t _ s n a p s h o t = t r u e "
myconf_gn+=" v 8 _ u s e _ e x t e r n a l _ s t a r t u p _ d a t a = t r u e "
2022-07-04 09:07:38 +00:00
myconf_gn+=" u s e _ s y s t e m _ z l i b = t r u e "
myconf_gn+=" u s e _ s y s t e m _ l i b j p e g = t r u e "
myconf_gn+=" u s e _ s y s t e m _ l i b p n g = t r u e "
myconf_gn+=" u s e _ s y s t e m _ l c m s 2 = t r u e "
myconf_gn+=" u s e _ s y s t e m _ l i b o p e n j p e g 2 = t r u e "
2022-08-08 08:46:02 +00:00
myconf_gn+=" u s e _ s y s t e m _ w a y l a n d _ s c a n n e r = t r u e "
2022-01-29 19:59:26 +00:00
%if %{with system_harfbuzz}
2022-01-27 22:16:50 +00:00
myconf_gn+=" u s e _ s y s t e m _ h a r f b u z z = t r u e "
2022-01-29 19:59:26 +00:00
%endif
%if %{with system_freetype}
2022-01-27 22:16:50 +00:00
myconf_gn+=" u s e _ s y s t e m _ f r e e t y p e = t r u e "
2022-01-29 19:59:26 +00:00
%endif
2022-07-04 09:07:38 +00:00
myconf_gn+=" u s e _ s y s t e m _ c a r e s = t r u e "
%if %{with system_nghttp2}
myconf_gn+=" u s e _ s y s t e m _ n g h t t p 2 = t r u e "
%endif
2022-07-07 08:02:56 +00:00
%if %{with system_llhttp}
myconf_gn+=" u s e _ s y s t e m _ l l h t t p = t r u e "
%endif
%if %{with system_histogram}
myconf_gn+=" u s e _ s y s t e m _ h i s t o g r a m = t r u e "
%endif
2021-06-29 20:42:56 +00:00
%if %{with clang}
myconf_gn+=" i s _ c l a n g = t r u e c l a n g _ b a s e _ p a t h = \" / u s r \" c l a n g _ u s e _ c h r o m e _ p l u g i n s = f a l s e "
2022-01-27 22:16:50 +00:00
myconf_gn+=" u s e _ l l d = t r u e "
2022-07-04 09:07:38 +00:00
# PGO is broken rn
myconf_gn+=" c h r o m e _ p g o _ p h a s e = 0 "
2021-06-29 20:42:56 +00:00
%else
myconf_gn+=" i s _ c l a n g = f a l s e "
2022-07-04 09:07:38 +00:00
%if %{with gold}
2022-01-27 22:16:50 +00:00
myconf_gn+=" u s e _ g o l d = t r u e "
2022-07-04 09:07:38 +00:00
%else
myconf_gn+=" u s e _ g o l d = f a l s e "
%endif
2021-06-29 20:42:56 +00:00
%endif
%if %{with lto}
2022-10-13 09:38:43 +00:00
2021-06-29 20:42:56 +00:00
%if %{without clang}
myconf_gn+=" g c c _ l t o = t r u e "
2022-10-13 09:38:43 +00:00
%else
myconf_gn+=" u s e _ t h i n _ l t o = t r u e "
2021-06-29 20:42:56 +00:00
%endif
# endif with lto
%endif
2022-08-08 08:46:02 +00:00
%ifarch %arm
# Bundled libaom is broken on ARMv7
%if %{without system_aom}
# [74796s] FAILED: v8_context_snapshot_generator
# [74796s] python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./v8_context_snapshot_generator" -- g++ -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -rdynamic -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags -Wl,-rpath=\$ORIGIN -Wl,--as-needed -fuse-ld=lld -o "./v8_context_snapshot_generator" -Wl,--start-group @"./v8_context_snapshot_generator.rsp" -Wl,--end-group -latomic -ldl -lpthread -lrt -lgmodule-2.0 -lglib-2.0 -lgobject-2.0 -lgthread-2.0 -ljsoncpp -labsl_base -labsl_raw_logging_internal -labsl_log_severity -labsl_spinlock_wait -labsl_cord -labsl_cordz_info -labsl_cord_internal -labsl_cordz_functions -labsl_exponential_biased -labsl_cordz_handle -labsl_synchronization -labsl_graphcycles_internal -labsl_stacktrace -labsl_symbolize -labsl_debugging_internal -labsl_demangle_internal -labsl_malloc_internal -labsl_time -labsl_civil_time -labsl_time_zone -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_hash -labsl_city -labsl_bad_variant_access -labsl_low_level_hash -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_failure_signal_handler -labsl_examine_stack -labsl_random_distributions -labsl_random_seed_sequences -labsl_random_internal_pool_urbg -labsl_random_internal_randen -labsl_random_internal_randen_hwaes -labsl_random_internal_randen_hwaes_impl -labsl_random_internal_randen_slow -labsl_random_internal_platform -labsl_random_internal_seed_material -labsl_random_seed_gen_exception -labsl_status -labsl_str_format_internal -labsl_strerror -labsl_statusor -licui18n -licuuc -licudata -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -ldouble-conversion -levent -lz -ljpeg -lpng16 -lxml2 -lxslt -lresolv -lgio-2.0 -lbrotlidec -lwebpdemux -lwebpmux -lwebp -lfreetype -lexpat -lfontconfig -lharfbuzz-subset -lharfbuzz -lyuv -lopus -lvpx -lm -ldav1d -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lpipewire-0.3 -lgbm -lEGL -ldrm -lcrc32c -lbsd -lxcb -lxkbcommon -lwayland-client -ldbus-1 -lre2 -lpangocairo-1.0 -lpango-1.0 -lcairo -latk-1.0 -latk-bridge-2.0 -lasound -lpulse -lavcodec -lavformat -lavutil -lXi -lpci -lxxhash -lXNVCtrl -lsnappy -lavif -ljxl -lwoff2dec -latspi
# [74796s] ld.lld: error: undefined symbol: aom_arm_cpu_caps
# [74796s] >>> referenced by av1_rtcd.h:1079 (../../third_party/libaom/source/config/linux/arm/config/av1_rtcd.h:1079)
# [74796s] >>> libaom/av1_rtcd.o:(setup_rtcd_internal) in archive obj/third_party/libaom/libaom.a
# [74796s] >>> referenced by aom_dsp_rtcd.h:3560 (../../third_party/libaom/source/config/linux/arm/config/aom_dsp_rtcd.h:3560)
# [74796s] >>> libaom/aom_dsp_rtcd.o:(setup_rtcd_internal) in archive obj/third_party/libaom/libaom.a
# [74796s] >>> referenced by aom_scale_rtcd.h:162 (../../third_party/libaom/source/config/linux/arm/config/aom_scale_rtcd.h:162)
# [74796s] >>> libaom/aom_scale_rtcd.o:(setup_rtcd_internal) in archive obj/third_party/libaom/libaom.a
myconf_gn+=" e n a b l e _ l i b a o m = f a l s e "
%endif
%endif
2022-07-04 09:07:38 +00:00
2021-06-29 20:42:56 +00:00
%if %{with pipewire}
myconf_gn+=" r t c _ u s e _ p i p e w i r e = t r u e r t c _ l i n k _ p i p e w i r e = t r u e "
%endif
2022-07-04 09:07:38 +00:00
# Do not build WebGPU support. It is huge and not used by ANY known apps (we would know if it was — it's hidden behind an experimental flag).
myconf_gn+=" u s e _ d a w n = f a l s e "
2021-06-29 20:42:56 +00:00
# The proprietary codecs just force the chromium to say they can use it and
# offload the actual computation to the ffmpeg, otherwise the chromium
# won't be able to load the codec even if the library can handle it
myconf_gn+=" p r o p r i e t a r y _ c o d e c s = t r u e "
myconf_gn+=" f f m p e g _ b r a n d i n g = \" C h r o m e \" "
# GN does not support passing cflags:
# https://bugs.chromium.org/p/chromium/issues/detail?id=642016
gn gen out/Release --args=" i m p o r t ( \" / / e l e c t r o n / b u i l d / a r g s / r e l e a s e . g n \" ) $ { m y c o n f _ g n } "
2022-09-09 08:50:38 +00:00
#Build the supplementary stuff first to notice errors earlier bc building electron itself takes several hours.
ninja -v %{?_smp_mflags} -C out/Release chromium_licenses
2022-01-29 19:59:26 +00:00
ninja -v %{?_smp_mflags} -C out/Release copy_headers
2022-11-02 11:16:40 +00:00
ninja -v %{?_smp_mflags} -C out/Release version
2021-06-29 20:42:56 +00:00
2022-10-26 04:51:48 +00:00
# dump the linker command line (if any) in case of failure
ninja -v %{?_smp_mflags} -C out/Release electron || (cat out/Release/*.rsp | sed 's/ /\n/g' && false)
2022-09-09 08:50:38 +00:00
2021-07-12 19:40:24 +00:00
2021-06-29 20:42:56 +00:00
%install
install -d -m 0755 %{buildroot} %{_bindir}
2022-01-29 19:59:26 +00:00
install -d -m 0755 %{buildroot} %{_includedir} /electron
2021-06-29 20:42:56 +00:00
install -d -m 0755 %{buildroot} %{_libdir} /electron
2022-07-04 09:07:38 +00:00
install -d -m 0755 %{buildroot} %{_libdir} /electron/resources
2021-06-29 20:42:56 +00:00
install -d -m 0755 %{buildroot} %{_datadir} /applications
install -d -m 0755 %{buildroot} %{_datadir} /pixmaps/
install -d -m 0755 %{buildroot} %{_datadir} /icons/hicolor/symbolic/apps/
2022-07-04 09:07:38 +00:00
install -pm 0755 %{SOURCE10} %{buildroot} %{_bindir} /%{mod_name}
sed -i 's[XXXLIBDIRXXX[%{_libdir}[g' %{buildroot} %{_bindir} /%{mod_name}
install -pm 0644 electron/default_app/icon.png %{buildroot} %{_datadir} /pixmaps/%{mod_name} .png
install -pm 0644 %{SOURCE12} %{buildroot} %{_datadir} /icons/hicolor/symbolic/apps/electron-symbolic.svg
2021-06-29 20:42:56 +00:00
desktop-file-install --dir %{buildroot} %{_datadir} /applications/ %{SOURCE11}
pushd out/Release
2022-07-04 09:07:38 +00:00
rsync -av *.bin *.pak %{buildroot} %{_libdir} /electron/
install -pm 0644 resources/default_app.asar -t %{buildroot} %{_libdir} /electron/resources/
2021-07-15 22:00:36 +00:00
2021-06-29 20:42:56 +00:00
rsync -av --exclude '*.pak.info' locales %{buildroot} %{_libdir} /electron/
2022-07-04 09:07:38 +00:00
install -pm 0755 electron -t %{buildroot} %{_libdir} /electron/
install -pm 0755 chrome_crashpad_handler -t %{buildroot} %{_libdir} /electron/
install -pm 0755 libEGL.so -t %{buildroot} %{_libdir} /electron/
install -pm 0755 libGLESv2.so -t %{buildroot} %{_libdir} /electron/
install -pm 0755 libvk_swiftshader.so -t %{buildroot} %{_libdir} /electron/
install -pm 0644 vk_swiftshader_icd.json -t %{buildroot} %{_libdir} /electron/
2022-11-02 11:16:40 +00:00
install -pm 0644 version -t %{buildroot} %{_libdir} /electron/
2021-06-29 20:42:56 +00:00
popd
2021-10-07 22:05:47 +00:00
2022-11-02 11:16:40 +00:00
2021-06-29 20:42:56 +00:00
# Install folders required for webapps
mkdir -p " %{buildroot} %{_sysconfdir} / w e b a p p s "
mkdir -p " %{buildroot} %{_datadir} / w e b a p p s "
2022-01-29 19:59:26 +00:00
rsync -av out/Release/gen/node_headers/include/node/* %{buildroot} %{_includedir} /electron
2022-09-21 09:00:14 +00:00
# Install electron.macros
mkdir -p %{buildroot} %{_rpmconfigdir} /macros.d
cp /dev/stdin %{buildroot} %{_rpmconfigdir} /macros.d/macros.electron <<" E O F "
%%electron_req Requires: electron%{_isa}(abi) = %{abi_version}
EOF
chmod -v 644 %{buildroot} %{_rpmconfigdir} /macros.d/macros.electron
2022-09-09 08:50:38 +00:00
2021-06-29 20:42:56 +00:00
%files
2022-09-09 08:50:38 +00:00
%license electron/LICENSE out/Release/LICENSES.chromium.html
2021-06-29 20:42:56 +00:00
%{_bindir} /electron
%{_datadir} /pixmaps/electron.png
%{_datadir} /icons/hicolor/symbolic/apps/electron-symbolic.svg
%{_datadir} /applications/electron.desktop
2021-10-07 22:05:47 +00:00
2022-07-04 09:07:38 +00:00
%{_libdir} /electron/
2021-06-29 20:42:56 +00:00
%dir %{_sysconfdir} /webapps
%dir %{_datadir} /webapps
2022-01-29 19:59:26 +00:00
%files devel
%{_includedir} /electron
2022-09-21 09:00:14 +00:00
%{_rpmconfigdir} /macros.d/macros.electron
2022-01-29 19:59:26 +00:00
2022-10-04 19:13:55 +00:00
%files doc
%doc electron/README.md
%doc electron/docs
2021-06-29 20:42:56 +00:00
%changelog