diff --git a/pkgs/by-name/mp/mpsolve/package.nix b/pkgs/by-name/mp/mpsolve/package.nix index 26df426393cc..91ac76c40fa8 100644 --- a/pkgs/by-name/mp/mpsolve/package.nix +++ b/pkgs/by-name/mp/mpsolve/package.nix @@ -2,20 +2,30 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, autoreconfHook, bison, + check, flex, gitUpdater, gmp, gtk3, pkg-config, libsForQt5, + + withGUI ? true, }: stdenv.mkDerivation (finalAttrs: { pname = "mpsolve"; version = "3.2.2"; + outputs = [ + "out" + "dev" + "man" + ]; + src = fetchFromGitHub { owner = "robol"; repo = "MPSolve"; @@ -23,20 +33,47 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-BGXvNxWUbto0yMIpEIxZ9wOYv9w0ev4OgVcniNYIKoU="; }; + patches = [ + (fetchpatch { + name = "include-cmath-in-c++-before-defining-isnan-macro.patch"; + url = "https://github.com/robol/MPSolve/commit/260432c9d1002261f60159d0520af7862d4471ed.patch"; + hash = "sha256-ODWpp966S1SsSN8hf7yuYgJR44GgbLwSxui280WWGmM="; + }) + ]; + + strictDeps = true; + nativeBuildInputs = [ autoreconfHook bison flex pkg-config + ] + ++ lib.optionals withGUI [ libsForQt5.wrapQtAppsHook ]; buildInputs = [ gmp + ] + ++ lib.optionals withGUI [ gtk3 libsForQt5.qtbase ]; + configureFlags = [ + (lib.enableFeature withGUI "graphical-debugger") + (lib.enableFeature withGUI "ui") + ]; + + enableParallelBuilding = true; + + doCheck = true; + + checkInputs = [ check ]; + + checkTarget = "check"; + passthru.updateScript = gitUpdater { }; meta = { @@ -45,6 +82,5 @@ stdenv.mkDerivation (finalAttrs: { license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ kilianar ]; mainProgram = "mpsolve"; - platforms = lib.platforms.linux; }; })