[108374] trunk/dports/lang/dragonegg-3.0

jeremyhu at macports.org jeremyhu at macports.org
Sun Jul 21 14:36:51 PDT 2013


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

Modified Paths:
--------------
    trunk/dports/lang/dragonegg-3.0/Portfile
    trunk/dports/lang/dragonegg-3.0/files/dragonegg-gcc
    trunk/dports/lang/dragonegg-3.0/files/revision.patch

Added Paths:
-----------
    trunk/dports/lang/dragonegg-3.0/files/dragonegg-select
    trunk/dports/lang/dragonegg-3.0/files/missing-includes.patch

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

Modified: trunk/dports/lang/dragonegg-3.0/Portfile
===================================================================
--- trunk/dports/lang/dragonegg-3.0/Portfile	2013-07-21 21:25:04 UTC (rev 108373)
+++ trunk/dports/lang/dragonegg-3.0/Portfile	2013-07-21 21:36:51 UTC (rev 108374)
@@ -5,29 +5,61 @@
 PortGroup select        1.0
 
 set llvm_version        3.0
+set llvm_version_no_dot 30
 name                    dragonegg-${llvm_version}
-set gcc_version         46
-set gcc_version_dot     4.6
-revision                7
+
+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
+}
+
 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                8
+
+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            146339
@@ -62,11 +94,8 @@
 
 use_configure no
 
-patchfiles revision.patch
-patch.pre_args -p1
-
 select.group    gcc
-select.file     ${filespath}/dragonegg-${llvm_version}-gcc46
+select.file     ${worksrcpath}/dragonegg-${llvm_version}-gcc-${gcc_version}
 
 build.target
 
@@ -88,6 +117,14 @@
     }
 }
 
+patchfiles revision.patch missing-includes.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 +133,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.0/files/dragonegg-3.0-gcc46
===================================================================
--- trunk/dports/lang/dragonegg-3.0/files/dragonegg-3.0-gcc46	2013-07-21 21:25:04 UTC (rev 108373)
+++ trunk/dports/lang/dragonegg-3.0/files/dragonegg-3.0-gcc46	2013-07-21 21:36:51 UTC (rev 108374)
@@ -1,7 +0,0 @@
-bin/dragonegg-3.0-gcc
-bin/dragonegg-3.0-cpp
-bin/dragonegg-3.0-c++
-bin/dragonegg-3.0-g++
-bin/dragonegg-3.0-gcj
-bin/dragonegg-3.0-gcov
-bin/dragonegg-3.0-gfortran

Modified: trunk/dports/lang/dragonegg-3.0/files/dragonegg-gcc
===================================================================
--- trunk/dports/lang/dragonegg-3.0/files/dragonegg-gcc	2013-07-21 21:25:04 UTC (rev 108373)
+++ trunk/dports/lang/dragonegg-3.0/files/dragonegg-gcc	2013-07-21 21:36:51 UTC (rev 108374)
@@ -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.0/files/dragonegg-select
===================================================================
--- trunk/dports/lang/dragonegg-3.0/files/dragonegg-select	                        (rev 0)
+++ trunk/dports/lang/dragonegg-3.0/files/dragonegg-select	2013-07-21 21:36:51 UTC (rev 108374)
@@ -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

Added: trunk/dports/lang/dragonegg-3.0/files/missing-includes.patch
===================================================================
--- trunk/dports/lang/dragonegg-3.0/files/missing-includes.patch	                        (rev 0)
+++ trunk/dports/lang/dragonegg-3.0/files/missing-includes.patch	2013-07-21 21:36:51 UTC (rev 108374)
@@ -0,0 +1,10 @@
+--- src/Cache.cpp.orig	2012-06-24 08:10:38.000000000 -0700
++++ src/Cache.cpp	2013-01-06 01:46:27.000000000 -0800
+@@ -30,6 +30,7 @@
+ #include "llvm/Support/ValueHandle.h"
+ 
+ // System headers
++#include <new>
+ #include <cassert>
+ #include <gmp.h>
+ 

Modified: trunk/dports/lang/dragonegg-3.0/files/revision.patch
===================================================================
--- trunk/dports/lang/dragonegg-3.0/files/revision.patch	2013-07-21 21:25:04 UTC (rev 108373)
+++ trunk/dports/lang/dragonegg-3.0/files/revision.patch	2013-07-21 21:36:51 UTC (rev 108374)
@@ -1,6 +1,6 @@
 diff -Naurp dragonegg-3.0.src.orig/Makefile dragonegg-3.0.src/Makefile
---- dragonegg-3.0.src.orig/Makefile	2011-10-20 13:29:47.000000000 -0700
-+++ dragonegg-3.0.src/Makefile	2011-12-17 01:16:59.000000000 -0800
+--- Makefile	2011-10-20 13:29:47.000000000 -0700
++++ Makefile	2011-12-17 01:16:59.000000000 -0800
 @@ -38,7 +38,7 @@ GCC_MICRO=$(word 3, $(subst ., ,$(GCC_VE
  TARGET_TRIPLE:=$(shell $(GCC) -dumpmachine)
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130721/15791f29/attachment.html>


More information about the macports-changes mailing list