recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / devel / gdb / recipe
blob8fddf46724106f5151e2f9c2d10c5393036237de
1 # Build recipe for gdb.
3 # Copyright (c) 2018-2019 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.
17 program=gdb
18 version=8.3.1
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=devel
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://ftpmirror.gnu.org/gdb/$tarname
29 description="
30 The GNU debugger.
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}"
44 build()
46     set -e
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
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, 8.3 ...
58     ./configure \
59     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
60      $configure_args \
61      --libdir=/usr/lib${libSuffix} \
62      --infodir=$infodir \
63      --mandir=$mandir \
64      --docdir=$docsdir \
65      --enable-compressed-debug-sections=none \
66      --with-python=/usr/bin/python3 \
67      --with-system-zlib \
68      --with-system-readline \
69      --build="$(cc -dumpmachine)"
71     make -j${jobs} V=1
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
78     rm -f \
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"
92     then
93         rm -f "${destdir}/${infodir}/dir"
94         lzip -9 "${destdir}/${infodir}"/*
95     fi
97     # Compress and link man pages (if needed)
98     if test -d "${destdir}/$mandir"
99     then
100         (
101             cd "${destdir}/$mandir"
102             find . -type f -exec lzip -9 '{}' +
103             find . -type l | while read -r file
104             do
105                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106                 rm -- "$file"
107             done
108         )
109     fi
111     # Copy documentation
112     mkdir -p "${destdir}${docsdir}"
113     cp -p $docs "${destdir}${docsdir}"