[MacPorts] #55051: py-matplotlib: pre-C99 compatibility patch

MacPorts noreply at macports.org
Tue Oct 17 18:35:43 UTC 2017


#55051: py-matplotlib: pre-C99 compatibility patch
----------------------------+----------------------
  Reporter:  ccorn          |      Owner:  sean@…
      Type:  defect         |     Status:  assigned
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:
Resolution:                 |   Keywords:  haspatch
      Port:  py-matplotlib  |
----------------------------+----------------------

Comment (by ccorn):

 Replying to [comment:4 udbraumann]:
 > Your proposed patch looks likes this and might be not valid:

 It is valid; the previous version applied with fuzz 1, the new version
 applies cleanly.

 Replying to [comment:5 udbraumann]:
 > Instead of patching the code I propose to add the `-std=c99` switch to
 the C-compiler calls.

 I agree, but `configure.cflags-append` does not do the trick.
 The following alternative works, maybe you find something more elegant:
 {{{
 diff --git a/python/py-matplotlib/Portfile b/python/py-matplotlib/Portfile
 index 026846a53c..315073ebb8 100644
 --- a/python/py-matplotlib/Portfile
 +++ b/python/py-matplotlib/Portfile
 @@ -68,6 +68,9 @@ if {${name} ne ${subport}} {
      # build fails with gcc-4.0 on Leopard, use gcc-4.2 (#37069)
      compiler.blacklist gcc-4.0

 +    # Using some C99 constructs
 +    build.cmd CFLAGS=\"\$CFLAGS -std=c99\" && ${build.cmd}
 +
      post-destroot {
          if {${name} ne ${subport}} {
              xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
 \
 }}}
 The downside of this approach is that it generates C++ warnings:
 {{{
 cc1plus: warning: command line option "-std=c99" is valid for C/ObjC but
 not for C++
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/55051#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list