nixpkgs/pkgs/development/libraries/nlopt/default.nix

38 lines
896 B
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, octave ? null }:
stdenv.mkDerivation rec {
pname = "nlopt";
2020-11-26 14:05:25 +01:00
version = "2.7.0";
src = fetchFromGitHub {
owner = "stevengj";
repo = pname;
rev = "v${version}";
2020-11-26 14:05:25 +01:00
sha256 = "0xm8y9cg5p2vgxbn8wn8gqfpxkbm0m4qsidp0bq1dqs8gvj9017v";
};
2018-11-02 12:44:08 +01:00
nativeBuildInputs = [ cmake ];
buildInputs = [ octave ];
2013-06-17 12:38:19 +02:00
2018-07-25 23:44:21 +02:00
configureFlags = [
"--with-cxx"
"--enable-shared"
"--with-pic"
"--without-guile"
"--without-python"
"--without-matlab"
] ++ lib.optionals (octave != null) [
2018-07-25 23:44:21 +02:00
"--with-octave"
"M_INSTALL_DIR=$(out)/${octave.sitePath}/m"
"OCT_INSTALL_DIR=$(out)/${octave.sitePath}/oct"
];
meta = {
2018-11-02 12:44:08 +01:00
homepage = "https://nlopt.readthedocs.io/en/latest/";
description = "Free open-source library for nonlinear optimization";
license = lib.licenses.lgpl21Plus;
hydraPlatforms = lib.platforms.linux;
};
}