From 356ac6d6ae8a9a86736d8b20ce692ad07580ea2d Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 31 Jul 2022 13:28:19 +0200 Subject: [PATCH] scalp: init at unstable-2022-03-15 --- .../science/math/scalp/default.nix | 58 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/applications/science/math/scalp/default.nix diff --git a/pkgs/applications/science/math/scalp/default.nix b/pkgs/applications/science/math/scalp/default.nix new file mode 100644 index 000000000000..05261701fc28 --- /dev/null +++ b/pkgs/applications/science/math/scalp/default.nix @@ -0,0 +1,58 @@ +{ lib +, stdenv +, fetchgit +, cmake +, withGurobi ? false +, gurobi +, withCplex ? false +, cplex +, withLpsolve ? true +, lp_solve +}: + +stdenv.mkDerivation rec { + pname = "scalp"; + version = "unstable-2022-03-15"; + + src = fetchgit { + url = "https://digidev.digi.e-technik.uni-kassel.de/git/scalp.git"; + # mirrored at https://github.com/wegank/scalp.git + rev = "185b84e4ff967f42cf2de5db4db4e6fa0cc18fb8"; + sha256 = "sha256-NyMZdJwdD3FR6uweYCclJjfcf3Y24Bns1ViwsmJ5izg="; + }; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = lib.optionals withGurobi [ + gurobi + ] ++ lib.optionals withCplex [ + cplex + ] ++ lib.optionals withLpsolve [ + lp_solve + ]; + + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace CMakeLists.txt \ + --replace "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib" + ''; + + cmakeFlags = [ + "-DBUILD_TESTS=${lib.boolToString doCheck}" + ] ++ lib.optionals withGurobi [ + "-DGUROBI_DIR=${gurobi}" + ] ++ lib.optionals withCplex [ + "-DCPLEX_DIR=${cplex}" + ]; + + doCheck = true; + + meta = with lib; { + description = "Scalable Linear Programming Library"; + homepage = "https://digidev.digi.e-technik.uni-kassel.de/scalp/"; + license = licenses.lgpl3; + platforms = platforms.unix; + maintainers = with maintainers; [ wegank ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 353bb602ec6f..0d9bc56ccfce 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34259,6 +34259,8 @@ with pkgs; pynac = callPackage ../applications/science/math/pynac { }; + scalp = callPackage ../applications/science/math/scalp { }; + singular = callPackage ../applications/science/math/singular { }; scilab-bin = callPackage ../applications/science/math/scilab-bin {};