Skip to content
Snippets Groups Projects
Commit c6a0b074 authored by Fabian.Jakub's avatar Fabian.Jakub
Browse files

add copy of gettext to local spack_repo to remove the newest version because...

add copy of gettext to local spack_repo to remove the newest version because it leads to build bug when calling msgfmt
parent 28038351
No related branches found
No related tags found
1 merge request!4Switching to the advanced configuration method and fixing spack build.
--- a/gettext-runtime/gnulib-lib/xalloc-oversized.h 2020-08-21 07:51:29.459375578 -0700
+++ b/gettext-runtime/gnulib-lib/xalloc-oversized.h 2020-08-21 07:53:18.571795663 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/gettext-runtime/gnulib-lib/intprops.h 2020-08-21 07:51:20.668341900 -0700
+++ b/gettext-runtime/gnulib-lib/intprops.h 2020-08-21 07:52:43.906661856 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-tools/gnulib-lib/xalloc-oversized.h 2020-08-21 10:19:23.875281647 -0700
+++ b/gettext-tools/gnulib-lib/xalloc-oversized.h 2020-08-21 10:20:40.650583499 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/gettext-tools/gnulib-lib/intprops.h 2020-08-21 10:18:38.650103825 -0700
+++ b/gettext-tools/gnulib-lib/intprops.h 2020-08-21 10:19:12.379236445 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-tools/libgrep/intprops.h 2020-08-21 10:31:00.726022663 -0700
+++ b/gettext-tools/libgrep/intprops.h 2020-08-21 10:31:29.946137693 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-tools/libgettextpo/xalloc-oversized.h 2020-08-21 11:19:50.065564273 -0700
+++ b/gettext-tools/libgettextpo/xalloc-oversized.h 2020-08-21 11:21:14.732898185 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/gettext-tools/libgettextpo/intprops.h 2020-08-21 11:19:58.703598336 -0700
+++ b/gettext-tools/libgettextpo/intprops.h 2020-08-21 11:20:37.612751786 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/libtextstyle/lib/xalloc-oversized.h 2020-08-21 11:30:13.488022919 -0700
+++ b/libtextstyle/lib/xalloc-oversized.h 2020-08-21 11:31:26.561311097 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/libtextstyle/lib/intprops.h 2020-08-21 11:30:24.283065492 -0700
+++ b/libtextstyle/lib/intprops.h 2020-08-21 11:30:54.415184325 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-runtime/intl/Makefile.in 2020-08-21 08:39:59.102729081 -0700
+++ b/gettext-runtime/intl/Makefile.in 2020-08-21 08:40:07.425761760 -0700
@@ -1471,7 +1471,6 @@
OTHER_LDFLAGS = \
@LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \
-no-undefined \
- -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir)
--- a/gettext-tools/intl/Makefile.in 2020-08-21 07:57:18.357721212 -0700
+++ b/gettext-tools/intl/Makefile.in 2020-08-21 07:57:29.051762490 -0700
@@ -2296,7 +2296,6 @@
OTHER_LDFLAGS = \
@LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \
-no-undefined \
- -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir)
--- a/libtextstyle/lib/Makefile.in 2020-08-21 08:49:08.277982271 -0700
+++ b/libtextstyle/lib/Makefile.in 2020-08-21 08:49:19.675030561 -0700
@@ -1917,7 +1917,7 @@
libtextstyle_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(FABS_LIBM) \
$(ISNAND_LIBM) $(ISNANF_LIBM) $(ISNANL_LIBM) $(LOG10_LIBM) \
$(LTLIBICONV) $(LTLIBINTL) $(POW_LIBM) $(am__append_8) \
- -no-undefined -export-symbols libtextstyle.sym -version-info \
+ -no-undefined -version-info \
$(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) -rpath $(libdir)
# Use this preprocessor expression to decide whether #include_next works.
--- a/gettext-tools/libgrep/regex_internal.h 2020-08-21 09:14:20.039942370 -0700
+++ b/gettext-tools/libgrep/regex_internal.h 2020-08-21 10:06:57.840331452 -0700
@@ -35,6 +35,14 @@
#include <intprops.h>
#include <verify.h>
+#ifndef __LONG_WIDTH__
+#if LONG_WIDTH
+#define __LONG_WIDTH__ LONG_WIDTH
+#else
+#define __LONG_WIDTH__ __WORDSIZE
+#endif
+#endif
+
#if defined DEBUG && DEBUG != 0
# include <assert.h>
# define DEBUG_ASSERT(x) assert (x)
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
from spack.package import *
class Gettext(AutotoolsPackage, GNUMirrorPackage):
"""GNU internationalization (i18n) and localization (l10n) library."""
homepage = "https://www.gnu.org/software/gettext/"
gnu_mirror_path = "gettext/gettext-0.20.1.tar.xz"
maintainers("michaelkuhn")
executables = [r"^gettext$"]
# buggy install when calling msgfmt version("0.21.1", sha256="50dbc8f39797950aa2c98e939947c527e5ac9ebd2c1b99dd7b06ba33a6767ae6")
# buggy install when calling msgfmt version("0.21", sha256="d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192")
version("0.20.2", sha256="b22b818e644c37f6e3d1643a1943c32c3a9bff726d601e53047d2682019ceaba")
version("0.20.1", sha256="53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800")
version("0.19.8.1", sha256="105556dbc5c3fbbc2aa0edb46d22d055748b6f5c7cd7a8d99f8e7eb84e938be4")
version("0.19.7", sha256="378fa86a091cec3acdece3c961bb8d8c0689906287809a8daa79dc0c6398d934")
# Recommended variants
variant("curses", default=True, description="Use libncurses")
variant("libxml2", default=True, description="Use libxml2")
variant("git", default=True, description="Enable git support")
variant("tar", default=True, description="Enable tar support")
variant("bzip2", default=True, description="Enable bzip2 support")
variant("xz", default=True, description="Enable xz support")
# Optional variants
variant("libunistring", default=False, description="Use libunistring")
depends_on("iconv")
# Recommended dependencies
depends_on("ncurses", when="+curses")
depends_on("libxml2", when="+libxml2")
# Java runtime and compiler (e.g. GNU gcj or kaffe)
# C# runtime and compiler (e.g. pnet or mono)
depends_on("tar", when="+tar")
# depends_on('gzip', when='+gzip')
depends_on("bzip2", when="+bzip2")
depends_on("xz", when="+xz", type=("build", "link", "run"))
# Optional dependencies
# depends_on('glib') # circular dependency?
# depends_on('libcroco@0.6.1:')
depends_on("libunistring", when="+libunistring")
# depends_on('cvs')
patch("test-verify-parallel-make-check.patch", when="@:0.19.8.1")
patch("nvhpc-builtin.patch", when="@:0.21.0 %nvhpc")
patch("nvhpc-export-symbols.patch", when="%nvhpc")
patch("nvhpc-long-width.patch", when="%nvhpc")
# Apply this only where we know that the system libc is glibc, be very careful:
@when("@:0.21.0 target=ppc64le:")
def patch(self):
for fn in ("gettext-tools/gnulib-lib/cdefs.h", "gettext-tools/libgrep/cdefs.h"):
with open(fn, "w") as f:
f.write("#include <sys/cdefs.h>\n")
@classmethod
def determine_version(cls, exe):
gettext = Executable(exe)
output = gettext("--version", output=str, error=str)
match = re.match(r"gettext(?: \(.+\)) ([\d.]+)", output)
return match.group(1) if match else None
def configure_args(self):
spec = self.spec
config_args = [
"--disable-java",
"--disable-csharp",
"--with-libiconv-prefix={0}".format(spec["iconv"].prefix),
"--with-included-glib",
"--with-included-gettext",
"--with-included-libcroco",
"--without-emacs",
"--with-lispdir=%s/emacs/site-lisp/gettext" % self.prefix.share,
"--without-cvs",
]
if "+curses" in spec:
config_args.append("--with-ncurses-prefix={0}".format(spec["ncurses"].prefix))
else:
config_args.append("--disable-curses")
if "+libxml2" in spec:
config_args.append("--with-libxml2-prefix={0}".format(spec["libxml2"].prefix))
else:
config_args.append("--with-included-libxml")
if "+bzip2" not in spec:
config_args.append("--without-bzip2")
if "+xz" not in spec:
config_args.append("--without-xz")
if "+libunistring" in spec:
config_args.append(
"--with-libunistring-prefix={0}".format(spec["libunistring"].prefix)
)
else:
config_args.append("--with-included-libunistring")
return config_args
@property
def libs(self):
return find_libraries(
["libasprintf", "libgettextlib", "libgettextpo", "libgettextsrc", "libintl"],
root=self.prefix,
recursive=True,
)
2017-04-20 Bruno Haible <bruno@clisp.org>
verify tests: Fix spurious failure with parallel make.
* tests/test-verify.sh: Build test-verify-try.o, not test-verify.o.
* tests/test-verify-try.c: New file.
Reported by Adam James Stewart <ajstewart@anl.gov>.
diff --git a/gettext-tools/gnulib-tests/test-verify.sh b/gettext-tools/gnulib-tests/test-verify.sh
index 3e76761..1e75d55 100755
--- a/gettext-tools/gnulib-tests/test-verify.sh
+++ b/gettext-tools/gnulib-tests/test-verify.sh
@@ -7,8 +7,9 @@ unset MALLOC_PERTURB_
# Rather than figure out how to invoke the compiler with the right
# include path ourselves, we let make do it:
-(cd "$initial_cwd_" && rm -f test-verify.o \
- && $MAKE test-verify.o >/dev/null 2>&1) \
+(cd "$initial_cwd_" \
+ && rm -f test-verify-try.o \
+ && $MAKE test-verify-try.o >/dev/null 2>&1) \
|| skip_ "cannot compile error-free"
# Now, prove that we encounter all expected compilation failures:
@@ -16,8 +17,8 @@ unset MALLOC_PERTURB_
: >err
for i in 1 2 3 4 5; do
(cd "$initial_cwd_"
- rm -f test-verify.o
- $MAKE CFLAGS=-DEXP_FAIL=$i test-verify.o) >>out 2>>err \
+ rm -f test-verify-try.o
+ $MAKE CFLAGS=-DEXP_FAIL=$i test-verify-try.o) >>out 2>>err \
&& { warn_ "compiler didn't detect verification failure $i"; fail=1; }
done
diff --git a/gettext-tools/gnulib-tests/test-verify-try.c b/gettext-tools/gnulib-tests/test-verify-try.c
new file mode 100644
index 0000000..362fb01
--- /dev/null
+++ b/tests/test-verify-try.c
@@ -0,0 +1,21 @@
+/* Test the "verify" module.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This is a separate source file, so that the execution of test-verify.sh
+ does not interfere with the building of the 'test-verify' program. */
+
+#include "test-verify.c"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment