blob: 69596ed66f41a49d7036edd50e4b343bc9e4928c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
{ stdenv, fetchurl, patchelf }:
assert stdenv ? glibc;
stdenv.mkDerivation rec {
version = "3.0";
date = "February2011";
name = "nvidia-cg-toolkit-${version}";
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86_64.tgz";
sha256 = "07gmnzfsla3vf1kf00cj86p87h6wrdbp6ri4ycslc5kmfxsq7ypq";
}
else if stdenv.system == "i686-linux" then
fetchurl {
url = "http://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86.tgz";
sha256 = "0hr8l0r20akbfm5j0vqv4ghl0acwjf5996pxnfxlajacl9w58nam";
}
else throw "nvidia-cg-toolkit does not support platform ${stdenv.system}";
installPhase = ''
for b in cgc cgfxcat cginfo
do
patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-*.so.? "bin/$b"
done
# FIXME: cgfxcat and cginfo need more patchelf
mkdir -p "$out/bin/"
cp -v bin/* "$out/bin/"
mkdir -p "$out/include/"
cp -v -r include/Cg/ "$out/include/"
mkdir -p "$out/lib/"
[ "$system" = "x86_64-linux" ] && cp -v lib64/* "$out/lib/"
[ "$system" = "i686-linux" ] && cp -v lib/* "$out/lib/"
for mandir in man1 man3 \
${if stdenv.system == "x86_64-linux" then "manCg" else ""} manCgFX
do
mkdir -p "$out/share/man/$mandir/"
cp -v share/man/$mandir/* "$out/share/man/$mandir/"
done
mkdir -p "$out/share/doc/$name/"
cp -v -r local/Cg/* "$out/share/doc/$name/"
'';
meta = {
homepage = http://developer.nvidia.com/cg-toolkit;
license = [ "nonfree-redistributable" ];
};
}
|