diff mbox series

[bug#46107,1/6] gnu: Add spglib.

Message ID 20210125212042.4358-1-kkebreau@posteo.net
State Accepted
Headers show
Series [bug#46107,1/6] gnu: Add spglib. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Kei Kebreau Jan. 25, 2021, 9:20 p.m. UTC
* gnu/packages/chemistry.scm (spglib): New variable.
---
 gnu/packages/chemistry.scm | 45 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

Comments

Leo Famulari Jan. 25, 2021, 10:17 p.m. UTC | #1
On Mon, Jan 25, 2021 at 04:20:42PM -0500, Kei Kebreau wrote:
> * gnu/packages/chemistry.scm (spglib): New variable.

Thanks! LGTM

> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'bootstrap
> +           (lambda _
> +             ;; These files are required by the Makefile, but not provided by
> +             ;; the developers.
> +             (for-each (lambda (file) (invoke "touch" file))
> +                       '("NEWS" "README" "AUTHORS"))
> +             (invoke "autoreconf" "-vi"))))))

Can you file a bug upstream about this?
Kei Kebreau Jan. 26, 2021, 3:20 a.m. UTC | #2
On Mon, 2021-01-25 at 17:17 -0500, Leo Famulari wrote:
> On Mon, Jan 25, 2021 at 04:20:42PM -0500, Kei Kebreau wrote:
> > * gnu/packages/chemistry.scm (spglib): New variable.
> 
> Thanks! LGTM
> 
> > +       #:phases
> > +       (modify-phases %standard-phases
> > +         (replace 'bootstrap
> > +           (lambda _
> > +             ;; These files are required by the Makefile, but not provided
> > by
> > +             ;; the developers.
> > +             (for-each (lambda (file) (invoke "touch" file))
> > +                       '("NEWS" "README" "AUTHORS"))
> > +             (invoke "autoreconf" "-vi"))))))
> 
> Can you file a bug upstream about this?

On closer inspection, it seems that the developer is moving to make CMake the
main build system.  Using the CMake build system, I ran into a known [0]
inconsistency [1] between the GNU and CMake build systems used by spglib.  I've
patched spglib to deal with this for now, with links added in the comments.

[0]: https://github.com/spglib/spglib/issues/75
[1]: https://github.com/OpenChemistry/avogadroapp/issues/97
diff mbox series

Patch

diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index ddbf5ca098..7a9b3069fa 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -29,6 +29,7 @@ 
   #:use-module (guix git-download)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
@@ -464,3 +465,47 @@  chemical data.  It's a collaborative project allowing anyone to search, convert,
 analyze, or store data from molecular modeling, chemistry, solid-state
 materials, biochemistry, or related areas.")
     (license license:gpl2)))
+
+(define-public spglib
+  (package
+    (name "spglib")
+    (version "1.16.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/spglib/spglib")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1kzc956m1pnazhz52vspqridlw72wd8x5l3dsilpdxl491aa2nws"))
+       (file-name (git-file-name name version))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (arguments
+     '(#:test-target "check"
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'bootstrap
+           (lambda _
+             ;; These files are required by the Makefile, but not provided by
+             ;; the developers.
+             (for-each (lambda (file) (invoke "touch" file))
+                       '("NEWS" "README" "AUTHORS"))
+             (invoke "autoreconf" "-vi"))))))
+    (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
+symmetries written in C.  Spglib can be used to:
+
+@enumerate
+@item Find symmetry operations
+@item Identify space-group type
+@item Wyckoff position assignment
+@item Refine crystal structure
+@item Find a primitive cell
+@item Search irreducible k-points
+@end enumerate")
+    (license license:bsd-3)))