libpdfium
MEDIUM
maintainer qubeck
0 votes
scanned 2026-10-18 13:22:09.532316
Why flagged
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
Triggered rules
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:36
source=("https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}-lite.tar.xz"
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: qubeck <qubeck [AT] disroot [DOT] org>
2
3
pkgname=libpdfium
4
pkgver=155.0.8059.84
5
pkgrel=1
6
_pdfium_rev=39f0ed4a657e53ed743a16d10d77dec086a08e03
7
pkgdesc='PDF rendering/manipulation library from Chromium'
8
arch=(x86_64)
9
url='https://pdfium.googlesource.com/pdfium/'
10
depends=(
11
glibc
12
libbrotlidec.so=1-64
13
libfreetype.so=6-64
14
libgcc_s.so=1-64
15
libharfbuzz.so=0-64
16
libharfbuzz-subset.so=0-64
17
libicuuc.so=78-64
18
liblcms2.so=2-64
19
libjpeg.so=8-64
20
libz.so=1-64
21
openjpeg2
22
)
23
makedepends=(
24
clang
25
fast_float
26
gn
27
lld
28
llvm
29
ninja
30
pkgconf
31
python
32
rust
33
)
34
provides=(${pkgname}.so=${pkgname}.so-64)
35
options=('!lto')
36
source=("https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}-lite.tar.xz"
37
'compiler-rt-adjust-paths.patch'
38
'increase-fortify-level.patch'
39
'chromium-153-hermetic-python.patch'
40
'chromium-155-fix-gn-no-public_inputs.patch')
41
sha256sums=('2063834f528029ad02a6a3de6d229c3e8b19bc43864be397944cbda18d7ee680'
42
'ec8e49b7114e2fa2d359155c9ef722ff1ba5fe2c518fa48e30863d71d3b82863'
43
'd634d2ce1fc63da7ac41f432b1e84c59b7cceabf19d510848a7cff40c8025342'
44
'ebf74154266d0b6d6cc957c413f845052c5fcfce7745befb8821595cdf3f7d49'
45
'81a9014afff7e2a836c2ba2da69a9023d42d2f69a46cb91a0504642c480f6cc7')
46
47
# Chromium unbundle shims relevant to pdfium's dependency closure
48
# (see build/linux/unbundle/replace_gn_files.py; abseil is deliberately absent).
49
_system_libs=(
50
brotli
51
freetype
52
harfbuzz
53
icu
54
libjpeg
55
zlib
56
)
57
58
# JavaScript (V8) support. 1 = on (default), 0 = off.
59
# On: V8 is compiled from the Chromium tree with a custom libc++, build time
60
# grows a lot and libpdfium.so gets much bigger. See the V8 flags in build().
61
# Off gives a much smaller library with no V8/libc++ statically linked.
62
_enable_js=1
63
if (( _enable_js )); then
64
_is_jitless=1
65
license=('Apache-2.0 AND MIT AND BSD-3-Clause AND (Apache-2.0 WITH LLVM-exception AND (MIT OR NCSA))')
66
makedepends+=(
67
highway
68
)
69
_system_libs+=(
70
highway
71
)
72
else
73
license=('Apache-2.0 AND MIT')
74
depends+=(
75
libstdc++.so=6-64
76
)
77
fi
78
79
prepare() {
80
cd "chromium-${pkgver}"
81
82
# Sanity: this must be the pdfium revision Chromium pins for this tag.
83
# (The tarball has no .git; compare against the DEPS file instead.)
84
if ! grep -q "'pdfium_revision': '${_pdfium_rev}'" DEPS; then
85
echo "DEPS does not pin pdfium ${_pdfium_rev}; update _pdfium_rev" >&2
86
return 1
87
fi
88
89
# Allow libclang_rt.builtins from compiler-rt >= 16 to be used
90
patch -Np1 -i ../compiler-rt-adjust-paths.patch
91
92
# Increase _FORTIFY_SOURCE level to match Arch's default flags
93
patch -Np1 -i ../increase-fortify-level.patch
94
95
# Use system python3 instead of the hermetic cpython3 interpreter
96
# https://github.com/ungoogled-software/ungoogled-chromium/pull/3946
97
patch -Np1 -i ../chromium-153-hermetic-python.patch
98
99
patch -Np1 -i ../chromium-155-fix-gn-no-public_inputs.patch
100
101
# Unbundle fast_float
102
mkdir -p pdfium/third_party/fast_float/src/include
103
ln -sf /usr/include/fast_float pdfium/third_party/fast_float/src/include/fast_float
104
105
mkdir -p third_party/rust-toolchain/bin
106
ln -sf /usr/bin/rustc third_party/rust-toolchain/bin/
107
108
# gclient normally generates this; some tarballs lack it. It defines
109
# build_with_chromium, which build_overrides/build.gni depends on.
110
if [[ ! -e build/config/gclient_args.gni ]]; then
111
cat > build/config/gclient_args.gni <<'EOF'
112
build_with_chromium = true
113
checkout_android = false
114
checkout_android_prebuilts_build_tools = false
115
checkout_clang_coverage_tools = false
116
checkout_copybara = false
117
checkout_fuchsia = false
118
checkout_glic_e2e_tests = false
119
checkout_ios_webkit = false
120
checkout_mutter = false
121
checkout_openxr = false
122
checkout_src_internal = false
123
checkout_src_internal_infra = false
124
checkout_clusterfuzz_data = false
125
checkout_google_benchmark = false
126
generate_location_tags = false
127
cros_boards = ""
128
cros_boards_with_qemu_images = ""
129
EOF
130
fi
131
132
# Upstream only defines component("pdfium") (static/source_set unless
133
# is_component_build=true, which would also split abseil, icu, ... into
134
# separate .so files). Add a plain shared_library on top of it, and define
135
# COMPONENT_BUILD for pdfium sources so FPDF_EXPORT expands to
136
# visibility("default") (see public/fpdfview.h); otherwise Chromium's
137
# -fvisibility=hidden hides the whole C API.
138
python - <<'EOF'
139
p = 'third_party/pdfium/BUILD.gn'
140
s = open(p).read()
141
anchor = 'config("pdfium_public_config") {\n defines = []\n'
142
assert anchor in s, 'pdfium_public_config layout changed; adjust prepare()'
143
assert 'component("pdfium")' in s, 'component("pdfium") not found'
144
if 'shared_library("pdfium_shared")' in s:
145
raise SystemExit(0) # already patched (prepare() re-run)
146
s = s.replace(anchor, anchor + ' defines += [ "COMPONENT_BUILD" ]\n', 1)
147
s += '''
148
shared_library("pdfium_shared") {
149
output_name = "pdfium"
150
deps = [ ":pdfium" ]
151
}
152
'''
153
open(p, 'w').write(s)
154
EOF
155
156
# Swap bundled GN files for the system-library shims.
157
python build/linux/unbundle/replace_gn_files.py --system-libraries "${_system_libs[@]}"
158
}
159
160
build() {
161
cd "chromium-${pkgver}"
162
163
export CC=clang CXX=clang++ AR=ar NM=nm
164
# Shared object: everything must be PIC. The unbundle toolchain reads these.
165
CFLAGS+=' -fPIC -Wno-unknown-warning-option'
166
CXXFLAGS+=' -fPIC -Wno-unknown-warning-option'
167
168
local _clang_version
169
_clang_version=$(clang --version | head -n1 | sed 's/.*version \([0-9]\+\).*/\1/')
170
171
local _flags=(
172
# --- Toolchain -----------------------------------------------------
173
# Use the system clang/lld through Chromium's "unbundle" toolchain
174
# instead of the downloaded one; no Chromium sysroot, link against
175
# the system glibc.
176
'clang_base_path="/usr"'
177
'clang_use_chrome_plugins=false' # Chromium's custom clang plugins are not in system clang
178
"clang_version=\"${_clang_version}\""
179
'custom_toolchain="//build/toolchain/linux/unbundle:default"'
180
'host_toolchain="//build/toolchain/linux/unbundle:default"'
181
'is_clang=true'
182
'use_lld=true'
183
'use_sysroot=false'
184
185
# --- C++ standard library ------------------------------------------
186
# Only the V8 build needs Chromium's libc++ (statically linked);
187
# without JS the library uses the system libstdc++.
188
"use_custom_libcxx=$( (( _enable_js )) && echo true || echo false )"
189
190
# --- Build type / optimization -------------------------------------
191
'dcheck_always_on=false'
192
'is_component_build=false' # one libpdfium.so, not one .so per component
193
'is_debug=false'
194
'is_official_build=false' # avoids official-only requirements (PGO profiles, etc.)
195
'symbol_level=0'
196
'treat_warnings_as_errors=false' # system clang is newer than what upstream tests
197
'use_thin_lto=false' # matches options=('!lto')
198
199
# --- gn gen workarounds --------------------------------------------
200
# gn evaluates every target in each BUILD.gn it loads, even unused ones.
201
# Don't load abseil's test targets (and with them //base/test).
202
'absl_build_tests=false'
203
204
# Rust is only needed so `gn gen` can *evaluate* the tree: //base,
205
# //third_party/googletest, //testing, ... define Rust targets with no
206
# enable_rust guard and assert on load. Nothing Rust is built for
207
# pdfium_shared (rust png/bmp/jpeg decoders, fontations and the Rust
208
# harfbuzz are all off/system). rustc is never invoked.
209
'enable_rust=true'
210
'rust_bindgen_root="/usr"'
211
"rust_sysroot_absolute=\"$(rustc --print sysroot)\""
212
"rustc_version=\"$(rustc --version)\""
213
214
# --- Memory allocator ----------------------------------------------
215
# This is a library loaded into foreign processes: it must never
216
# replace malloc/free of the host application.
217
'pdf_use_partition_alloc=false'
218
'use_allocator_shim=false'
219
'use_partition_alloc=false'
220
'use_partition_alloc_as_malloc=false'
221
222
# --- PDFium features -----------------------------------------------
223
'pdf_enable_fontations=false' # Rust font backend
224
'pdf_enable_rust_bmp=false' # Rust image decoders: not built (see Rust note above)
225
'pdf_enable_rust_jpeg=false'
226
'pdf_enable_rust_png=false'
227
"pdf_enable_v8=$( (( _enable_js )) && echo true || echo false )"
228
'pdf_enable_xfa=false' # XFA forms are deprecated and need extra deps
229
'pdf_use_skia=false' # use the AGG renderer
230
231
# --- System libraries ----------------------------------------------
232
# Complements the _system_libs unbundle shims applied in prepare().
233
'use_system_lcms2=true'
234
'use_system_libopenjpeg2=true'
235
'use_system_libpng=true'
236
'use_system_zlib=true'
237
)
238
239
if (( _enable_js )); then
240
_flags+=(
241
# --- V8: linking / embedding ---------------------------------------
242
'v8_monolithic=true' # single V8 archive instead of many targets
243
'v8_monolithic_for_shared_library=true' # PIC + visibility suitable for linking into a .so
244
'v8_use_external_startup_data=false' # embed the snapshot; a library can't ship loose .bin files
245
246
# --- V8: ICU / i18n ------------------------------------------------
247
# V8's own Intl is not needed for PDF JavaScript. (The system ICU in
248
# _system_libs is for pdfium itself.)
249
'v8_depend_on_icu_data_file=false'
250
'v8_enable_i18n_support=false'
251
252
# --- V8: disabled features -----------------------------------------
253
'v8_enable_sandbox=false' # PDFium's upstream configuration disables it
254
'v8_enable_test_features=false'
255
256
# Temporal is a Rust crate that really is compiled; PDF JavaScript
257
# has no use for it, and we never build Rust.
258
'v8_enable_temporal_support=false'
259
'v8_enable_webassembly=false' # PDF JavaScript does not require WebAssembly
260
'v8_use_metagen_instance_types=false'
261
262
# --- V8: tracing / profiling ---------------------------------------
263
'v8_use_perfetto=false' # V8's Perfetto integration
264
)
265
# Jitless: interpreter only. No writable+executable pages, which suits a
266
# library loaded into arbitrary host processes, and PDF scripts are tiny.
267
if (( _is_jitless )); then
268
_flags+=(
269
'v8_enable_maglev=false'
270
'v8_enable_sparkplug=false'
271
'v8_enable_turbofan=false'
272
'v8_jitless=true'
273
)
274
fi
275
fi
276
277
gn gen out/Release \
278
--root-target=//third_party/pdfium \
279
--args="${_flags[*]}"
280
281
ninja -C out/Release third_party/pdfium:pdfium_shared
282
}
283
284
check() {
285
cd "chromium-${pkgver}/out/Release"
286
287
# The C API must be exported (FPDF_EXPORT visibility) ...
288
nm -D --defined-only libpdfium.so | grep -q ' T FPDF_InitLibraryWithConfig$'
289
nm -D --defined-only libpdfium.so | grep -q ' T FPDF_LoadMemDocument$'
290
291
# ... and, in the default configuration, nothing JS-related may be linked in.
292
if (( ! _enable_js )) && readelf -d libpdfium.so | grep -qi 'v8'; then
293
echo 'libpdfium.so unexpectedly links V8' >&2
294
return 1
295
fi
296
}
297
298
package() {
299
cd "chromium-${pkgver}"
300
301
install -Dm755 out/Release/libpdfium.so \
302
-t "${pkgdir}/usr/lib"
303
304
# Public headers use both "fpdfview.h" and "public/fpdfview.h" styles, so
305
# install them under public/ and expose both include roots via pkg-config.
306
install -dm755 "${pkgdir}/usr/include/${pkgname}/public/cpp"
307
install -Dm644 third_party/pdfium/public/*.h \
308
-t "${pkgdir}/usr/include/${pkgname}/public/"
309
install -Dm644 third_party/pdfium/public/cpp/*.h \
310
-t "${pkgdir}/usr/include/${pkgname}/public/cpp/"
311
312
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/pkgconfig/${pkgname}.pc" <<EOF
313
prefix=/usr
314
libdir=\${prefix}/lib
315
includedir=\${prefix}/include/${pkgname}
316
317
Name: ${pkgname}
318
Description: PDF rendering library
319
Version: ${pkgver}
320
Libs: -L\${libdir} -lpdfium
321
Cflags: -I\${includedir} -I\${includedir}/public
322
EOF
323
324
install -Dm644 third_party/pdfium/third_party/agg23/copying \
325
-t "${pkgdir}/usr/share/licenses/${pkgname}/agg23"
326
327
if (( _enable_js )); then
328
install -Dm644 v8/LICENSE.v8 \
329
-t "${pkgdir}/usr/share/licenses/${pkgname}/v8"
330
331
# Original, unmodified
332
install -Dm644 third_party/libc++/src/LICENSE.TXT \
333
-t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"
334
335
# Apache-2.0 with LLVM exceptions: between the 2nd and 3rd "=====" rules
336
awk '/^=+$/ { n++; if (n == 3) exit; next } n >= 2' \
337
third_party/libc++/src/LICENSE.TXT \
338
> "${srcdir}/LICENSE.Apache-2.0-with-LLVM-exception"
339
340
# University of Illinois/NCSA: from its title up to the next "=====" rule
341
awk '/^University of Illinois\/NCSA$/ { p = 1 } p && /^=+$/ { exit } p' \
342
third_party/libc++/src/LICENSE.TXT \
343
> "${srcdir}/LICENSE.NCSA"
344
345
# MIT: from its copyright line to end of file
346
awk '/^Copyright \(c\) 2009-2014 by the contributors/ { p = 1 } p' \
347
third_party/libc++/src/LICENSE.TXT \
348
> "${srcdir}/LICENSE.MIT"
349
350
install -Dm644 "${srcdir}/LICENSE.Apache-2.0-with-LLVM-exception" \
351
-t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"
352
install -Dm644 "${srcdir}/LICENSE.NCSA" \
353
-t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"
354
install -Dm644 "${srcdir}/LICENSE.MIT" \
355
-t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"
356
fi
357
}
358
Changes since previous scan
--- PKGBUILD @ 2026-10-14 19:22+++ PKGBUILD @ 2026-10-18 13:22@@ -1,7 +1,7 @@ # Maintainer: qubeck <qubeck [AT] disroot [DOT] org> pkgname=libpdfium-pkgver=155.0.8059.79+pkgver=155.0.8059.84 pkgrel=1 _pdfium_rev=39f0ed4a657e53ed743a16d10d77dec086a08e03 pkgdesc='PDF rendering/manipulation library from Chromium'@@ -38,7 +38,7 @@ 'increase-fortify-level.patch' 'chromium-153-hermetic-python.patch' 'chromium-155-fix-gn-no-public_inputs.patch')-sha256sums=('fcb5be44f1f5916ac23309c706146819c792c0d0e9c1a8220b7fbc046d79f15e'+sha256sums=('2063834f528029ad02a6a3de6d229c3e8b19bc43864be397944cbda18d7ee680' 'ec8e49b7114e2fa2d359155c9ef722ff1ba5fe2c518fa48e30863d71d3b82863' 'd634d2ce1fc63da7ac41f432b1e84c59b7cceabf19d510848a7cff40c8025342' 'ebf74154266d0b6d6cc957c413f845052c5fcfce7745befb8821595cdf3f7d49'@@ -62,7 +62,7 @@ _enable_js=1 if (( _enable_js )); then _is_jitless=1- license=('Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND MIT AND NCSA')+ license=('Apache-2.0 AND MIT AND BSD-3-Clause AND (Apache-2.0 WITH LLVM-exception AND (MIT OR NCSA))') makedepends+=( highway )@@ -238,9 +238,6 @@ if (( _enable_js )); then _flags+=(- # --- libc++ (only meaningful with use_custom_libcxx) ---------------- 'enable_safe_libcxx=true' # hardened libc++ assertions- # --- V8: linking / embedding --------------------------------------- 'v8_monolithic=true' # single V8 archive instead of many targets 'v8_monolithic_for_shared_library=true' # PIC + visibility suitable for linking into a .so@@ -254,6 +251,7 @@ # --- V8: disabled features ----------------------------------------- 'v8_enable_sandbox=false' # PDFium's upstream configuration disables it+ 'v8_enable_test_features=false' # Temporal is a Rust crate that really is compiled; PDF JavaScript # has no use for it, and we never build Rust.@@ -262,8 +260,6 @@ 'v8_use_metagen_instance_types=false' # --- V8: tracing / profiling ---------------------------------------- 'enable_base_tracing=false' # tracing instrumentation in //base- 'use_perfetto_client_library=false' # Perfetto as TRACE_EVENT implementation 'v8_use_perfetto=false' # V8's Perfetto integration ) # Jitless: interpreter only. No writable+executable pages, which suits a@@ -327,11 +323,36 @@ install -Dm644 third_party/pdfium/third_party/agg23/copying \ -t "${pkgdir}/usr/share/licenses/${pkgname}/agg23"+ if (( _enable_js )); then install -Dm644 v8/LICENSE.v8 \ -t "${pkgdir}/usr/share/licenses/${pkgname}/v8"- install -Dm644 third_party/libc++/src/LICENSE.txt \++ # Original, unmodified+ install -Dm644 third_party/libc++/src/LICENSE.TXT \ -t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"- fi-}-++ # Apache-2.0 with LLVM exceptions: between the 2nd and 3rd "=====" rules+ awk '/^=+$/ { n++; if (n == 3) exit; next } n >= 2' \+ third_party/libc++/src/LICENSE.TXT \+ > "${srcdir}/LICENSE.Apache-2.0-with-LLVM-exception"++ # University of Illinois/NCSA: from its title up to the next "=====" rule+ awk '/^University of Illinois\/NCSA$/ { p = 1 } p && /^=+$/ { exit } p' \+ third_party/libc++/src/LICENSE.TXT \+ > "${srcdir}/LICENSE.NCSA"++ # MIT: from its copyright line to end of file+ awk '/^Copyright \(c\) 2009-2014 by the contributors/ { p = 1 } p' \+ third_party/libc++/src/LICENSE.TXT \+ > "${srcdir}/LICENSE.MIT"++ install -Dm644 "${srcdir}/LICENSE.Apache-2.0-with-LLVM-exception" \+ -t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"+ install -Dm644 "${srcdir}/LICENSE.NCSA" \+ -t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"+ install -Dm644 "${srcdir}/LICENSE.MIT" \+ -t "${pkgdir}/usr/share/licenses/${pkgname}/libc++"+ fi+}+Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-18 13:22:09 | Medium | 2 |
| 2026-10-14 19:22:30 | Clean | 3 |
| 2026-10-14 19:20:25 | Medium | 2 |