electron16
maintainer ewout
· 5 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The package builds Electron from source using official repositories (GitHub, Chromium) and a patchset from a third-party GitHub release; the non-whitelisted host is GitHub, which is trustworthy for this context, and no unverifiable prebuilt binaries are executed.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The package builds Electron from source using official repositories (GitHub, Chromium) and a patchset from a third-party GitHub release; the non-whitelisted host is GitHub, which is trustworthy for this context, and no unverifiable prebuilt binaries are executed.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
source=() URL on a non-standard host
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:48
'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main'
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: Nicola Squartini <tensor5@gmail.com>
2
3
_use_suffix=1
4
pkgver=16.2.8
5
_commit=10ce3725c280131d7b7ad5b1440680b76d25a4d5
6
_chromiumver=96.0.4664.174
7
_gcc_patchset=4
8
# shellcheck disable=SC2034
9
pkgrel=2
10
11
_major_ver=${pkgver%%.*}
12
if [[ ${_use_suffix} != 0 ]]; then
13
pkgname="electron${_major_ver}"
14
else
15
pkgname=electron
16
fi
17
# shellcheck disable=SC2034
18
pkgdesc='Build cross platform desktop apps with web technologies'
19
# shellcheck disable=SC2034
20
arch=('x86_64')
21
# shellcheck disable=SC2034
22
url='https://electronjs.org/'
23
# shellcheck disable=SC2034
24
license=('MIT' 'custom')
25
# shellcheck disable=SC2034
26
depends=('c-ares' 'ffmpeg' 'gtk3' 'libxslt' 'minizip' 'nss' 're2' 'snappy')
27
# shellcheck disable=SC2034
28
makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser'
29
'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja'
30
'npm' 'pciutils' 'pipewire' 'python' 'python-httplib2' 'wget'
31
'python-pyparsing' 'python-six' 'yarn')
32
# shellcheck disable=SC2034
33
optdepends=('kde-cli-tools: file deletion support (kioclient5)'
34
'libappindicator-gtk3: StatusNotifierItem support'
35
'pipewire: WebRTC desktop sharing under Wayland'
36
'trash-cli: file deletion support (trash-put)'
37
"xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
38
if [[ ${_use_suffix} == 0 ]]; then
39
# shellcheck disable=SC2034
40
conflicts=("electron${_major_ver}")
41
# shellcheck disable=SC2034
42
provides=("electron${_major_ver}")
43
fi
44
# shellcheck disable=SC2034
45
options=('!lto') # Electron adds its own flags for ThinLTO
46
# shellcheck disable=SC2034
47
source=('git+https://github.com/electron/electron.git'
48
'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main'
49
"https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz"
50
"electron-launcher.sh"
51
"electron.desktop"
52
'default_app-icon.patch'
53
'breakpad-fix-for-non-constant-SIGSTKSZ.patch'
54
'jinja-python-3.10.patch'
55
'sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch'
56
'std-vector-non-const.patch'
57
'use-system-libraries-in-node.patch'
58
'cppgc-fix-include.patch'
59
'iwyu-add-utility-for-std-exchange.patch'
60
'sql-make-VirtualCursor-standard-layout-type.patch'
61
'wayland-fix-binding-to-wrong-version.patch'
62
'unbundle-fix-visibility-of-build-config-freetype.patch'
63
'unexpire-accelerated-video-decode-flag.patch'
64
)
65
# shellcheck disable=SC2034
66
sha256sums=('SKIP'
67
'SKIP'
68
'090af7eab39aade15a1786273f2497d6b4abfaef24279fbf97ce0dd1c38c69aa'
69
'3953f532a3ea5fce19ee33600c6ead89dcd066df6a01d3c3ab4c24f96e46fca2'
70
'4484200d90b76830b69eea3a471c103999a3ce86bb2c29e6c14c945bf4102bae'
71
'75bac9c4ad32ff9329399b8587f9772e208c009fd822cdfce61b2bd1ee9ac828'
72
'b4d28867c1fabde6c50a2cfa3f784730446c4d86e5191e0f0000fbf7b0f91ecf'
73
'09de0ebb4002be7fb4ede63d3977e4f1235637750169c9e71bfdbd75bf750f7a'
74
'f910be9370c880de6e1d61cc30383c069e421d7acf406166e4fbfad324fc7d61'
75
'4fbef42aaa7bf60d059f1a6b0a92dc997d475256110bd4df32c12de7f4f175a7'
76
'c70652a8b24c237bcfd27469de32797a2cb46d9f0d63d897bb6418314a25644c'
77
'7987b106dbb35b74d6ff28dc8cf2c897647d5ce59d5d6dbe36b2f72542e713b6'
78
'6f666ef0acb08704ca58cc0d5e97e7ce64d8fea51042e593adae1ce15a61231c'
79
'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
80
'fc2be146412d117869368f8559afef76ad39a3442ace16e5c7000bd45aa56b27'
81
'd0b17162211dd49e3a58c16d1697e7d8c322dcfd3b7890f0c2f920b711f52293'
82
'2a97b26c3d6821b15ef4ef1369905c6fa3e9c8da4877eb9af4361452a425290b'
83
)
84
85
_system_libs=('ffmpeg'
86
'flac'
87
'fontconfig'
88
'freetype'
89
'harfbuzz-ng'
90
'icu'
91
'libdrm'
92
'libevent'
93
'libjpeg'
94
'libpng'
95
# 'libvpx'
96
'libwebp'
97
'libxml'
98
'libxslt'
99
# 'openh264'
100
'opus'
101
're2'
102
'snappy'
103
'zlib'
104
)
105
106
prepare() {
107
sed -i "s|@ELECTRON@|${pkgname}|" electron-launcher.sh
108
sed -i "s|@ELECTRON@|${pkgname}|" electron.desktop
109
if [[ ${_use_suffix} != 0 ]]; then
110
sed -i "s|@ELECTRON_NAME@|Electron ${_major_ver}|" electron.desktop
111
else
112
sed -i "s|@ELECTRON_NAME@|Electron|" electron.desktop
113
fi
114
115
export PATH="${PATH}:${srcdir:?}/depot_tools"
116
117
echo "Fetching chromium..."
118
git clone --branch=${_chromiumver} --depth=1 \
119
https://chromium.googlesource.com/chromium/src.git
120
121
echo "solutions = [
122
{
123
\"name\": \"src/electron\",
124
\"url\": \"file://${srcdir}/electron@${_commit}\",
125
\"deps_file\": \"DEPS\",
126
\"managed\": False,
127
\"custom_deps\": {
128
\"src\": None,
129
},
130
\"custom_vars\": {},
131
},
132
]" > .gclient
133
134
python "${srcdir}/depot_tools/gclient.py" sync \
135
--with_branch_heads \
136
--with_tags \
137
--nohooks
138
139
(
140
cd src/electron || exit
141
patch -Np1 -i ../../std-vector-non-const.patch
142
)
143
144
echo "Running hooks..."
145
# python "${srcdir}/depot_tools/gclient.py" runhooks
146
src/build/landmines.py
147
src/build/util/lastchange.py -o src/build/util/LASTCHANGE
148
src/build/util/lastchange.py -m GPU_LISTS_VERSION \
149
--revision-id-only --header src/gpu/config/gpu_lists_version.h
150
src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
151
-s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
152
# Create sysmlink to system clang-format
153
ln -s /usr/bin/clang-format src/buildtools/linux64
154
# Create sysmlink to system Node.js
155
mkdir -p src/third_party/node/linux/node-linux-x64/bin
156
ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
157
src/third_party/depot_tools/download_from_google_storage.py \
158
--no_resume --extract --no_auth --bucket chromium-nodejs \
159
-s src/third_party/node/node_modules.tar.gz.sha1
160
vpython src/tools/download_optimization_profile.py \
161
--newest_state=src/chrome/android/profiles/newest.txt \
162
--local_state=src/chrome/android/profiles/local.txt \
163
--output_name=src/chrome/android/profiles/afdo.prof \
164
--gs_url_base=chromeos-prebuilt/afdo-job/llvm
165
#vpython src/tools/update_pgo_profiles.py \
166
# --target=linux \
167
# update \
168
# --gs-url-base=chromium-optimization-profiles/pgo_profiles
169
src/electron/script/apply_all_patches.py \
170
src/electron/patches/config.json
171
cd src/electron || exit
172
yarn install --frozen-lockfile
173
cd ..
174
175
echo "Applying local patches..."
176
# Fixes for building with libstdc++ instead of libc++
177
patch -Np1 -i ../patches/chromium-96-CommandLine-include.patch
178
patch -Np1 -i ../patches/chromium-96-RestrictedCookieManager-tuple.patch
179
patch -Np1 -i ../patches/chromium-96-DrmRenderNodePathFinder-include.patch
180
patch -Np1 -i ../patches/chromium-96-CouponDB-include.patch
181
182
patch -Np1 -d v8 < ../cppgc-fix-include.patch
183
patch -Np1 -i ../iwyu-add-utility-for-std-exchange.patch
184
patch -Np1 -d third_party/breakpad/breakpad < ../breakpad-fix-for-non-constant-SIGSTKSZ.patch
185
patch -Np1 -i ../unbundle-fix-visibility-of-build-config-freetype.patch
186
patch -Np1 -i ../sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
187
patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
188
patch -Np1 -i ../wayland-fix-binding-to-wrong-version.patch
189
patch -Np0 -i ../unexpire-accelerated-video-decode-flag.patch
190
patch -d third_party/electron_node/tools/inspector_protocol/jinja2 \
191
-Np1 -i ../../../../../../jinja-python-3.10.patch
192
patch -Np1 -i ../use-system-libraries-in-node.patch
193
patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
194
195
echo "Patching Chromium for using system libraries..."
196
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
197
tools/generate_shim_headers/generate_shim_headers.py
198
for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do
199
third_party_dir="third_party/${lib}"
200
if [ ! -d "${third_party_dir}" ]; then
201
third_party_dir="base/${third_party_dir}"
202
fi
203
find "${third_party_dir}" -type f \
204
\! -path "${third_party_dir}/chromium/*" \
205
\! -path "${third_party_dir}/google/*" \
206
\! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \
207
\! -regex '.*\.\(gn\|gni\|isolate\)' \
208
-delete
209
done
210
build/linux/unbundle/replace_gn_files.py \
211
--system-libraries \
212
"${_system_libs[@]}"
213
}
214
215
build() {
216
export CC=clang
217
export CXX=clang++
218
export AR=ar
219
export NM=nm
220
221
CFLAGS="${CFLAGS/-fexceptions/}"
222
CXXFLAGS="${CXXFLAGS/-fexceptions/}"
223
224
# This appears to cause random segfaults when combined with ThinLTO
225
# https://bugs.archlinux.org/task/73518
226
CFLAGS=${CFLAGS/-fstack-clash-protection}
227
CXXFLAGS=${CXXFLAGS/-fstack-clash-protection}
228
229
# Do not warn about unknown warning options
230
CFLAGS+=' -Wno-unknown-warning-option'
231
CXXFLAGS+=' -Wno-unknown-warning-option'
232
233
cd src || exit
234
export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
235
GN_EXTRA_ARGS='
236
blink_symbol_level = 0
237
chrome_pgo_phase = 0
238
clang_use_chrome_plugins = false
239
custom_toolchain = "//build/toolchain/linux/unbundle:default"
240
host_toolchain = "//build/toolchain/linux/unbundle:default"
241
icu_use_data_file = false
242
is_component_ffmpeg = false
243
link_pulseaudio = true
244
rtc_use_pipewire = true
245
treat_warnings_as_errors = false
246
use_custom_libcxx = false
247
use_gnome_keyring = false
248
use_sysroot = false
249
'
250
gn gen out/Release \
251
--args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
252
ninja -C out/Release electron
253
# Strip before zip to avoid
254
# zipfile.LargeZipFile: Filesize would require ZIP64 extensions
255
strip -s out/Release/electron
256
ninja -C out/Release electron_dist_zip
257
# ninja -C out/Release third_party/electron_node:headers
258
}
259
260
package() {
261
install -dm755 "${pkgdir:?}/usr/lib/${pkgname}"
262
bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
263
264
chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
265
266
install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
267
for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
268
ln -s \
269
"$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \
270
"${pkgdir}/usr/share/licenses/${pkgname}"
271
done
272
273
install -Dm755 "${srcdir}/electron-launcher.sh" \
274
"${pkgdir}/usr/bin/${pkgname}"
275
if [[ "${_use_suffix}" == 0 ]]; then
276
ln "${pkgdir}/usr/bin/${pkgname}" \
277
"${pkgdir}/usr/bin/${pkgname}${_major_ver}"
278
fi
279
280
# Install .desktop and icon file (see default_app-icon.patch)
281
install -Dm644 electron.desktop \
282
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
283
install -Dm644 src/electron/default_app/icon.png \
284
"${pkgdir}/usr/share/pixmaps/${pkgname}.png" # hicolor has no 1024x1024
285
}
286
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |