On Thu, Jan 10, 2013 at 8:53 PM, Ryan Schmidt <[email protected]> wrote:

> I'm looking through them but not really finding the example I was hoping for. 
> A lot of Jeremy Huddleston's ports do this:
>
> configure.compiler gcc-4.2
> if {![file exists ${configure.cc}]} {
>     depends_build-append port:apple-gcc42
>     depends_skip_archcheck-append apple-gcc42
>     configure.compiler apple-gcc-4.2
> }
>
> But my goal was to avoid explicitly setting the compiler and instead letting 
> MacPorts choose a suitable one. I can check my Tiger machine in a few hours 
> to see what would happen if you blacklisted gcc-4.0. I bet you'll have to 
> blacklist gcc-3.3 too; that's the other gcc version Tiger has. But I have a 
> feeling it won't automatically realize that using apple-gcc42 instead would 
> be a good idea.

How about something like the following:

--- a/python/py-matplotlib/Portfile
+++ b/python/py-matplotlib/Portfile
@@ -47,9 +47,15 @@ post-patch {
   reinplace "s|@@PYTHON_BRANCH@@|${prefix}|" ${worksrcpath}/setupext.py
 }

-# build fails with gcc-4.0 on Leopard, use gcc-4.2 (#37069)
+# build fails with gcc-4.0, use gcc-4.2 (#37069)
 if {${configure.compiler} == "gcc-4.0"} {
-   configure.compiler gcc-4.2
+  if {${os.major} = 8} {
+    depends_build-append port:apple-gcc42
+    depends_skip_archcheck-append apple-gcc42
+    configure.compiler apple-gcc-4.2
+  } else {
+    configure.compiler gcc-4.2
+  }
 }

 post-destroot {

I don't a machine running Tiger (or Leopard, or even Snow Leopard) so
can't test this... Any other suggestions are welcome.

Cheers

Adam
_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to