gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / tbb.scm
CommitLineData
8c6c91fe 1;;; GNU Guix --- Functional package management for GNU
7f5ca399 2;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
3c986a7d 3;;; Copyright © 2016 Nikita <nikita@n0.is>
e315c72f 4;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8c6c91fe
RW
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)
941699b3 24 #:use-module (guix git-download)
8c6c91fe
RW
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")
e9cbf43a 32 (version "2020.3")
8c6c91fe 33 (source (origin
941699b3
MB
34 (method git-fetch)
35 (uri (git-reference
36 (url "https://github.com/01org/tbb")
e315c72f 37 (commit (string-append "v" version))))
75ea39da 38 (file-name (git-file-name name version))
8c6c91fe
RW
39 (sha256
40 (base32
e9cbf43a 41 "0r9axsdlmacjlcnax4vkzg86nwf8lsx7wbqdi3wnryaxk0xvdcx6"))
8c6c91fe
RW
42 (modules '((guix build utils)))
43 (snippet
6cbee49d
MW
44 '(begin
45 (substitute* "build/common.inc"
46 (("export tbb_build_prefix.+$")
47 "export tbb_build_prefix?=guix\n"))
7647c0de
LC
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"))
6cbee49d 59 #t))))
8c6c91fe
RW
60 (outputs '("out" "doc"))
61 (build-system gnu-build-system)
62 (arguments
63 `(#:test-target "test"
02ed8be3
RW
64 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
65 (assoc-ref %outputs "out") "/lib"))
7f5ca399
RW
66 #:phases
67 (modify-phases %standard-phases
1a545a1e
RW
68 (add-after 'unpack 'fail-on-test-errors
69 (lambda _
70 (substitute* "Makefile"
71 (("-\\$\\(MAKE") "$(MAKE"))
72 #t))
7f5ca399
RW
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))))))
8c6c91fe
RW
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
103the low-level threading details necessary for optimal multi-core performance.
104It uses common C++ templates and coding style to eliminate tedious threading
105implementation work. It provides parallel loop constructs, asynchronous
106tasks, synchronization primitives, atomic operations, and more.")
b6337f30 107 (license asl2.0)))