diff options
author | Michael Mair-Keimberger <mmk@levelnine.at> | 2024-05-29 21:10:22 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-05-30 08:55:30 +0300 |
commit | 639b2e2b7df98733299d73e516a341b603e78136 (patch) | |
tree | 7bba7bcfec4031bbec8af49de0e0378b7a05f08c /x11-misc/primus/primus-0.2-r4.ebuild | |
parent | net-mail/queue-repair: add python 3.1[12] support (diff) | |
download | gentoo-639b2e2b7df98733299d73e516a341b603e78136.tar.gz gentoo-639b2e2b7df98733299d73e516a341b603e78136.tar.bz2 gentoo-639b2e2b7df98733299d73e516a341b603e78136.zip |
x11-misc/primus: EAPI8 bump
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'x11-misc/primus/primus-0.2-r4.ebuild')
-rw-r--r-- | x11-misc/primus/primus-0.2-r4.ebuild | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/x11-misc/primus/primus-0.2-r4.ebuild b/x11-misc/primus/primus-0.2-r4.ebuild new file mode 100644 index 000000000000..acd44b6182fd --- /dev/null +++ b/x11-misc/primus/primus-0.2-r4.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib-build + +DESCRIPTION="Faster OpenGL offloading for Bumblebee" +HOMEPAGE="https://github.com/amonakov/primus" +SRC_URI="https://github.com/amonakov/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +EGIT_REPO_URI="https://github.com/amonakov/${PN}.git" + +LICENSE="ISC" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+libglvnd" + +RDEPEND=" + x11-misc/bumblebee + x11-drivers/nvidia-drivers[libglvnd(+)=] +" +DEPEND="virtual/opengl" + +PATCHES=( + "${FILESDIR}/primus-0.2-libglvnd-workaround.patch" + "${FILESDIR}/primus-0.2-respect-ldflags.patch" +) + +src_prepare() { + default + # Exported values don't always seem to be used. Until source fixed, + # patch primusrun script + if use libglvnd; then + sed -i "/libGLa/a export PRIMUS_libGLa='\/usr\/\$LIB\/libGLX_nvidia.so.0'" primusrun || die + sed -i "/libGLd/a export PRIMUS_libGLd='\/usr\/\$LIB\/libGLX.so.0'" primusrun || die + else + sed -i "/libGLa/a export PRIMUS_libGLa='\/usr\/$$LIB\/opengl\/nvidia\/lib/libGL.so.1'" primusrun || die + fi +} + +src_compile() { + if use libglvnd; then + export PRIMUS_libGLa='/usr/$$LIB/libGLX_nvidia.so.0' + export PRIMUS_libGLd='/usr/$$LIB/libGLX.so.0' + else + export PRIMUS_libGLa='/usr/$$LIB/opengl/nvidia/lib/libGL.so.1' + fi + mymake() { + emake LIBDIR=$(get_libdir) + } + multilib_parallel_foreach_abi mymake +} + +src_install() { + sed -i -e "s#^PRIMUS_libGL=.*#PRIMUS_libGL='/usr/\$LIB/primus'#" primusrun || die + dobin primusrun + myinst() { + insinto /usr/$(get_libdir)/primus + doins "${S}"/$(get_libdir)/libGL.so.1 + } + multilib_foreach_abi myinst +} |