bdw-gc.scm 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2016, 2018 Leo Famulari <leo@famulari.name>
  5. ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
  6. ;;;
  7. ;;; This file is part of GNU Guix.
  8. ;;;
  9. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  10. ;;; under the terms of the GNU General Public License as published by
  11. ;;; the Free Software Foundation; either version 3 of the License, or (at
  12. ;;; your option) any later version.
  13. ;;;
  14. ;;; GNU Guix is distributed in the hope that it will be useful, but
  15. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;;; GNU General Public License for more details.
  18. ;;;
  19. ;;; You should have received a copy of the GNU General Public License
  20. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  21. (define-module (gnu packages bdw-gc)
  22. #:use-module (guix licenses)
  23. #:use-module (guix packages)
  24. #:use-module (guix download)
  25. #:use-module (guix build-system gnu)
  26. #:use-module (gnu packages pkg-config)
  27. #:use-module (gnu packages hurd))
  28. (define-public libgc
  29. (package
  30. (name "libgc")
  31. (version "7.6.6")
  32. (source (origin
  33. (method url-fetch)
  34. (uri (string-append "https://github.com/ivmai/bdwgc/releases"
  35. "/download/v" version "/gc-" version ".tar.gz"))
  36. (sha256
  37. (base32
  38. "1p1r015a7jbpvkkbgzv1y8nxrbbp6dg0mq3ksi6ji0qdz3wfss79"))))
  39. (build-system gnu-build-system)
  40. (arguments
  41. `(#:configure-flags
  42. (list
  43. ;; Install gc_cpp.h et al.
  44. "--enable-cplusplus"
  45. ;; In GNU/Hurd systems during the 'Check' phase,
  46. ;; there is a deadlock caused by the 'gctest' test.
  47. ;; To disable the error set "--disable-gcj-support"
  48. ;; to configure script. See bug report and discussion:
  49. ;; <https://lists.opendylan.org/pipermail/bdwgc/2017-April/006275.html>
  50. ;; <https://lists.gnu.org/archive/html/bug-hurd/2017-01/msg00008.html>
  51. ,@(if (hurd-triplet? (or (%current-system)
  52. (%current-target-system)))
  53. '("--disable-gcj-support")
  54. '()))))
  55. (native-inputs `(("pkg-config" ,pkg-config)))
  56. (inputs `(("libatomic-ops" ,libatomic-ops)))
  57. (outputs '("out" "debug"))
  58. (synopsis "The Boehm-Demers-Weiser conservative garbage collector
  59. for C and C++")
  60. (description
  61. "The Boehm-Demers-Weiser conservative garbage collector can be used
  62. as a garbage collecting replacement for C malloc or C++ new. It allows
  63. you to allocate memory basically as you normally would, without
  64. explicitly deallocating memory that is no longer useful. The collector
  65. automatically recycles memory when it determines that it can no longer
  66. be otherwise accessed.
  67. The collector is also used by a number of programming language
  68. implementations that either use C as intermediate code, want to
  69. facilitate easier interoperation with C libraries, or just prefer the
  70. simple collector interface.
  71. Alternatively, the garbage collector may be used as a leak detector for
  72. C or C++ programs, though that is not its primary goal.")
  73. (home-page "http://www.hboehm.info/gc/")
  74. (license (x11-style (string-append home-page "license.txt")))))
  75. (define-public libgc/back-pointers
  76. (package
  77. (inherit libgc)
  78. (name "libgc-back-pointers")
  79. (arguments
  80. `(#:make-flags
  81. (list "CPPFLAGS=-DKEEP_BACK_PTRS=1")
  82. ,@(package-arguments libgc)))
  83. (synopsis "The BDW garbage collector, with back-pointer tracking")))
  84. (define-public libatomic-ops
  85. (package
  86. (name "libatomic-ops")
  87. (version "7.6.6")
  88. (source (origin
  89. (method url-fetch)
  90. (uri (string-append
  91. "https://github.com/ivmai/libatomic_ops/releases/download/v"
  92. version "/libatomic_ops-" version ".tar.gz"))
  93. (sha256
  94. (base32
  95. "0x7071z707msvyrv9dmgahd1sghbkw8fpbagvcag6xs8yp2spzlr"))))
  96. (build-system gnu-build-system)
  97. (outputs '("out" "debug"))
  98. (synopsis "Accessing hardware atomic memory update operations")
  99. (description
  100. "This C library provides semi-portable access to hardware-provided atomic
  101. memory update operations on a number of architectures. These might allow you to
  102. write code that does more interesting things in signal handlers, write
  103. lock-free code, experiment with thread programming paradigms, etc.")
  104. (home-page "https://github.com/ivmai/libatomic_ops/")
  105. ;; Some source files are X11-style, others are GPLv2+.
  106. (license gpl2+)))