Subject: [PATCH 4/6] gnu: Add arrayfire-forge.

From: Adam Faiz <[email-masked]>
Date: Sun, 27 Aug 2023 02:53:47 +0800

>From 57c398fa56f343ef3767f3be33a47c33a510b758 Mon Sep 17 00:00:00 2001
Message-ID: <5[email-masked]>
In-Reply-To: <[email-masked]>
References: <[email-masked]>
From: AwesomeAdam54321 <[email-masked]>
Date: Sun, 27 Aug 2023 02:09:00 +0800
Subject: [PATCH 4/6] gnu: Add arrayfire-forge.

* gnu/packages/statistics.scm (arrayfire-forge): New variable.
---
 gnu/packages/statistics.scm | 51 +++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 5abc62d760..7681af717b 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -43,6 +43,7 @@ (define-module (gnu packages statistics)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system ant)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system r)
@@ -54,16 +55,19 @@ (define-module (gnu packages statistics)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cran)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages emacs-xyz)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages icu4c)
@@ -77,6 +81,7 @@ (define-module (gnu packages statistics)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocaml)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -6821,6 +6826,52 @@ (define-public emacs-poly-r
 files, including Rmarkdown files.")
     (license license:gpl3+)))
 
+(define-public arrayfire-forge
+  (package
+    (name "arrayfire-forge")
+    (version "1.0.8")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/arrayfire/forge.git")
+               (commit (string-append "v" version))))
+        (sha256
+         (base32 "19bqqq56bvpi9dyn7i3p86ccs9v45zy5a74njacjn7l0rb0l09lm"))
+        (modules '((guix build utils)))
+        (snippet
+         #~(begin
+             (substitute* "CMakeLists.txt"
+               (("include\\(ForgeConfigureDepsVars\\)") ""))
+             (substitute* "examples/CMakeLists.txt"
+               (("include.build_cl2hpp.") ""))))
+        (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (native-inputs
+     (list doxygen
+           pkg-config
+           python-breathe
+           python-sphinx
+           python-recommonmark))
+    (inputs
+     (list arrayfire-glad
+           boost
+           fontconfig
+           freeimage
+           freetype
+           glfw
+           glm
+           opencl-clhpp))
+    (arguments
+     (list #:tests? #f)) ; no tests
+    (home-page "https://arrayfire.com/")
+    (synopsis "OpenGL visualiser")
+    (description "Forge is an OpenGL interop library that can be used
+with ArrayFire or any other application using the OpenCL compute backend.
+  The goal of Forge is to provide OpenGL visualizations
+for C/C++ applications that use OpenCL.")
+    (license license:bsd-3)))
+
 (define-public readstat
   (package
     (name "readstat")
-- 
2.41.0