/
Portfile
305 lines (269 loc) · 10.5 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
# -*- 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: Portfile 106262 2013-05-20 20:55:10Z sean@macports.org $
PortSystem 1.0
PortGroup muniversal 1.0
PortGroup archcheck 1.0
name gdb
#TODO: update to 8.0.1, but that will involve changing compiler lists:
version 7.7.1
revision 2
categories devel
license GPL-3+
maintainers dweber openmaintainer
description GDB: The GNU Project Debugger
long_description \
GDB, the GNU Project debugger, allows you to see what is going on \
'inside' another program while it executes -- or what another program \
was doing at the moment it crashed. GDB can do four main kinds of \
things (plus other things in support of these) to help you catch bugs \
in the act: \
a) start your program, specifying anything that might affect \
its behavior, \
b) make your program stop on specified conditions, \
c) examine what has happened, when your program has stopped, \
d) change things in your program, so you can experiment with \
correcting the effects of one bug and go on to learn about \
another. \
The program being debugged can be written in Ada, C, C++, Objective-C, \
Pascal (and many other languages). Those programs might be executing on \
the same machine as GDB (native) or on another machine (remote). GDB \
can run on most popular UNIX and Microsoft Windows variants.
homepage http://www.gnu.org/software/${name}/
platforms darwin
supported_archs x86_64 i386
master_sites gnu
use_bzip2 yes
checksums \
sha1 35228319f7c715074a80be42fff64c7645227a80 \
rmd160 523b0b2ac61e62d98c1df379571331604c4f62e1 \
sha256 0dbd5260406f1b0c70fcf027c6488527fadde0cd9bb574593491fe076eb03aa5
# some of these would be "depends_test" if we had that...
depends_build-append port:gettext \
port:zlib \
port:gawk \
port:bison \
port:flex \
path:bin/makeinfo:texinfo \
port:expect \
port:tcl \
port:tk \
path:bin/nm:cctools \
path:bin/perl:perl5 \
port:intltool \
port:gsed \
bin:mig:bootstrap_cmds \
port:gmake \
port:byacc \
port:vislcg3 \
bin:gm4:m4 \
port:libunwind-headers \
path:bin/xmkmf:imake \
port:xz
# things that still need ports:
# - libmcheck (part of glibc, would be hard to extract from it)
# - libbabeltrace (seems slightly more reasonable to port - have a WIP)
depends_lib-append port:readline \
port:expat \
port:libiconv \
port:ncurses \
port:ppl \
port:gettext \
port:zlib \
port:gnuregex \
path:lib/pkgconfig/bdw-gc.pc:boehmgc \
port:libmpc \
port:mpfr \
port:gmp \
port:cloog \
port:isl \
port:xz
depends_run-append port:gcc_select \
port:exec-wrapper
depends_skip_archcheck-append bootstrap_cmds exec-wrapper
platform macosx {
depends_run-append path:etc/openssl/cert.pem:certsync
}
set docdir ${prefix}/share/doc/${name}
set datadir ${prefix}/share/${name}
# hack to try to fix build failure:
post-patch {
reinplace "s|ATTRIBUTE_RETURNS_NONNULL||g" ${worksrcpath}/include/libiberty.h
}
pre-configure {
file mkdir "${workpath}/build"
#FIXME: this is currently unused.
}
configure.args-append \
--infodir=${docdir}/info \
--mandir=${docdir}/man \
--with-docdir=${docdir} \
--datadir=${datadir} \
--localedir=${datadir}/locale \
--program-prefix=g \
--disable-werror \
--enable-build-warnings \
--enable-gdb-build-warnings \
--enable-tui \
--enable-multi-ice \
--with-gnu-ld \
--with-curses \
--with-zlib \
--with-libiconv-prefix=${prefix} \
--with-iconv-bin=${prefix}/bin/iconv \
--with-expat \
--with-libexpat-prefix=${prefix} \
--enable-gold=yes \
--enable-ld=yes \
--enable-libada \
--enable-libssp \
--enable-static-libjava=yes \
--enable-lto \
--enable-objc-gc \
--with-mpc=${prefix} \
--with-mpfr=${prefix} \
--with-gmp=${prefix} \
--with-cloog=${prefix} \
--with-isl=${prefix} \
--disable-isl-version-check \
--disable-cloog-version-check \
--without-python \
--with-lzma \
--with-liblzma-prefix=${prefix} \
--with-tcl=${prefix}/lib \
--with-tk=${prefix}/lib \
--with-x \
--x-includes=${prefix}/include \
--x-libraries=${prefix}/lib \
--enable-sim \
--enable-plugins \
--enable-largefile
# forcing the makeinfo from our prefix is now only done in build/destroot
configure.env-append \
MAKEINFO="${worksrcpath}/missing makeinfo" \
LIBS="-lgnuregex -lgc -lcloog-isl -lgmp -lisl -lmpc -lmpfr -lppl -lhistory -lreadline" \
PICFLAG="-fno-common -DPIC" \
PICFLAG_FOR_TARGET="-fno-common -DPIC" \
COREFILE="trad-core.lo" \
SIM_OBS="remote-sim.o" \
LIBM="-lm" \
ignore_sim="false" \
SIM_OBS="remote-sim.o"
# (the LIBS env entry used to be appended to configure.ldflags instead)
configure.optflags -ggdb3
# I think this is backwards... the description for this flag says that it
# is for hosts with NARROWER word sizes, i.e. 32-bit, i.e. i386, which is
# counter-intuitive... leave the more intuitive one for now:
platform x86_64 {
configure.args-append \
--enable-64-bit-bfd
}
if {[string match *clang* ${configure.compiler}]} {
configure.args-append --disable-rpath
}
build.type gnu
use_parallel_build no
configure.ccache no
# try to get the subdirs to build some additional things:
build.env-append \
PICFLAG="-fno-common -DPIC" \
PICFLAG_FOR_TARGET="-fno-common -DPIC" \
COREFILE="trad-core.lo" \
LIBM="-lm" \
CPPFLAGS="${configure.cppflags}" \
XMKMF="${prefix}/bin/xmkmf" \
LIBLZMA="-L${prefix}/lib -llzma" \
LTLIBLZMA="-L${prefix}/lib -llzma" \
HAVE_LIBLZMA="yes" \
with_lzma="yes" \
ignore_sim="false" \
SIM_OBS="remote-sim.o" \
TCL_BIN_DIR="${prefix}/lib" \
TK_BIN_DIR="${prefix}/lib" \
LIBS="-lgnuregex -lgc -lcloog-isl -lgmp -lisl -lmpc -lmpfr -lppl -lhistory -lreadline" \
MAKEINFO="${prefix}/bin/makeinfo"
# try forcing things that fail to be simply picked up from the environment:
build.args-append \
PICFLAG="-fno-common -DPIC" \
PICFLAG_FOR_TARGET="-fno-common -DPIC" \
COREFILE="trad-core.lo" \
SIM_OBS="remote-sim.o" \
LIBM="-lm" \
ignore_sim="false" \
SIM_OBS="remote-sim.o" \
MAKEINFO="${prefix}/bin/makeinfo"
# some tests currently fail, probably need to do the permission-changing
# before testing instead of after...
test.run yes
test.target check
destroot.env-append \
MAKEINFO="${prefix}/bin/makeinfo"
destroot.args-append \
MAKEINFO="${prefix}/bin/makeinfo"
post-destroot {
ui_debug "changing ggdb to be setgid procmod"
#FIXME: this should really be done with "file attributes", but trunk
# does it like this instead, so keep it like trunk:
system "chgrp procmod ${destroot}${prefix}/bin/ggdb*"
system "chmod g+s ${destroot}${prefix}/bin/ggdb*"
# The info-renaming stuff should no longer be necessary now that I
# changed the location to which gdb installs its info files instead.
# Thus I have removed the info-renaming stuff that used to be here.
ui_debug "setting up gnubin in destroot"
xinstall -m 755 -d ${destroot}${prefix}/libexec/gnubin
foreach binary [glob -tails -directory ${destroot}${prefix}/bin g*] {
ui_debug "symlinking ${binary} into gnubin"
ln -s ${prefix}/bin/${binary} ${destroot}${prefix}/libexec/gnubin/[string range ${binary} 1 end]
}
}
# Technically gdb supports python25, too, and is going to extend python
# support back to python24 in gdb 7.8, but MacPorts does not build those
# versions as frameworks, at least not really... python25 does have one
# made out of symlinks, and the dbus-python24 and dbus-python25 ports both
# put stuff framework locations for both python24 and python25 respectively
# despite them not existing yet, but these do not really count.
set pythons_suffixes {26 27 31 32 33}
set pythons_ports {}
foreach s ${pythons_suffixes} {
lappend pythons_ports python${s}
}
foreach s ${pythons_suffixes} {
set p python${s}
set v [string index ${s} 0].[string index ${s} 1]
set i [lsearch -exact ${pythons_ports} ${p}]
set c [lreplace ${pythons_ports} ${i} ${i}]
set python_bin ${prefix}/bin/python${v}
set python_framework_dir ${prefix}/Library/Frameworks/Python.framework/Versions/${v}
eval [subst {
variant ${p} description "Build GDB with Python ${v} Scripting" \
conflicts ${c} {
depends_build-append port:${p}
depends_lib-append port:${p}
depends_run-append port:${p}
configure.args-delete --without-python
configure.args-append --with-python=${python_bin}
configure.ldflags-append -lpython${v} \
-L${python_framework_dir}/lib
configure.cppflags-append -I${python_framework_dir}/include
configure.python ${python_bin}
configure.env-append python_prog_path="${python_bin}"
patchfiles-append patch-python-config.py.diff
}
}]
}
if {![variant_isset python26] && ![variant_isset python31] && ![variant_isset python32] && ![variant_isset python33]} {
default_variants-append +python27
}
if {${os.platform} eq "darwin" && ${os.major} >= 12} {
notes "
You will need to make sure /System/Library/LaunchDaemons/com.apple.taskgated.plist\
has the '-p' option, e.g.
<key>ProgramArguments</key>
<array>
<string>/usr/libexec/taskgated</string>
<string>-sp</string>
</array>
"
}
livecheck.type regex
livecheck.url http://ftp.gnu.org/gnu/${name}/
livecheck.regex gdb-(\\d+(?:\\.\\d+)+)\\.tar