2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, octave ? null }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nlopt";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "2.7.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stevengj";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-TgieCX7yUdTAEblzXY/gCN0r6F9TVDh4RdNDjQdXZ1o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ octave ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-cxx"
|
|
|
|
"--enable-shared"
|
|
|
|
"--with-pic"
|
|
|
|
"--without-guile"
|
|
|
|
"--without-python"
|
|
|
|
"--without-matlab"
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals (octave != null) [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-octave"
|
|
|
|
"M_INSTALL_DIR=$(out)/${octave.sitePath}/m"
|
|
|
|
"OCT_INSTALL_DIR=$(out)/${octave.sitePath}/oct"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://nlopt.readthedocs.io/en/latest/";
|
|
|
|
description = "Free open-source library for nonlinear optimization";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.lgpl21Plus;
|
|
|
|
hydraPlatforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|