Commit | Line | Data |
---|---|---|
8c6c91fe | 1 | ;;; GNU Guix --- Functional package management for GNU |
7f5ca399 | 2 | ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net> |
4a78fd46 | 3 | ;;; Copyright © 2016 Nils Gillmann <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) | |
23 | #:use-module (guix download) | |
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") | |
e35ce689 | 31 | (version "2017_20160916") |
8c6c91fe RW |
32 | (source (origin |
33 | (method url-fetch) | |
34 | (uri (string-append | |
35 | "https://www.threadingbuildingblocks.org/sites/default" | |
36 | "/files/software_releases/source/" | |
e35ce689 | 37 | "tbb" version "oss_src.tgz")) |
8c6c91fe RW |
38 | (sha256 |
39 | (base32 | |
e35ce689 | 40 | "1i3zy87gyzw22fvajm039w6g822qzqn7jbmznc8y8c57qpqnf330")) |
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")) | |
47 | #t)))) | |
8c6c91fe RW |
48 | (outputs '("out" "doc")) |
49 | (build-system gnu-build-system) | |
50 | (arguments | |
51 | `(#:test-target "test" | |
02ed8be3 RW |
52 | #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath=" |
53 | (assoc-ref %outputs "out") "/lib")) | |
7f5ca399 RW |
54 | #:phases |
55 | (modify-phases %standard-phases | |
1a545a1e RW |
56 | (add-after 'unpack 'fail-on-test-errors |
57 | (lambda _ | |
58 | (substitute* "Makefile" | |
59 | (("-\\$\\(MAKE") "$(MAKE")) | |
60 | #t)) | |
7f5ca399 RW |
61 | (replace 'configure |
62 | (lambda* (#:key outputs #:allow-other-keys) | |
63 | (substitute* "build/linux.gcc.inc" | |
64 | (("LIB_LINK_FLAGS =") | |
65 | (string-append "LIB_LINK_FLAGS = -Wl,-rpath=" | |
66 | (assoc-ref outputs "out") "/lib"))))) | |
67 | (replace 'install | |
68 | (lambda* (#:key outputs #:allow-other-keys) | |
69 | (let* ((doc (string-append | |
70 | (assoc-ref outputs "doc") "/doc")) | |
71 | (examples (string-append doc "/examples")) | |
72 | (lib (string-append | |
73 | (assoc-ref outputs "out") "/lib")) | |
74 | (include (string-append | |
75 | (assoc-ref outputs "out") "/include"))) | |
76 | (mkdir-p lib) | |
77 | (for-each | |
78 | (lambda (f) | |
79 | (copy-file f | |
80 | (string-append lib "/" | |
81 | (basename f)))) | |
82 | (find-files "build/guix_release" "\\.so")) | |
83 | (copy-recursively "doc" doc) | |
84 | (copy-recursively "examples" examples) | |
85 | (copy-recursively "include" include) | |
86 | #t)))))) | |
8c6c91fe RW |
87 | (home-page "https://www.threadingbuildingblocks.org") |
88 | (synopsis "C++ library for parallel programming") | |
89 | (description | |
90 | "Threading Building Blocks (TBB) is a C++ runtime library that abstracts | |
91 | the low-level threading details necessary for optimal multi-core performance. | |
92 | It uses common C++ templates and coding style to eliminate tedious threading | |
93 | implementation work. It provides parallel loop constructs, asynchronous | |
94 | tasks, synchronization primitives, atomic operations, and more.") | |
b6337f30 | 95 | (license asl2.0))) |