diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2020-12-28 08:43:37 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-28 08:43:37 -0600 |
commit | 808f55fa1fd8d858b6a7d32774c835efb8775a94 (patch) | |
tree | 852e9952a3db3f53293ef39a86374bb12d6df355 /var/spack/repos/builtin | |
parent | 7f997f82c28c6ec04b20e7a24254ad074a64041a (diff) | |
download | spack-808f55fa1fd8d858b6a7d32774c835efb8775a94.tar.gz spack-808f55fa1fd8d858b6a7d32774c835efb8775a94.tar.bz2 spack-808f55fa1fd8d858b6a7d32774c835efb8775a94.tar.xz spack-808f55fa1fd8d858b6a7d32774c835efb8775a94.zip |
minizip: fix build with Apple Clang 12 (#20554)
Diffstat (limited to 'var/spack/repos/builtin')
-rw-r--r-- | var/spack/repos/builtin/packages/minizip/implicit.patch | 10 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/minizip/package.py | 7 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/minizip/static.patch | 26 |
3 files changed, 43 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/minizip/implicit.patch b/var/spack/repos/builtin/packages/minizip/implicit.patch new file mode 100644 index 0000000000..86df7d46f0 --- /dev/null +++ b/var/spack/repos/builtin/packages/minizip/implicit.patch @@ -0,0 +1,10 @@ +--- a/contrib/minizip/miniunz.c 2010-07-18 11:04:24.000000000 -0500 ++++ b/contrib/minizip/miniunz.c 2020-12-25 21:39:19.000000000 -0600 +@@ -45,6 +45,7 @@ + #include <time.h> + #include <errno.h> + #include <fcntl.h> ++#include <sys/stat.h> + + #ifdef _WIN32 + # include <direct.h> diff --git a/var/spack/repos/builtin/packages/minizip/package.py b/var/spack/repos/builtin/packages/minizip/package.py index 0bf524da48..ffe5fc139f 100644 --- a/var/spack/repos/builtin/packages/minizip/package.py +++ b/var/spack/repos/builtin/packages/minizip/package.py @@ -22,6 +22,13 @@ class Minizip(AutotoolsPackage): depends_on('m4', type='build') depends_on('zlib') + # error: implicit declaration of function 'mkdir' is invalid in C99 + patch('implicit.patch', when='%apple-clang@12:') + + # statically link to libz.a + # https://github.com/Homebrew/homebrew-core/blob/master/Formula/minizip.rb + patch('static.patch') + # build minizip and miniunz @run_before('autoreconf') def build_minizip_binary(self): diff --git a/var/spack/repos/builtin/packages/minizip/static.patch b/var/spack/repos/builtin/packages/minizip/static.patch new file mode 100644 index 0000000000..3030a08e64 --- /dev/null +++ b/var/spack/repos/builtin/packages/minizip/static.patch @@ -0,0 +1,26 @@ +--- a/contrib/minizip/Makefile.am 2012-03-26 22:17:41.000000000 -0500 ++++ b/contrib/minizip/Makefile.am 2020-12-26 12:48:31.000000000 -0600 +@@ -8,7 +8,7 @@ + zlib_top_builddir = $(top_builddir)/../.. + + AM_CPPFLAGS = -I$(zlib_top_srcdir) +-AM_LDFLAGS = -L$(zlib_top_builddir) ++AM_LDFLAGS = $(zlib_top_builddir)/libz.a + + if WIN32 + iowin32_src = iowin32.c +@@ -22,7 +22,7 @@ + zip.c \ + ${iowin32_src} + +-libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz ++libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 + + minizip_includedir = $(includedir)/minizip + minizip_include_HEADERS = \ +@@ -42,4 +42,4 @@ + miniunzip_LDADD = libminizip.la + + minizip_SOURCES = minizip.c +-minizip_LDADD = libminizip.la -lz ++minizip_LDADD = libminizip.la |