about summary refs log tree commit diff
path: root/pkgs/by-name/su/superscs/package.nix
blob: ae5fb5537be43c37c9b7c338c90c554dd2f21f35 (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
39
40
41
42
43
44
{
  blas,
  lapack,
  lib,
  fetchFromGitHub,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "superscs";
  version = "1.3.3";

  src = fetchFromGitHub {
    owner = "kul-optec";
    repo = "superscs";
    #rev = "v${finalAttrs.version}";
    # ref. https://github.com/kul-optec/superscs/pull/38
    rev = "500070e807f92347a7c6cbdc96739521a256b71e";
    hash = "sha256-Qu7RM6Ew4hEmoIXO0utDDVmjmNX3yt3FxWZXCQ/Xjp4=";
  };

  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace Makefile --replace-fail \
      ".so" \
      ".dylib"
  '';

  buildInputs = [
    blas
    lapack
  ];

  makeFlags = [ "PREFIX=$(out)" ];

  doCheck = true;

  meta = {
    description = "Fast conic optimization in C";
    homepage = "https://github.com/kul-optec/superscs";
    changelog = "https://github.com/kul-optec/superscs/blob/${finalAttrs.src.rev}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ nim65s ];
  };
})