projects/guix·blob python-team · refs

188 lines · 7.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014, 2016, 2017, 2020, 2021, 2023 Ludovic Courtès <[email protected]>
3;;; Copyright © 2014 Mark H Weaver <[email protected]>
4;;; Copyright © 2016, 2018 Leo Famulari <[email protected]>
5;;; Copyright © 2017 Rene Saavedra <[email protected]>
6;;; Copyright © 2019, 2020, 2022 Marius Bakke <[email protected]>
7;;; Copyright © 2022, 2023 Efraim Flashner <[email protected]>
8;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages bdw-gc)
26 #:use-module (guix licenses)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix gexp)
30 #:use-module (guix utils)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages hurd))
35
36(define-public libgc
37 (package
38 (name "libgc")
39 (version "8.2.8")
40 (source (origin
41 (method url-fetch)
42 (uri (list (string-append "https://github.com/bdwgc/bdwgc/releases"
43 "/download/v" version
44 "/gc-" version ".tar.gz")
45 (string-append "https://www.hboehm.info/gc/gc_source"
46 "/gc-" version ".tar.gz")))
47 (sha256
48 (base32
49 "0q5imdfzpngpz81banf2wn6b8byrj0jp9j5m3xg349nb44304jbn"))))
50 (build-system gnu-build-system)
51 (arguments
52 (append
53 (list
54 #:configure-flags
55 #~(list
56 ;; Install gc_cpp.h et al.
57 "--enable-cplusplus"
58
59 ;; In GNU/Hurd systems during the 'check' phase,
60 ;; there is a deadlock caused by the 'gctest' test.
61 ;; To disable the error set "--disable-gcj-support"
62 ;; to configure script. See bug report and discussion:
63 ;; <https://lists.opendylan.org/pipermail/bdwgc/2017-April/006275.html>
64 ;; <https://lists.gnu.org/archive/html/bug-hurd/2017-01/msg00008.html>
65 #$@(if (target-hurd? (or (%current-system)
66 (%current-target-system)))
67 #~("--disable-gcj-support")
68 #~())
69 #$@(if (target-mingw?)
70 #~("--enable-threads=pthreads")
71 #~())))
72 (cond
73 ((target-ppc64le?)
74 (list #:make-flags
75 ;; This is a known workaround upstream.
76 ;; https://github.com/bdwgc/bdwgc/issues/479
77 #~(list "CFLAGS_EXTRA=-DNO_SOFT_VDB")))
78 ((target-ppc32?)
79 (list #:make-flags
80 ;; Similar to above.
81 #~(list "CFLAGS_EXTRA=-DNO_MPROTECT_VDB")))
82 (else '()))))
83 (native-inputs (list pkg-config))
84 (propagated-inputs
85 (if (%current-target-system)
86 ;; The build system refuses to check for compiler intrinsics when
87 ;; cross-compiling, and demands using libatomic-ops instead.
88 (list libatomic-ops)
89 '()))
90 (outputs '("out" "debug"))
91 (properties
92 '((release-monitoring-url . "https://www.hboehm.info/gc/gc_source/")
93 (upstream-name . "gc")))
94 (synopsis "The Boehm-Demers-Weiser conservative garbage collector
95for C and C++")
96 (description
97 "The Boehm-Demers-Weiser conservative garbage collector can be used
98as a garbage collecting replacement for C malloc or C++ new. It allows
99you to allocate memory basically as you normally would, without
100explicitly deallocating memory that is no longer useful. The collector
101automatically recycles memory when it determines that it can no longer
102be otherwise accessed.
103
104The collector is also used by a number of programming language
105implementations that either use C as intermediate code, want to
106facilitate easier interoperation with C libraries, or just prefer the
107simple collector interface.
108
109Alternatively, the garbage collector may be used as a leak detector for
110C or C++ programs, though that is not its primary goal.")
111 (home-page "https://www.hboehm.info/gc/")
112
113 (license (x11-style (string-append home-page "license.txt")))))
114
115;; TODO: Add a static output in libgc in the next rebuild cycle.
116(define-public libgc/static-libs
117 (package/inherit
118 libgc
119 (arguments
120 (substitute-keyword-arguments arguments
121 ((#:configure-flags flags #~'())
122 #~(cons "--enable-static" #$flags))))
123
124 (properties '((hidden? . #t)))))
125
126(define-public libgc-7
127 (package
128 (inherit libgc)
129 (version "7.6.12")
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "https://github.com/bdwgc/bdwgc/releases"
133 "/download/v" version "/gc-" version ".tar.gz"))
134 (sha256
135 (base32
136 "10jhhi79d5brwlsyhwgpnrmc8nhlf7aan2lk9xhgihk5jc6srbvc"))))
137 (propagated-inputs (list libatomic-ops))))
138
139(define-public libgc/back-pointers
140 (package/inherit
141 libgc
142 (name "libgc-back-pointers")
143 (arguments
144 (substitute-keyword-arguments arguments
145 ((#:make-flags _ #~'())
146 #~(list "CPPFLAGS=-DKEEP_BACK_PTRS=1"))))
147 (synopsis "The BDW garbage collector, with back-pointer tracking")))
148
149(define-public libatomic-ops
150 (package
151 (name "libatomic-ops")
152 (version "7.8.2")
153 (source (origin
154 (method url-fetch)
155 (uri (string-append
156 "https://github.com/bdwgc/libatomic_ops/releases/download/v"
157 version "/libatomic_ops-" version ".tar.gz"))
158 (sha256
159 (base32
160 "0lcv86ib2ryqh18gsgarpkyf6k5l2bd1kh5lbkxv7wh7w9zj01fk"))))
161 (build-system gnu-build-system)
162 (outputs '("out" "debug"))
163 (native-inputs (if (target-loongarch64?)
164 (list config)
165 '()))
166 (arguments (if (target-loongarch64?)
167 (list #:phases
168 #~(modify-phases %standard-phases
169 (add-after 'unpack 'update-config-scripts
170 (lambda* (#:key inputs native-inputs #:allow-other-keys)
171 ;; Replace outdated config.guess and config.sub.
172 (for-each (lambda (file)
173 (install-file
174 (search-input-file
175 (or native-inputs inputs)
176 (string-append "/bin/" file)) "."))
177 '("config.guess" "config.sub"))))))
178 '()))
179 (synopsis "Accessing hardware atomic memory update operations")
180 (description
181 "This C library provides semi-portable access to hardware-provided atomic
182memory update operations on a number of architectures. These might allow you to
183write code that does more interesting things in signal handlers, write
184lock-free code, experiment with thread programming paradigms, etc.")
185 (home-page "https://github.com/bdwgc/libatomic_ops/")
186
187 ;; Some source files are X11-style, others are GPLv2+.
188 (license gpl2+)))