summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMartin Lang <67915889+lang-m@users.noreply.github.com>2024-02-22 11:23:59 +0100
committerGitHub <noreply@github.com>2024-02-22 03:23:59 -0700
commit3ebaf339153918c5801199e4bb583e1ab88ee651 (patch)
treee0f3e7da462876b56c4304ee0a3e47a7a3b9b024 /var
parente8d981b405406a16597332990673e2e7b5e24137 (diff)
downloadspack-3ebaf339153918c5801199e4bb583e1ab88ee651.tar.gz
spack-3ebaf339153918c5801199e4bb583e1ab88ee651.tar.bz2
spack-3ebaf339153918c5801199e4bb583e1ab88ee651.tar.xz
spack-3ebaf339153918c5801199e4bb583e1ab88ee651.zip
libgd: fix INT_MAX not defined (#42104)
Compiling version 2.2.4 fails (on a Debian system with only a minimum set of packages installed) with an error because `INT_MAX` is undeclared: ``` 263 gd_gd2.c: In function '_gd2GetHeader': >> 264 gd_gd2.c:212:54: error: 'INT_MAX' undeclared (first use in this function) 265 212 | if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) { 266 | ^~~~~~~ 267 gd_gd2.c:87:1: note: 'INT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'? ```
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/libgd/package.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/libgd/package.py b/var/spack/repos/builtin/packages/libgd/package.py
index e01c81d74c..aba8e8045d 100644
--- a/var/spack/repos/builtin/packages/libgd/package.py
+++ b/var/spack/repos/builtin/packages/libgd/package.py
@@ -39,6 +39,13 @@ class Libgd(AutotoolsPackage):
depends_on("fontconfig")
depends_on("libx11")
+ # add missing '#include <limits.h>' in gd_gd2.c, which uses the constant 'INT_MAX'
+ patch(
+ "https://github.com/libgd/libgd/commit/c9b601a658a79e6ea2aad29fbf60ca6e24ccef1e.patch?full_index=1",
+ sha256="1dc3a72491427acbae2cd0c6d3b08c0814ffa2f9fee91269b8b46429cabb773d",
+ when="@2.2.4",
+ )
+
def patch(self):
p = self.spec["jpeg"].libs.search_flags
filter_file(