guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 1c2606944731971a95d0be36ca17fc38098206e2
Author: Ludovic Courtès <[email protected]>
AuthorDate: Fri Aug 28 00:13:34 2026 +0200

    gnu: scotch: Update to 7.0.15.
    
    * gnu/packages/maths.scm (scotch): Update to 7.0.15.
    [source]: Remove ‘snippet’.
    [arguments]: Add ‘add-metis-executable-runpath’ phase.  In ‘install-metis’
    phase, move ‘adm2dgr’ as well.
    * gnu/packages/patches/scotch-cmake-remove-metis.patch: Update.
    
    Co-authored-by: Luca Cirrottola <[email protected]>
    Signed-off-by: Ludovic Courtès <[email protected]>
    Merges: #10868
---
 gnu/packages/maths.scm                             | 26 +++++++++++++---------
 .../patches/scotch-cmake-remove-metis.patch        | 10 ++++++---
 2 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 811826bcfb2..c27b60ddf29 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5640,7 +5640,7 @@ implemented in ANSI C, and MPI for communications.")
 (define-public scotch
   (package
     (name "scotch")
-    (version "7.0.7")
+    (version "7.0.15")
     (source
      (origin
        (method git-fetch)
@@ -5649,15 +5649,8 @@ implemented in ANSI C, and MPI for communications.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0r46bmnz9xjlgcb3vvlx3sg2qh4gfgga89vs4vlbzz3s4lj48g46"))
-       (patches (search-patches "scotch-cmake-remove-metis.patch"))
-       (modules '((guix build utils)))
-       (snippet
-        #~(substitute* "src/libscotchmetis/library_parmetis.h"
-            (("typedef DUMMYINT SCOTCH_Num" all)
-             ;; 'DUMMYINT' is typically replaced by 'int32_t'.  Include
-             ;; <stdint.h> to get that type definition.
-             (string-append "#include <stdint.h>\n" all "\n"))))))
+        (base32 "1d2v481zgi0b42qny3d97ysm1f5y89qkjhlzpnh8xx2abljssnqi"))
+       (patches (search-patches "scotch-cmake-remove-metis.patch"))))
     (build-system cmake-build-system)
     (inputs
      (list zlib))
@@ -5670,6 +5663,17 @@ implemented in ANSI C, and MPI for communications.")
                                  "-DBUILD_PTSCOTCH=OFF")
            #:phases
            #~(modify-phases %standard-phases
+               (add-after 'unpack 'add-metis-executable-runpath
+                 (lambda _
+                   ;; 'adm2dgr' is linked to libptscotchparmetisv3 and
+                   ;; installed in the "metis" output so add
+                   ;; '${ORIGIN}/../lib' to its RUNPATH.
+                   (substitute* "src/libscotchmetis/CMakeLists.txt"
+                     (("target_link_libraries\\(adm2dgr (.*)\\)" _ libraries)
+                      (string-append
+                       "target_link_libraries(adm2dgr "
+                       libraries
+                       " -Wl,-rpath='\\${ORIGIN}/../lib')\n")))))
                (add-after 'install 'install-metis
                  (lambda* (#:key outputs #:allow-other-keys)
                    ;; Move the METIS compatibility library to a separate 
output to
@@ -5684,7 +5688,7 @@ implemented in ANSI C, and MPI for communications.")
                                                                     prefix))))
                                    (mkdir-p (dirname target))
                                    (rename-file file target)))
-                               (find-files out "metis"))))))))
+                               (find-files out "(adm2dgr|metis)"))))))))
     (home-page "https://www.labri.fr/perso/pelegrin/scotch/";)
     (properties
      `((release-monitoring-url
diff --git a/gnu/packages/patches/scotch-cmake-remove-metis.patch 
b/gnu/packages/patches/scotch-cmake-remove-metis.patch
index 91bb36f86ea..f95525c5b94 100644
--- a/gnu/packages/patches/scotch-cmake-remove-metis.patch
+++ b/gnu/packages/patches/scotch-cmake-remove-metis.patch
@@ -10,15 +10,19 @@ available under '_IMPORT_PREFIX', which is only the case 
when
 
 diff --git a/cmake/SCOTCHConfig.cmake.in b/cmake/SCOTCHConfig.cmake.in
 index ec52ac5..4ce5c30 100644
---- a/cmake/SCOTCHConfig.cmake.in
-+++ b/cmake/SCOTCHConfig.cmake.in
-@@ -77,9 +77,3 @@ if(@BUILD_LIBESMUMPS@)
+---- a/cmake/SCOTCHConfig.cmake.in
+-+++ b/cmake/SCOTCHConfig.cmake.in
+@@ -79,13 +79,5 @@ if(@BUILD_LIBESMUMPS@)
      include("${CMAKE_CURRENT_LIST_DIR}/ptesmumpsTargets.cmake")
    endif()
  endif()
 -if(@BUILD_LIBSCOTCHMETIS@)
+-  set(@PROJECT_NAME@_LIBSCOTCH_METIS_FOUND ON)
 -  include("${CMAKE_CURRENT_LIST_DIR}/scotchmetisTargets.cmake")
 -  if(@BUILD_PTSCOTCH@)
+-    set(@PROJECT_NAME@_LIBSCOTCH_PARMETIS_FOUND ON)
 -    include("${CMAKE_CURRENT_LIST_DIR}/ptscotchparmetisTargets.cmake")
 -  endif()
 -endif()
+ 
+ check_required_components(@PROJECT_NAME@)

Reply via email to