Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 40 lines 1.0 kB view raw
1{ lib, 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 # https://github.com/tonyrog/cl/issues/39 15 postPatch = '' 16 substituteInPlace c_src/Makefile \ 17 --replace "-m64" "" 18 ''; 19 20 buildInputs = [ erlang rebar opencl-headers ocl-icd ]; 21 22 buildPhase = '' 23 rebar compile 24 ''; 25 26 # 'cp' line taken from Arch recipe 27 # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl 28 installPhase = '' 29 DIR=$out/lib/erlang/lib/${pname}-${version} 30 mkdir -p $DIR 31 cp -ruv c_src doc ebin include priv src $DIR 32 ''; 33 34 meta = with lib; { 35 homepage = "https://github.com/tonyrog/cl"; 36 description = "OpenCL binding for Erlang"; 37 license = licenses.mit; 38 platforms = platforms.linux; 39 }; 40}