[bug#76728] Patches with comments

Message ID Z_6UweSgnQaPcHQ4@kernelpanicroom
State New
Headers
Series [bug#76728] Patches with comments |

Commit Message

Jakob Kirsch April 15, 2025, 5:17 p.m. UTC
  spglib wants to clone a repository using git while building the tests and that won't work so I've added a comment (spglib works with avogadro2 that is its only dependant).
From 2a366ea2a876dff391fad94fb9a7ca34b0b92850 Mon Sep 17 00:00:00 2001
Message-ID: <2a366ea2a876dff391fad94fb9a7ca34b0b92850.1744737318.git.jakob.kirsch@web.de>
From: Jakob Kirsch <jakob.kirsch@web.de>
Date: Fri, 11 Apr 2025 15:33:14 +0200
Subject: [PATCH 1/3] gnu: spglib: Update to 2.5.0.

* gnu/packages/chemistry.scm (spglib): Update to 2.5.0.

Change-Id: Ia05bb8e2f012fcf4c576db8a6e5d2f8b153493ff
---
 gnu/packages/chemistry.scm | 52 +++++++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 18 deletions(-)


base-commit: 12a6dd40a7b88454cc8a8c930c22681fcee5b1ea
  

Patch

diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index d05792c56d..4e186e017c 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -477,7 +477,7 @@  (define-public openbabel
 (define-public spglib
   (package
     (name "spglib")
-    (version "1.16.0")
+    (version "2.5.0")
     (source
      (origin
        (method git-fetch)
@@ -485,26 +485,42 @@  (define-public spglib
              (url "https://github.com/spglib/spglib")
              (commit (string-append "v" version))))
        (sha256
-        (base32 "1kzc956m1pnazhz52vspqridlw72wd8x5l3dsilpdxl491aa2nws"))
+        (base32 "0x5igrqwx7r2shysmi9sqcjg4hpb7hba3ddlwg05z6c57a3ifbqc"))
        (file-name (git-file-name name version))))
     (build-system cmake-build-system)
     (arguments
-     '(#:test-target "check"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-header-install-dir
-           (lambda _
-             ;; As of the writing of this package, CMake and GNU build systems
-             ;; install the header to two different location.  This patch makes
-             ;; the CMake build system's choice of header directory compatible
-             ;; with the GNU build system's choice and with what avogadrolibs
-             ;; expects.
-             ;; See https://github.com/spglib/spglib/issues/75 and the relevant
-             ;; part of https://github.com/OpenChemistry/avogadroapp/issues/97.
-             (substitute* "CMakeLists.txt"
-               (("\\$\\{CMAKE_INSTALL_INCLUDEDIR\\}" include-dir)
-                (string-append include-dir "/spglib")))
-             #t)))))
+     '(#:tests? #f ; tests want to clone a git repository, which won't work
+       #:configure-flags '("-DSPGLIB_WITH_TESTS=OFF")
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'patch-files (lambda _ (substitute* "CMakeLists.txt"
+                      (("include\\(cmake/DynamicVersion.cmake\\)")
+                       "")
+                      (("dynamic_version.*")
+                       "")
+                      (("PROJECT_PREFIX.*")
+                       "")
+                      (("FALLBACK_VERSION.*")
+                       "set (PROJECT_VERSION 2.5.0")
+                      (("\\$\\{PROJECT_VERSION_FULL\\}")
+                       "2.5.0")
+                      (("\\$\\{GIT_COMMIT\\}")
+                       "\"\""))
+                    (substitute* "src/CMakeLists.txt"
+                      ((".*Spglib_GitHash.*")
+                       ""))))
+                  (add-after 'unpack 'patch-header-install-dir
+                    (lambda _
+                      ;; As of the writing of this package, CMake and GNU build systems
+                      ;; install the header to two different location.  This patch makes
+                      ;; the CMake build system's choice of header directory compatible
+                      ;; with the GNU build system's choice and with what avogadrolibs
+                      ;; expects.
+                      ;; See https://github.com/spglib/spglib/issues/75 and the relevant
+                      ;; part of https://github.com/OpenChemistry/avogadroapp/issues/97.
+                      (substitute* "CMakeLists.txt"
+                        (("\\$\\{CMAKE_INSTALL_INCLUDEDIR\\}" include-dir)
+                         (string-append include-dir "/spglib")))
+                      #t)))))
     (home-page "https://spglib.github.io/spglib/index.html")
     (synopsis "Library for crystal symmetry search")
     (description "Spglib is a library for finding and handling crystal