| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 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 | |
| 57 | "--enable-cplusplus"
|
| 58 |
|
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 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 | |
| 76 | |
| 77 | #~(list "CFLAGS_EXTRA=-DNO_SOFT_VDB")))
|
| 78 | ((target-ppc32?)
|
| 79 | (list #:make-flags
|
| 80 | |
| 81 | #~(list "CFLAGS_EXTRA=-DNO_MPROTECT_VDB")))
|
| 82 | (else '()))))
|
| 83 | (native-inputs (list pkg-config))
|
| 84 | (propagated-inputs
|
| 85 | (if (%current-target-system)
|
| 86 | |
| 87 | |
| 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
|
| 95 | for C and C++")
|
| 96 | (description
|
| 97 | "The Boehm-Demers-Weiser conservative garbage collector can be used
|
| 98 | as a garbage collecting replacement for C malloc or C++ new. It allows
|
| 99 | you to allocate memory basically as you normally would, without
|
| 100 | explicitly deallocating memory that is no longer useful. The collector
|
| 101 | automatically recycles memory when it determines that it can no longer
|
| 102 | be otherwise accessed.
|
| 103 |
|
| 104 | The collector is also used by a number of programming language
|
| 105 | implementations that either use C as intermediate code, want to
|
| 106 | facilitate easier interoperation with C libraries, or just prefer the
|
| 107 | simple collector interface.
|
| 108 |
|
| 109 | Alternatively, the garbage collector may be used as a leak detector for
|
| 110 | C 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 | |
| 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 | |
| 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
|
| 182 | memory update operations on a number of architectures. These might allow you to
|
| 183 | write code that does more interesting things in signal handlers, write
|
| 184 | lock-free code, experiment with thread programming paradigms, etc.")
|
| 185 | (home-page "https://github.com/bdwgc/libatomic_ops/")
|
| 186 |
|
| 187 | |
| 188 | (license gpl2+)))
|