jemalloc.scm 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. (define-module (gnu packages jemalloc)
  21. #:use-module (srfi srfi-1)
  22. #:use-module (srfi srfi-26)
  23. #:use-module ((guix licenses) #:select (bsd-2))
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix utils)
  27. #:use-module (gnu packages)
  28. #:use-module (gnu packages perl)
  29. #:use-module (guix build-system gnu))
  30. (define-public jemalloc
  31. (package
  32. (name "jemalloc")
  33. (version "5.1.0")
  34. (source (origin
  35. (method url-fetch)
  36. (uri (string-append
  37. "https://github.com/jemalloc/jemalloc/releases/download/"
  38. version "/jemalloc-" version ".tar.bz2"))
  39. (sha256
  40. (base32
  41. "0s3jpcyhzia8d4k0xyc67is78kg416p9yc3c2f9w6fhhqqffd5jk"))))
  42. (build-system gnu-build-system)
  43. (arguments
  44. `(#:phases
  45. (modify-phases %standard-phases
  46. (add-after 'unpack 'delete-thp-test
  47. ;; This test does not check if transparent huge pages are supported
  48. ;; on the system before running the test.
  49. (lambda _
  50. (substitute* "Makefile.in"
  51. (("\\$\\(srcroot\\)test/unit/pages.c \\\\") "\\"))
  52. #t)))
  53. ,@(if (any (cute string-prefix? <> (or (%current-target-system)
  54. (%current-system)))
  55. '("x64_64" "i686"))
  56. ;; Transparent huge pages are only enabled by default on Intel processors
  57. '()
  58. '(#:configure-flags (list "--disable-thp")))))
  59. (inputs `(("perl" ,perl)))
  60. (home-page "http://jemalloc.net/")
  61. (synopsis "General-purpose scalable concurrent malloc implementation")
  62. (description
  63. "This library providing a malloc(3) implementation that emphasizes
  64. fragmentation avoidance and scalable concurrency support.")
  65. (license bsd-2)))
  66. (define-public jemalloc-4.5.0
  67. (package
  68. (inherit jemalloc)
  69. (version "4.5.0")
  70. (source (origin
  71. (method url-fetch)
  72. (uri (string-append
  73. "https://github.com/jemalloc/jemalloc/releases/download/"
  74. version "/jemalloc-" version ".tar.bz2"))
  75. (sha256
  76. (base32
  77. "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl"))))
  78. (inputs '())))