summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py5
-rw-r--r--var/spack/repos/builtin/packages/ncurses/nvhpc_fix_preprocessor_flag.patch30
-rw-r--r--var/spack/repos/builtin/packages/ncurses/package.py1
3 files changed, 33 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index 8f244239fa..4278610895 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -169,10 +169,9 @@ class Cmake(Package):
'please use %apple-clang or a newer CMake release. '
'See: https://gitlab.kitware.com/cmake/cmake/-/issues/21135')
- # Seems like the vendored dependencies do not build with nvhpc, and linking with
- # ncurses runs into issues.
+ # Vendored dependencies do not build with nvhpc; it's also more
+ # transparent to patch Spack's versions of CMake's dependencies.
conflicts('+ownlibs %nvhpc')
- conflicts('+ncurses %nvhpc')
with when('~ownlibs'):
depends_on('curl')
diff --git a/var/spack/repos/builtin/packages/ncurses/nvhpc_fix_preprocessor_flag.patch b/var/spack/repos/builtin/packages/ncurses/nvhpc_fix_preprocessor_flag.patch
new file mode 100644
index 0000000000..54f659734a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ncurses/nvhpc_fix_preprocessor_flag.patch
@@ -0,0 +1,30 @@
+From a2ae279d50514edca1f8d1fe74a59c4e77385567 Mon Sep 17 00:00:00 2001
+From: Harmen Stoppels <harmenstoppels@gmail.com>
+Date: Tue, 19 Apr 2022 13:24:48 +0200
+Subject: [PATCH] MKlib_gen.sh: -P for nvhpc means "stop after preprocessing"
+ and outputs nothing
+
+---
+ ncurses/base/MKlib_gen.sh | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
+index 5a3770e..f256546 100755
+--- a/ncurses/base/MKlib_gen.sh
++++ b/ncurses/base/MKlib_gen.sh
+@@ -77,12 +77,6 @@ PRG=`echo "$1" | $AWK '{ sub(/^[ ]*/,""); sub(/[ ].*$/, ""); print; }' || exit
+ FSF=`"$PRG" --version 2>/dev/null || exit 0 | fgrep "Free Software Foundation" | head -n 1`
+ ALL=`"$PRG" -dumpversion 2>/dev/null || exit 0`
+ ONE=`echo "$ALL" | sed -e 's/\..*$//'`
+-if test -n "$FSF" && test -n "$ALL" && test -n "$ONE" ; then
+- if test $ONE -ge 5 ; then
+- echo ".. adding -P option to work around $PRG $ALL" >&2
+- preprocessor="$preprocessor -P"
+- fi
+-fi
+
+ PID=$$
+ ED1=sed1_${PID}.sed
+--
+2.25.1
+
diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py
index 5b80efe290..393eab54e0 100644
--- a/var/spack/repos/builtin/packages/ncurses/package.py
+++ b/var/spack/repos/builtin/packages/ncurses/package.py
@@ -41,6 +41,7 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage):
patch('patch_gcc_5.txt', when='@6.0%gcc@5.0:')
patch('sed_pgi.patch', when='@:6.0')
+ patch('nvhpc_fix_preprocessor_flag.patch', when='@6.0:%nvhpc')
@classmethod
def determine_version(cls, exe):