summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/oce/package.py4
-rw-r--r--var/spack/repos/builtin/packages/oce/xlocale.patch13
2 files changed, 17 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/oce/package.py b/var/spack/repos/builtin/packages/oce/package.py
index d01b5a4546..e3ad222e85 100644
--- a/var/spack/repos/builtin/packages/oce/package.py
+++ b/var/spack/repos/builtin/packages/oce/package.py
@@ -60,6 +60,10 @@ class Oce(Package):
# https://github.com/tpaviot/oce/commit/61cb965b9ffeca419005bc15e635e67589c421dd.patch
patch('null.patch', when='@0.16:0.17.1')
+ # OCE depends on xlocale.h from glibc-headers but it was removed in 2.26,
+ # see https://github.com/tpaviot/oce/issues/675
+ patch('xlocale.patch', level=0, when='@0.18.1:')
+
# fix build with Xcode 8 "previous definition of CLOCK_REALTIME"
# reported 27 Sep 2016 https://github.com/tpaviot/oce/issues/643
if (platform.system() == "Darwin") and (
diff --git a/var/spack/repos/builtin/packages/oce/xlocale.patch b/var/spack/repos/builtin/packages/oce/xlocale.patch
new file mode 100644
index 0000000000..2c4ba59958
--- /dev/null
+++ b/var/spack/repos/builtin/packages/oce/xlocale.patch
@@ -0,0 +1,13 @@
+--- src/Standard/Standard_CLocaleSentry.hxx.ORIG 2017-08-11 07:51:11.000000000 +0200
++++ src/Standard/Standard_CLocaleSentry.hxx 2017-08-18 01:07:11.639206272 +0200
+@@ -30,7 +30,9 @@
+ #endif
+
+ //! We check _GNU_SOURCE for glibc extensions here and it is always defined by g++ compiler.
+- #if defined(_GNU_SOURCE) && !defined(__ANDROID__)
++ //! Musl libc does not provide xlocale.h
++ //! glibc 2.26+ does not provide xlocale.h (anymore)
++ #if defined(_GNU_SOURCE) && defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 26 && !defined(__ANDROID__)
+ #define HAVE_XLOCALE_H
+ #endif
+ #endif // ifndef HAVE_LOCALE_H