projects/guix·blob javascript-team · refs

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