gnu: fish: Update to 2.7.1.
[jackhill/guix/guix.git] / gnu / packages / jemalloc.scm
CommitLineData
82d8729b
SB
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
06be3161 3;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
aa5c2063 4;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
82d8729b
SB
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages jemalloc)
06be3161
EF
22 #:use-module (srfi srfi-1)
23 #:use-module (srfi srfi-26)
82d8729b
SB
24 #:use-module ((guix licenses) #:select (bsd-2))
25 #:use-module (guix packages)
26 #:use-module (guix download)
d53fb678 27 #:use-module (guix utils)
aa5c2063 28 #:use-module (gnu packages)
475b99fa 29 #:use-module (gnu packages perl)
82d8729b
SB
30 #:use-module (guix build-system gnu))
31
32(define-public jemalloc
33 (package
34 (name "jemalloc")
475b99fa 35 (version "5.0.1")
82d8729b
SB
36 (source (origin
37 (method url-fetch)
38 (uri (string-append
4a4fc718
MB
39 "https://github.com/jemalloc/jemalloc/releases/download/"
40 version "/jemalloc-" version ".tar.bz2"))
82d8729b
SB
41 (sha256
42 (base32
aa5c2063
EB
43 "1sf3lzgb0y8nnyzmp4zrca3sngdxw3kfh20sna9z03jv74fph528"))
44 (patches (search-patches "jemalloc-arm-address-bits.patch"))))
82d8729b 45 (build-system gnu-build-system)
06be3161
EF
46 (arguments
47 `(#:phases
48 (modify-phases %standard-phases
49 (add-after 'unpack 'delete-thp-test
50 ;; This test does not check if transparent huge pages are supported
51 ;; on the system before running the test.
52 (lambda _
53 (substitute* "Makefile.in"
54 (("\\$\\(srcroot\\)test/unit/pages.c \\\\") "\\"))
55 #t)))
56 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
57 (%current-system)))
58 '("x64_64" "i686"))
59 ;; Transparent huge pages are only enabled by default on Intel processors
60 '()
61 '(#:configure-flags (list "--disable-thp")))))
475b99fa 62 (inputs `(("perl" ,perl)))
4a4fc718 63 (home-page "http://jemalloc.net/")
82d8729b
SB
64 (synopsis "General-purpose scalable concurrent malloc implementation")
65 (description
66 "This library providing a malloc(3) implementation that emphasizes
67fragmentation avoidance and scalable concurrency support.")
68 (license bsd-2)))
d53fb678
NM
69
70(define-public jemalloc-4.5.0
71 (package
72 (inherit jemalloc)
73 (version "4.5.0")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append
77 "https://github.com/jemalloc/jemalloc/releases/download/"
78 version "/jemalloc-" version ".tar.bz2"))
79 (sha256
80 (base32
81 "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl"))))
82 (inputs '())))