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