From bec673f23351c544be2f87b116e863bba7b657a5 Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Fri, 19 Dec 2025 12:05:42 -0500 Subject: [PATCH] ipopt: add optional dependencies back --- pkgs/by-name/ip/ipopt/package.nix | 42 ++++++++++++++++++------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/ip/ipopt/package.nix b/pkgs/by-name/ip/ipopt/package.nix index 80953aa13174..7d365c730506 100644 --- a/pkgs/by-name/ip/ipopt/package.nix +++ b/pkgs/by-name/ip/ipopt/package.nix @@ -6,9 +6,12 @@ blas, lapack, gfortran, - mumps, - spral, + enableAMPL ? true, libamplsolver, + enableMUMPS ? true, + mumps, + enableSPRAL ? true, + spral, }: assert (!blas.isILP64) && (!lapack.isILP64); @@ -25,12 +28,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-85fUBMwQtG+RWQYk9YzdZYK3CYcDKgWroo4blhVWBzE="; }; - outputs = [ - "bin" - "dev" - "out" - "doc" - ]; + outputs = + # The solver executables for AMPL modeling environment are only installed + # when AMPL is available. + lib.optional enableAMPL "bin" ++ [ + "out" + "dev" + "doc" + ]; nativeBuildInputs = [ pkg-config @@ -40,17 +45,18 @@ stdenv.mkDerivation rec { buildInputs = [ blas lapack - mumps - spral - libamplsolver - ]; + ] + ++ lib.optional enableMUMPS mumps + ++ lib.optional enableSPRAL spral + ++ lib.optional enableAMPL libamplsolver; - configureFlags = [ - "--with-mumps-cflags=-I${lib.getDev mumps}/include/mumps_seq" - "--with-mumps-lflags=-ldmumps" - "--with-spral-lflags=-lspral" - "--with-asl-lflags=-lamplsolver" - ]; + configureFlags = + lib.optionals enableMUMPS [ + "--with-mumps-cflags=-I${lib.getDev mumps}/include/mumps_seq" + "--with-mumps-lflags=-ldmumps" + ] + ++ lib.optional enableSPRAL "--with-spral-lflags=-lspral" + ++ lib.optional enableAMPL "--with-asl-lflags=-lamplsolver"; enableParallelBuilding = true;