gfxbench5-git
LOW
maintainer Grakul
0 votes
scanned 2026-09-26 15:15:21.013550
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
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
# Maintainer: Eugene Flanagin <eflanagin at pm dot me>
2
#
3
# Open-source GFXBench 5 (Kishonti Ltd; code BSD-3-Clause, benchmark assets CC BY 4.0).
4
# This is the Linux "developer" build: the command-line test runner (testfw_app),
5
# not the Qt GUI. Three runners are built and installed side by side:
6
# /opt/gfxbench5/vk Vulkan + desktop GL, XCB display protocol (--gfx xcb_vulkan | glfw)
7
# /opt/gfxbench5/gl OpenGL / GLES 3.1, XCB display protocol (--gfx glfw | egl)
8
# /opt/gfxbench5/wl OpenGL / GLES 3.1, native Wayland (GLFW built with Wayland; --gfx egl)
9
# The ~3 GB of assets are shared (/opt/gfxbench5/data). Launchers: gfxbench5-{vk,gl,wl}.
10
#
11
# Size warning: the git source is large (~1.7 GB mirror + ~5.3 GB checkout) and the
12
# build tree needs another ~4 GB; the installed package is ~3 GB.
13
14
pkgname=gfxbench5-git
15
pkgver=5.1.5.r2.g89aa956
16
pkgrel=1
17
pkgdesc="GFXBench 5 GPU benchmark (open-source release), Vulkan/OpenGL/Wayland CLI runners"
18
arch=('x86_64')
19
url="https://github.com/Kishonti-Opensource/gfxbench"
20
license=('BSD-3-Clause' 'CC-BY-4.0')
21
depends=('glibc' 'gcc-libs'
22
'libx11' 'libxcb' 'libglvnd' 'vulkan-icd-loader' 'wayland'
23
# dlopen()ed at runtime by the bundled GLFW 3.4 (X11 and Wayland backends);
24
# they never show up in ldd/namcap
25
'libxrandr' 'libxcursor' 'libxinerama' 'libxi' 'libxkbcommon')
26
makedepends=('git' 'cmake' 'python' 'vulkan-headers' 'wayland-protocols'
27
# linked by upstream's CMake (X11/GLFW/systeminfo) but dropped again by
28
# -Wl,--as-needed, so build-time only
29
'libxext' 'libsm' 'libice' 'libdrm')
30
optdepends=('vulkan-driver: Vulkan tests (gfxbench5-vk, vulkan_* test ids)'
31
'opengl-driver: OpenGL / GLES tests'
32
'libdecor: client-side window decorations for the Wayland runner')
33
provides=('gfxbench5')
34
conflicts=('gfxbench5')
35
source=("git+https://github.com/Kishonti-Opensource/gfxbench.git"
36
'0001-poco-1.5.3-delegate-fix-assignment-operator.patch'
37
'0002-cmake-drop-Werror.patch'
38
'0003-poco-disable-net-and-openssl.patch'
39
'0004-set-window-class-for-compositor-rules.patch')
40
sha256sums=('SKIP'
41
'ecaeaae56061090f33785e3d62e0c3471486910577e84dbefa9b32127af2c29d'
42
'1a521d7a8c5e3d114d6c1857177e228bca04104f21bc441ada05b6b84f3c50bd'
43
'd04fd2d9ca5c1021bcb52fa8c1a615de29602395788b4b947d1c987161ed94f5'
44
'36993733821ddef69fb20ba73cc4da903a5fc7c06b739337bee0e497ae50193d')
45
46
pkgver() {
47
cd gfxbench
48
# upstream has no tags; prefix the product version from ./product (5.1.5) so
49
# the version stays meaningful: <product>.r<commits>.g<hash>
50
local ver
51
ver=$(sed -n 's/^PRODUCT_VERSION="\(.*\)"$/\1/p' product)
52
printf '%s.r%s.g%s' "${ver:-0}" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
53
}
54
55
prepare() {
56
cd gfxbench
57
local p
58
for p in "${source[@]}"; do
59
[[ $p == *.patch ]] || continue
60
patch -Np1 -i "$srcdir/$p"
61
done
62
}
63
64
# Common environment for upstream's scripts/build*.sh wrappers.
65
_gfxbench_env() {
66
export WORKSPACE="$srcdir/gfxbench"
67
export NG_THIRDPARTY_ROOT="$WORKSPACE/out/3rdparty"
68
export PLATFORM=linux CONFIG=Release
69
# users may carry odd CC/CXX (clang, aocc, ...) in their environment; the tree is GCC-only
70
export CC=gcc CXX=g++
71
# the tree still has cmake_minimum_required() < 3.5 in places (CMake 4.x refuses them)
72
export CMAKE_POLICY_VERSION_MINIMUM=3.5
73
# frameworks/ngl: link the system Vulkan loader instead of the bundled 2016 one
74
export VULKAN_LIB_PATH=/usr/lib
75
# scripts/build.sh reads $EDITOR as its own "editor build" flag (true/false)
76
export EDITOR=false
77
# parallelism: let makepkg's MAKEFLAGS drive make (MP_COMPILE would force -j16)
78
export MP_COMPILE=false
79
export MAKEFLAGS="${MAKEFLAGS:--j$(nproc)}"
80
# GCC 14+ turns these C diagnostics into errors; the old bundled glew/epoxy code trips them
81
export CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -Wno-error=implicit-int -Wno-error=return-mismatch"
82
}
83
84
# Build one testfw_app variant with upstream's scripts/build.sh into out/pkg-<variant>.
85
_gfxbench_variant() {
86
local v=$1
87
export NG_BUILD_ROOT="$WORKSPACE/out/build-$v"
88
export NG_INSTALL_ROOT="$WORKSPACE/out/install-$v"
89
export APPLICATION_TYPE=developer
90
# no CUDA on a stock system: never build the cudaw wrapper (its public header
91
# needs <cuda.h>); systeminfo's find_package(cudaw QUIET) is optional
92
export DISABLED_PACKAGES="CUDAToolkit cudaw" SKIP_PROJECT=cudaw
93
unset DISPLAY_PROTOCOL OGLX_VARIANT USE_WAYLAND
94
case $v in
95
# the vk build bundles the assets (BUNDLE_DATA); they are identical for every
96
# variant, so gl/wl skip the 3 GB copy and package() takes data from pkg-vk
97
vk) export PRODUCT_ID=gfxbench_vulkan BUNDLE_DATA=true ;;
98
gl) export PRODUCT_ID=gfxbench_gl BUNDLE_DATA=false ;;
99
wl) export PRODUCT_ID=gfxbench_gl BUNDLE_DATA=false \
100
DISPLAY_PROTOCOL=WAYLAND OGLX_VARIANT=sys USE_WAYLAND=true ;;
101
esac
102
rm -rf "$WORKSPACE/tfw-pkg" "$WORKSPACE/out/pkg-$v"
103
./scripts/build.sh
104
mv "$WORKSPACE/tfw-pkg" "$WORKSPACE/out/pkg-$v"
105
}
106
107
build() {
108
cd gfxbench
109
_gfxbench_env
110
111
# 1. bundled third-party libraries (static): libepoxy zlib libpng poco AgilitySDK glew glfw(X11).
112
# "loader" is the bundled 2016 Vulkan loader (libvulkan-1.so): skipped, so the
113
# only loader the build can find is the system vulkan-icd-loader.
114
# Poco 1.5.3 predates C++17, hence -std=gnu++11 for this step only.
115
NG_BUILD_ROOT="$WORKSPACE/out/build-3rdparty" NG_INSTALL_ROOT="$WORKSPACE/out/3rdparty" \
116
CXXFLAGS="$CXXFLAGS -std=gnu++11" SKIP_PROJECT=loader \
117
./scripts/build-3rdparty.sh
118
119
# 2. the two XCB variants (link the X11 GLFW just built)
120
_gfxbench_variant vk
121
_gfxbench_variant gl
122
123
# 3. rebuild only GLFW with the Wayland backend, over the same prefix (this
124
# replaces libglfw3.a, so it must come after vk/gl), then the Wayland variant
125
NG_BUILD_ROOT="$WORKSPACE/out/build-3rdparty-wl" NG_INSTALL_ROOT="$WORKSPACE/out/3rdparty" \
126
CXXFLAGS="$CXXFLAGS -std=gnu++11" USE_WAYLAND=true \
127
SKIP_PROJECT="libepoxy zlib libpng poco AgilitySDK glew loader" \
128
./scripts/build-3rdparty.sh
129
_gfxbench_variant wl
130
}
131
132
package() {
133
local out="$srcdir/gfxbench/out"
134
local opt="$pkgdir/opt/gfxbench5"
135
local v
136
137
# shared benchmark assets (~3 GB), taken from the vk build (see _gfxbench_variant)
138
install -d "$opt"
139
cp -a "$out/pkg-vk/data" "$opt/data"
140
141
for v in vk gl wl; do
142
# plugins/ is probed at runtime (LibraryLoader); it is empty in this build
143
install -d "$opt/$v"/{bin,config,plugins}
144
install -m755 "$out/pkg-$v/bin/testfw_app" "$opt/$v/bin/testfw_app"
145
install -m644 "$out/pkg-$v"/config/*.json "$opt/$v/config/"
146
ln -s ../data "$opt/$v/data"
147
done
148
149
# launcher: one script, selected by the name it is invoked as
150
cat > "$srcdir/gfxbench5-launcher" <<'EOF'
151
#!/bin/bash
152
# gfxbench5-{vk,gl,wl}: launchers for the open-source GFXBench 5 command-line runner (testfw_app).
153
# Usage: gfxbench5-<variant> [--list] [testfw_app args...]
154
# vk : Vulkan (--gfx xcb_vulkan, auto-selected for vulkan_* test ids) or desktop GL (--gfx glfw)
155
# gl : OpenGL / GLES 3.1 via GLFW (--gfx glfw, default) or EGL (--gfx egl)
156
# wl : native Wayland build, EGL/GLES (--gfx egl, default; --gfx glfw is known to crash)
157
# Defaults added when absent: -w 1920 -h 1080, --gfx (see above) and --resultdir (see below).
158
# Examples:
159
# gfxbench5-vk -t vulkan_5_high_off # 1080p offscreen Aztec Ruins High, ~64 s
160
# gfxbench5-gl -t gl_manhattan31_off --ei -play_time=10000
161
# gfxbench5-wl -t gl_5_normal_off
162
# gfxbench5-vk -t gl_5_high -w 2560 -h 1440 # onscreen window (WM_CLASS/app_id "gfxbench")
163
# Test-specific overrides: --ei -play_time=<ms> --ei -screenmode=0|1 --ei -fsaa=<n> --ei -test_width=<px>
164
# One API per invocation (do not mix vulkan_* and gl_* test ids in one run).
165
# Environment:
166
# GFXBENCH_RESULTS where result JSON files go, one <timestamp>/ subdirectory per run
167
# (default: $XDG_DATA_HOME/gfxbench5/results, i.e. ~/.local/share/gfxbench5/results);
168
# /opt/gfxbench5 itself is read-only, so testfw_app's own default would fail
169
# GFXBENCH_MANGOHUD set to 1 to allow MangoHud; the default exports MANGOHUD=0 for clean numbers
170
export MANGOHUD=${GFXBENCH_MANGOHUD:-0}
171
V=${0##*-}
172
case $V in
173
vk|gl|wl) ;;
174
*) echo "usage: gfxbench5-{vk,gl,wl} [--list] [testfw_app args...]" >&2; exit 2 ;;
175
esac
176
B=/opt/gfxbench5/$V
177
case "${1:-}" in
178
""|--list|-l)
179
echo "Test ids ($B/config):"; ls "$B/config" | sed 's/\.json$//' | column -c 110
180
echo; echo "Run: gfxbench5-$V -t <test_id> [-t ...] (see the header of $0 for options)"; exit 0 ;;
181
-h|--help)
182
exec "$B/bin/testfw_app" --help ;;
183
esac
184
gfx=0; w=0; vk=0; rd=0
185
for a in "$@"; do
186
case "$a" in
187
--gfx*) gfx=1 ;;
188
-w*|--width*) w=1 ;;
189
--resultdir*) rd=1 ;;
190
-tvulkan_*|--test_id=vulkan_*|vulkan_*) vk=1 ;;
191
esac
192
done
193
args=("$@")
194
if [ $gfx = 0 ]; then
195
case $V in wl) g=egl ;; *) g=glfw ;; esac
196
[ $vk = 1 ] && g=xcb_vulkan
197
args=(--gfx "$g" "${args[@]}")
198
fi
199
[ $w = 0 ] && args=(-w 1920 -h 1080 "${args[@]}")
200
if [ $rd = 0 ]; then
201
# testfw_app names result files <test_id>.json and only adds a per-run timestamp
202
# directory when no --resultdir is given, so add one here to keep every run
203
r=${GFXBENCH_RESULTS:-${XDG_DATA_HOME:-$HOME/.local/share}/gfxbench5/results}/$(date +%Y_%m_%d_%H_%M_%S)
204
mkdir -p "$r" || exit 1
205
args=(--resultdir "$r" "${args[@]}")
206
fi
207
cd "$B" || exit 1
208
exec "$B/bin/testfw_app" -b "$B" "${args[@]}"
209
EOF
210
install -Dm755 "$srcdir/gfxbench5-launcher" "$opt/gfxbench5"
211
install -d "$pkgdir/usr/bin"
212
for v in vk gl wl; do
213
ln -s /opt/gfxbench5/gfxbench5 "$pkgdir/usr/bin/gfxbench5-$v"
214
done
215
216
cd "$srcdir/gfxbench"
217
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
218
install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
219
}
220
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-26 15:15:21 | Low | 1 |