tbb.scm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages tbb)
  20. #:use-module (guix packages)
  21. #:use-module (guix licenses)
  22. #:use-module (guix download)
  23. #:use-module (guix utils)
  24. #:use-module (guix build-system gnu)
  25. #:use-module (gnu packages))
  26. (define-public tbb
  27. (package
  28. (name "tbb")
  29. (version "2017_20160916")
  30. (source (origin
  31. (method url-fetch)
  32. (uri (string-append
  33. "https://www.threadingbuildingblocks.org/sites/default"
  34. "/files/software_releases/source/"
  35. "tbb" version "oss_src.tgz"))
  36. (sha256
  37. (base32
  38. "1i3zy87gyzw22fvajm039w6g822qzqn7jbmznc8y8c57qpqnf330"))
  39. (modules '((guix build utils)))
  40. (snippet
  41. '(begin
  42. (substitute* "build/common.inc"
  43. (("export tbb_build_prefix.+$")
  44. "export tbb_build_prefix?=guix\n"))
  45. #t))))
  46. (outputs '("out" "doc"))
  47. (build-system gnu-build-system)
  48. (arguments
  49. `(#:test-target "test"
  50. #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  51. (assoc-ref %outputs "out") "/lib"))
  52. #:phases
  53. (modify-phases %standard-phases
  54. (add-after 'unpack 'fail-on-test-errors
  55. (lambda _
  56. (substitute* "Makefile"
  57. (("-\\$\\(MAKE") "$(MAKE"))
  58. #t))
  59. (replace 'configure
  60. (lambda* (#:key outputs #:allow-other-keys)
  61. (substitute* "build/linux.gcc.inc"
  62. (("LIB_LINK_FLAGS =")
  63. (string-append "LIB_LINK_FLAGS = -Wl,-rpath="
  64. (assoc-ref outputs "out") "/lib")))))
  65. (replace 'install
  66. (lambda* (#:key outputs #:allow-other-keys)
  67. (let* ((doc (string-append
  68. (assoc-ref outputs "doc") "/doc"))
  69. (examples (string-append doc "/examples"))
  70. (lib (string-append
  71. (assoc-ref outputs "out") "/lib"))
  72. (include (string-append
  73. (assoc-ref outputs "out") "/include")))
  74. (mkdir-p lib)
  75. (for-each
  76. (lambda (f)
  77. (copy-file f
  78. (string-append lib "/"
  79. (basename f))))
  80. (find-files "build/guix_release" "\\.so"))
  81. (copy-recursively "doc" doc)
  82. (copy-recursively "examples" examples)
  83. (copy-recursively "include" include)
  84. #t))))))
  85. (home-page "https://www.threadingbuildingblocks.org")
  86. (synopsis "C++ library for parallel programming")
  87. (description
  88. "Threading Building Blocks (TBB) is a C++ runtime library that abstracts
  89. the low-level threading details necessary for optimal multi-core performance.
  90. It uses common C++ templates and coding style to eliminate tedious threading
  91. implementation work. It provides parallel loop constructs, asynchronous
  92. tasks, synchronization primitives, atomic operations, and more.")
  93. (license asl2.0)))