summary refs log tree commit diff
path: root/pkgs/development/libraries/cl/default.nix
blob: 7c44c2e0ab0cf017e46002dedb8cc63beb11ea4f (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
{stdenv, fetchFromGitHub, SDL, libGLU_combined, rebar, erlang, opencl-headers, ocl-icd }:

stdenv.mkDerivation rec {
  version = "1.2.3";
  name = "cl-${version}";

  src = fetchFromGitHub {
    owner = "tonyrog";
    repo = "cl";
    rev = "cl-${version}";
    sha256 = "1dk0k03z0ipxvrnn0kihph135hriw96jpnd31lbq44k6ckh6bm03";
  };

  buildInputs = [ erlang rebar opencl-headers ocl-icd ];
  
  buildPhase = ''
    rebar compile
  '';

  # 'cp' line taken from Arch recipe
  # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl
  installPhase = ''
    DIR=$out/lib/erlang/lib/${name}
    mkdir -p $DIR
    cp -ruv c_src doc ebin include priv src $DIR
  '';

  meta = with stdenv.lib; {
    homepage = https://github.com/tonyrog/cl;
    description = "OpenCL binding for Erlang";
    license = licenses.mit;
    platforms = platforms.linux;
  };
}