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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
Nix
Raw Normal View History

2022-04-04 22:13:42 +00:00
{ lib, stdenv, fetchFromGitHub, cmake, octave ? null, libiconv }:
stdenv.mkDerivation rec {
pname = "nlopt";
2021-12-07 17:29:09 +00:00
version = "2.7.1";
src = fetchFromGitHub {
owner = "stevengj";
repo = pname;
rev = "v${version}";
2021-12-07 17:29:09 +00:00
sha256 = "sha256-TgieCX7yUdTAEblzXY/gCN0r6F9TVDh4RdNDjQdXZ1o=";
};
2022-04-04 22:13:42 +00:00
nativeBuildInputs = [ cmake ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
buildInputs = [ octave ];
2013-06-17 10:38:19 +00:00
2018-07-25 21:44:21 +00:00
configureFlags = [
"--with-cxx"
"--enable-shared"
"--with-pic"
"--without-guile"
"--without-python"
"--without-matlab"
] ++ lib.optionals (octave != null) [
2018-07-25 21:44:21 +00:00
"--with-octave"
"M_INSTALL_DIR=$(out)/${octave.sitePath}/m"
"OCT_INSTALL_DIR=$(out)/${octave.sitePath}/oct"
];
2022-02-26 16:26:33 +00:00
postFixup = ''
substituteInPlace $out/lib/cmake/nlopt/NLoptLibraryDepends.cmake --replace \
'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/' 'INTERFACE_INCLUDE_DIRECTORIES "'
'';
meta = {
2018-11-02 11:44:08 +00:00
homepage = "https://nlopt.readthedocs.io/en/latest/";
description = "Free open-source library for nonlinear optimization";
license = lib.licenses.lgpl21Plus;
hydraPlatforms = lib.platforms.linux;
};
}