base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / bo / bonmin / package.nix
blob1cf64101face304153eba91e713c572694fe2c06
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fontconfig
5 , gfortran
6 , pkg-config
7 , blas
8 , bzip2
9 , cbc
10 , clp
11 , doxygen
12 , graphviz
13 , ipopt
14 , lapack
15 , libamplsolver
16 , osi
17 , texliveSmall
18 , zlib
21 assert (!blas.isILP64) && (!lapack.isILP64);
23 stdenv.mkDerivation rec {
24   pname = "bonmin";
25   version = "1.8.9";
27   src = fetchFromGitHub {
28     owner = "coin-or";
29     repo = "Bonmin";
30     rev = "releases/${version}";
31     sha256 = "sha256-nqjAQ1NdNJ/T4p8YljEWRt/uy2aDwyBeAsag0TmRc5Q=";
32   };
34   __structuredAttrs = true;
36   nativeBuildInputs = [
37     doxygen
38     gfortran
39     graphviz
40     pkg-config
41     texliveSmall
42   ];
43   buildInputs = [
44     blas
45     bzip2
46     cbc
47     clp
48     ipopt
49     lapack
50     libamplsolver
51     osi
52     zlib
53   ];
55   configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [
56     "--with-asl-lib=-lipoptamplinterface -lamplsolver"
57   ];
59   # Fix doc install. Should not be necessary after next release
60   # ref https://github.com/coin-or/Bonmin/commit/4f665bc9e489a73cb867472be9aea518976ecd28
61   sourceRoot = "${src.name}/Bonmin";
63   # Fontconfig error: Cannot load default config file: No such file: (null)
64   env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
66   # Fontconfig error: No writable cache directories
67   preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";
69   doCheck = true;
70   checkTarget = "test";
72   # ignore one failing test
73   postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
74     substituteInPlace test/Makefile.in --replace-fail \
75       "./unitTest\''$(EXEEXT)" \
76       ""
77   '';
79   # install documentation
80   postInstall = "make install-doxygen-docs";
82   meta = {
83     description = "Open-source code for solving general MINLP (Mixed Integer NonLinear Programming) problems";
84     mainProgram = "bonmin";
85     homepage = "https://github.com/coin-or/Bonmin";
86     license = lib.licenses.epl10;
87     platforms = lib.platforms.unix;
88     maintainers = with lib.maintainers; [ aanderse ];
89   };