diff --git a/pkgs/by-name/pa/pagsuite/package.nix b/pkgs/by-name/pa/pagsuite/package.nix index 6994712e18fd..850732275cb3 100644 --- a/pkgs/by-name/pa/pagsuite/package.nix +++ b/pkgs/by-name/pa/pagsuite/package.nix @@ -1,10 +1,12 @@ -{ lib -, stdenv -, fetchurl -, cmake -, unzip -, gmp -, scalp +{ + lib, + stdenv, + fetchurl, + fetchpatch, + cmake, + unzip, + gmp, + scalp, }: stdenv.mkDerivation rec { @@ -12,11 +14,21 @@ stdenv.mkDerivation rec { version = "1.80"; src = fetchurl { - url = "https://gitlab.com/kumm/pagsuite/-/raw/master/releases/pagsuite_${lib.replaceStrings ["."] ["_"] version}.zip"; + url = "https://gitlab.com/kumm/pagsuite/-/raw/master/releases/pagsuite_${ + lib.replaceStrings [ "." ] [ "_" ] version + }.zip"; hash = "sha256-TYd+dleVPWEWU9Cb3XExd7ixJZyiUAp9QLtorYJSIbQ="; }; - sourceRoot = "pagsuite_${lib.replaceStrings ["."] ["_"] version}"; + patches = [ + # Fix issue with latest ScaLP update + (fetchpatch { + url = "https://gitlab.com/kumm/pagsuite/-/commit/cae9f78bec93a7f197461358f2f796f6b5778781.patch"; + hash = "sha256-12IisS6oGYLRicORTemHB7bw9EB9cuQjxG8f6X0WMrU="; + }) + ]; + + sourceRoot = "pagsuite_${lib.replaceStrings [ "." ] [ "_" ] version}"; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/sc/scalp/package.nix b/pkgs/by-name/sc/scalp/package.nix index a4d3dc52e0a9..fcd0ce58c24f 100644 --- a/pkgs/by-name/sc/scalp/package.nix +++ b/pkgs/by-name/sc/scalp/package.nix @@ -1,59 +1,80 @@ -{ lib -, stdenv -, fetchgit -, cmake -, withGurobi ? false -, gurobi -, withCplex ? false -, cplex -, withLpsolve ? true -, lp_solve +{ + lib, + stdenv, + fetchgit, + cmake, + withGurobi ? false, + gurobi, + withCplex ? false, + cplex, + withLpsolve ? true, + lp_solve, + unstableGitUpdater, }: stdenv.mkDerivation rec { pname = "scalp"; - version = "unstable-2022-03-15"; + version = "0-unstable-2024-08-28"; src = fetchgit { url = "https://digidev.digi.e-technik.uni-kassel.de/git/scalp.git"; # mirrored at https://git.sr.ht/~weijia/scalp - rev = "185b84e4ff967f42cf2de5db4db4e6fa0cc18fb8"; - hash = "sha256-NyMZdJwdD3FR6uweYCclJjfcf3Y24Bns1ViwsmJ5izg="; + rev = "4a8e8b850a57328d9377ea7955c27c437394ebd3"; + hash = "sha256-6OEf3yWFBmTKgeTMojRMRf/t9Ec1i851Lx3mQjCeOuw="; }; + postPatch = + '' + substituteInPlace CMakeLists.txt \ + --replace-fail "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib" \ + --replace-fail "-m64" "" + substituteInPlace src/tests/CMakeLists.txt \ + --replace-fail "src/tests/" "" + '' + + lib.optionalString withGurobi '' + substituteInPlace CMakeExtensions/FindGurobi.cmake \ + --replace-fail "\''${GUROBI_VERSION}" '"${lib.versions.major gurobi.version}${lib.versions.minor gurobi.version}"' + ''; + nativeBuildInputs = [ cmake ]; - buildInputs = lib.optionals withGurobi [ - gurobi - ] ++ lib.optionals withCplex [ - cplex - ] ++ lib.optionals withLpsolve [ - lp_solve - ]; + buildInputs = + lib.optionals withGurobi [ + gurobi + ] + ++ lib.optionals withCplex [ + cplex + ] + ++ lib.optionals withLpsolve [ + lp_solve + ]; - postPatch = lib.optionalString stdenv.hostPlatform.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}" - ]; + cmakeFlags = + [ + (lib.cmakeBool "BUILD_TESTS" doCheck) + ] + ++ lib.optionals withGurobi [ + (lib.cmakeFeature "GUROBI_ROOT_DIR" "${gurobi}") + ] + ++ lib.optionals withCplex [ + (lib.cmakeFeature "CPLEX_ROOT_DIR" "${cplex}") + ] + ++ lib.optionals withLpsolve [ + (lib.cmakeFeature "LPSOLVE_ROOT_DIR" "${lp_solve}") + ]; doCheck = true; - meta = with lib; { + passthru.updateScript = unstableGitUpdater { }; + + meta = { description = "Scalable Linear Programming Library"; mainProgram = "scalp"; homepage = "https://digidev.digi.e-technik.uni-kassel.de/scalp/"; - license = licenses.lgpl3; - platforms = platforms.unix; - maintainers = with maintainers; [ wegank ]; + license = lib.licenses.lgpl3Only; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ wegank ]; }; }