1{ stdenv, fetchFromGitHub }:
2
3stdenv.mkDerivation rec {
4 name = "ecos-${version}";
5 version = "2.0.6";
6
7 src = fetchFromGitHub {
8 owner = "embotech";
9 repo = "ecos";
10 rev = "v${version}";
11 sha256 = "11v958j66wq30gxpjpkgl7n3rvla845lygz8fl39pgf1vk9sdyc7";
12 };
13
14 buildPhase = ''
15 make all shared
16 '';
17
18 doCheck = true;
19 checkPhase = ''
20 make test
21 ./runecos
22 '';
23
24 installPhase = ''
25 mkdir -p $out/lib
26 cp lib*.a lib*.so $out/lib
27 cp -r include $out/
28 '';
29
30 meta = with stdenv.lib; {
31 description = "A lightweight conic solver for second-order cone programming";
32 homepage = https://www.embotech.com/ECOS;
33 license = licenses.gpl3;
34 platforms = platforms.all;
35 maintainers = [ maintainers.bhipple ];
36 };
37}