source: trunk/dports/devel/swig/Portfile @ 92837

Last change on this file since 92837 was 92837, checked in by ryandesign@…, 7 years ago

Increase revision of ports depending on pcre since the libpcre library version has increased from 0 to 1

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1# -*- 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
2# $Id: Portfile 92837 2012-05-09 00:51:48Z ryandesign@macports.org $
3
4PortSystem 1.0
5
6name            swig
7version         2.0.6
8
9categories      devel
10# The swig tool itself is GPL, but code incorporated into dependents has a
11# permissive license.
12license         {GPL-3+ Permissive}
13maintainers     kevin jwa
14
15description     Tool to wrap C/C++ libraries in high-level languages.
16long_description        \
17    SWIG is a software development tool that connects programs written in C \
18    and C++ with a variety of high-level programming languages. SWIG is \
19    primarily used with common scripting languages such as Perl, Python, \
20    Tcl/Tk, Ruby, Guile and MzScheme, however the list of supported languages \
21    also includes non-scripting languages such as Java and OCAML. SWIG is \
22    most commonly used to create high-level interpreted programming \
23    environments, user interfaces, and as a tool for testing and \
24    prototyping C/C++ software. SWIG may be freely used, distributed, and \
25    modified for commercial and noncommercial use.
26
27homepage        http://www.swig.org/
28platforms       darwin
29master_sites    sourceforge:project/swig/swig/swig-${version}
30
31checksums           rmd160  accc9f01f7359463199a39d553539649c74bad81 \
32                    sha256  dd376331dd76899736852881f0fc5ba874b0d79e88a5bd9b366bcb20e7fbb17d
33
34depends_build   port:bison \
35    port:gsed
36
37post-patch {
38    # The configure script should use GNU sed
39    reinplace "s/\[\[:<:\]\]sed\[\[:>:\]\]/gsed/g" ${worksrcpath}/configure
40}
41
42build.target
43
44test.run        yes
45test.target     check
46
47array set bindings {
48    allegro     {port:allegro           allegrocl}
49    chicken     {port:chicken           chicken}
50    clisp       {port:clisp             clisp}
51    csharp      {port:mono              csharp}
52    gcj         {port:gcc45             "gcj=${prefix}/bin/gcj-mp-4.5 --with-gcjh=${prefix}/bin/gcjh-mp-4.5"}
53    go          {port:go                go}
54    guile       {port:guile             guile}
55    java        {bin:java:kaffe         java}
56    lua         {port:lua               lua}
57    mzscheme    {port:mzscheme          mzscheme}
58    ocaml       {port:ocaml             ocaml}
59    octave      {path:bin/octave:octave octave}
60    perl        {path:bin/perl:perl5    perl5=${prefix}/bin/perl}
61    php5        {path:bin/php:php5      php}
62    pike        {port:pike              pike}
63    python      {port:python_select     python}
64    r           {port:R                 r}
65    ruby        {port:ruby              ruby}
66    tcl         {port:tcl               tcl}
67}
68array set prettynames {allegrocl Allegro chicken Chicken clisp CLISP csharp "C#"
69    gcj GCJ go Go guile Guile java Java lua Lua mzscheme MzScheme
70    ocaml "Objective Caml" octave Octave perl5 Perl php "PHP 5" pike Pike
71    python Python r R ruby Ruby tcl Tcl}
72
73options         swig.lang
74default         swig.lang ""
75
76foreach lang [lsort [array names bindings]] {
77    set arg      [lindex $bindings($lang) 1]
78    set arg_name [lindex [split ${arg} =] 0]
79    subport swig-${lang} "
80        depends_lib-append      [lindex $bindings($lang) 0]
81        configure.args-append   --with-${arg}
82        destroot.args           lib-languages=\"${arg_name}\"
83        swig.lang               $arg_name
84    "
85    if {${swig.lang} != $arg_name} {
86        configure.args-append --without-${arg_name}
87    }
88}
89
90subport swig-gcj {
91    variant gcc43 conflicts gcc44 gcc45 description {build using GCJ 4.3} {
92        depends_lib-delete port:gcc45
93        depends_lib-append port:gcc43
94        configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.5 --with-gcjh=${prefix}/bin/gcjh-mp-4.5
95        configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.3 --with-gcjh=${prefix}/bin/gcjh-mp-4.3
96    }
97
98    variant gcc44 conflicts gcc43 gcc45 description {build using GCJ 4.4} {
99        depends_lib-delete port:gcc45
100        depends_lib-append port:gcc44
101        configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.5 --with-gcjh=${prefix}/bin/gcjh-mp-4.5
102        configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.4 --with-gcjh=${prefix}/bin/gcjh-mp-4.4
103    }
104
105    # just a placeholder variant until gcc46 gets added
106    variant gcc45 conflicts gcc43 gcc44 description {build using GCJ 4.5} {}
107
108    if {![variant_isset gcc43] && ![variant_isset gcc44]} {
109        default_variants +gcc45
110    }
111}
112
113if {${swig.lang} == ""} {
114    revision        1
115
116    depends_lib     port:pcre
117
118    set docdir      ${prefix}/share/doc/${name}-${version}
119   
120    destroot.args   lib-languages="typemaps"
121   
122    post-destroot {
123        xinstall -d ${destroot}${docdir}
124        xinstall -m 0644 -W ${worksrcpath} ANNOUNCE CHANGES LICENSE README \
125            TODO ${destroot}${docdir}
126    }
127   
128    variant doc description {Install extra documentation} {
129        post-destroot {
130            xinstall -d ${destroot}${docdir}/html
131            eval xinstall -m 0644 [glob ${worksrcpath}/Doc/Manual/*.{css,html,pdf,png}] \
132                ${destroot}${docdir}/html
133        }
134    }
135   
136    livecheck.type      regex
137    livecheck.url       http://www.swig.org/download.html
138    livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
139} else {
140    description     $prettynames(${swig.lang}) binding for swig
141    long_description    \
142        SWIG is a software development tool that connects programs written in C \
143        and C++ with a variety of high-level programming languages. This is the \
144        $prettynames(${swig.lang}) binding.
145    supported_archs     noarch
146    depends_lib-append  port:swig
147    livecheck.type      none
148    post-destroot {
149        delete ${destroot}${prefix}/bin
150        delete ${destroot}${prefix}/share/man
151        foreach f [glob -directory ${destroot}${prefix}/share/swig/${version} *] {
152            if {[file tail $f] != ${swig.lang}} {
153                delete $f
154            }
155        }
156    }
157}
Note: See TracBrowser for help on using the repository browser.