gnu: Add Threading Building Blocks.
[jackhill/guix/guix.git] / gnu / packages / tbb.scm
CommitLineData
8c6c91fe
RW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages tbb)
20 #:use-module (guix packages)
21 #:use-module (guix licenses)
22 #:use-module (guix download)
23 #:use-module (guix utils)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages))
26
27(define-public tbb
28 (package
29 (name "tbb")
30 (version "4.3.2")
31 (source (origin
32 (method url-fetch)
33 (uri (string-append
34 "https://www.threadingbuildingblocks.org/sites/default"
35 "/files/software_releases/source/"
36 "tbb43_20141204oss_src.tgz"))
37 (sha256
38 (base32
39 "0jsczl99jfgj47kj7c4sd4fk7v3rbaiax1ng9ypykz1hh0lrrsws"))
40 (modules '((guix build utils)))
41 (snippet
42 '(substitute* "build/common.inc"
43 (("export tbb_build_prefix.+$")
44 "export tbb_build_prefix?=guix\n")))))
45 (outputs '("out" "doc"))
46 (build-system gnu-build-system)
47 (arguments
48 `(#:test-target "test"
49 #:phases (alist-delete
50 'configure
51 (alist-replace
52 'install
53 (lambda* (#:key outputs #:allow-other-keys)
54 (let* ((doc (string-append
55 (assoc-ref outputs "doc") "/doc"))
56 (examples (string-append doc "/examples"))
57 (lib (string-append
58 (assoc-ref outputs "out") "/lib"))
59 (include (string-append
60 (assoc-ref outputs "out") "/include")))
61 (mkdir-p lib)
62 (for-each
63 (lambda (f)
64 (copy-file f
65 (string-append lib "/"
66 (basename f))))
67 (find-files "build/guix_release" "\\.so"))
68 (copy-recursively "doc" doc)
69 (copy-recursively "examples" examples)
70 (copy-recursively "include" include)
71 #t))
72 %standard-phases))))
73 (home-page "https://www.threadingbuildingblocks.org")
74 (synopsis "C++ library for parallel programming")
75 (description
76 "Threading Building Blocks (TBB) is a C++ runtime library that abstracts
77the low-level threading details necessary for optimal multi-core performance.
78It uses common C++ templates and coding style to eliminate tedious threading
79implementation work. It provides parallel loop constructs, asynchronous
80tasks, synchronization primitives, atomic operations, and more.")
81 ;; GPLv2 with run-time exception:
82 ;; <https://www.threadingbuildingblocks.org/licensing#runtime-exception>
83 (license gpl2)))