2016-05-20 12:04:38 +02:00
|
|
|
{ stdenv, fetchFromGitHub
|
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";
|
|
|
|
|
2016-05-20 12:04:38 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "amonakov";
|
|
|
|
repo = "primus";
|
2015-12-04 22:31:10 +01:00
|
|
|
rev = "d1afbf6fce2778c0751eddf19db9882e04f18bfd";
|
2016-05-20 12:04:38 +02:00
|
|
|
sha256 = "118jm57ccawskb8vjq3a9dpa2gh72nxzvx2zk7zknpy0arrdznj1";
|
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
|
|
|
}
|