summary refs log tree commit diff
path: root/pkgs/development/libraries/science/math/ecos/default.nix
blob: b60bd1fe76c11db20593d999f1da34acdb2bf1e6 (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
37
38
{ lib, stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "ecos";
  version = "2.0.7";

  src = fetchFromGitHub {
    owner = "embotech";
    repo = "ecos";
    rev = version;
    sha256 = "1hsndim5kjvcwk5svqa4igawzahj982180xj1d7yd0dbjlgxc7w7";
  };

  buildPhase = ''
    make all shared
  '';

  doCheck = true;
  checkPhase = ''
    make test
    ./runecos
  '';

  installPhase = ''
    mkdir -p $out/lib
    cp lib*.a lib*.so $out/lib
    cp -r include $out/
  '';

  meta = with lib; {
    description = "A lightweight conic solver for second-order cone programming";
    homepage = "https://www.embotech.com/ECOS";
    downloadPage = "https://github.com/embotech/ecos/releases";
    license = licenses.gpl3;
    platforms = platforms.all;
    maintainers = with maintainers; [ bhipple ];
  };
}