1 { lib, stdenv, fetchFromGitHub, cmake, octave ? null, libiconv }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-TgieCX7yUdTAEblzXY/gCN0r6F9TVDh4RdNDjQdXZ1o=";
14 nativeBuildInputs = [ cmake ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
15 buildInputs = [ octave ];
24 ] ++ lib.optionals (octave != null) [
26 "M_INSTALL_DIR=$(out)/${octave.sitePath}/m"
27 "OCT_INSTALL_DIR=$(out)/${octave.sitePath}/oct"
31 substituteInPlace $out/lib/cmake/nlopt/NLoptLibraryDepends.cmake --replace \
32 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/' 'INTERFACE_INCLUDE_DIRECTORIES "'
36 homepage = "https://nlopt.readthedocs.io/en/latest/";
37 description = "Free open-source library for nonlinear optimization";
38 license = lib.licenses.lgpl21Plus;
39 hydraPlatforms = lib.platforms.linux;