1{stdenv, fetchFromGitHub, rebar, erlang, opencl-headers, ocl-icd }:
2
3stdenv.mkDerivation rec {
4 version = "1.2.4";
5 pname = "cl";
6
7 src = fetchFromGitHub {
8 owner = "tonyrog";
9 repo = "cl";
10 rev = "cl-${version}";
11 sha256 = "1gwkjl305a0231hz3k0w448dsgbgdriaq764sizs5qfn59nzvinz";
12 };
13
14 buildInputs = [ erlang rebar opencl-headers ocl-icd ];
15
16 buildPhase = ''
17 rebar compile
18 '';
19
20 # 'cp' line taken from Arch recipe
21 # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl
22 installPhase = ''
23 DIR=$out/lib/erlang/lib/${pname}-${version}
24 mkdir -p $DIR
25 cp -ruv c_src doc ebin include priv src $DIR
26 '';
27
28 meta = with stdenv.lib; {
29 homepage = https://github.com/tonyrog/cl;
30 description = "OpenCL binding for Erlang";
31 license = licenses.mit;
32 # https://github.com/tonyrog/cl/issues/39
33 broken = stdenv.isAarch64;
34 platforms = platforms.linux;
35 };
36}