2014-05-03 16:28:21 +02:00
|
|
|
{ stdenv, fetchgit
|
2015-09-15 11:13:22 +02:00
|
|
|
, xlibsWrapper, mesa
|
2015-12-04 22:31:10 +01:00
|
|
|
, nvidia_x11 ? null
|
|
|
|
, libX11
|
2014-05-03 16:28:21 +02:00
|
|
|
}:
|
2015-12-04 22:31:10 +01:00
|
|
|
|
2014-05-03 16:28:21 +02:00
|
|
|
stdenv.mkDerivation {
|
2015-12-04 22:31:10 +01:00
|
|
|
name = "primus-lib-20151204";
|
|
|
|
|
2014-05-03 16:28:21 +02:00
|
|
|
src = fetchgit {
|
|
|
|
url = git://github.com/amonakov/primus.git;
|
2015-12-04 22:31:10 +01:00
|
|
|
rev = "d1afbf6fce2778c0751eddf19db9882e04f18bfd";
|
|
|
|
sha256 = "8f095b5e2030cdb155a42a49873832843c1e4dc3087a6fb94d198de982609923";
|
2014-05-03 16:28:21 +02:00
|
|
|
};
|
|
|
|
|
2015-12-04 22:31:10 +01:00
|
|
|
buildInputs = [ libX11 mesa ];
|
|
|
|
|
|
|
|
makeFlags = [ "LIBDIR=$(out)/lib"
|
|
|
|
"PRIMUS_libGLa=${if nvidia_x11 == null then mesa else nvidia_x11}/lib/libGL.so"
|
|
|
|
"PRIMUS_libGLd=${mesa}/lib/libGL.so"
|
|
|
|
"PRIMUS_LOAD_GLOBAL=${mesa}/lib/libglapi.so"
|
|
|
|
];
|
2014-05-03 16:28:21 +02:00
|
|
|
|
2015-12-04 22:31:10 +01:00
|
|
|
installPhase = ''
|
|
|
|
ln -s $out/lib/libGL.so.1 $out/lib/libGL.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Low-overhead client-side GPU offloading";
|
|
|
|
homepage = https://github.com/amonakov/primus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
2014-05-03 16:28:21 +02:00
|
|
|
}
|