2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2023-10-09 19:29:22 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchpatch
|
|
|
|
, meson-python
|
|
|
|
, pkg-config
|
|
|
|
, Accelerate
|
2020-04-24 23:36:52 +00:00
|
|
|
, blas
|
|
|
|
, lapack
|
|
|
|
, numpy
|
|
|
|
, scipy
|
|
|
|
# check inputs
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "scs";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "3.2.4";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bodono";
|
|
|
|
repo = "scs-python";
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-UmMbnj7QZSvHWSUk1Qa0VP4i3iDCYHxoa+qBmEdFjRs=";
|
2021-12-06 16:07:01 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
# needed for building against netlib's reference blas implementation and
|
|
|
|
# the pkg-config patch. remove on next update
|
|
|
|
(fetchpatch {
|
|
|
|
name = "find-and-ld-lapack.patch";
|
|
|
|
url = "https://github.com/bodono/scs-python/commit/a0aea80e7d490770d6a47d2c79396f6c3341c1f9.patch";
|
|
|
|
hash = "sha256-yHF8f7SLoG7veZ6DEq1HVH6rT2KtFONwJtqSiKcxOdg=";
|
|
|
|
})
|
|
|
|
# add support for pkg-config. remove on next update
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-pkg-config.patch";
|
|
|
|
url = "https://github.com/bodono/scs-python/commit/dd17e2e5282ebe85f2df8a7c6b25cfdeb894970d.patch";
|
|
|
|
hash = "sha256-vSeSJeeu5Wx3RXPyB39YTo0RU8HtAojrUw85Q76/QzA=";
|
|
|
|
})
|
2024-02-07 01:22:34 +00:00
|
|
|
# fix test_solve_random_cone_prob on linux after scipy 1.12 update
|
|
|
|
# https://github.com/bodono/scs-python/pull/82
|
|
|
|
(fetchpatch {
|
|
|
|
name = "scipy-1.12-fix.patch";
|
|
|
|
url = "https://github.com/bodono/scs-python/commit/4baf4effdc2ce7ac2dd1beaf864f1a5292eb06c6.patch";
|
|
|
|
hash = "sha256-U/F5MakwYZN5hCaeAkcCG38WQxX9mXy9OvhyEQqN038=";
|
|
|
|
})
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson-python
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = if stdenv.isDarwin then [
|
|
|
|
Accelerate
|
|
|
|
] else [
|
2020-04-24 23:36:52 +00:00
|
|
|
blas
|
2024-01-02 11:29:13 +00:00
|
|
|
lapack
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
pythonImportsCheck = [ "scs" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python interface for SCS: Splitting Conic Solver";
|
|
|
|
longDescription = ''
|
|
|
|
Solves convex cone programs via operator splitting.
|
|
|
|
Can solve: linear programs (LPs), second-order cone programs (SOCPs), semidefinite programs (SDPs),
|
|
|
|
exponential cone programs (ECPs), and power cone programs (PCPs), or problems with any combination of those cones.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/cvxgrp/scs"; # upstream C package
|
|
|
|
downloadPage = "https://github.com/bodono/scs-python";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ a-n-n-a-l-e-e drewrisinger ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|