libsigsegv.scm 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2018 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages libsigsegv)
  20. #:use-module (guix licenses)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu))
  24. (define-public libsigsegv
  25. (package
  26. (name "libsigsegv")
  27. (version "2.13")
  28. (source (origin
  29. (method url-fetch)
  30. (uri (string-append
  31. "mirror://gnu/libsigsegv/libsigsegv-"
  32. version ".tar.gz"))
  33. (sha256
  34. (base32 "06c1qjiv69hjvbq06mcxdi5hzfadhy28sa83zxspqpxhfr0ywy5y"))))
  35. (build-system gnu-build-system)
  36. (home-page "https://www.gnu.org/software/libsigsegv/")
  37. (synopsis "Library for handling page faults")
  38. (arguments
  39. `(;; The shared library isn't built by default but some packages need it.
  40. #:configure-flags '("--enable-shared")
  41. ;; On MIPS, work around this error:
  42. ;;
  43. ;; In file included from fault-linux-mips-old.h:18:0,
  44. ;; [...]
  45. ;; linux-libre-headers-cross-mips64el-linux-gnu-3.3.8/include/asm/sigcontext.h:57:8: error: redefinition of 'struct sigcontext'
  46. ,@(if (string-contains (or (%current-target-system) (%current-system))
  47. "mips64el")
  48. `(#:phases (modify-phases %standard-phases
  49. (add-before 'configure 'patch-mips-old-h
  50. (lambda _
  51. (substitute* "src/fault-linux-mips-old.h"
  52. (("#include <asm/sigcontext\\.h>") ""))
  53. #t))))
  54. '())))
  55. (description
  56. "GNU libsigsegv is a library to handle page faults, which occur when a
  57. program tries to access an unavailable region of memory, in user mode. By
  58. catching and handling page faults, the program can implement pageable virtual
  59. memory, stack overflow handlers, and so on.")
  60. (license gpl2+)))