summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJannek Squar <github@jsquar.eu>2024-09-11 15:00:56 +0200
committerGitHub <noreply@github.com>2024-09-11 08:00:56 -0500
commit122c3c2dbb4269869b12b3b6175d731cd8301b6e (patch)
treebc33730404bb422d8b1eea9331a55ff164765b1e /var
parent607d158a44fdc7a880bbe9f4f6b06f894ed0e9a5 (diff)
downloadspack-122c3c2dbb4269869b12b3b6175d731cd8301b6e.tar.gz
spack-122c3c2dbb4269869b12b3b6175d731cd8301b6e.tar.bz2
spack-122c3c2dbb4269869b12b3b6175d731cd8301b6e.tar.xz
spack-122c3c2dbb4269869b12b3b6175d731cd8301b6e.zip
CDO: add patch for missing algorithm header (#45692)
* add cdo patch for missing algorithm header * add patch for 2.2.2:2.3.0 Signed-off-by: Jannek <squar@informatik.uni-hamburg.de> * Add conflict of old cdo with new gcc * Update var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Adjust patch hash * Update var/spack/repos/builtin/packages/cdo/package.py fix copy-paste-error on hash Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> --------- Signed-off-by: Jannek <squar@informatik.uni-hamburg.de> Co-authored-by: Jannek <squar@informatik.uni-hamburg.de> Co-authored-by: Try2Code <stark.dreamdetective@gmail.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch22
-rw-r--r--var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch23
-rw-r--r--var/spack/repos/builtin/packages/cdo/package.py14
3 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch b/var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch
new file mode 100644
index 0000000000..2e9e6803ae
--- /dev/null
+++ b/var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch
@@ -0,0 +1,22 @@
+diff --git a/src/cdo_module.cc b/src/cdo_module_patched.cc
+index dc408d9..f50c2d3 100644
+--- a/src/cdo_module.cc
++++ b/src/cdo_module_patched.cc
+@@ -1,4 +1,5 @@
+ #include "cdo_module.h"
++#include <algorithm>
+
+ oper_t::oper_t() : help(default_help) {}
+
+diff --git a/src/cdo_options.cc b/src/cdo_options_patched.cc
+index 465f1f9..0684e78 100644
+--- a/src/cdo_options.cc
++++ b/src/cdo_options_patched.cc
+@@ -12,6 +12,7 @@
+ #include "cdo_output.h"
+
+ #include <cstring>
++#include <algorithm>
+
+ namespace cdo
+ {
diff --git a/var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch b/var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch
new file mode 100644
index 0000000000..319e140ef4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch
@@ -0,0 +1,23 @@
+diff --git a/src/cdo_options.cc b/src/cdo_options_patched.cc
+index 465f1f9..0684e78 100644
+--- a/src/cdo_options.cc
++++ b/src/cdo_options_patched.cc
+@@ -12,6 +12,7 @@
+ #include "cdo_output.h"
+
+ #include <cstring>
++#include <algorithm>
+
+ namespace cdo
+ {
+diff -u src/cdo_options.h src/cdo_options_patched.h
+--- a/src/cdo_options.h
++++ b/src/cdo_options_patched.h
+@@ -3,6 +3,7 @@
+
+ #include <vector>
+ #include <string>
++#include <algorithm>
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h" /* _FILE_OFFSET_BITS influence off_t */
diff --git a/var/spack/repos/builtin/packages/cdo/package.py b/var/spack/repos/builtin/packages/cdo/package.py
index 9f6910fa04..2c39959207 100644
--- a/var/spack/repos/builtin/packages/cdo/package.py
+++ b/var/spack/repos/builtin/packages/cdo/package.py
@@ -170,6 +170,20 @@ class Cdo(AutotoolsPackage):
depends_on("cxx", type="build") # generated
depends_on("fortran", type="build") # generated
+ # patches
+ # see https://code.mpimet.mpg.de/boards/1/topics/15594
+ patch(
+ "add_algorithm_header.patch",
+ when="@2.4.0:2.4.2 %gcc@14:",
+ sha256="0bc20d2fcb14d8e4010d4222297f259eb7b4220effd97555ed3f027e63cf8b30",
+ )
+ patch(
+ "add_algorithm_header_222.patch",
+ when="@2.2.2:2.3.0 %gcc@14:",
+ sha256="db0d9bd32bbee01d914c1dbebd751403e9c918fafd540fd6ecc6a2f27e0900cf",
+ )
+ conflicts("%gcc@14:", when="@:2.2.0", msg="Compilation with gcc@14: requires cdo@2.2.2:")
+
variant("netcdf", default=True, description="Enable NetCDF support")
variant(
"grib2",