1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
19 (define-module (gnu packages opencl)
20 #:use-module (guix build-system gnu)
21 #:use-module (guix git-download)
22 #:use-module (guix packages)
23 #:use-module ((guix licenses) #:prefix license:))
25 ;; This file adds OpenCL implementation related packages. Due to the fact that
26 ;; OpenCL devices are not available during build (store environment), tests are
28 ;; Check https://lists.gnu.org/archive/html/guix-devel/2018-04/msg00293.html
30 (define (make-opencl-headers major-version subversion)
31 (let ((commit "e986688daf750633898dfd3994e14a9e618f2aa5")
34 (name "opencl-headers")
36 (string-append major-version "." subversion ".0")
41 (url "https://github.com/KhronosGroup/OpenCL-Headers.git")
43 (file-name (string-append name "-" commit))
46 "176ydpbyws5nr4av6hf8p41pkhc0rc4m4vrah9w6gp2fw2i32838"))))
47 (build-system gnu-build-system)
50 (modify-phases %standard-phases
55 (lambda* (#:key outputs #:allow-other-keys)
56 (copy-recursively (string-append "./opencl" (string-append
60 (assoc-ref outputs "out")
62 (synopsis "The Khronos OpenCL headers")
64 "This package provides the C headers by Khronos for OpenCL
66 (home-page "https://www.khronos.org/registry/OpenCL/")
67 (license license:expat))))
69 (define-public opencl-headers-2.2
70 (make-opencl-headers "2" "2"))
71 (define-public opencl-headers-2.1
72 (make-opencl-headers "2" "1"))
73 (define-public opencl-headers-2.0
74 (make-opencl-headers "2" "0"))
75 (define-public opencl-headers-1.2
76 (make-opencl-headers "1" "2"))
77 (define-public opencl-headers-1.1
78 (make-opencl-headers "1" "1"))
79 (define-public opencl-headers-1.0
80 (make-opencl-headers "1" "0"))
82 (define-public opencl-headers opencl-headers-2.2)