diff mbox series

[bug#65553,3/6] gnu: Add arrayfire-threads.

Message ID a46f6871-4785-b322-80cb-bb87ade9c761@disroot.org
State New
Headers show
Series gnu: Add arrayfire. | expand

Commit Message

Adam Faiz Aug. 26, 2023, 6:52 p.m. UTC
From 8eb098f8c795f0bfdc036fc53c94de6f7c29eeb1 Mon Sep 17 00:00:00 2001
Message-ID: <8eb098f8c795f0bfdc036fc53c94de6f7c29eeb1.1693075221.git.adam.faiz@disroot.org>
In-Reply-To: <cover.1693075221.git.adam.faiz@disroot.org>
References: <cover.1693075221.git.adam.faiz@disroot.org>
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Sun, 27 Aug 2023 02:06:31 +0800
Subject: [PATCH 3/6] gnu: Add arrayfire-threads.

* gnu/packages/cpp.scm (arrayfire-threads): New variable.
---
 gnu/packages/cpp.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6ab3710000..64147167c1 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1554,6 +1554,46 @@  (define-public lager
 event loops it also provides lenses and cursors.")
      (license license:expat))))
 
+(define-public arrayfire-threads
+  (let ((commit "4d4a4f0384d1ac2f25b2c4fc1d57b9e25f4d6818")
+        (revision "0"))
+  (package
+    (name "arrayfire-threads")
+    (version (git-version "0.0.0" revision commit))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/arrayfire/threads")
+             (commit commit)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0zipmh6rlk9nzczqp0bj9jjbqvjyk1rxnxz5rqpx83h91bvi7axa"))
+       (modules '((guix build utils)))
+       (snippet
+        #~(begin
+            (substitute* "Makefile"
+              (("g\\+\\+-4.9") "g++")
+              (("-o test" all)
+               (string-append all "\n\n"
+                              "install:\n\t"
+                              "mkdir -p $(DESTDIR)$(PREFIX)/include\n\t"
+                              "cp -r include $(DESTDIR)$(PREFIX)")))))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:make-flags
+           #~(list (string-append "DESTDIR=" #$output))
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure) ; no configure
+               (delete 'build) ; building the headers fail to compile
+               (delete 'check)))) ; test.cpp is compiled in the `all` target
+    (synopsis "Threads headers for ArrayFire")
+    (description
+     "This package provides threads headers for ArrayFire.")
+    (home-page "https://github.com/arrayfire/threads")
+    (license license:bsd-3))))
+
 (define-public atomic-queue
   (package
     (name "atomic-queue")