2014-05-03 16:28:21 +02:00
|
|
|
# For a 64bit + 32bit system the LD_LIBRARY_PATH must contain both the 32bit and 64bit primus
|
|
|
|
# libraries. Providing a different primusrun for each architecture will not work as expected. EG:
|
|
|
|
# Using steam under wine can involve both 32bit and 64bit process. All of which inherit the
|
|
|
|
# same LD_LIBRARY_PATH.
|
|
|
|
# Other distributions do the same.
|
|
|
|
{ stdenv
|
|
|
|
, primusLib
|
|
|
|
, writeScript
|
|
|
|
, primusLib_i686 ? null
|
|
|
|
}:
|
|
|
|
with stdenv.lib;
|
|
|
|
let
|
|
|
|
version = "1.0.0748176";
|
|
|
|
ldPath = makeLibraryPath ([primusLib] ++ optional (primusLib_i686 != null) primusLib_i686);
|
|
|
|
primusrun = writeScript "primusrun"
|
|
|
|
''
|
2015-03-09 21:01:32 +01:00
|
|
|
export LD_LIBRARY_PATH=${ldPath}:$LD_LIBRARY_PATH
|
2014-05-03 16:28:21 +02:00
|
|
|
exec "$@"
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "primus-${version}";
|
|
|
|
builder = writeScript "builder"
|
|
|
|
''
|
|
|
|
source $stdenv/setup
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${primusrun} $out/bin/primusrun
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://github.com/amonakov/primus;
|
|
|
|
description = "Faster OpenGL offloading for Bumblebee";
|
2015-05-14 19:09:10 +02:00
|
|
|
maintainers = with maintainers; [ coconnor ];
|
2014-05-03 16:28:21 +02:00
|
|
|
};
|
|
|
|
}
|