1 # Build recipe for gdb.
3 # Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/devel"
24 tarname=${program}-${version}.tar.gz
27 fetch=http://ftpmirror.gnu.org/gdb/$tarname
32 GDB, the GNU Project debugger, allows you to see what is going on
33 inside another program while it executes, or what another program
34 was doing at the moment it crashed.
37 homepage=http://www.gnu.org/software/gdb
38 license="GPLv2+, GPLv3+, LGPLv2, LGPLv3"
40 # Source documentation
41 docs="COPYING* ChangeLog README*"
42 docsdir="${docdir}/${program}-${version}"
48 unpack "${tardir}/$tarname"
52 # Set sane permissions
53 chmod -R u+w,go-w,a+rX-s .
55 # The GUILE support is pending (--with-guile=guile-2.2)
56 # It does not work for GDB 8.2 ...
59 CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
61 --libdir=/usr/lib${libSuffix} \
65 --enable-compressed-debug-sections=none \
66 --with-python=/usr/bin/python3 \
68 --with-system-readline \
69 --build="$(cc -dumpmachine)"
72 make -j${jobs} DESTDIR="$destdir" install
74 # Delete generated charset.alias
75 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
77 # Delete files belonging to the binutils package
79 "${destdir}/usr/include/plugin-api.h" \
80 "${destdir}/usr/include/dis-asm.h" \
81 "${destdir}/usr/include/ansidecl.h" \
82 "${destdir}/usr/include/symcat.h" \
83 "${destdir}/usr/include/bfd.h" \
84 "${destdir}/usr/lib${libSuffix}/libbfd.a" \
85 "${destdir}/usr/lib${libSuffix}/libopcodes.a" \
86 "${destdir}/usr/lib${libSuffix}/libbfd.la" \
87 "${destdir}/usr/lib${libSuffix}/libopcodes.la" \
88 "${destdir}/${infodir}/bdf.info"
90 # Compress info documents deleting index file for the package
91 if test -d "${destdir}/$infodir"
93 rm -f "${destdir}/${infodir}/dir"
94 lzip -9 "${destdir}/${infodir}"/*
97 # Compress and link man pages (if needed)
98 if test -d "${destdir}/$mandir"
101 cd "${destdir}/$mandir"
102 find . -type f -exec lzip -9 '{}' +
103 find . -type l | while read -r file
105 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
112 mkdir -p "${destdir}${docsdir}"
113 cp -p $docs "${destdir}${docsdir}"