1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 ng0 <ng0@n0.is>
4 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
36 (url "https://github.com/01org/tbb")
37 (commit (string-append "v" version))))
38 (file-name (git-file-name name version))
41 "1vrh1mr9jmj46as9y8j5q1hpvihzd1iq4jr1y4x9a19dw8b7yk56"))
42 (modules '((guix build utils)))
45 (substitute* "build/common.inc"
46 (("export tbb_build_prefix.+$")
47 "export tbb_build_prefix?=guix\n"))
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"))
54 (substitute* "build/linux.inc"
55 (("os_kernel_version:=.*")
56 "os_kernel_version:=5\n")
60 (outputs '("out" "doc"))
61 (build-system gnu-build-system)
63 `(#:test-target "test"
64 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
65 (assoc-ref %outputs "out") "/lib"))
67 (modify-phases %standard-phases
68 (add-after 'unpack 'fail-on-test-errors
70 (substitute* "Makefile"
71 (("-\\$\\(MAKE") "$(MAKE"))
74 (lambda* (#:key outputs #:allow-other-keys)
75 (substitute* "build/linux.gcc.inc"
77 (string-append "LIB_LINK_FLAGS = -Wl,-rpath="
78 (assoc-ref outputs "out") "/lib")))))
80 (lambda* (#:key outputs #:allow-other-keys)
81 (let* ((doc (string-append
82 (assoc-ref outputs "doc") "/doc"))
83 (examples (string-append doc "/examples"))
85 (assoc-ref outputs "out") "/lib"))
86 (include (string-append
87 (assoc-ref outputs "out") "/include")))
92 (string-append lib "/"
94 (find-files "build/guix_release" "\\.so"))
95 (copy-recursively "doc" doc)
96 (copy-recursively "examples" examples)
97 (copy-recursively "include" include)
99 (home-page "https://www.threadingbuildingblocks.org")
100 (synopsis "C++ library for parallel programming")
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.")