[108373] trunk/dports/lang/dragonegg-3.1

jeremyhu at macports.org jeremyhu at macports.org
Sun Jul 21 14:25:04 PDT 2013


Revision: 108373
          https://trac.macports.org/changeset/108373
Author:   jeremyhu at macports.org
Date:     2013-07-21 14:25:04 -0700 (Sun, 21 Jul 2013)
Log Message:
-----------
dragonegg-3.1: Support multiple gcc versions using subports

Modified Paths:
--------------
    trunk/dports/lang/dragonegg-3.1/Portfile
    trunk/dports/lang/dragonegg-3.1/files/dragonegg-gcc

Added Paths:
-----------
    trunk/dports/lang/dragonegg-3.1/files/dragonegg-select

Removed Paths:
-------------
    trunk/dports/lang/dragonegg-3.1/files/dragonegg-3.1-gcc46

Modified: trunk/dports/lang/dragonegg-3.1/Portfile
===================================================================
--- trunk/dports/lang/dragonegg-3.1/Portfile	2013-07-21 21:11:25 UTC (rev 108372)
+++ trunk/dports/lang/dragonegg-3.1/Portfile	2013-07-21 21:25:04 UTC (rev 108373)
@@ -5,29 +5,66 @@
 PortGroup select        1.0
 
 set llvm_version        3.1
+set llvm_version_no_dot 31
 name                    dragonegg-${llvm_version}
-set gcc_version         46
-set gcc_version_dot     4.6
-revision                4
+
+subport                 ${name}-gcc-4.5 {
+    revision            0
+    set gcc_version     4.5
+    set gcc_version_no_dot 45
+}
+subport                 ${name}-gcc-4.6 {
+    revision            0
+    set gcc_version     4.6
+    set gcc_version_no_dot 46
+}
+subport                 ${name}-gcc-4.7 {
+    revision            0
+    set gcc_version     4.7
+    set gcc_version_no_dot 47
+}
+
 dist_subdir             llvm
 categories              lang
 platforms               darwin
 maintainers             jeremyhu
 license                 GPL-2
 
-description             DragonEgg is a LLVM plug-in for GCC ${gcc_version_dot}
+description             DragonEgg is a LLVM plug-in for GCC
 long_description        DragonEgg replaces GCC optimizers and code generators \
                         by the LLVM optimizing infrastructure. It supersedes \
                         llvm-gcc.
 
 homepage                http://dragonegg.llvm.org/
 
