nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 blas,
3 lapack,
4 lib,
5 fetchFromGitHub,
6 stdenv,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "superscs";
11 version = "1.3.3";
12
13 src = fetchFromGitHub {
14 owner = "kul-optec";
15 repo = "superscs";
16 #rev = "v${finalAttrs.version}";
17 # ref. https://github.com/kul-optec/superscs/pull/38
18 rev = "500070e807f92347a7c6cbdc96739521a256b71e";
19 hash = "sha256-Qu7RM6Ew4hEmoIXO0utDDVmjmNX3yt3FxWZXCQ/Xjp4=";
20 };
21
22 postPatch = ''
23 substituteInPlace include/unit_test_util.h \
24 --replace-fail "typedef int bool;" "#include <stdbool.h>"
25 ''
26 + lib.optionalString stdenv.hostPlatform.isDarwin ''
27 substituteInPlace Makefile --replace-fail \
28 ".so" \
29 ".dylib"
30 '';
31
32 buildInputs = [
33 blas
34 lapack
35 ];
36
37 makeFlags = [ "PREFIX=$(out)" ];
38
39 doCheck = true;
40
41 meta = {
42 description = "Fast conic optimization in C";
43 homepage = "https://github.com/kul-optec/superscs";
44 changelog = "https://github.com/kul-optec/superscs/blob/${finalAttrs.src.rev}/CHANGELOG.md";
45 license = lib.licenses.mit;
46 maintainers = with lib.maintainers; [ nim65s ];
47 };
48})