diff mbox series

[bug#57410] gnu: Add ecbuild.

Message ID 20220825172702.1111386-1-antero@mailbox.org
State New
Headers show
Series [bug#57410] gnu: Add ecbuild. | expand

Checks

Context Check Description
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

Antero Mejr Aug. 25, 2022, 5:27 p.m. UTC
* gnu/packages/cmake.scm (ecbuild): New variable.
---
 gnu/packages/cmake.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

M Aug. 28, 2022, 3:22 p.m. UTC | #1
On 25-08-2022 19:27, Antero Mejr via Guix-patches via wrote:
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url"https://github.com/ecmwf/ecbuild")
> +                    (commit version)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "1mcjdqwvkzli7xj2wlnr4hshfh3wi5rs585f9nvqjfpgwvn0ym14"))
> +              (modules '((guix build utils)))
> +              (snippet #~(substitute* "bin/ecbuild"
> +                           (("cmake=\\$\\{cmakebin:=cmake\\}")
> +                            (string-append "cmake=${cmakebin:="
> +                                           #$cmake-minimal "/bin/cmake}"))))))

This 'source' is only usable inside Guix as it embeds store items, which 
makes "guix build --source" less useful for sharing source code (see: 
(guix)Snippets versus Phases).

Try doing this in a snippet instead.

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index cf930c57fc..aa89d4815c 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -32,6 +32,7 @@  (define-module (gnu packages cmake)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix deprecation)
@@ -49,6 +50,7 @@  (define-module (gnu packages cmake)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages texinfo)
@@ -406,3 +408,33 @@  (define-public emacs-cmake-mode
     (description "@code{cmakeos-mode} provides an Emacs major mode for editing
 Cmake files.  It supports syntax highlighting, indenting and refilling of
 comments.")))
+
+(define-public ecbuild
+  ;; when using set the configure flag "-DECBUILD_DISABLE_NEW_DTAGS=OFF"
+  ;; otherwise validate-runpath build step will fail when building Guix packages
+  (package
+    (name "ecbuild")
+    (version "3.7.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ecmwf/ecbuild")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1mcjdqwvkzli7xj2wlnr4hshfh3wi5rs585f9nvqjfpgwvn0ym14"))
+              (modules '((guix build utils)))
+              (snippet #~(substitute* "bin/ecbuild"
+                           (("cmake=\\$\\{cmakebin:=cmake\\}")
+                            (string-append "cmake=${cmakebin:="
+                                           #$cmake-minimal "/bin/cmake}"))))))
+    (build-system cmake-build-system)
+    (native-inputs (list perl))
+    (inputs (list cmake-minimal))
+    (home-page "https://ecbuild.readthedocs.io/en/latest/")
+    (synopsis "CMake wrapper and collection of macros")
+    (description "ecBuild is built on top of CMake and consists of a set of
+macros as well as a wrapper around CMake.  Calling @code{ecbuild $SRC_DIR} is
+equivalent to @code{cmake -DCMAKE_MODULE_PATH=$ECBUILD_DIR/cmake $SRC_DIR}.")
+    (license license:asl2.0)))