Subject: [PATCH] Add Climate Data Operators package

From: Roman Scherer <[email-masked]>
Date: Sat, 25 Jun 2022 12:18:24 +0200

Hi Antero,

thanks for your review! Here's an updated version of the patch. I added
--with-netcdf to the configure flags, removed the build utils, added
spaces between sentences and don't use a list for the licence field
anymore.

Could you have another look please?

I'm not sure if I addressed all lint issues, since this command is
failing on my machine recently. Any idea what this could be? Here's the
backtrace of the lint command:

```
[roman@thinkpad guix]$ ./pre-inst-env guix lint cdo
;;; note: source file /home/roman/workspace/guix/gnu/packages/geo.scm
;;;       newer than compiled /home/roman/workspace/guix/gnu/packages/geo.go
;;; note: source file /home/roman/workspace/guix/gnu/packages/geo.scm
;;;       newer than compiled /home/roman/.cache/guile/ccache/3.0-LE-8-4.5/home/roman/workspace/guix/gnu/packages/geo.scm.go
;;; Failed to autoload html->sxml in (htmlprag):
;;; no code for module (htmlprag)
Backtrace:
In ice-9/boot-9.scm:
  1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
          17 (apply-smob/0 #<thunk 7f3b46a28f60>)
In ice-9/boot-9.scm:
    724:2 16 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
    619:8 15 (_ #(#(#<directory (guile-user) 7f3b46a22c80>)))
In guix/ui.scm:
   2238:7 14 (run-guix . _)
  2201:10 13 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10 12 (with-exception-handler _ _ #:unwind? _ # _)
  1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   659:37 10 (thunk)
In srfi/srfi-1.scm:
    634:9  9 (for-each #<procedure 7f3b4531efa0 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
     65:4  8 (run-checkers _ _ #:store _)
In srfi/srfi-1.scm:
    634:9  7 (for-each #<procedure 7f3b31769de0 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
    74:21  6 (_ _)
In guix/lint.scm:
   1476:5  5 (check-for-updates #<package [email-masked] /home/roman/work…>)
    811:2  4 (call-with-networking-fail-safe _ _ _)
In ice-9/boot-9.scm:
  1752:10  3 (with-exception-handler _ _ #:unwind? _ # _)
  1685:16  2 (raise-exception _ #:continuable? _)
  1683:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: html->sxml: unbound variable
```

Thanks, Roman.

From d003fb5a519341a23973e8565ac7bc3195742808 Mon Sep 17 00:00:00 2001
From: r0man <[email-masked]>
Date: Sat, 25 Jun 2022 12:10:00 +0200
Subject: [PATCH] Add Climate Data Operators package

This patch adds CDO, a collection of command line Operators to manipulate and
analyse Climate and NWP model Data to Guix's geo module.
---
 gnu/packages/geo.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 7b29c55088..7ce1d2bda2 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -119,6 +119,33 @@ (define-module (gnu packages geo)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
+(define-public cdo
+  (package
+    (name "cdo")
+    (version "2.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://code.mpimet.mpg.de/attachments/download/26823/cdo-"
+                     version ".tar.gz"))
+              (sha256
+               (base32
+                "1khdbd5cmnn7qm6hcqg4md5wbq14fs6brrns8b3g18diqgqvpvpd"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--with-netcdf=" (assoc-ref %build-inputs "netcdf")))))
+    (inputs
+     (list netcdf))
+    (native-inputs
+     (list pkg-config))
+    (home-page "https://code.mpimet.mpg.de/projects/cdo")
+    (synopsis "Climate Data Operators")
+    (description "CDO is a collection of command line Operators to manipulate and analyse
+Climate and NWP model Data.  Supported data formats are GRIB 1/2, netCDF 3/4,
+SERVICE, EXTRA and IEG.  There are more than 600 operators available.")
+    (license license:bsd-3)))
+
 (define-public memphis
   (package
     (name "memphis")
-- 
2.36.1