Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / bdw-gc.scm
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
22 (define-module (gnu packages bdw-gc)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages hurd))
29
30 (define-public libgc
31 (package
32 (name "libgc")
33 (version "7.6.8")
34 (source (origin
35 (method url-fetch)
36 (uri (string-append "https://github.com/ivmai/bdwgc/releases"
37 "/download/v" version "/gc-" version ".tar.gz"))
38 (sha256
39 (base32
40 "0n720a0i584ghcwmdsjiq6bl9ig0p9mrja29rp4cgsqvpz6wa2h4"))))
41 (build-system gnu-build-system)
42 (arguments
43 `(#:configure-flags
44 (list
45 ;; Install gc_cpp.h et al.
46 "--enable-cplusplus"
47 ;; In GNU/Hurd systems during the 'Check' phase,
48 ;; there is a deadlock caused by the 'gctest' test.
49 ;; To disable the error set "--disable-gcj-support"
50 ;; to configure script. See bug report and discussion:
51 ;; <https://lists.opendylan.org/pipermail/bdwgc/2017-April/006275.html>
52 ;; <https://lists.gnu.org/archive/html/bug-hurd/2017-01/msg00008.html>
53 ,@(if (hurd-triplet? (or (%current-system)
54 (%current-target-system)))
55 '("--disable-gcj-support")
56 '()))))
57 (native-inputs `(("pkg-config" ,pkg-config)))
58 (inputs `(("libatomic-ops" ,libatomic-ops)))
59 (outputs '("out" "debug"))
60 (synopsis "The Boehm-Demers-Weiser conservative garbage collector
61 for C and C++")
62 (description
63 "The Boehm-Demers-Weiser conservative garbage collector can be used
64 as a garbage collecting replacement for C malloc or C++ new. It allows
65 you to allocate memory basically as you normally would, without
66 explicitly deallocating memory that is no longer useful. The collector
67 automatically recycles memory when it determines that it can no longer
68 be otherwise accessed.
69
70 The collector is also used by a number of programming language
71 implementations that either use C as intermediate code, want to
72 facilitate easier interoperation with C libraries, or just prefer the
73 simple collector interface.
74
75 Alternatively, the garbage collector may be used as a leak detector for
76 C or C++ programs, though that is not its primary goal.")
77 (home-page "http://www.hboehm.info/gc/")
78
79 (license (x11-style (string-append home-page "license.txt")))))
80
81 (define-public libgc/back-pointers
82 (package
83 (inherit libgc)
84 (name "libgc-back-pointers")
85 (arguments
86 `(#:make-flags
87 (list "CPPFLAGS=-DKEEP_BACK_PTRS=1")
88 ,@(package-arguments libgc)))
89 (synopsis "The BDW garbage collector, with back-pointer tracking")))
90
91 (define-public libatomic-ops
92 (package
93 (name "libatomic-ops")
94 (version "7.6.8")
95 (source (origin
96 (method url-fetch)
97 (uri (string-append
98 "https://github.com/ivmai/libatomic_ops/releases/download/v"
99 version "/libatomic_ops-" version ".tar.gz"))
100 (sha256
101 (base32
102 "0rgni7056gnbn105lln629gwd6s51779yb5ds9s7wxl1vyg2fshx"))))
103 (build-system gnu-build-system)
104 (outputs '("out" "debug"))
105 (synopsis "Accessing hardware atomic memory update operations")
106 (description
107 "This C library provides semi-portable access to hardware-provided atomic
108 memory update operations on a number of architectures. These might allow you to
109 write code that does more interesting things in signal handlers, write
110 lock-free code, experiment with thread programming paradigms, etc.")
111 (home-page "https://github.com/ivmai/libatomic_ops/")
112
113 ;; Some source files are X11-style, others are GPLv2+.
114 (license gpl2+)))