Subject: [bug#57410] [PATCH] gnu: Add eccodes.

From: Antero Mejr <[email-masked]>
Date: Thu, 25 Aug 2022 13:22:27 -0400

* gnu/packages/geo.scm (eccodes): New variable.
---
 gnu/packages/geo.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 0c869fdebb..f1151fa95c 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -64,6 +64,7 @@ (define-module (gnu packages geo)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages build-tools)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages cups)
@@ -76,6 +77,7 @@ (define-module (gnu packages geo)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -112,6 +114,7 @@ (define-module (gnu packages geo)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages textutils)
@@ -2797,3 +2800,35 @@ (define-public libaec
 point representations are not directly supported, they can also be efficiently
 coded by grouping exponents and mantissa.")
     (license license:bsd-2)))
+
+(define-public eccodes
+  (package
+    (name "eccodes")
+    (version "2.27.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ecmwf/eccodes")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1hd4lli6g4m77rdfqwq8kxqpgn9na7lhv0j47w0sw9ihy8qllq41"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:configure-flags #~(list "-DECBUILD_DISABLE_NEW_DTAGS=OFF"
+                                     "-DENABLE_PNG=ON")))
+    (native-inputs (list ecbuild gfortran perl))
+    (inputs (list oksh libaec libpng netcdf openjpeg))
+    (home-page "https://confluence.ecmwf.int/display/ECC")
+    (synopsis "Encoder/decoder for GRIB and BUFR meteorological data files")
+    (description "ecCodes is a package developed by ECMWF which provides an
+application programming interface and a set of tools for decoding and encoding
+messages in the following formats:
+
+@itemize
+@item WMO FM-92 GRIB edition 1 and edition 2
+@item WMO FM-94 BUFR edition 3 and edition 4
+@item WMO GTS abbreviated header (only decoding)
+@end itemize")
+    (license license:asl2.0)))
-- 
2.37.2