1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="Faster OpenGL offloading for Bumblebee"
9 HOMEPAGE="https://github.com/amonakov/primus"
10 SRC_URI="https://github.com/amonakov/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11 EGIT_REPO_URI="https://github.com/amonakov/${PN}.git"
20 x11-drivers/nvidia-drivers[libglvnd(+)=]
22 DEPEND="virtual/opengl"
25 "${FILESDIR}/primus-0.2-libglvnd-workaround.patch"
26 "${FILESDIR}/primus-0.2-respect-ldflags.patch"
31 # Exported values don't always seem to be used. Until source fixed,
32 # patch primusrun script
34 sed -i "/libGLa/a export PRIMUS_libGLa='\/usr\/\$LIB\/libGLX_nvidia.so.0'" primusrun || die
35 sed -i "/libGLd/a export PRIMUS_libGLd='\/usr\/\$LIB\/libGLX.so.0'" primusrun || die
37 sed -i "/libGLa/a export PRIMUS_libGLa='\/usr\/$$LIB\/opengl\/nvidia\/lib/libGL.so.1'" primusrun || die
43 export PRIMUS_libGLa='/usr/$$LIB/libGLX_nvidia.so.0'
44 export PRIMUS_libGLd='/usr/$$LIB/libGLX.so.0'
46 export PRIMUS_libGLa='/usr/$$LIB/opengl/nvidia/lib/libGL.so.1'
49 emake LIBDIR=$(get_libdir)
51 multilib_parallel_foreach_abi mymake
55 sed -i -e "s#^PRIMUS_libGL=.*#PRIMUS_libGL='/usr/\$LIB/primus'#" primusrun || die
58 insinto /usr/$(get_libdir)/primus
59 doins "${S}"/$(get_libdir)/libGL.so.1
61 multilib_foreach_abi myinst