File primus.spec of Package primus

# spec file for package primus
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           primus
Version:        0+git20150328.d1afbf6
Release:        0
Summary:        Faster OpenGL offloading for Bumblebee
License:        HPND
Group:          Hardware/Other
Source0:        %{name}-%{version}.tar.xz
Source1:        baselibs.conf
Patch0:         primusrun-bsc1061561.diff
BuildRequires:  Mesa-libGL-devel
BuildRequires:  gcc-c++
BuildRequires:  libX11-devel
BuildRequires:  unzip
Requires:       bumblebee
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Primus is a shared library that provides OpenGL and GLX APIs and
implements low-overhead local-only client-side OpenGL offloading via GLX
forking, similar to VirtualGL. It intercepts GLX calls and redirects GL
rendering to a secondary X display, presumably driven by a faster GPU.
On swapping buffers, rendered contents are read back using a PBO and
copied onto the drawable it was supposed to be rendered on in the first

%setup -q
%patch0 -p1 

export CXXFLAGS="%{optflags}"
export PRIMUS_libGLd=%{_libdir}/primus/
export PRIMUS_libGLa=%{_libdir}/primus/
make %{?_smp_mflags}

install -D lib/ "%{buildroot}%{_libdir}/primus/"
install -D primusrun "%{buildroot}%{_bindir}/primusrun"

%doc LICENSE.txt