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