summary refs log tree commit diff
path: root/pkgs/development/misc/amdadl-sdk/default.nix
blob: d16f63152b844c2bcba4510344a925e50f757ad5 (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
{ requireFile, stdenv, unzip }:

stdenv.mkDerivation rec {
  version = "6.0";
  pname = "amdadl-sdk";

  src = requireFile {
    name = "ADL_SDK_6.0.zip";
    url = http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/;
    sha256 = "429f4fd1edebb030d6366f4e0a877cf105e4383f7dd2ccf54e5aef8f2e4242c9";
  };

  buildInputs = [ unzip ];

  doCheck = false;

  unpackPhase = ''
    unzip $src
  '';

  patchPhase = ''
    sed -i -e '/include/a \#include <wchar.h>' include/adl_structures.h || die
  '';

  buildPhase = ''
    #Build adlutil
    cd adlutil
    gcc main.c -o adlutil -DLINUX -ldl -I ../include/ 
    cd ..
  '';

  installPhase = ''
    #Install SDK
    mkdir -p $out/bin
    cp -r include "$out/"
    cp "adlutil/adlutil" "$out/bin/adlutil"

    #Fix modes
    chmod -R 755 "$out/bin/"
  '';

  meta = with stdenv.lib; {
    description = "API to access display driver functionality for ATI graphics cards";
    homepage = https://developer.amd.com/tools/graphics-development/display-library-adl-sdk/;
    license = licenses.unfree;
    maintainers = [ maintainers.offline ];
    platforms = stdenv.lib.platforms.linux;
    hydraPlatforms = [];
  };
}