2018-07-21 02:44:44 +02:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2011-11-16 17:31:02 +01:00
|
|
|
|
|
|
|
assert stdenv ? glibc;
|
|
|
|
|
2011-11-12 18:19:45 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-08-03 07:11:49 +02:00
|
|
|
version = "3.1";
|
2015-02-15 22:28:32 +01:00
|
|
|
|
2014-08-03 07:11:49 +02:00
|
|
|
date = "April2012";
|
2015-02-15 22:28:32 +01:00
|
|
|
|
2011-11-12 18:19:45 +01:00
|
|
|
name = "nvidia-cg-toolkit-${version}";
|
2015-02-15 22:28:32 +01:00
|
|
|
|
2011-11-12 18:19:45 +01:00
|
|
|
src =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2011-11-12 18:19:45 +01:00
|
|
|
fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86_64.tgz";
|
2014-08-03 07:11:49 +02:00
|
|
|
sha256 = "e8ff01e6cc38d1b3fd56a083f5860737dbd2f319a39037528fb1a74a89ae9878";
|
2011-11-12 18:19:45 +01:00
|
|
|
}
|
2018-08-20 21:11:29 +02:00
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
2011-11-12 18:19:45 +01:00
|
|
|
fetchurl {
|
|
|
|
url = "http://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86.tgz";
|
2014-08-03 07:11:49 +02:00
|
|
|
sha256 = "cef3591e436f528852db0e8c145d3842f920e0c89bcfb219c466797cb7b18879";
|
2011-11-12 18:19:45 +01:00
|
|
|
}
|
2018-08-20 21:11:29 +02:00
|
|
|
else throw "nvidia-cg-toolkit does not support platform ${stdenv.hostPlatform.system}";
|
2015-02-15 22:28:32 +01:00
|
|
|
|
2011-11-12 18:19:45 +01:00
|
|
|
installPhase = ''
|
|
|
|
for b in cgc cgfxcat cginfo
|
|
|
|
do
|
2015-04-26 19:54:51 +02:00
|
|
|
patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux*.so.? "bin/$b"
|
2011-11-12 18:19:45 +01:00
|
|
|
done
|
|
|
|
# FIXME: cgfxcat and cginfo need more patchelf
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/bin/"
|
2011-11-12 18:19:45 +01:00
|
|
|
cp -v bin/* "$out/bin/"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/include/"
|
2011-11-12 18:19:45 +01:00
|
|
|
cp -v -r include/Cg/ "$out/include/"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/lib/"
|
2012-02-24 21:18:32 +01:00
|
|
|
[ "$system" == "x86_64-linux" ] && cp -v lib64/* "$out/lib/"
|
|
|
|
[ "$system" == "i686-linux" ] && cp -v lib/* "$out/lib/"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/share/doc/$name/"
|
2011-11-12 18:19:45 +01:00
|
|
|
cp -v -r local/Cg/* "$out/share/doc/$name/"
|
|
|
|
'';
|
2015-02-15 22:28:32 +01:00
|
|
|
|
2011-11-12 18:19:45 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://developer.nvidia.com/cg-toolkit;
|
2015-02-15 22:28:32 +01:00
|
|
|
license = lib.licenses.unfreeRedistributable;
|
2011-11-12 18:19:45 +01:00
|
|
|
};
|
|
|
|
}
|