| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 3 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
| 4 | ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org> |
| 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) |
| 22 | #:use-module (srfi srfi-1) |
| 23 | #:use-module (srfi srfi-26) |
| 24 | #:use-module ((guix licenses) #:select (bsd-2)) |
| 25 | #:use-module (guix packages) |
| 26 | #:use-module (guix download) |
| 27 | #:use-module (guix utils) |
| 28 | #:use-module (gnu packages) |
| 29 | #:use-module (gnu packages perl) |
| 30 | #:use-module (guix build-system gnu)) |
| 31 | |
| 32 | (define-public jemalloc |
| 33 | (package |
| 34 | (name "jemalloc") |
| 35 | (version "5.2.1") |
| 36 | (source (origin |
| 37 | (method url-fetch) |
| 38 | (uri (string-append |
| 39 | "https://github.com/jemalloc/jemalloc/releases/download/" |
| 40 | version "/jemalloc-" version ".tar.bz2")) |
| 41 | (sha256 |
| 42 | (base32 |
| 43 | "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl")))) |
| 44 | (build-system gnu-build-system) |
| 45 | (arguments |
| 46 | `(#:phases |
| 47 | (modify-phases %standard-phases |
| 48 | (add-after 'unpack 'delete-thp-test |
| 49 | ;; This test does not check if transparent huge pages are supported |
| 50 | ;; on the system before running the test. |
| 51 | (lambda _ |
| 52 | (substitute* "Makefile.in" |
| 53 | (("\\$\\(srcroot\\)test/unit/pages.c \\\\") "\\")) |
| 54 | #t))) |
| 55 | ,@(if (any (cute string-prefix? <> (or (%current-target-system) |
| 56 | (%current-system))) |
| 57 | '("x64_64" "i686")) |
| 58 | ;; Transparent huge pages are only enabled by default on Intel processors |
| 59 | '() |
| 60 | '(#:configure-flags (list "--disable-thp"))))) |
| 61 | (inputs `(("perl" ,perl))) |
| 62 | ;; Install the scripts to a separate output to avoid referencing Perl and |
| 63 | ;; Bash in the default output, saving ~75 MiB on the closure. |
| 64 | (outputs '("out" "bin")) |
| 65 | (home-page "http://jemalloc.net/") |
| 66 | (synopsis "General-purpose scalable concurrent malloc implementation") |
| 67 | (description |
| 68 | "This library providing a malloc(3) implementation that emphasizes |
| 69 | fragmentation avoidance and scalable concurrency support.") |
| 70 | (license bsd-2))) |
| 71 | |
| 72 | (define-public jemalloc-4.5.0 |
| 73 | (package |
| 74 | (inherit jemalloc) |
| 75 | (version "4.5.0") |
| 76 | (source (origin |
| 77 | (method url-fetch) |
| 78 | (uri (string-append |
| 79 | "https://github.com/jemalloc/jemalloc/releases/download/" |
| 80 | version "/jemalloc-" version ".tar.bz2")) |
| 81 | (sha256 |
| 82 | (base32 |
| 83 | "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl")))) |
| 84 | (inputs '()))) |