recipe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Build recipe for gdb.
  2. #
  3. # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. program=gdb
  17. version=8.3.1
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/devel"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://ftpmirror.gnu.org/gdb/$tarname
  24. description="
  25. The GNU debugger.
  26. GDB, the GNU Project debugger, allows you to see what is going on
  27. inside another program while it executes, or what another program
  28. was doing at the moment it crashed.
  29. "
  30. homepage=http://www.gnu.org/software/gdb
  31. license="GPLv2+, GPLv3+, LGPLv2, LGPLv3"
  32. # Source documentation
  33. docs="COPYING* ChangeLog README*"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. # The GUILE support is pending (--with-guile=guile-2.2)
  43. # It does not work for GDB 8.2, 8.3 ...
  44. ./configure \
  45. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  46. $configure_args \
  47. --libdir=/usr/lib${libSuffix} \
  48. --infodir=$infodir \
  49. --mandir=$mandir \
  50. --docdir=$docsdir \
  51. --enable-compressed-debug-sections=none \
  52. --with-python=/usr/bin/python3 \
  53. --with-system-zlib \
  54. --with-system-readline \
  55. --build="$(cc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install
  58. # Delete generated charset.alias
  59. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  60. # Delete files belonging to the binutils package
  61. rm -f \
  62. "${destdir}/usr/include/plugin-api.h" \
  63. "${destdir}/usr/include/dis-asm.h" \
  64. "${destdir}/usr/include/ansidecl.h" \
  65. "${destdir}/usr/include/symcat.h" \
  66. "${destdir}/usr/include/bfd.h" \
  67. "${destdir}/usr/lib${libSuffix}/libbfd.a" \
  68. "${destdir}/usr/lib${libSuffix}/libopcodes.a" \
  69. "${destdir}/usr/lib${libSuffix}/libbfd.la" \
  70. "${destdir}/usr/lib${libSuffix}/libopcodes.la" \
  71. "${destdir}/${infodir}/bdf.info"
  72. # Compress info documents deleting index file for the package
  73. if test -d "${destdir}/$infodir"
  74. then
  75. rm -f "${destdir}/${infodir}/dir"
  76. lzip -9 "${destdir}/${infodir}"/*
  77. fi
  78. # Compress and link man pages (if needed)
  79. if test -d "${destdir}/$mandir"
  80. then
  81. (
  82. cd "${destdir}/$mandir"
  83. find . -type f -exec lzip -9 '{}' +
  84. find . -type l | while read -r file
  85. do
  86. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  87. rm -- "$file"
  88. done
  89. )
  90. fi
  91. # Copy documentation
  92. mkdir -p "${destdir}${docsdir}"
  93. cp -p $docs "${destdir}${docsdir}"
  94. }