guix_mirror_bot pushed a commit to branch master
in repository guix.

commit b2c5cff69e60ebc9b73aee8c8f5564b0d8bb9491
Author: Nigko Yerden <[email protected]>
AuthorDate: Mon Nov 16 20:29:49 2026 +0500

    gnu: Add alpscore.
    
    * gnu/packages/physics.scm (alpscore): Add variable.
    (Copyright message): Update.
    * gnu/packages/patches/alpscore-unbundle-googletest.patch: Add patch.
    
    Merges: guix/guix!12142
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 .../patches/alpscore-unbundle-googletest.patch     | 28 +++++++++++++++
 gnu/packages/physics.scm                           | 40 +++++++++++++++++++++-
 2 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/patches/alpscore-unbundle-googletest.patch 
b/gnu/packages/patches/alpscore-unbundle-googletest.patch
new file mode 100644
index 00000000000..5c9039623f7
--- /dev/null
+++ b/gnu/packages/patches/alpscore-unbundle-googletest.patch
@@ -0,0 +1,28 @@
+Set ALPSCore to use Guix's `googletest` instead of a bundled one.
+
+diff --git a/common/cmake/ALPSEnableTests.cmake 
b/common/cmake/ALPSEnableTests.cmake
+index 0389ef8..b8166a0 100644
+--- a/common/cmake/ALPSEnableTests.cmake
++++ b/common/cmake/ALPSEnableTests.cmake
+@@ -34,17 +34,10 @@ function(UseGtest gtest_root)
+ endfunction()
+ 
+ # enable testing with gtest - fetch it if needed
+-if (NOT tests_are_already_enabled) 
+-    if (ALPS_GLOBAL_BUILD)
+-        set(gtest_root "${PROJECT_SOURCE_DIR}/common/deps/gtest-1.16.0")
+-    else(ALPS_GLOBAL_BUILD)
+-        set(gtest_root "${PROJECT_SOURCE_DIR}/../common/deps/gtest-1.16.0")
+-    endif(ALPS_GLOBAL_BUILD)
+-
+-    UseGtest(${gtest_root})
+-    unset(gtest_root)
+-    # set (LINK_TEST  ${GTEST_MAIN_LIBRARIES}) 
+-    include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
++if (NOT tests_are_already_enabled)
++    find_package(GTest REQUIRED)
++    set(GTEST_LIBRARY GTest::gtest)
++    set(GTEST_MAIN_LIBRARIES GTest::gtest_main)
+     set(tests_are_already_enabled TRUE)
+ endif(NOT tests_are_already_enabled)
+ 
diff --git a/gnu/packages/physics.scm b/gnu/packages/physics.scm
index 6a0027d76c5..3e95e3ec19c 100644
--- a/gnu/packages/physics.scm
+++ b/gnu/packages/physics.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2025 Nigko Yerden <[email protected]>
+;;; Copyright © 2025, 2026 Nigko Yerden <[email protected]>
 ;;; Copyright © 2025 Vinicius Monego <[email protected]>
 ;;; Copyright © 2025, 2026 Sharlatan Hellseher <[email protected]>
 ;;; Copyright © 2026 Danny Milosavljevic <[email protected]>
@@ -142,6 +142,44 @@ ready to use applications and C++ library for simplifying 
the development of
 such components.")
     (license license:expat)))
 
+(define-public alpscore
+  (package
+    (name "alpscore")
+    (version "2.3.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/ALPSCore/ALPSCore";)
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1h8mgq55cv07hizfys6iq4iq6ing84dicrzpfnz71hrrlpvh888d"))
+       (modules '((guix build utils)))
+       (snippet #~(delete-file-recursively "common/deps/gtest-1.16.0"))
+       (patches
+        (search-patches "alpscore-unbundle-googletest.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'patch-source-shebangs 'sh-in-tests
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "common/cmake/ALPSEnableTests.cmake"
+                         (("/bin/sh")
+                          (search-input-file inputs "/bin/sh"))))))))
+    (native-inputs (list googletest))
+    (inputs (list boost eigen hdf5 openmpi))
+    (home-page "https://alpscore.org/";)
+    (synopsis "Applications and Libraries for Physics Simulations Core
+libraries")
+    (description
+     "The ALPSCore project, based on the ALPS (Algorithms and
+Libraries for Physics Simulations) provides a set of C++ libraries
+facilitating developing condensed matter physics simulation applications
+using Monte Carlo and Green's functions methods.")
+    (license license:expat)))
+
 (define-public cif-core
   (package
     (name "cif-core")

Reply via email to