[141379] trunk/dports/math/R/Portfile

dstrubbe at macports.org dstrubbe at macports.org
Sat Dec 12 01:16:59 PST 2015


Revision: 141379
          https://trac.macports.org/changeset/141379
Author:   dstrubbe at macports.org
Date:     2015-10-16 12:18:06 -0700 (Fri, 16 Oct 2015)
Log Message:
-----------
R: Use compilers PortGroup to manage Fortran variants (which adds support for gcc5, gcc6, g95, and dragonegg, and sets gcc5 as default -- passes test phase on my machine). Comments on necessity of clang for the C compiler (at least on Yosemite). Two small fixes: comment in configure.args was ending up in the middle of the configure line since more args are appended to this line, and therefore were probably ignored since they fall after the '#'. The require_active_variants line for tk should not use the path: dependency since tk is set as a port: dependency. Closes ticket #49316.

Modified Paths:
--------------
    trunk/dports/math/R/Portfile

Modified: trunk/dports/math/R/Portfile
===================================================================
--- trunk/dports/math/R/Portfile	2015-10-16 18:13:10 UTC (rev 141378)
+++ trunk/dports/math/R/Portfile	2015-10-16 19:18:06 UTC (rev 141379)
@@ -2,6 +2,7 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup compilers 1.0
 PortGroup active_variants 1.1
 
 name                        R
@@ -35,6 +36,9 @@
 checksums                   rmd160  0e8bf2ecca48f0f2433f6b07f422b7730a76fbb4 \
                             sha256  9c9152e74134b68b0f3a1c7083764adc1cb56fd8336bec003fd0ca550cd2461d
 
+compilers.choose            fc f77
+compilers.setup             require_fortran
+
 depends_build               port:pkgconfig
 
 depends_lib                 port:readline \
@@ -50,6 +54,19 @@
     reinplace "s|R_HOME|\"${resources}\"|" "${worksrcpath}/src/unix/Rscript.c"
 }
 
+# Note: gcc cannot be used for the C compiler. It will give:
+#:info:build In file included from /usr/include/dispatch/dispatch.h:51:0,
+#:info:build                  from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
+#:info:build                  from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
+#:info:build                  from langprefs.c:30:
+#:info:build /usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token
+#:info:build  typedef void (^dispatch_block_t)(void);
+#:info:build                ^
+#:info:build /usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t'
+#:info:build    dispatch_block_t notification_block);
+#:info:build    ^
+# However, use of compiler.blacklist *gcc* would remove the GCC Fortran compilers too.
+
 configure.pre_args          --prefix=${frameworks_dir}
 
 configure.args              --enable-memory-profiling \
@@ -62,7 +79,8 @@
                             --without-recommended-packages \
                             --without-x \
                             --with-included-gettext \
-                            --without-system-xz #bug introduced in R-3.2.0, doesn't link to system copy, put port:xz back too
+                            --without-system-xz
+#bug introduced in R-3.2.0, doesn't link to system copy, put port:xz back too
 
 if {${os.major} < 13} {
     configure.args-append --disable-openmp
@@ -104,50 +122,6 @@
     configure.optflags-append -g
 }
 
-set gcc_versions {4.5 4.6 4.7 4.8 4.9}
-set default_fortran_variant +gfortran48
-
-foreach ver ${gcc_versions} {
-    set ver_no_dot [join [split ${ver} "."] ""]
-
-    set variant_line {variant gfortran${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}"}
-
-    foreach over ${gcc_versions} {
-        if {${ver} == ${over}} {
-            continue
-        }
-
-        set over_no_dot [join [split ${over} "."] ""]
-        append variant_line " conflicts gfortran${over_no_dot}"
-    }
-    append variant_line { {}}
-
-    eval $variant_line
-
-    if {[variant_isset gfortran${ver_no_dot}]} {
-        if {${default_fortran_variant} != "+gfortran${ver_no_dot}"} {
-            set default_fortran_variant ""
-        }
-    }
-}
-
-if {${default_fortran_variant} != ""} {
-    default_variants-append "${default_fortran_variant}"
-}
-
-foreach ver ${gcc_versions} {
-    set ver_no_dot [join [split ${ver} "."] ""]
-
-    if {[variant_isset gfortran${ver_no_dot}]} {
-        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
-        depends_build-append port:gcc${ver_no_dot}
-
-        configure.fc  ${prefix}/bin/gfortran-mp-${ver}
-        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
-        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
-    }
-}
-
 variant recommended description {install recommended R packages} {
     configure.args-delete   --without-recommended-packages
     configure.args-append   --with-recommended-packages
@@ -158,7 +132,7 @@
                             port:tk \
                             port:xorg-libXScrnSaver \
                             port:xorg-libXext
-    require_active_variants path:lib/pkgconfig/tk.pc:tk x11
+    require_active_variants tk x11
     configure.args-delete   --without-tcltk
     configure.args-append   --with-tcltk \
                             --with-tcl-config=${prefix}/lib/tclConfig.sh \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/52a43b78/attachment.html>


More information about the macports-changes mailing list