gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / tbb.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Nikita <nikita@n0.is>
4 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
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 tbb)
22 #:use-module (guix packages)
23 #:use-module (guix licenses)
24 #:use-module (guix git-download)
25 #:use-module (guix utils)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages))
28
29 (define-public tbb
30 (package
31 (name "tbb")
32 (version "2020.3")
33 (source (origin
34 (method git-fetch)
35 (uri (git-reference
36 (url "https://github.com/01org/tbb")
37 (commit (string-append "v" version))))
38 (file-name (git-file-name name version))
39 (sha256
40 (base32
41 "0r9axsdlmacjlcnax4vkzg86nwf8lsx7wbqdi3wnryaxk0xvdcx6"))
42 (modules '((guix build utils)))
43 (snippet
44 '(begin
45 (substitute* "build/common.inc"
46 (("export tbb_build_prefix.+$")
47 "export tbb_build_prefix?=guix\n"))
48
49 ;; Don't capture the build time and kernel version.
50 (substitute* "build/version_info_linux.sh"
51 (("uname -srv") "uname -s")
52 (("`date -u`") "01 Jan 1970"))
53
54 (substitute* "build/linux.inc"
55 (("os_kernel_version:=.*")
56 "os_kernel_version:=5\n")
57 (("os_version:=.*")
58 "os_version:=1\n"))
59 #t))))
60 (outputs '("out" "doc"))
61 (build-system gnu-build-system)
62 (arguments
63 `(#:test-target "test"
64 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
65 (assoc-ref %outputs "out") "/lib"))
66 #:phases
67 (modify-phases %standard-phases
68 (add-after 'unpack 'fail-on-test-errors
69 (lambda _
70 (substitute* "Makefile"
71 (("-\\$\\(MAKE") "$(MAKE"))
72 #t))
73 (replace 'configure
74 (lambda* (#:key outputs #:allow-other-keys)
75 (substitute* "build/linux.gcc.inc"
76 (("LIB_LINK_FLAGS =")
77 (string-append "LIB_LINK_FLAGS = -Wl,-rpath="
78 (assoc-ref outputs "out") "/lib")))))
79 (replace 'install
80 (lambda* (#:key outputs #:allow-other-keys)
81 (let* ((doc (string-append
82 (assoc-ref outputs "doc") "/doc"))
83 (examples (string-append doc "/examples"))
84 (lib (string-append
85 (assoc-ref outputs "out") "/lib"))
86 (include (string-append
87 (assoc-ref outputs "out") "/include")))
88 (mkdir-p lib)
89 (for-each
90 (lambda (f)
91 (copy-file f
92 (string-append lib "/"
93 (basename f))))
94 (find-files "build/guix_release" "\\.so"))
95 (copy-recursively "doc" doc)
96 (copy-recursively "examples" examples)
97 (copy-recursively "include" include)
98 #t))))))
99 (home-page "https://www.threadingbuildingblocks.org")
100 (synopsis "C++ library for parallel programming")
101 (description
102 "Threading Building Blocks (TBB) is a C++ runtime library that abstracts
103 the low-level threading details necessary for optimal multi-core performance.
104 It uses common C++ templates and coding style to eliminate tedious threading
105 implementation work. It provides parallel loop constructs, asynchronous
106 tasks, synchronization primitives, atomic operations, and more.")
107 (license asl2.0)))