projects/guix·blob java-team · refs

82 lines · 3.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Sou Bunnbu <[email protected]>
3;;; Copyright © 2017, 2020, 2021 Efraim Flashner <[email protected]>
4;;; Copyright © 2017 Eric Bavier <[email protected]>
5;;; Copyright © 2021 Ryan Sundberg <[email protected]>
6;;; Copyright © 2022 Marius Bakke <[email protected]>
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages jemalloc)
24 #:use-module (srfi srfi-1)
25 #:use-module (srfi srfi-26)
26 #:use-module (ice-9 match)
27 #:use-module ((guix licenses) #:select (bsd-2))
28 #:use-module (guix packages)
29 #:use-module (guix gexp)
30 #:use-module (guix download)
31 #:use-module (guix utils)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages perl)
34 #:use-module (guix build-system gnu))
35
36(define-public jemalloc
37 (package
38 (name "jemalloc")
39 (version "5.3.1")
40 (source (origin
41 (method url-fetch)
42 (uri (string-append
43 "https://github.com/jemalloc/jemalloc/releases/download/"
44 version "/jemalloc-" version ".tar.bz2"))
45 (sha256
46 (base32
47 "14kgf0hs864hp5xxqfqh37l1d8wwg57h7wv28rffs8ig4f0bq9iq"))))
48 (build-system gnu-build-system)
49 (arguments
50 (list
51 #:tests? (and (not (%current-target-system))
52 (not (target-arm32?)))
53 #:phases
54 #~(modify-phases %standard-phases
55 (add-after 'unpack 'delete-thp-test
56 ;; This test does not check if transparent huge pages are supported
57 ;; on the system before running the test.
58 (lambda _
59 (substitute* "Makefile.in"
60 (("\\$\\(srcroot\\)test/unit/pages.c \\\\") "\\")))))
61 #:configure-flags
62 ;; Disable the thread local storage model in jemalloc 5 to prevent
63 ;; shared libraries linked to libjemalloc from crashing on dlopen()
64 ;; https://github.com/jemalloc/jemalloc/issues/937
65 #~'("--disable-initial-exec-tls"
66 #$@(match (%current-system)
67 ("aarch64-linux"
68 (list "--with-lg-page=14"))
69 ("powerpc-linux"
70 (list "CPPFLAGS=-maltivec"))
71 (_
72 '())))))
73 (inputs (list perl))
74 ;; Install the scripts to a separate output to avoid referencing Perl and
75 ;; Bash in the default output, saving ~75 MiB on the closure.
76 (outputs '("out" "bin"))
77 (home-page "https://jemalloc.net/")
78 (synopsis "General-purpose scalable concurrent malloc implementation")
79 (description
80 "This library providing a malloc(3) implementation that emphasizes
81fragmentation avoidance and scalable concurrency support.")
82 (license bsd-2)))