[bug#78559,1/2] gnu: Add or-tools.

Message ID 6a8d8a4fd03c5d5238517ddc6d31a7d50df0b1cc.1747981045.git.herman@rimm.ee
State New
Headers
Series [bug#78559,1/2] gnu: Add or-tools. |

Commit Message

Herman Rimm May 23, 2025, 6:17 a.m. UTC
  * gnu/packages/maths.scm (or-tools): Add variable.

Change-Id: Iea8f971f3d06d048bfa08aa8bf6c171fb154e9d0
---
 gnu/packages/maths.scm | 48 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)


base-commit: ba59ec9a11d6d4c0add8d5832500261fa50346da
  

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index eea9f8f718b..5d20803999a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -63,7 +63,7 @@ 
 ;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
 ;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
 ;;; Copyright © 2023, 2025 David Elsing <david.elsing@posteo.net>
-;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
+;;; Copyright © 2024, 2025 Herman Rimm <herman@rimm.ee>
 ;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
 ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
@@ -174,6 +174,7 @@  (define-module (gnu packages maths)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages protobuf)
   #:use-module (gnu packages prolog)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
@@ -184,6 +185,7 @@  (define-module (gnu packages maths)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages regex)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages tbb)
   #:use-module (gnu packages scheme)
@@ -10195,6 +10197,50 @@  (define-public libqalculate
 cli.")
     (license license:gpl2+)))
 
+(define-public or-tools
+  (package
+    (name "or-tools")
+    (version "9.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/google/or-tools")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1z15f2nf9jww34fmfpycc9z7j1j06xbihs4qhd4s7qsdjds67zpa"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+       #:configure-flags
+       #~'("-DUSE_COINOR=OFF" "-DUSE_HIGHS=OFF" "-DUSE_SCIP=OFF")
+       #:phases
+       #~(modify-phases %standard-phases
+           (add-before 'configure 'patch-install-paths
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "ortools/flatzinc/ortools.msc.in"
+                   (("\\.\\.") (string-append out "/share/minizinc"))
+                   (("@FZ_REL_INSTALL_BINARY@")
+                    (string-append out "/bin/fzn-ortools")))))))))
+    (inputs (list abseil-cpp-20220623 eigen protobuf re2 zlib))
+    (native-inputs (list googletest pkg-config))
+    (home-page "https://developers.google.com/optimization")
+    (synopsis "Google's software suite for combinatorial optimization")
+    (description
+     "Google Optimization Tools (a.k.a. OR-Tools) is a software suite
+for solving combinatorial optimization problems.  The suite contains:
+@itemize
+@item CP* and CP-SAT constraint programming solvers;
+@item Glop and PDLP linear programming solvers;
+@item Wrappers around solvers, including mixed integer solvers;
+@item Bin packing and knapsack algorithms;
+@item Traveling Salesman Problem and Vehicle Routing Problem algorithms;
+@item Graph algorithms for shortest paths, min cost flow, max flow, etc.
+@end itemize")
+    (license license:asl2.0)))
+
 (define-public qalculate-gtk
   (package
     (name "qalculate-gtk")