# Maintainer: Bruno Pagani # Remember to handle https://bugs.archlinux.org/task/74324 on major upgrades _use_suffix=0 pkgver=22.3.3 _commit=a831d69dfdd74655e95f93130c286662e1ba343d _chromiumver=108.0.5359.215 _gcc_patchset=2 # shellcheck disable=SC2034 pkgrel=1 _major_ver=${pkgver%%.*} if [[ ${_use_suffix} != 0 ]]; then pkgname="electron${_major_ver}" else pkgname=electron fi # shellcheck disable=SC2034 pkgdesc='Build cross platform desktop apps with web technologies' # shellcheck disable=SC2034 arch=('x86_64') # shellcheck disable=SC2034 url='https://electronjs.org/' # shellcheck disable=SC2034 license=('MIT' 'custom') # shellcheck disable=SC2034 depends=('c-ares' 'gtk3' 'libevent' 'nss' 'wayland') # shellcheck disable=SC2034 makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser' 'qt5-base' 'java-runtime-headless' 'libnotify' 'lld' 'llvm' 'ninja' 'npm' 'pciutils' 'pipewire' 'python' 'python-httplib2' 'python-pyparsing' 'python-six' 'wget' 'yarn') # shellcheck disable=SC2034 optdepends=('kde-cli-tools: file deletion support (kioclient5)' 'libappindicator-gtk3: StatusNotifierItem support' 'pipewire: WebRTC desktop sharing under Wayland' 'qt5-base: enable Qt5 with --enable-features=AllowQt' 'trash-cli: file deletion support (trash-put)' 'xdg-utils: open URLs with desktop’s default (xdg-email, xdg-open)') if [[ ${_use_suffix} == 0 ]]; then # shellcheck disable=SC2034 conflicts=("electron${_major_ver}") # shellcheck disable=SC2034 provides=("electron${_major_ver}") fi # shellcheck disable=SC2034 options=('!lto') # Electron adds its own flags for ThinLTO # shellcheck disable=SC2034 source=('git+https://github.com/electron/electron.git' 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main' "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz" "electron-launcher.sh" "electron.desktop" 'default_app-icon.patch' 'jinja-python-3.10.patch' 'use-system-libraries-in-node.patch' 'std-vector-non-const.patch' 're-fix-TFLite-build-error-on-linux-with-system-zlib.patch' 'chromium-icu72.patch' 'v8-enhance-Date-parser-to-take-Unicode-SPACE.patch' 'REVERT-roll-src-third_party-ffmpeg-m102.patch' 'REVERT-roll-src-third_party-ffmpeg-m106.patch' 'angle-wayland-include-protocol.patch' ) # shellcheck disable=SC2034 sha256sums=('SKIP' 'SKIP' '40ef8af65e78901bb8554eddbbb5ebc55c0b8e7927f6ca51b2a353d1c7c50652' '77817939c9833f8dda74a8c75620c15747170551ffa6f14f7c5b4071599e8831' '4484200d90b76830b69eea3a471c103999a3ce86bb2c29e6c14c945bf4102bae' 'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4' '55dbe71dbc1f3ab60bf1fa79f7aea7ef1fe76436b1d7df48728a1f8227d2134e' 'ff588a8a4fd2f79eb8a4f11cf1aa151298ffb895be566c57cc355d47f161f53f' '893bc04c7fceba2f0a7195ed48551d55f066bbc530ec934c89c55768e6f3949c' '9015b9d6d5b4c1e7248d6477a4b4b6bd6a3ebdc57225d2d8efcd79fc61790716' 'dabb5ab204b63be73d3c5c8b7c1fa74053105a285852ba3bbc4fb77646608572' 'b83406a881d66627757d9cbc05e345cbb2bd395a48b6d4c970e5e1cb3f6ed454' '30df59a9e2d95dcb720357ec4a83d9be51e59cc5551365da4c0073e68ccdec44' '4c12d31d020799d31355faa7d1fe2a5a807f7458e7f0c374adf55edb37032152' 'cd0d9d2a1d6a522d47c3c0891dabe4ad72eabbebc0fe5642b9e22efa3d5ee572') # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py # Keys are the names in the above script; values are the dependencies in Arch declare -gA _system_libs=( [brotli]=brotli [dav1d]=dav1d [ffmpeg]=ffmpeg [flac]=flac [fontconfig]=fontconfig [freetype]=freetype2 [harfbuzz-ng]=harfbuzz [icu]=icu [jsoncpp]=jsoncpp [libaom]=aom [libavif]=libavif [libdrm]= [libjpeg]=libjpeg [libpng]=libpng #[libvpx]=libvpx [libwebp]=libwebp [libxml]=libxml2 [libxslt]=libxslt [opus]=opus [re2]=re2 [snappy]=snappy [woff2]=woff2 [zlib]=minizip ) _unwanted_bundled_libs=( $(printf "%s\n" ${!_system_libs[@]} | sed 's/^libjpeg$/&_turbo/') ) depends+=(${_system_libs[@]}) prepare() { sed -i "s|@ELECTRON@|${pkgname}|" electron-launcher.sh sed -i "s|@ELECTRON@|${pkgname}|" electron.desktop if [[ ${_use_suffix} != 0 ]]; then sed -i "s|@ELECTRON_NAME@|Electron ${_major_ver}|" electron.desktop else sed -i "s|@ELECTRON_NAME@|Electron|" electron.desktop fi cat >.gclient <