compilers PortGroup lacking dependencies for libgfortran

Mihai Moldovan ionic at macports.org
Thu Nov 27 20:53:29 PST 2014


Hi Sean,

The compilers PortGroup is currently only putting library dependencies on libgcc.

We hit a bug with octave today, where octave defaults to +gcc48, uses fortran.
but does only build-depend on gcc48.

That's fine when compiling from source (and not using port_cutleaves), but will
fail blatantly when installing from binary archives. In that case, libgfortran
will be missing the package broken.

I've crafted a patch to fix that, but I'm not quite sure it's really fixing the
issue.

As you have a deeper understanding of the PortGroup, could you please take a
look at it?

Thanks in advance!



Mihai
-------------- next part --------------
diff --git a/dports/_resources/port1.0/group/compilers-1.0.tcl b/dports/_resources/port1.0/group/compilers-1.0.tcl
index 875c949..901ec9b 100644
--- a/dports/_resources/port1.0/group/compilers-1.0.tcl
+++ b/dports/_resources/port1.0/group/compilers-1.0.tcl
@@ -220,30 +220,39 @@ proc compilers.setup_variants {args} {
 
                         # disable archflags
                         if {"[info command configure.${compiler}_archflags]" ne ""} {
                             configure.${compiler}_archflags
                             configure.ld_archflags
                         }
                     }]
                 }
             }
 
+            set fortran_used ![compilers.is_c_only]
+
             eval [subst {
                 variant ${variant} description \
                     {Build using the $cdb($variant,descrip) compiler} \
                     conflicts $c {
 
                     depends_build-append   $cdb($variant,depends)
                     depends_lib-append     $cdb($variant,dependsl)
                     depends_lib-delete     $cdb($variant,dependsd)
                     depends_skip_archcheck $cdb($variant,dependsa)
 
+                    # If also using fortran, we must register the compiler as
+                    # a build dependency due to fortran libraries needed
+                    # at run time.
+                    if {$c_only} {
+                        depends_lib-append $cdb($variant,depends)
+                    }
+
                     $comp
                 }
             }]
         }
     }
 }
 
 foreach variant ${compilers.gcc_variants} {
     # we need to check the default_variants so we can't use variant_isset
     if {[info exists variations($variant)] && $variations($variant) eq "+"} {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20141128/db455ef7/attachment.sig>


More information about the macports-dev mailing list