From a05a6456d5aa69fdc369b99134227a4958b9832e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 25 Aug 2016 11:00:58 -0400 Subject: glib: build on macos --- .../packages/glib/no-Werror=format-security.patch | 16 ++++++++++++++++ var/spack/repos/builtin/packages/glib/package.py | 19 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch b/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch new file mode 100644 index 0000000000..cfcfe424be --- /dev/null +++ b/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch @@ -0,0 +1,16 @@ +--- a/configure.ac 2016-08-16 11:57:34.000000000 -0400 ++++ b/configure.ac 2016-08-16 11:57:36.000000000 -0400 +@@ -3357,11 +3357,11 @@ + enable_compile_warnings=yes) + AS_IF([test "x$enable_compile_warnings" = xyes], [ + CC_CHECK_FLAGS_APPEND([GLIB_WARN_CFLAGS], [CFLAGS], [\ + -Wall -Wstrict-prototypes -Werror=declaration-after-statement \ + -Werror=missing-prototypes -Werror=implicit-function-declaration \ +- -Werror=pointer-arith -Werror=init-self -Werror=format-security \ +- -Werror=format=2 -Werror=missing-include-dirs]) ++ -Werror=pointer-arith -Werror=init-self \ ++ -Werror=missing-include-dirs]) + ]) + AC_SUBST(GLIB_WARN_CFLAGS) + + # diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py index 94ef95e7ab..3e687ccd95 100644 --- a/var/spack/repos/builtin/packages/glib/package.py +++ b/var/spack/repos/builtin/packages/glib/package.py @@ -23,6 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import os class Glib(Package): @@ -38,14 +39,20 @@ class Glib(Package): version('2.48.1', '67bd3b75c9f6d5587b457dc01cdcd5bb') version('2.42.1', '89c4119e50e767d3532158605ee9121a') + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') + depends_on('pkg-config', type='build') depends_on('libffi') depends_on('zlib') - depends_on('pkg-config', type='build') depends_on('gettext') depends_on('pcre+utf', when='@2.48:') # The following patch is needed for gcc-6.1 patch('g_date_strftime.patch', when='@2.42.1') + # Clang doesn't seem to acknowledge the pragma lines to disable the -Werror + # around a legitimate usage. + patch('no-Werror=format-security.patch') def url_for_version(self, version): """Handle glib's version-based custom URLs.""" @@ -53,6 +60,16 @@ class Glib(Package): return url + '/%s/glib-%s.tar.xz' % (version.up_to(2), version) def install(self, spec, prefix): + autoreconf = which("autoreconf") + autoreconf("--install", "--verbose", "--force", + "-I", "config", + "-I", os.path.join(spec['pkg-config'].prefix, + "share", "aclocal"), + "-I", os.path.join(spec['automake'].prefix, + "share", "aclocal"), + "-I", os.path.join(spec['libtool'].prefix, + "share", "aclocal"), + ) configure("--prefix=%s" % prefix) make() make("install", parallel=False) -- cgit v1.2.3-60-g2f50