2018-07-21 01:44:44 +01:00
|
|
|
{ lib, stdenv, fetchurl }:
|
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 06:11:49 +01:00
|
|
|
version = "3.1";
|
2015-02-15 21:28:32 +00:00
|
|
|
|
2014-08-03 06:11:49 +01: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 =
|
2018-08-20 20:11:29 +01:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2011-11-12 17:19:45 +00:00
|
|
|
fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86_64.tgz";
|
2014-08-03 06:11:49 +01:00
|
|
|
sha256 = "e8ff01e6cc38d1b3fd56a083f5860737dbd2f319a39037528fb1a74a89ae9878";
|
2011-11-12 17:19:45 +00:00
|
|
|
}
|
2018-08-20 20:11:29 +01:00
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
2011-11-12 17:19:45 +00:00
|
|
|
fetchurl {
|
|
|
|
url = "http://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86.tgz";
|
2014-08-03 06:11:49 +01:00
|
|
|
sha256 = "cef3591e436f528852db0e8c145d3842f920e0c89bcfb219c466797cb7b18879";
|
2011-11-12 17:19:45 +00:00
|
|
|
}
|
2018-08-20 20:11:29 +01:00
|
|
|
else throw "nvidia-cg-toolkit does not support platform ${stdenv.hostPlatform.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
|
2015-04-26 18:54:51 +01:00
|
|
|
patchelf --set-interpreter ${stdenv.glibc.out}/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
|
|
|
};
|
|
|
|
}
|