-depends_lib             port:llvm-${llvm_version} port:gcc${gcc_version}
+if {${subport} == ${name}} {
+version                 ${llvm_version}
+epoch                   1
+revision                5
+
+distfiles
+
+set gcc_version         4.6
+
+depends_run             port:${name}-gcc-${gcc_version}
+
+use_configure           no
+build                   {}
+destroot {
+    # For base
+    foreach binary {gcc cpp c++ g++ gcj gcov gfortran} {
+        ln -s dragonegg-${llvm_version}-${binary}-mp-${gcc_version} ${destroot}${prefix}/bin/dragonegg-${llvm_version}-${binary}
+    }
+}
+
+} else {
+
+depends_lib             port:llvm-${llvm_version} port:gcc${gcc_version_no_dot}
 depends_run             port:gcc_select
 
 # gcc needs to match our arch, not the other way around
 # We build +universal just fine in order to support whatever arch gcc is
-depends_skip_archcheck-append gcc${gcc_version}
+depends_skip_archcheck-append gcc${gcc_version_no_dot}
 
 #fetch.type              svn
 #svn.revision            155781
@@ -41,7 +78,7 @@
 epoch                   1
 master_sites            http://llvm.org/releases/${version}/
 extract.suffix          .tar.gz
-distname                 dragonegg-${version}.src
+distname                dragonegg-${version}.src
 checksums           sha1    98e865f16c76bddb3f6969c733042677e306d63c \
                     rmd160  303e98f4d33f87fe018505a03ae1265d3c5a080c \
                     sha256  a11d1379fab772bc4a747e6f5c6a27acf5fe03f27b5a152af67f63d5fbc4a876
@@ -64,7 +101,7 @@
 use_configure no
 
 select.group    gcc
-select.file     ${filespath}/dragonegg-${llvm_version}-gcc${gcc_version}
+select.file     ${worksrcpath}/dragonegg-${llvm_version}-gcc-${gcc_version}
 
 build.target
 
@@ -88,6 +125,12 @@
 
 patchfiles missing-includes.patch cstring.patch
 
+post-extract {
+    file copy ${filespath}/dragonegg-select ${select.file}
+    reinplace "s:LLVM_VERSION:${llvm_version}:" ${select.file}
+    reinplace "s:GCC_VERSION:${gcc_version}:" ${select.file}
+}
+
 variant universal {
     post-patch {
         reinplace "/-MD -MP/d" ${worksrcpath}/Makefile
@@ -96,25 +139,24 @@
 
 build.env-append \
     LLVM_CONFIG=${prefix}/bin/llvm-config-mp-${llvm_version} \
-    GCC=${prefix}/bin/gcc-mp-${gcc_version_dot} \
+    GCC=${prefix}/bin/gcc-mp-${gcc_version} \
     CC="${configure.cc} ${configure.cppflags} [get_canonical_archflags cc]" \
     CXX="${configure.cxx} ${configure.cppflags} [get_canonical_archflags cxx]"
 
 destroot {
     xinstall -m 755 -d ${destroot}${prefix}/libexec/dragonegg
-    xinstall -m 755 ${worksrcpath}/dragonegg.so ${destroot}${prefix}/libexec/dragonegg/llvm-${llvm_version}-gcc${gcc_version}.so
+    xinstall -m 755 ${worksrcpath}/dragonegg.so ${destroot}${prefix}/libexec/dragonegg/llvm${llvm_version_no_dot}gcc${gcc_version_no_dot}.so
 
-    xinstall -m 755 ${filespath}/dragonegg-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gcc
-    ln -s dragonegg-${llvm_version}-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-cpp
-    ln -s dragonegg-${llvm_version}-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-c++
-    ln -s dragonegg-${llvm_version}-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-g++
-    ln -s dragonegg-${llvm_version}-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gcj
-    ln -s dragonegg-${llvm_version}-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gcov
-    ln -s dragonegg-${llvm_version}-gcc ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gfortran
+    foreach binary {gcc cpp c++ g++ gcj gcov gfortran} {
+        set path ${destroot}${prefix}/bin/dragonegg-${llvm_version}-${binary}-mp-${gcc_version}
+        xinstall -m 755 ${filespath}/dragonegg-gcc ${path}
+        reinplace "s:PLUGIN:${prefix}/libexec/dragonegg/llvm${llvm_version_no_dot}gcc${gcc_version_no_dot}.so:" ${path}
+        reinplace "s:PREFIX:${prefix}:" ${path}
+        reinplace "s:GCC_VERSION:${gcc_version}:" ${path}
+        reinplace "s:BINARY:${binary}:" ${path}
+    }
+}
 
-    reinplace "s:PLUGIN:${prefix}/libexec/dragonegg/llvm-${llvm_version}-gcc${gcc_version}.so:" ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gcc
-    reinplace "s:LLVM_VERSION:${llvm_version}:" ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gcc
-    reinplace "s:GCC_VERSION:${gcc_version_dot}:" ${destroot}${prefix}/bin/dragonegg-${llvm_version}-gcc
 }
 
 livecheck.type          none

Deleted: trunk/dports/lang/dragonegg-3.1/files/dragonegg-3.1-gcc46
===================================================================
--- trunk/dports/lang/dragonegg-3.1/files/dragonegg-3.1-gcc46	2013-07-21 21:11:25 UTC (rev 108372)
+++ trunk/dports/lang/dragonegg-3.1/files/dragonegg-3.1-gcc46	2013-07-21 21:25:04 UTC (rev 108373)
@@ -1,7 +0,0 @@
-bin/dragonegg-3.1-gcc
-bin/dragonegg-3.1-cpp
-bin/dragonegg-3.1-c++
-bin/dragonegg-3.1-g++
-bin/dragonegg-3.1-gcj
-bin/dragonegg-3.1-gcov
-bin/dragonegg-3.1-gfortran

Modified: trunk/dports/lang/dragonegg-3.1/files/dragonegg-gcc
===================================================================
--- trunk/dports/lang/dragonegg-3.1/files/dragonegg-gcc	2013-07-21 21:11:25 UTC (rev 108372)
+++ trunk/dports/lang/dragonegg-3.1/files/dragonegg-gcc	2013-07-21 21:25:04 UTC (rev 108373)
@@ -1,5 +1,3 @@
 #!/bin/bash
 
-CMD=${0/dragonegg-LLVM_VERSION-/}
-
-exec ${CMD}-mp-GCC_VERSION -fplugin=PLUGIN "${@}"
+exec PREFIX/bin/BINARY-mp-GCC_VERSION -fplugin=PLUGIN "${@}"

Added: trunk/dports/lang/dragonegg-3.1/files/dragonegg-select
===================================================================
--- trunk/dports/lang/dragonegg-3.1/files/dragonegg-select	                        (rev 0)
+++ trunk/dports/lang/dragonegg-3.1/files/dragonegg-select	2013-07-21 21:25:04 UTC (rev 108373)
@@ -0,0 +1,7 @@
+bin/dragonegg-LLVM_VERSION-gcc-mp-GCC_VERSION
+bin/dragonegg-LLVM_VERSION-cpp-mp-GCC_VERSION
+bin/dragonegg-LLVM_VERSION-c++-mp-GCC_VERSION
+bin/dragonegg-LLVM_VERSION-g++-mp-GCC_VERSION
+bin/dragonegg-LLVM_VERSION-gcj-mp-GCC_VERSION
+bin/dragonegg-LLVM_VERSION-gcov-mp-GCC_VERSION
+bin/dragonegg-LLVM_VERSION-gfortran-mp-GCC_VERSION
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130721/f22e505f/attachment.html>


More information about the macports-changes mailing list