diff options
Diffstat (limited to 'x11-misc/primus')
-rw-r--r-- | x11-misc/primus/Manifest | 4 | ||||
-rw-r--r-- | x11-misc/primus/files/primus-0.2-libglvnd-workaround.patch | 23 | ||||
-rw-r--r-- | x11-misc/primus/metadata.xml | 7 | ||||
-rw-r--r-- | x11-misc/primus/primus-0.2-r1.ebuild | 59 |
4 files changed, 90 insertions, 3 deletions
diff --git a/x11-misc/primus/Manifest b/x11-misc/primus/Manifest index a994a981442f..2eec8ba86b75 100644 --- a/x11-misc/primus/Manifest +++ b/x11-misc/primus/Manifest @@ -1,3 +1,5 @@ +AUX primus-0.2-libglvnd-workaround.patch 662 BLAKE2B c2a4af4171487405ca08248c162e7ea38cdf7af0ee32636f19f867741794d18dfbd66490163c7eb38de975f5adf29b69dabb47ec8c6196a5d36781e25be58c24 SHA512 529d62808a488237b0730aee9e83448d0d9910f4b3b1f707012724a571a3a94362d5e19f8f347b94f999ee3c4b7ff9260113718bc8a4d7450264579de8ee7fff DIST primus-0.2.tar.gz 26248 BLAKE2B 5e7822e66f3abadc442c30792c03dc731814a084ca2911b9e0333efda1fdfd36ce3c31be612426ae3747d7be0575aca2e7562054ba4ae719812cf800ffc04ff5 SHA512 4108f4e721c9cd8f8dc592a41706230b29bbcfcb8ba49e61d1f07f715c81304471e0d00407bc59a314568b3b42e19f0962ba1dbb8ef1996fe0d4ac13af2e3d2b +EBUILD primus-0.2-r1.ebuild 1576 BLAKE2B 377050ecf80c04894149a9b69ddd8cf51fbb0b080cdcd7cc389d98d81be3a57ec947c1f93d4047c9f6f10f1f21b59af2a54cae679d9773d6497fa8d4de09d41b SHA512 151ec75b8bdc6a673e85d977c771ba0758155027c591129ae86e2c828f6d0e6aa6f2b4c1483153dfc324d9a4eacc478a2a3dda1b8d7009b579c73976751e8a36 EBUILD primus-0.2.ebuild 919 BLAKE2B b1eb99e7e0b18b69e24a7ade73729228b6829a36da518539072bb7919dd54c338c0c9bedcf8a69a557563bcc85e7a61d716ad851e2ae084ebf767c8fa0827635 SHA512 9c967343163ac52b2ef9e5e061b8ca6be8d3cb0b7be1e51ad0a913c8fd9953ee486fa70a697b41814440d5739eebf39f3d6b84f09d2c3cdbc4082a75ee7debe3 -MISC metadata.xml 330 BLAKE2B 81c08f8c927d9be08433569cb570a334c5eb6597fefcbdc1b19f66635d64344682804dfc257e2d23f8113c4d5460da2ec6c2b9b9b179737477d8cc0cef3ca4f5 SHA512 1dc5d48fe52eeb8db3b6f369ce5acad4c7f03811d02cf4e6175aea37ffe117763e5601cc02124a3b7218d85d380504f5db6dddf18be6e04a469b4f6b27ded552 +MISC metadata.xml 423 BLAKE2B b55ae11da7b5968ec0b88042f4180c690d818c28690824eaf0511890dd747d64d0bd12510c2389e067e5ad190d295c27ed6a6e8ca43b8fd1abffbc22a3581096 SHA512 7d9a32f2d32a8973f17679e8658ebf461c7c88ba028f85209629767c097f66c4bfd0e3e1c9fd80d7a6b88bd4d6ccc52bd56a5650a61a68f6259278b172aab72d diff --git a/x11-misc/primus/files/primus-0.2-libglvnd-workaround.patch b/x11-misc/primus/files/primus-0.2-libglvnd-workaround.patch new file mode 100644 index 000000000000..f64757b7e340 --- /dev/null +++ b/x11-misc/primus/files/primus-0.2-libglvnd-workaround.patch @@ -0,0 +1,23 @@ +From 6ff7b3ee8c38830a72b5fc087d6f4f12cf421920 Mon Sep 17 00:00:00 2001 +From: Gary Gatling <gsgatlin@ncsu.edu> +Date: Thu, 2 Mar 2017 14:50:47 -0500 +Subject: [PATCH] primus needs this variable workaround for libglvnd enabled + mesa + +--- + primusrun | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/primusrun b/primusrun +index 81e2dc0..33f0eef 100755 +--- a/primusrun ++++ b/primusrun +@@ -1,5 +1,8 @@ + #!/bin/bash + ++# primus needs this variable workaround for libglvnd enabled mesa ++export __GLVND_DISALLOW_PATCHING=1 ++ + # Readback-display synchronization method + # 0: no sync, 1: D lags behind one frame, 2: fully synced + # export PRIMUS_SYNC=${PRIMUS_SYNC:-0} diff --git a/x11-misc/primus/metadata.xml b/x11-misc/primus/metadata.xml index 7eea5579ed48..80d44a9dc986 100644 --- a/x11-misc/primus/metadata.xml +++ b/x11-misc/primus/metadata.xml @@ -2,9 +2,12 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> - <email>zx2c4@gentoo.org</email> - <name>Jason A. Donenfeld</name> + <email>NP-Hardass@gentoo.org</email> + <name>Adam Feldman</name> </maintainer> + <use> + <flag name="libglvnd">Use <pkg>media-libs/libglvnd</pkg> for dispatch</flag> + </use> <upstream> <remote-id type="github">amonakov/primus</remote-id> </upstream> diff --git a/x11-misc/primus/primus-0.2-r1.ebuild b/x11-misc/primus/primus-0.2-r1.ebuild new file mode 100644 index 000000000000..b17cd30fb649 --- /dev/null +++ b/x11-misc/primus/primus-0.2-r1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +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 ~x86" +IUSE="+libglvnd" + +RDEPEND=" + x11-misc/bumblebee + x11-drivers/nvidia-drivers[libglvnd(-)=] +" +DEPEND="virtual/opengl" + +PATCHES=( "${FILESDIR}/primus-0.2-libglvnd-workaround.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 + dobin primusrun + myinst() { + insinto /usr/$(get_libdir)/primus + doins "${S}"/$(get_libdir)/libGL.so.1 + } + multilib_foreach_abi myinst +} |