1{
2 lib,
3 stdenv,
4 cmake,
5 fetchFromGitHub,
6 withBlas ? true,
7 blas,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "cminpack";
12 version = "1.3.8";
13
14 src = fetchFromGitHub {
15 owner = "devernay";
16 repo = "cminpack";
17 rev = "v${version}";
18 hash = "sha256-eFJ43cHbSbWld+gPpMaNiBy1X5TIcN9aVxjh8PxvVDU=";
19 };
20
21 strictDeps = true;
22
23 nativeBuildInputs = [
24 cmake
25 ];
26
27 buildInputs = lib.optionals withBlas [
28 blas
29 ];
30
31 cmakeFlags = [
32 "-DUSE_BLAS=${if withBlas then "ON" else "OFF"}"
33 "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
34 ];
35
36 meta = {
37 description = "Software for solving nonlinear equations and nonlinear least squares problems";
38 homepage = "http://devernay.free.fr/hacks/cminpack/";
39 changelog = "https://github.com/devernay/cminpack/blob/v${version}/README.md#history";
40 license = lib.licenses.bsd3;
41 platforms = lib.platforms.all;
42 maintainers = [ ];
43 };
44}