gdb.scm 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages gdb)
  21. #:use-module (gnu packages)
  22. #:use-module (gnu packages ncurses)
  23. #:use-module (gnu packages readline)
  24. #:use-module (gnu packages dejagnu)
  25. #:use-module (gnu packages texinfo)
  26. #:use-module (gnu packages multiprecision)
  27. #:use-module (gnu packages xml)
  28. #:use-module (gnu packages guile)
  29. #:use-module (gnu packages python)
  30. #:use-module (gnu packages pkg-config)
  31. #:use-module ((guix licenses) #:select (gpl3+))
  32. #:use-module (guix packages)
  33. #:use-module (guix download)
  34. #:use-module (guix build-system gnu))
  35. (define-public gdb
  36. (package
  37. (name "gdb")
  38. (version "8.2")
  39. (source (origin
  40. (method url-fetch)
  41. (uri (string-append "mirror://gnu/gdb/gdb-"
  42. version ".tar.xz"))
  43. (sha256
  44. (base32
  45. "0fbw6j4z7kmvywwgavn7w3knp860i5i9qnjffc5p52bwkji43963"))))
  46. (build-system gnu-build-system)
  47. (arguments
  48. `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
  49. #:modules ((srfi srfi-1)
  50. ,@%gnu-build-system-modules)
  51. #:phases (modify-phases %standard-phases
  52. (add-after
  53. 'configure 'post-configure
  54. (lambda _
  55. (for-each patch-makefile-SHELL
  56. (find-files "." "Makefile\\.in"))
  57. #t))
  58. (add-after
  59. 'install 'remove-libs-already-in-binutils
  60. (lambda* (#:key inputs outputs #:allow-other-keys)
  61. ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
  62. ;; However, this leads to collisions when both are
  63. ;; installed, and really is none of its business,
  64. ;; conceptually. So remove them.
  65. (let* ((binutils (assoc-ref inputs "binutils"))
  66. (out (assoc-ref outputs "out"))
  67. (files1 (with-directory-excursion binutils
  68. (append (find-files "lib")
  69. (find-files "include"))))
  70. (files2 (with-directory-excursion out
  71. (append (find-files "lib")
  72. (find-files "include"))))
  73. (common (lset-intersection string=?
  74. files1 files2)))
  75. (with-directory-excursion out
  76. (for-each delete-file common)
  77. #t)))))))
  78. (inputs
  79. `(("expat" ,expat)
  80. ("mpfr" ,mpfr)
  81. ("gmp" ,gmp)
  82. ("readline" ,readline)
  83. ("ncurses" ,ncurses)
  84. ("guile" ,guile-2.0)
  85. ("python" ,python)
  86. ("python-wrapper" ,python-wrapper)
  87. ("dejagnu" ,dejagnu)
  88. ;; Allow use of XML-formatted syscall information. This enables 'catch
  89. ;; syscall' and similar commands.
  90. ("libxml2" ,libxml2)))
  91. (native-inputs
  92. `(("texinfo" ,texinfo)
  93. ("pkg-config" ,pkg-config)))
  94. (home-page "https://www.gnu.org/software/gdb/")
  95. (synopsis "The GNU debugger")
  96. (description
  97. "GDB is the GNU debugger. With it, you can monitor what a program is
  98. doing while it runs or what it was doing just before a crash. It allows you
  99. to specify the runtime conditions, to define breakpoints, and to change how
  100. the program is running to try to fix bugs. It can be used to debug programs
  101. written in C, C++, Ada, Objective-C, Pascal and more.")
  102. (license gpl3+)))