about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/opencl-info/default.nix
blob: d5fd86f231ab9cceeadcc6582756665eda8ffc63 (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
{ lib, stdenv, fetchFromGitHub, opencl-clhpp, ocl-icd }:

stdenv.mkDerivation {
  name = "opencl-info-2014-02-21";

  src = fetchFromGitHub {
    owner = "marchv";
    repo = "opencl-info";
    rev = "3e53d001a98978feb865650cf0e93b045400c0d7";
    sha256 = "114lxgnjg40ivjjszkv4n3f3yq2lbrvywryvbazf20kqmdz7315l";
  };

  patches = [
    # The cl.hpp header was removed from opencl-clhpp. This patch
    # updates opencl-info to use the new cp2.hpp header.
    #
    # Submitted upstream: https://github.com/marchv/opencl-info/pull/2
    ./opencl-info-clhpp2.diff
  ];

  buildInputs = [ opencl-clhpp ocl-icd ];

  NIX_LDFLAGS = "-lOpenCL";

  installPhase = ''
    install -Dm755 opencl-info $out/bin/opencl-info
  '';

  meta = with lib; {
    description = "A tool to dump OpenCL platform/device information";
    homepage = "https://github.com/marchv/opencl-info";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = with maintainers; [ abbradar ];
  };
}