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
|
|
|
|
%if 0%{?fedora}
|
|
|
|
# Debuginfo packages aren't very useful here. If you need to debug
|
|
|
|
# you should do a proper debug build (not implemented in this spec yet)
|
2022-04-13 11:28:20 +00:00
|
|
|
#%%global debug_package %{nil}
|
2022-03-18 15:41:41 +00:00
|
|
|
%endif
|
2022-02-17 22:40:10 +00:00
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
%define mod_name electron
|
2021-12-16 01:00:29 +00:00
|
|
|
ExcludeArch: %{ix86} %{arm}
|
2021-06-29 20:42:56 +00:00
|
|
|
%ifarch x86_64
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?fedora}
|
2022-01-27 22:16:50 +00:00
|
|
|
# DISABLE LTO AS IT IS BROKEN RIGHT NOW
|
|
|
|
#%%bcond_without lto
|
|
|
|
%bcond_with lto
|
2021-06-29 20:42:56 +00:00
|
|
|
# else suse_version
|
|
|
|
%else
|
|
|
|
%bcond_with lto
|
|
|
|
# endif suse_version
|
|
|
|
%endif
|
|
|
|
# else arch x86_64
|
|
|
|
%else
|
|
|
|
%bcond_with lto
|
|
|
|
# endif arch x86_64
|
|
|
|
%endif
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200 || 0%{?fedora}
|
2021-06-29 20:42:56 +00:00
|
|
|
%bcond_without pipewire
|
|
|
|
%else
|
|
|
|
%bcond_with pipewire
|
|
|
|
%endif
|
|
|
|
%ifarch %{arm} aarch64
|
|
|
|
%bcond_with swiftshader
|
|
|
|
%else
|
|
|
|
%bcond_without swiftshader
|
|
|
|
%endif
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?suse_version} >= 1550 || 0%{?fedora} > 34
|
2021-10-07 22:05:47 +00:00
|
|
|
%bcond_without systemicu
|
|
|
|
%else
|
|
|
|
%bcond_with systemicu
|
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
# vaapi still requires bundled libvpx
|
|
|
|
%bcond_with system_vpx
|
2021-12-01 19:47:04 +00:00
|
|
|
%ifarch aarch64
|
|
|
|
%bcond_without clang
|
|
|
|
%else
|
2021-07-01 05:05:47 +00:00
|
|
|
%bcond_with clang
|
2021-12-01 19:47:04 +00:00
|
|
|
%endif
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?suse_version} >= 1550 || 0%{?fedora} > 35
|
|
|
|
%bcond_without system_harfbuzz
|
|
|
|
%bcond_without system_freetype
|
|
|
|
%else
|
|
|
|
%bcond_with system_harfbuzz
|
|
|
|
%bcond_with system_freetype
|
|
|
|
%endif
|
|
|
|
%bcond_without system_ffmpeg
|
2021-06-29 20:42:56 +00:00
|
|
|
Name: nodejs-electron
|
2022-04-12 19:50:41 +00:00
|
|
|
Version: 17.3.1
|
2021-06-29 20:42:56 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS
|
|
|
|
License: MIT
|
|
|
|
Group: Productivity/Networking/Web/Browsers
|
|
|
|
URL: https://github.com/electron/electron
|
|
|
|
Source0: %{mod_name}-%{version}.tar.xz
|
|
|
|
Source1: create_tarball.sh
|
|
|
|
Source10: electron-launcher.sh
|
|
|
|
Source11: electron.desktop
|
|
|
|
Source12: electron-logo-symbolic.svg
|
2022-03-18 15:41:41 +00:00
|
|
|
Patch0: chromium-98-compiler.patch
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?sle_version} < 150300 || 0%{?fedora} < 34
|
2021-07-01 05:05:47 +00:00
|
|
|
# Fixed with ld.gold >= 2.36
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=26200
|
2021-06-29 20:42:56 +00:00
|
|
|
Patch1: chromium-disable-parallel-gold.patch
|
2021-07-01 05:05:47 +00:00
|
|
|
%endif
|
2022-01-27 22:16:50 +00:00
|
|
|
Patch2: chromium-system-libusb.patch
|
|
|
|
Patch3: gcc-enable-lto.patch
|
|
|
|
Patch4: chromium-gcc11.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
|
|
|
Patch8: chromium-glibc-2.34.patch
|
|
|
|
Patch9: chromium-86-fix-vaapi-on-intel.patch
|
2022-01-29 19:59:26 +00:00
|
|
|
%if %{with system_ffmpeg}
|
2022-01-27 22:16:50 +00:00
|
|
|
Patch10: chromium-93-ffmpeg-4.4.patch
|
2022-03-18 15:41:41 +00:00
|
|
|
Patch11: chromium-ffmpeg-first-dts.patch
|
2022-01-29 19:59:26 +00:00
|
|
|
%endif
|
2022-01-27 22:16:50 +00:00
|
|
|
Patch13: chromium-96-CouponDB-include.patch
|
2022-03-18 15:41:41 +00:00
|
|
|
Patch14: chromium-98-MiraclePtr-gcc-ice.patch
|
|
|
|
Patch15: chromium-98-WaylandFrameManager-check.patch
|
|
|
|
Patch16: chromium-98-EnumTable-crash.patch
|
|
|
|
Patch17: system-libdrm.patch
|
2021-06-29 20:42:56 +00:00
|
|
|
# Fix building sql recover_module
|
|
|
|
Patch20: electron-13-fix-sql-virtualcursor-type.patch
|
|
|
|
# Always disable use_thin_lto which is an lld feature
|
|
|
|
Patch21: electron-13-fix-use-thin-lto.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
|
|
|
|
Patch22: electron-13-fix-base-check-nomerge.patch
|
2021-07-01 05:05:47 +00:00
|
|
|
# Fix blink nodestructor
|
2022-01-27 22:16:50 +00:00
|
|
|
Patch23: electron-13-blink-gcc-ambiguous-nodestructor.patch
|
|
|
|
# Fix electron patched code
|
|
|
|
Patch24: electron-16-std-vector-non-const.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-02-17 22:40:10 +00:00
|
|
|
Patch27: electron-16-freetype-visibility-list.patch
|
2022-02-24 17:21:01 +00:00
|
|
|
Patch28: electron-16-third_party-symbolize-missing-include.patch
|
|
|
|
Patch29: electron-16-webpack-fix-openssl-3.patch
|
2022-03-18 15:41:41 +00:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=2052228
|
|
|
|
Patch30: electron-16-fix-swiftshader-template.patch
|
|
|
|
Patch31: electron-16-v8-missing-utility-include.patch
|
|
|
|
Patch32: electron-17-breakpad-align-int-types.patch
|
2022-04-21 09:54:19 +00:00
|
|
|
# From https://git.droidware.info/wchen342/ungoogled-chromium-fedora
|
|
|
|
Patch33: chromium-94.0.4606.71-InkDropHost-crash.patch
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: SDL-devel
|
|
|
|
BuildRequires: binutils-gold
|
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: cups-devel
|
|
|
|
BuildRequires: desktop-file-utils
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: flex
|
|
|
|
BuildRequires: gn >= 0.1807
|
|
|
|
BuildRequires: gperf
|
|
|
|
BuildRequires: hicolor-icon-theme
|
|
|
|
# Java used during build
|
|
|
|
BuildRequires: java-openjdk-headless
|
|
|
|
BuildRequires: libcap-devel
|
|
|
|
BuildRequires: libdc1394
|
|
|
|
BuildRequires: libgcrypt-devel
|
2021-07-01 05:05:47 +00:00
|
|
|
%if 0%{?suse_version}
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: libgsm-devel
|
2021-07-01 05:05:47 +00:00
|
|
|
%else
|
|
|
|
BuildRequires: gsm-devel
|
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: libpng-devel
|
|
|
|
BuildRequires: memory-constraints
|
|
|
|
BuildRequires: nasm
|
|
|
|
BuildRequires: ncurses-devel
|
2021-07-01 05:05:47 +00:00
|
|
|
%if 0%{?suse_version}
|
2021-07-15 22:00:36 +00:00
|
|
|
# Required for /usr/bin/clang-format
|
|
|
|
BuildRequires: clang >= 8.0.0
|
2022-01-27 22:16:50 +00:00
|
|
|
BuildRequires: lld >= 8.0.0
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: ninja >= 1.7.2
|
2021-07-15 22:00:36 +00:00
|
|
|
%endif
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?fedora}
|
2021-07-15 22:00:36 +00:00
|
|
|
# Required for /usr/bin/clang-format
|
|
|
|
BuildRequires: clang-tools-extra
|
|
|
|
BuildRequires: libatomic
|
2021-07-01 05:05:47 +00:00
|
|
|
BuildRequires: ninja-build >= 1.7.2
|
|
|
|
%endif
|
2022-01-27 22:16:50 +00:00
|
|
|
BuildRequires: nodejs >= 16.5.0
|
2022-04-12 12:19:37 +00:00
|
|
|
%if 0%{?sle_version} == 150300
|
2022-04-12 12:21:49 +00:00
|
|
|
BuildRequires: nodejs16
|
2022-04-12 10:42:11 +00:00
|
|
|
%endif
|
2022-04-12 19:50:41 +00:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: npm-default
|
|
|
|
%else
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: npm
|
2022-04-12 19:50:41 +00:00
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: pam-devel
|
|
|
|
BuildRequires: pkgconfig
|
2022-01-27 22:16:50 +00:00
|
|
|
BuildRequires: python3
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
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
|
|
|
|
BuildRequires: wdiff
|
|
|
|
BuildRequires: perl(Switch)
|
|
|
|
BuildRequires: pkgconfig(alsa)
|
|
|
|
BuildRequires: pkgconfig(bzip2)
|
|
|
|
BuildRequires: pkgconfig(cairo) >= 1.6
|
|
|
|
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)
|
|
|
|
BuildRequires: pkgconfig(gtk+-2.0)
|
|
|
|
BuildRequires: pkgconfig(gtk+-3.0)
|
2022-01-29 19:59:26 +00:00
|
|
|
%if %{with system_harfbuzz}
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: pkgconfig(harfbuzz) > 2.3.0
|
2022-01-29 19:59:26 +00:00
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: pkgconfig(hunspell)
|
2021-10-07 22:05:47 +00:00
|
|
|
%if %{with systemicu}
|
|
|
|
BuildRequires: pkgconfig(icu-i18n) >= 68.0
|
|
|
|
%else
|
|
|
|
Provides: bundled(icu) = 68.0
|
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: pkgconfig(imlib2)
|
|
|
|
BuildRequires: pkgconfig(jack)
|
|
|
|
BuildRequires: pkgconfig(kadm-client)
|
|
|
|
BuildRequires: pkgconfig(kdb)
|
|
|
|
BuildRequires: pkgconfig(krb5)
|
2022-02-24 17:21:01 +00:00
|
|
|
%if %{with system_ffmpeg}
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: pkgconfig(libavcodec)
|
|
|
|
BuildRequires: pkgconfig(libavfilter)
|
|
|
|
BuildRequires: pkgconfig(libavformat) >= 58
|
|
|
|
BuildRequires: pkgconfig(libavutil)
|
2021-07-01 05:05:47 +00:00
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
|
|
|
BuildRequires: pkgconfig(libcurl)
|
|
|
|
BuildRequires: pkgconfig(libdc1394-2)
|
|
|
|
BuildRequires: pkgconfig(libdrm)
|
|
|
|
BuildRequires: pkgconfig(libelf)
|
|
|
|
BuildRequires: pkgconfig(libevent)
|
|
|
|
BuildRequires: pkgconfig(libexif)
|
|
|
|
BuildRequires: pkgconfig(libffi)
|
|
|
|
BuildRequires: pkgconfig(libnotify)
|
|
|
|
BuildRequires: pkgconfig(libpci)
|
|
|
|
BuildRequires: pkgconfig(libpulse)
|
|
|
|
BuildRequires: pkgconfig(libssl)
|
|
|
|
BuildRequires: pkgconfig(libtcmalloc)
|
|
|
|
BuildRequires: pkgconfig(libudev)
|
|
|
|
BuildRequires: pkgconfig(libusb-1.0)
|
|
|
|
BuildRequires: pkgconfig(libva)
|
|
|
|
BuildRequires: pkgconfig(libwebp) >= 0.4.0
|
|
|
|
BuildRequires: pkgconfig(libxml-2.0) >= 2.9.5
|
|
|
|
BuildRequires: pkgconfig(libxslt)
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?fedora}
|
2021-07-15 22:00:36 +00:00
|
|
|
BuildRequires: minizip-compat-devel
|
2022-04-12 17:26:19 +00:00
|
|
|
# help decide for dependency
|
|
|
|
BuildRequires: pipewire-jack-audio-connection-kit-devel
|
|
|
|
BuildRequires: nodejs-devel >= 17
|
2021-07-15 22:00:36 +00:00
|
|
|
%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(ogg)
|
|
|
|
BuildRequires: pkgconfig(openssl)
|
|
|
|
BuildRequires: pkgconfig(opus) >= 1.3.1
|
|
|
|
BuildRequires: pkgconfig(python)
|
|
|
|
BuildRequires: pkgconfig(re2)
|
|
|
|
BuildRequires: pkgconfig(schroedinger-1.0)
|
|
|
|
BuildRequires: pkgconfig(slang)
|
|
|
|
BuildRequires: pkgconfig(sqlite3)
|
|
|
|
BuildRequires: pkgconfig(theora) >= 1.1
|
|
|
|
BuildRequires: pkgconfig(vdpau)
|
|
|
|
BuildRequires: pkgconfig(vorbis)
|
|
|
|
BuildRequires: pkgconfig(wayland-client)
|
|
|
|
BuildRequires: pkgconfig(wayland-cursor)
|
|
|
|
BuildRequires: pkgconfig(wayland-scanner)
|
|
|
|
BuildRequires: pkgconfig(wayland-server)
|
|
|
|
BuildRequires: pkgconfig(x11)
|
|
|
|
BuildRequires: pkgconfig(xcb-dri3)
|
|
|
|
BuildRequires: pkgconfig(xcb-proto)
|
|
|
|
BuildRequires: pkgconfig(xcomposite)
|
|
|
|
BuildRequires: pkgconfig(xcursor)
|
|
|
|
BuildRequires: pkgconfig(xdamage)
|
|
|
|
BuildRequires: pkgconfig(xext)
|
|
|
|
BuildRequires: pkgconfig(xfixes)
|
|
|
|
BuildRequires: pkgconfig(xi)
|
|
|
|
BuildRequires: pkgconfig(xkbcommon)
|
|
|
|
BuildRequires: pkgconfig(xrandr)
|
|
|
|
BuildRequires: pkgconfig(xrender)
|
|
|
|
BuildRequires: pkgconfig(xscrnsaver)
|
|
|
|
BuildRequires: pkgconfig(xshmfence)
|
|
|
|
BuildRequires: pkgconfig(xt)
|
|
|
|
BuildRequires: pkgconfig(xtst)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
|
|
|
Requires: hicolor-icon-theme
|
|
|
|
Recommends: noto-coloremoji-fonts
|
|
|
|
Provides: electron
|
|
|
|
Obsoletes: nodejs-electron-prebuilt < %{version}
|
|
|
|
Provides: nodejs-electron-prebuilt = %{version}
|
|
|
|
%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-01-29 19:59:26 +00:00
|
|
|
%if 0%{?suse_version} >= 1550 || 0%{?fedora}
|
2021-06-29 20:42:56 +00:00
|
|
|
BuildRequires: gcc >= 10
|
|
|
|
BuildRequires: gcc-c++ >= 10
|
|
|
|
%else
|
|
|
|
BuildRequires: gcc10
|
|
|
|
BuildRequires: gcc10-c++
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%if %{with pipewire}
|
|
|
|
BuildRequires: pkgconfig(libpipewire-0.3)
|
|
|
|
BuildRequires: pkgconfig(libspa-0.2)
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Recommends: noto-coloremoji-fonts
|
|
|
|
|
|
|
|
Provides: electron
|
|
|
|
|
|
|
|
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++
|
|
|
|
Requires: nodejs-electron = %{version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Development headers for Electron projects.
|
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
%prep
|
|
|
|
%autosetup -n %{mod_name}-%{version} -p1
|
|
|
|
|
|
|
|
# Required for third_party/blink/renderer/bindings/scripts/generate_bindings.py
|
|
|
|
ln -sf %{_bindir}/clang-format buildtools/linux64/clang-format
|
|
|
|
|
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
|
|
|
|
rm buildtools/third_party/eu-strip/bin/eu-strip
|
|
|
|
ln -s %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip
|
|
|
|
|
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
|
|
|
%if %{with systemicu}
|
|
|
|
find third_party/icu -type f ! -name "*.gn" -a ! -name "*.gni" -delete
|
|
|
|
%endif
|
|
|
|
|
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-01-27 22:16:50 +00:00
|
|
|
# Make sure python is python3
|
|
|
|
install -d -m 0755 python3-path
|
|
|
|
ln -sf %{_bindir}/python3 "$(pwd)/python3-path/python"
|
|
|
|
export PATH="$(pwd)/python3-path:${PATH}"
|
2021-07-15 22:00:36 +00:00
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
# for wayland
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon"
|
|
|
|
|
|
|
|
%if %{with clang}
|
|
|
|
export CFLAGS="${CXXFLAGS}"
|
|
|
|
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
|
|
|
|
# else with clang
|
|
|
|
%else
|
|
|
|
|
|
|
|
# REDUCE DEBUG as it gets TOO large
|
2022-04-19 08:14:15 +00:00
|
|
|
ARCH_FLAGS="$(echo %{optflags} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')"
|
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?fedora}
|
2021-07-15 22:00:36 +00:00
|
|
|
# Fix base/allocator/allocator_shim.cc:408:2: error: #error This code cannot be
|
|
|
|
# used when exceptions are turned on.
|
2022-03-18 15:41:41 +00:00
|
|
|
ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')"
|
2021-07-15 22:00:36 +00:00
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
|
2021-07-01 05:05:47 +00:00
|
|
|
export CXXFLAGS="${CXXFLAGS} ${ARCH_FLAGS} -Wno-return-type"
|
2021-06-29 20:42:56 +00:00
|
|
|
# extra flags to reduce warnings that aren't very useful
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -Wno-pedantic -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-deprecated-declarations"
|
|
|
|
# ignore warnings for minor mistakes that are too common
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -Wno-return-type -Wno-parentheses -Wno-misleading-indentation"
|
|
|
|
# ignore warnings that are not supported well until gcc 8
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -Wno-attributes"
|
|
|
|
# ignore warnings due to gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84055)
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -Wno-ignored-attributes"
|
|
|
|
# ingore new gcc 8 warnings that aren't yet handled upstream
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -Wno-address -Wno-dangling-else -Wno-packed-not-aligned"
|
|
|
|
|
|
|
|
export CFLAGS="${CXXFLAGS}"
|
|
|
|
export CXXFLAGS="${CXXFLAGS} -Wno-subobject-linkage -Wno-class-memaccess -Wno-invalid-offsetof -fpermissive"
|
2021-07-01 05:05:47 +00:00
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
%if 0%{?suse_version} >= 1550 || 0%{?fedora}
|
2021-06-29 20:42:56 +00:00
|
|
|
export CC=gcc
|
|
|
|
export CXX=g++
|
2021-07-01 05:05:47 +00:00
|
|
|
%else
|
|
|
|
export CC=gcc-10
|
|
|
|
export CXX=g++-10
|
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
|
|
|
|
# endif with clang
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Needed e.g. for static library creation by base/third_party/dynamic_annotations/
|
|
|
|
export AR=ar
|
|
|
|
export NM=nm
|
|
|
|
export RANLIB=ranlib
|
|
|
|
|
|
|
|
# do not eat all memory
|
|
|
|
%limit_build -m 2600
|
|
|
|
|
|
|
|
gn_system_libraries=(
|
|
|
|
flac
|
|
|
|
fontconfig
|
|
|
|
libdrm
|
|
|
|
libevent
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libusb
|
|
|
|
libwebp
|
|
|
|
libxml
|
|
|
|
libxslt
|
|
|
|
opus
|
|
|
|
re2
|
|
|
|
snappy
|
|
|
|
zlib
|
|
|
|
)
|
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
%if %{with system_harfbuzz}
|
|
|
|
gn_system_libraries+=( harfbuzz-ng )
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with system_freetype}
|
|
|
|
gn_system_libraries+=( freetype )
|
|
|
|
%endif
|
|
|
|
|
2021-10-07 22:05:47 +00:00
|
|
|
%if %{with systemicu}
|
|
|
|
gn_system_libraries+=( icu )
|
|
|
|
%endif
|
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
%if %{with system_ffmpeg}
|
2021-07-15 22:00:36 +00:00
|
|
|
gn_system_libraries+=( ffmpeg )
|
|
|
|
%endif
|
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
%if %{with system_vpx}
|
|
|
|
gn_system_libraries+=( libvpx )
|
|
|
|
%endif
|
|
|
|
build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]}
|
|
|
|
|
|
|
|
# Create the configuration for GN
|
|
|
|
# Available options: out/Release/gn args --list out/Release/
|
|
|
|
myconf_gn=""
|
|
|
|
myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
|
|
|
|
myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
|
|
|
|
myconf_gn+=" use_custom_libcxx=false"
|
2022-01-27 22:16:50 +00:00
|
|
|
%ifarch x86_64
|
|
|
|
myconf_gn+=" host_cpu=\"x64\""
|
|
|
|
%endif
|
|
|
|
%ifarch aarch64
|
|
|
|
myconf_gn+=" host_cpu=\"arm64\""
|
|
|
|
%endif
|
|
|
|
myconf_gn+=" host_os=\"linux\""
|
2021-06-29 20:42:56 +00:00
|
|
|
myconf_gn+=" is_debug=false"
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" dcheck_always_on=false"
|
2021-06-29 20:42:56 +00:00
|
|
|
myconf_gn+=" enable_nacl=false"
|
|
|
|
%if %{with swiftshader}
|
|
|
|
myconf_gn+=" use_swiftshader_with_subzero=true"
|
|
|
|
%endif
|
|
|
|
myconf_gn+=" is_component_ffmpeg=true"
|
|
|
|
myconf_gn+=" use_cups=true"
|
|
|
|
myconf_gn+=" use_aura=true"
|
2022-03-18 15:41:41 +00:00
|
|
|
# symbol_level=2 is full debug
|
|
|
|
# symbol_level=1 is enough info for stacktraces
|
|
|
|
# symbol_level=0 disable debug
|
2021-06-29 20:42:56 +00:00
|
|
|
myconf_gn+=" symbol_level=1"
|
|
|
|
myconf_gn+=" blink_symbol_level=0"
|
|
|
|
myconf_gn+=" use_kerberos=true"
|
|
|
|
myconf_gn+=" enable_vr=false"
|
|
|
|
myconf_gn+=" optimize_webui=false"
|
|
|
|
myconf_gn+=" enable_reading_list=false"
|
|
|
|
myconf_gn+=" use_pulseaudio=true link_pulseaudio=true"
|
|
|
|
myconf_gn+=" is_component_build=false"
|
|
|
|
myconf_gn+=" use_sysroot=false"
|
|
|
|
myconf_gn+=" fatal_linker_warnings=false"
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" use_allocator=\"partition\""
|
|
|
|
myconf_gn+=" use_allocator_shim=true"
|
|
|
|
myconf_gn+=" use_partition_alloc=true"
|
|
|
|
myconf_gn+=" disable_fieldtrial_testing_config=true"
|
2021-06-29 20:42:56 +00:00
|
|
|
myconf_gn+=" use_gnome_keyring=false"
|
|
|
|
myconf_gn+=" use_unofficial_version_number=false"
|
|
|
|
myconf_gn+=" use_lld=false"
|
|
|
|
myconf_gn+=" use_vaapi=true"
|
|
|
|
myconf_gn+=" treat_warnings_as_errors=false"
|
|
|
|
myconf_gn+=" enable_widevine=true"
|
|
|
|
myconf_gn+=" use_dbus=true"
|
|
|
|
myconf_gn+=" enable_vulkan=true"
|
|
|
|
myconf_gn+=" icu_use_data_file=false"
|
2021-11-11 20:37:54 +00:00
|
|
|
myconf_gn+=" media_use_openh264=false"
|
|
|
|
myconf_gn+=" rtc_use_h264=false"
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" use_v8_context_snapshot=true"
|
|
|
|
myconf_gn+=" v8_use_external_startup_data=true"
|
2022-01-29 19:59:26 +00:00
|
|
|
%if %{with system_harfbuzz}
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" use_system_harfbuzz=true"
|
2022-01-29 19:59:26 +00:00
|
|
|
%endif
|
|
|
|
%if %{with system_freetype}
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" use_system_freetype=true"
|
2022-01-29 19:59:26 +00:00
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
|
|
|
|
%if %{with clang}
|
|
|
|
myconf_gn+=" is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false"
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" use_lld=true"
|
2021-06-29 20:42:56 +00:00
|
|
|
%else
|
|
|
|
myconf_gn+=" is_clang=false"
|
2022-01-27 22:16:50 +00:00
|
|
|
myconf_gn+=" use_gold=true"
|
2021-06-29 20:42:56 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with lto}
|
|
|
|
myconf_gn+=" use_thin_lto=false"
|
|
|
|
|
|
|
|
%if %{without clang}
|
|
|
|
myconf_gn+=" gcc_lto=true"
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# endif with lto
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with pipewire}
|
|
|
|
myconf_gn+=" rtc_use_pipewire=true rtc_link_pipewire=true"
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# 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+=" proprietary_codecs=true"
|
|
|
|
myconf_gn+=" ffmpeg_branding=\"Chrome\""
|
|
|
|
|
|
|
|
# GN does not support passing cflags:
|
|
|
|
# https://bugs.chromium.org/p/chromium/issues/detail?id=642016
|
|
|
|
gn gen out/Release --args="import(\"//electron/build/args/release.gn\") ${myconf_gn}"
|
|
|
|
ninja -v %{?_smp_mflags} -C out/Release electron
|
2022-01-29 19:59:26 +00:00
|
|
|
ninja -v %{?_smp_mflags} -C out/Release copy_headers
|
2021-06-29 20:42:56 +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
|
|
|
|
install -d -m 0755 %{buildroot}%{_libdir}/electron/swiftshader
|
|
|
|
install -d -m 0755 %{buildroot}%{_datadir}/applications
|
|
|
|
install -d -m 0755 %{buildroot}%{_datadir}/pixmaps/
|
|
|
|
install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/
|
|
|
|
|
|
|
|
install -m 0755 %{SOURCE10} %{buildroot}%{_bindir}/%{mod_name}
|
|
|
|
install -m 0644 electron/default_app/icon.png %{buildroot}%{_datadir}/pixmaps/%{mod_name}.png
|
|
|
|
install -m 0644 %{SOURCE12} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/electron-symbolic.svg
|
|
|
|
|
|
|
|
desktop-file-install --dir %{buildroot}%{_datadir}/applications/ %{SOURCE11}
|
|
|
|
|
|
|
|
pushd out/Release
|
|
|
|
rsync -av *.bin *.pak *.so resources %{buildroot}%{_libdir}/electron/
|
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
%if %{without system_ffmpeg}
|
2021-07-15 22:00:36 +00:00
|
|
|
rm -f %{buildroot}%{_libdir}/electron/libffmpeg*
|
|
|
|
%endif
|
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
rsync -av --exclude '*.pak.info' locales %{buildroot}%{_libdir}/electron/
|
|
|
|
|
|
|
|
%if %{with swiftshader}
|
|
|
|
rsync -av --exclude '*.so.TOC' swiftshader %{buildroot}%{_libdir}/electron/
|
2021-12-01 19:47:04 +00:00
|
|
|
%else
|
|
|
|
rm -f %{buildroot}/%{_libdir}/electron/libvk_swiftshader.so
|
2021-06-29 20:42:56 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
install -m 0755 electron %{buildroot}%{_libdir}/electron/electron
|
|
|
|
popd
|
|
|
|
|
2021-10-07 22:05:47 +00:00
|
|
|
%if %{without systemicu}
|
|
|
|
rsync -av third_party/icu/common/icudtl.dat %{buildroot}%{_libdir}/electron/
|
|
|
|
%endif
|
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
echo -n "%{version}" > %{buildroot}%{_libdir}/electron/version
|
|
|
|
|
|
|
|
# Install folders required for webapps
|
|
|
|
mkdir -p "%{buildroot}%{_sysconfdir}/webapps"
|
|
|
|
mkdir -p "%{buildroot}%{_datadir}/webapps"
|
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
rsync -av out/Release/gen/node_headers/include/node/* %{buildroot}%{_includedir}/electron
|
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
%files
|
|
|
|
%license electron/LICENSE
|
|
|
|
%doc electron/README.md
|
|
|
|
%{_bindir}/electron
|
|
|
|
%{_datadir}/pixmaps/electron.png
|
|
|
|
%{_datadir}/icons/hicolor/symbolic/apps/electron-symbolic.svg
|
|
|
|
%{_datadir}/applications/electron.desktop
|
|
|
|
|
|
|
|
%dir %{_libdir}/electron/
|
|
|
|
|
|
|
|
%{_libdir}/electron/electron
|
|
|
|
|
|
|
|
%{_libdir}/electron/*.bin
|
|
|
|
%{_libdir}/electron/*.pak
|
2021-10-07 22:05:47 +00:00
|
|
|
|
|
|
|
%{_libdir}/electron/libEGL.so
|
|
|
|
%{_libdir}/electron/libGLESv2.so
|
|
|
|
%{_libdir}/electron/libVkICD_mock_icd.so
|
|
|
|
|
|
|
|
%if %{without systemicu}
|
|
|
|
%{_libdir}/electron/icudtl.dat
|
|
|
|
%endif
|
2021-06-29 20:42:56 +00:00
|
|
|
|
|
|
|
%{_libdir}/electron/locales/
|
|
|
|
%{_libdir}/electron/resources/
|
|
|
|
|
|
|
|
%if %{with swiftshader}
|
|
|
|
%{_libdir}/electron/libvk_swiftshader.so
|
2021-10-07 22:05:47 +00:00
|
|
|
|
|
|
|
%dir %{_libdir}/electron/swiftshader/
|
|
|
|
%{_libdir}/electron/swiftshader/libEGL.so
|
|
|
|
%{_libdir}/electron/swiftshader/libGLESv2.so
|
2021-06-29 20:42:56 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%{_libdir}/electron/version
|
|
|
|
%dir %{_sysconfdir}/webapps
|
|
|
|
%dir %{_datadir}/webapps
|
|
|
|
|
2022-01-29 19:59:26 +00:00
|
|
|
%files devel
|
|
|
|
%{_includedir}/electron
|
|
|
|
|
2021-06-29 20:42:56 +00:00
|
|
|
%changelog
|