/
Portfile
356 lines (300 loc) · 14.2 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# -*- 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
PortSystem 1.0
name swig3
version 3.0.12
revision 4
checksums rmd160 41877e9de3ff598731ef36161f77fa66dec3c301 \
sha256 7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d \
size 8149820
categories devel
maintainers {michaelld @michaelld} openmaintainer
# The swig tool itself is GPL, but code incorporated into dependents has a
# permissive license.
license {GPL-3+ Permissive}
description Tool to wrap C/C++ libraries in high-level languages.
long_description \
SWIG is a software development tool that connects programs written in C \
and C++ with a variety of high-level programming languages. SWIG is \
primarily used with common scripting languages such as Perl, Python, \
Tcl/Tk, Ruby, Guile and MzScheme, however the list of supported languages \
also includes non-scripting languages such as Java and OCAML. SWIG is \
most commonly used to create high-level interpreted programming \
environments, user interfaces, and as a tool for testing and \
prototyping C/C++ software. SWIG may be freely used, distributed, and \
modified for commercial and noncommercial use.
homepage http://www.swig.org/
master_sites sourceforge:project/swig/swig/swig-${version}
dist_subdir swig
distfiles swig-${version}${extract.suffix}
worksrcdir swig-${version}
depends_build port:bison \
port:gsed
post-patch {
# The configure script should use GNU sed
reinplace "s/\[\[:<:\]\]sed\[\[:>:\]\]/gsed/g" ${worksrcpath}/configure
}
build.target
test.run yes
test.target check
configure.args-append --without-php5
array set bindings {
chicken {port:chicken chicken}
clisp {port:clisp clisp}
csharp {port:mono csharp}
gcj {port:gcc47 "gcj=${prefix}/bin/gcj-mp-4.7 --with-gcjh=${prefix}/bin/gcjh-mp-4.7"}
d {port:phobos d}
go {port:go go}
guile {port:guile guile}
java {{} java}
lua {port:lua "lua=${prefix}/bin/lua"}
ocaml {port:ocaml ocaml}
octave {path:bin/octave:octave octave}
perl {path:bin/perl:perl5 perl5=${prefix}/bin/perl}
php {port:php72 "php=${prefix}/bin/php72"}
pike {port:pike pike}
python {port:python_select python}
r {port:R r}
ruby {port:ruby23 "ruby=${prefix}/bin/ruby2.3"}
tcl {port:tcl tcl}
}
array set prettynames {chicken Chicken clisp CLISP csharp "C#"
d D gcj GCJ go Go guile Guile java Java lua Lua
ocaml "Objective Caml" octave Octave perl5 Perl php "PHP 5" pike Pike
python Python r R ruby Ruby tcl Tcl}
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 swig3-${lang} "
depends_lib-append [lindex $bindings($lang) 0]
configure.args-append --with-${arg}
destroot.args lib-languages=\"${arg_name}\"
swig.lang $arg_name
platforms any
supported_archs noarch
"
if {${swig.lang} != $arg_name} {
configure.args-append --without-${arg_name}
}
}
subport swig3-d {
# MacPorts has DMD at which supports macOS up to 12
# See: https://forum.dlang.org/thread/yrmpzhhpuwdgnfaldstz@forum.dlang.org
platforms-append {darwin <= 21}
}
subport swig3-java {
PortGroup java 1.0
java.version 1.4+
# Set fallback to an LTS Java version
java.fallback openjdk8
}
subport swig3-php {
# patch to fix finding of "php-configXY"
patchfiles-append patch-configure.diff
variant php53 conflicts php54 php55 php56 php70 php71 php72 description {build using PHP 5.3} {
depends_lib-delete port:php72
depends_lib-append port:php53
configure.args-delete --with-php=${prefix}/bin/php72
configure.args-delete --without-php5
configure.args-append --with-php5=${prefix}/bin/php53 --without-php
}
variant php54 conflicts php53 php55 php56 php70 php71 php72 description {build using PHP 5.4} {
depends_lib-delete port:php72
depends_lib-append port:php54
configure.args-delete --with-php=${prefix}/bin/php72
configure.args-delete --without-php5
configure.args-append --with-php5=${prefix}/bin/php54 --without-php
}
variant php55 conflicts php53 php54 php56 php70 php71 php72 description {build using PHP 5.5} {
depends_lib-delete port:php72
depends_lib-append port:php55
configure.args-delete --with-php=${prefix}/bin/php72
configure.args-delete --without-php5
configure.args-append --with-php5=${prefix}/bin/php55 --without-php
}
variant php56 conflicts php53 php54 php55 php70 php71 php72 description {build using PHP 5.6} {
depends_lib-delete port:php72
depends_lib-append port:php56
configure.args-delete --with-php=${prefix}/bin/php72
configure.args-delete --without-php5
configure.args-append --with-php5=${prefix}/bin/php56 --without-php
}
variant php70 conflicts php53 php54 php55 php56 php71 php72 description {build using PHP 7.0} {
depends_lib-delete port:php72
depends_lib-append port:php70
configure.args-delete --with-php=${prefix}/bin/php72
configure.args-append --with-php=${prefix}/bin/php70
}
variant php71 conflicts php53 php54 php55 php56 php70 php72 description {build using PHP 7.1} {
depends_lib-delete port:php72
depends_lib-append port:php71
configure.args-delete --with-php=${prefix}/bin/php72
configure.args-append --with-php=${prefix}/bin/php71
}
variant php72 conflicts php53 php54 php55 php56 php70 php71 description {build using PHP 7.2} {}
if {![variant_isset php53] && ![variant_isset php54] &&
![variant_isset php55] && ![variant_isset php56] &&
![variant_isset php70] && ![variant_isset php71] &&
![variant_isset php72]} {
default_variants +php72
}
if {![variant_isset php53] && ![variant_isset php54] &&
![variant_isset php55] && ![variant_isset php56] &&
![variant_isset php70] && ![variant_isset php71] &&
![variant_isset php72]} {
ui_error "\n\nA +phpXY variant must be selected; the variant '-php72' cannot be used alone.\n"
return -code error "Invalid variant selection"
}
}
subport swig3-gcj {
# gcc4x is supported up to 10.6
platforms-append {darwin <= 10}
variant gcc43 conflicts gcc44 gcc45 gcc47 gcc48 description {build using GCJ 4.3} {
depends_lib-delete port:gcc47
depends_lib-append port:gcc43
configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.7 --with-gcjh=${prefix}/bin/gcjh-mp-4.7
configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.3 --with-gcjh=${prefix}/bin/gcjh-mp-4.3
}
variant gcc44 conflicts gcc43 gcc45 gcc47 gcc48 description {build using GCJ 4.4} {
depends_lib-delete port:gcc47
depends_lib-append port:gcc44
configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.7 --with-gcjh=${prefix}/bin/gcjh-mp-4.7
configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.4 --with-gcjh=${prefix}/bin/gcjh-mp-4.4
}
variant gcc45 conflicts gcc43 gcc44 gcc47 gcc48 description {build using GCJ 4.5} {
depends_lib-delete port:gcc47
depends_lib-append port:gcc45
configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.7 --with-gcjh=${prefix}/bin/gcjh-mp-4.7
configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.5 --with-gcjh=${prefix}/bin/gcjh-mp-4.5
}
# No +gcc46 because the gcc46 port does not build GCJ.
variant gcc48 conflicts gcc43 gcc44 gcc45 gcc47 description {build using GCJ 4.8} {
depends_lib-delete port:gcc47
depends_lib-append port:gcc48
configure.args-delete --with-gcj=${prefix}/bin/gcj-mp-4.7 --with-gcjh=${prefix}/bin/gcjh-mp-4.7
configure.args-append --with-gcj=${prefix}/bin/gcj-mp-4.8 --with-gcjh=${prefix}/bin/gcjh-mp-4.8
}
# Placeholder variant for the default.
variant gcc47 conflicts gcc43 gcc44 gcc45 gcc48 description {build using GCJ 4.7} {}
if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] &&
![variant_isset gcc47] && ![variant_isset gcc48]} {
default_variants +gcc47
}
if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] &&
![variant_isset gcc47] && ![variant_isset gcc48]} {
ui_error "\n\nA +gcc4X variant must be selected; the variant '-gcc47' cannot be used alone.\n"
return -code error "Invalid variant selection"
}
}
subport swig3-pike {
# See:
# - https://trac.macports.org/ticket/31384
# - https://trac.macports.org/ticket/68011
known_fail yes
}
subport swig3-ruby {
variant ruby186 conflicts ruby187 ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 description {build using Ruby 1.8.6} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby186
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby
}
variant ruby187 conflicts ruby186 ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 description {build using Ruby 1.8.7} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby1.8
}
variant ruby19 conflicts ruby186 ruby187 ruby20 ruby21 ruby22 ruby23 ruby24 description {build using Ruby 1.9} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby19
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby1.9
}
variant ruby20 conflicts ruby186 ruby187 ruby19 ruby21 ruby22 ruby23 ruby24 description {build using Ruby 2.0} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby20
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby2.0
}
variant ruby21 conflicts ruby186 ruby187 ruby19 ruby20 ruby22 ruby23 ruby24 description {build using Ruby 2.1} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby21
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby2.1
}
variant ruby22 conflicts ruby186 ruby187 ruby19 ruby20 ruby21 ruby23 ruby24 description {build using Ruby 2.2} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby22
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby2.2
}
variant ruby23 conflicts ruby186 ruby187 ruby19 ruby20 ruby21 ruby22 ruby24 description {build using Ruby 2.3} {
# depends_lib-delete port:ruby
# depends_lib-append port:ruby23
# configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
# configure.args-append --with-ruby=${prefix}/bin/ruby2.3
}
variant ruby24 conflicts ruby186 ruby187 ruby19 ruby20 ruby21 ruby22 ruby23 description {build using Ruby 2.4} {
depends_lib-delete port:ruby23
depends_lib-append port:ruby24
configure.args-delete --with-ruby=${prefix}/bin/ruby2.3
configure.args-append --with-ruby=${prefix}/bin/ruby2.4
}
if {![variant_isset ruby186] && ![variant_isset ruby187] &&
![variant_isset ruby19] && ![variant_isset ruby20] &&
![variant_isset ruby21] && ![variant_isset ruby22] &&
![variant_isset ruby23] && ![variant_isset ruby24]} {
default_variants +ruby23
}
if {![variant_isset ruby186] && ![variant_isset ruby187] &&
![variant_isset ruby19] && ![variant_isset ruby20] &&
![variant_isset ruby21] && ![variant_isset ruby22] &&
![variant_isset ruby23] && ![variant_isset ruby24]} {
ui_error "\n\nA +rubyXY variant must be selected; the variant '-ruby23' cannot be used alone.\n"
return -code error "Invalid variant selection"
}
}
if {${swig.lang} eq ""} {
depends_lib port:pcre
set docdir ${prefix}/share/doc/${name}-${version}
destroot.args lib-languages="typemaps"
post-destroot {
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
xinstall -m 0644 {*}[glob ${worksrcpath}/Doc/Manual/*.{css,html,pdf,png}] \
${destroot}${docdir}/html
}
}
# rename the swig binary to avoid conflict
post-destroot {
move ${destroot}${prefix}/bin/swig ${destroot}${prefix}/bin/swig3
move ${destroot}${prefix}/bin/ccache-swig ${destroot}${prefix}/bin/ccache-swig3
}
livecheck.type regex
livecheck.url https://sourceforge.net/projects/swig/files/swig/
livecheck.regex >swig-(3(?:\\.\\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.
depends_lib-append port:swig3
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
}
}
}
}