%global commit 85962a4825d77fe2eff93d7c32024b529fbbf4e0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global snapdate 20261022.024312 %global armhf_libdir %{_prefix}/lib/arm-linux-gnueabihf %global client_project 87947369 # The armhf client is built by this repo's CI; rpm must not read its 32-bit deps as ours %global __requires_exclude_from ^%{armhf_libdir}/.*$ %global __provides_exclude_from ^%{armhf_libdir}/.*$ Name: gpu-bridge Version: 0.1.0^%{snapdate}git%{shortcommit} Release: 1%{?dist} Summary: Run 32-bit OpenGL, GLES, EGL and GLX programs on the 64-bit GPU driver License: MIT AND Apache-2.0 URL: https://github.com/theofficialgman/gpu-bridge Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Source1: https://gitlab.com/api/v4/projects/%{client_project}/packages/generic/%{name}-armhf/%{shortcommit}/%{name}-armhf-%{shortcommit}.tar.xz ExclusiveArch: aarch64 BuildRequires: cmake BuildRequires: gcc BuildRequires: ninja-build BuildRequires: python3 BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(x11) Requires: libX11 Requires: libglvnd-egl Requires: libglvnd-glx %description gpu-bridge lets 32-bit (armhf) programs use the 64-bit-only NVIDIA Tegra GPU driver. A 32-bit library, installed as libGL, libEGL, libGLESv2, libGLESv1_CM, libGLX and libOpenGL in %{armhf_libdir}, sends each call over shared memory to gbd, a 64-bit server that runs it on the real driver. gbd is started on demand by the library; nothing runs unless a 32-bit program uses it. X11 only: on a Wayland session it needs Xwayland. %prep %autosetup -n %{name}-%{commit} mkdir armhf tar -xf %{SOURCE1} -C armhf %build %cmake -G Ninja %cmake_build --target gbd test_ring test_mbox %install install -Dpm 0755 %{__cmake_builddir}/gbd %{buildroot}%{_libexecdir}/%{name}/gbd install -Dpm 0755 armhf/libGL.so.1.7.0 %{buildroot}%{armhf_libdir}/libGL.so.1.7.0 for n in libGL.so.1 libEGL.so.1 libGLESv2.so.2 libGLESv1_CM.so.1 libGLX.so.0 libOpenGL.so.0; do ln -s libGL.so.1.7.0 %{buildroot}%{armhf_libdir}/$n done %check %ctest -R '^(ring64|mbox64)$' %files %license LICENSE THIRD_PARTY_NOTICES.md %doc README.md %{_libexecdir}/%{name}/ %dir %{armhf_libdir} %{armhf_libdir}/libGL.so.1.7.0 %{armhf_libdir}/libGL.so.1 %{armhf_libdir}/libEGL.so.1 %{armhf_libdir}/libGLESv2.so.2 %{armhf_libdir}/libGLESv1_CM.so.1 %{armhf_libdir}/libGLX.so.0 %{armhf_libdir}/libOpenGL.so.0 %changelog %autochangelog