[84644] trunk/dports

jmr at macports.org jmr at macports.org
Thu Sep 29 02:45:06 PDT 2011


Revision: 84644
          http://trac.macports.org/changeset/84644
Author:   jmr at macports.org
Date:     2011-09-29 02:45:03 -0700 (Thu, 29 Sep 2011)
Log Message:
-----------
unify swig and bindings (#30765)

Modified Paths:
--------------
    trunk/dports/devel/swig/Portfile

Removed Paths:
-------------
    trunk/dports/_resources/port1.0/group/swigbinding-1.0.tcl
    trunk/dports/devel/swig-allegro/
    trunk/dports/devel/swig-chicken/
    trunk/dports/devel/swig-clisp/
    trunk/dports/devel/swig-csharp/
    trunk/dports/devel/swig-gcj/
    trunk/dports/devel/swig-go/
    trunk/dports/devel/swig-guile/
    trunk/dports/devel/swig-java/
    trunk/dports/devel/swig-lua/
    trunk/dports/devel/swig-mzscheme/
    trunk/dports/devel/swig-ocaml/
    trunk/dports/devel/swig-octave/
    trunk/dports/devel/swig-perl/
    trunk/dports/devel/swig-php5/
    trunk/dports/devel/swig-pike/
    trunk/dports/devel/swig-python/
    trunk/dports/devel/swig-r/
    trunk/dports/devel/swig-ruby/
    trunk/dports/devel/swig-tcl/

Deleted: trunk/dports/_resources/port1.0/group/swigbinding-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/swigbinding-1.0.tcl	2011-09-29 09:18:01 UTC (rev 84643)
+++ trunk/dports/_resources/port1.0/group/swigbinding-1.0.tcl	2011-09-29 09:45:03 UTC (rev 84644)
@@ -1,90 +0,0 @@
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id$
-# portgroup for swig language bindings
-
-categories      devel lang
-homepage        http://www.swig.org/
-platforms       darwin
-master_sites    sourceforge:swig
-default distname        {swig-${version}}
-dist_subdir     swig
-
-depends_build	port:bison \
-                port:gsed
-
-depends_lib     port:swig
-
-supported_archs noarch
-
-# for use in post-destroot
-options         swig.lang
-
-proc swigbinding-setup {lang prettyname} {
-    name            swig-${lang}
-    description     $prettyname binding for swig
-    long_description    \
-        SWIG is a software development tool that connects programs written in C \
-        and C++ with a variety of high-level programming languages. This is the \
-        $prettyname binding.
-    
-    # we can't have each port just pass in its info for this stuff, since we
-    # have to turn all other bindings off as well as turning this one on
-    array set bindings { \
-        python      {port:python_select     python} \
-        perl        {path:bin/perl:perl5    perl5=${prefix}/bin/perl} \
-        gcj         {port:gcc44             "gcj=${prefix}/bin/gcj-mp-4.4 --with-gcjh=${prefix}/bin/gcjh-mp-4.4"} \
-        guile       {port:guile             guile} \
-        mzscheme    {port:mzscheme          mzscheme} \
-        ruby        {port:ruby              ruby} \
-        php5        {path:bin/php:php5      php} \
-        ocaml       {port:ocaml             ocaml} \
-        pike        {port:pike              pike} \
-        lua         {port:lua               lua} \
-        chicken     {port:chicken           chicken} \
-        allegro     {port:allegro           allegrocl} \
-        clisp       {port:clisp             clisp} \
-        r           {port:R                 r} \
-        tcl         {port:tcl               tcl} \
-        csharp      {port:mono              csharp} \
-        octave      {path:bin/octave:octave octave} \
-        java        {bin:java:kaffe         java} \
-        go          {port:go                go}
-    }
-
-    foreach binding [array names bindings] {
-        set arg      [lindex $bindings($binding) 1]
-        set arg_name [lindex [split ${arg} =] 0]
-        if {$binding == $lang} {
-            depends_lib-append      [lindex $bindings($lang) 0]
-            configure.args-append   --with-${arg}
-            destroot.args           lib-languages="${arg_name}"
-            swig.lang               ${arg_name}
-        } else {
-            configure.args-append   --without-${arg_name}
-        }
-    }
-    
-    post-destroot {
-        delete ${destroot}${prefix}/bin
-        delete ${destroot}${prefix}/share/man
-        foreach f [glob -directory ${destroot}${prefix}/share/swig/${version} *] {
-            if {[file tail $f] != ${swig.lang}} {
-                delete $f
-            }
-        }
-    }
-}
-
-post-patch {
-    # The configure script should use GNU sed
-    reinplace "s/\[\[:<:\]\]sed\[\[:>:\]\]/gsed/g" ${worksrcpath}/configure
-}
-
-build.target
-
-test.run            yes
-test.target         check
-
-livecheck.type      regex
-livecheck.url       http://www.swig.org/download.html
-livecheck.regex     {swig-(\d+(?:\.\d+)*)}

Modified: trunk/dports/devel/swig/Portfile
===================================================================
--- trunk/dports/devel/swig/Portfile	2011-09-29 09:18:01 UTC (rev 84643)
+++ trunk/dports/devel/swig/Portfile	2011-09-29 09:45:03 UTC (rev 84644)
@@ -5,9 +5,10 @@
 name		swig
 version		2.0.4
 
-# remember to update the binding ports at the same time as swig
-
 categories	devel
+# The swig tool itself is GPL, but code incorporated into dependents has a
+# permissive license. 
+license		{GPL-3+ Permissive}
 maintainers	kevin jwa
 
 description	Tool to wrap C/C++ libraries in high-level languages.
@@ -24,7 +25,7 @@
 
 homepage	http://www.swig.org/
 platforms	darwin
-master_sites	sourceforge
+master_sites	sourceforge:project/swig/swig/swig-${version}
 
 checksums           md5     4319c503ee3a13d2a53be9d828c3adc0 \
                     sha1    ace563563a8f6f367ba82236e5bea240adea0d94 \
@@ -33,44 +34,115 @@
 depends_build	port:bison \
     port:gsed
 
-depends_lib	port:pcre
-
 post-patch {
     # The configure script should use GNU sed
     reinplace "s/\[\[:<:\]\]sed\[\[:>:\]\]/gsed/g" ${worksrcpath}/configure
 }
 
-foreach lang {python perl5 gcj guile mzscheme ruby php ocaml pike lua chicken allegrocl clisp r tcl csharp octave java go} {
-    configure.args-append --without-${lang}
-}
-
 build.target
 
-set languages   [list typemaps]
-set docdir      ${prefix}/share/doc/${name}-${version}
-
 test.run        yes
 test.target     check
 
-pre-destroot {
-    # This must be evaluated after variants selection.
-    destroot.args   lib-languages="[join ${languages}]"
+array set bindings {
+    allegro     {port:allegro           allegrocl}
+    chicken     {port:chicken           chicken}
+    clisp       {port:clisp             clisp}
+    csharp      {port:mono              csharp}
+    gcj         {port:gcc44             "gcj=${prefix}/bin/gcj-mp-4.4 --with-gcjh=${prefix}/bin/gcjh-mp-4.4"}
+    go          {port:go                go}
+    guile       {port:guile             guile}
+    java        {bin:java:kaffe         java}
+    lua         {port:lua               lua}
+    mzscheme    {port:mzscheme          mzscheme}
+    ocaml       {port:ocaml             ocaml}
+    octave      {path:bin/octave:octave octave}
+    perl        {path:bin/perl:perl5    perl5=${prefix}/bin/perl}
+    php5        {path:bin/php:php5      php}
+    pike        {port:pike              pike}
+    python      {port:python_select     python}
+    r           {port:R                 r}
+    ruby        {port:ruby              ruby}
+    tcl         {port:tcl               tcl}
 }
+array set prettynames {allegrocl Allegro chicken Chicken clisp CLISP csharp "C#"
+    gcj GCJ go Go guile Guile java Java lua Lua mzscheme MzScheme
+    ocaml "Objective Caml" octave Octave perl5 Perl php "PHP 5" pike Pike
+    python Python r R ruby Ruby tcl Tcl}
 
-post-destroot {
-    xinstall -d ${destroot}${docdir}
-    xinstall -m 0644 -W ${worksrcpath} ANNOUNCE CHANGES LICENSE README \
-        TODO ${destroot}${docdir}
+options         swig.lang
+default         swig.lang ""
+
+foreach lang [lsort [array names bindings]] {
+    set arg      [lindex $bindings($lang) 1]
+    set arg_name [lindex [split ${arg} =] 0]
+    subport swig-${lang} "
+        depends_lib-append      [lindex $bindings($lang) 0]
+        configure.args-append   --with-${arg}
+        destroot.args           lib-languages=\"${arg_name}\"
+        swig.lang               $arg_name
+    "
+    if {${swig.lang} != $arg_name} {
+        configure.args-append --without-${arg_name}
+    }
 }
 
-variant doc description {Install extra documentation} {
+subport swig-gcj {
+    variant gcc43 conflicts gcc44 description {build using GCJ 4.3} {
+        depends_lib-delete port:gcc44
+        depends_lib-append port:gcc43
+        configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.4 --with-gcjh=${prefix}/bin/gcjh-mp-4.4
+        configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.3 --with-gcjh=${prefix}/bin/gcjh-mp-4.3
+    }
+    
+    # just a placeholder variant until gcc45 gets added
+    variant gcc44 conflicts gcc43 description {build using GCJ 4.4} {}
+    
+    if {![variant_isset gcc43]} {
+        default_variants +gcc44
+    }
+}
+
+if {${swig.lang} == ""} {
+    depends_lib	    port:pcre
+
+    set docdir      ${prefix}/share/doc/${name}-${version}
+    
+    destroot.args   lib-languages="typemaps"
+    
     post-destroot {
-        xinstall -d ${destroot}${docdir}/html
-        eval xinstall -m 0644 [glob ${worksrcpath}/Doc/Manual/*.{css,html,pdf,png}] \
-            ${destroot}${docdir}/html
+        xinstall -d ${destroot}${docdir}
+        xinstall -m 0644 -W ${worksrcpath} ANNOUNCE CHANGES LICENSE README \
+            TODO ${destroot}${docdir}
     }
+    
+    variant doc description {Install extra documentation} {
+        post-destroot {
+            xinstall -d ${destroot}${docdir}/html
+            eval xinstall -m 0644 [glob ${worksrcpath}/Doc/Manual/*.{css,html,pdf,png}] \
+                ${destroot}${docdir}/html
+        }
+    }
+    
+    livecheck.type      regex
+    livecheck.url       http://www.swig.org/download.html
+    livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
+} else {
+    description     $prettynames(${swig.lang}) binding for swig
+    long_description    \
+        SWIG is a software development tool that connects programs written in C \
+        and C++ with a variety of high-level programming languages. This is the \
+        $prettynames(${swig.lang}) binding.
+    supported_archs     noarch
+    depends_lib-append  port:swig
+    livecheck.type      none
+    post-destroot {
+        delete ${destroot}${prefix}/bin
+        delete ${destroot}${prefix}/share/man
+        foreach f [glob -directory ${destroot}${prefix}/share/swig/${version} *] {
+            if {[file tail $f] != ${swig.lang}} {
+                delete $f
+            }
+        }
+    }
 }
-
-livecheck.type      regex
-livecheck.url       http://www.swig.org/download.html
-livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110929/6d7d993f/attachment.html>


More information about the macports-changes mailing list