[bug#73287,1/3] gnu: Add embree-2.

Message ID 523f56c5bce617aba865a0d6cb7497caed06d249.1726445374.git.jsubuntuxp@disroot.org
State New
Headers
Series Add ericw-tools and TrenchBroom. |

Commit Message

James Smith Sept. 16, 2024, 2:16 a.m. UTC
* gnu/packages/graphics.scm: (embree-2): New variable.

Change-Id: I2b2143b4d93c402ba940d408280ef1b37ab552ea
---
 gnu/packages/graphics.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
  

Comments

Liliana Marie Prikler Sept. 20, 2024, 7:58 a.m. UTC | #1
Am Sonntag, dem 15.09.2024 um 19:16 -0700 schrieb James Smith:
> * gnu/packages/graphics.scm: (embree-2): New variable.
> 
> Change-Id: I2b2143b4d93c402ba940d408280ef1b37ab552ea
> ---
>  gnu/packages/graphics.scm | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
> index 3d03802245..d893c9dfee 100644
> --- a/gnu/packages/graphics.scm
> +++ b/gnu/packages/graphics.scm
> @@ -37,6 +37,7 @@
>  ;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
>  ;;; Copyright © 2023 Eric Bavier <bavier@posteo.net>
>  ;;; Copyright © 2023, 2024 Artyom V. Poptsov
> <poptsov.artyom@gmail.com>
> +;;; Copyright © 2024 James Smith <jsubuntuxp@disroot.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -490,6 +491,27 @@ (define-public embree-3
>                 (base32
>                 
> "1kcvz7g6j56anv9zjyd3gidxl46vipw0gg82lns12m45cd43iwxm"))))))
>  
> +(define-public embree-2
> +  (package/inherit embree
> +    (version "2.17.7")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference (url
> "https://github.com/RenderKit/embree")
> +                           (commit (string-append "v" version))))
> +       (file-name (git-file-name (package-name embree) version))
> +       (sha256
> +        (base32
> "19v60zdfix33c772x6dzmhsarhafsns8qy7c2ysqr7a9j16whgql"))))
> +    (arguments
> +     (substitute-keyword-arguments (package-arguments embree)
> +       ((#:configure-flags configure-flags)
> +        #~(append (list "-DEMBREE_TUTORIALS=OFF") #$configure-
> flags))))
> +    (inputs (modify-inputs (package-inputs embree)
> +              (replace "tbb" tbb-2020)))
> +    ;; Tries to build with SSE2 and AVX support on ARM, so disable
> building for
> +    ;; those systems.
Comments should be full sentences.  Also, this is a hint that it uses
SSE2 and AVX on the platforms below too – we should disable them, as
they won't work with every CPU.
> +    (supported-systems (list "i686-linux" "x86_64-linux"))))
> +

Cheers
  
James Smith Sept. 21, 2024, 12:35 a.m. UTC | #2
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Am Sonntag, dem 15.09.2024 um 19:16 -0700 schrieb James Smith:
>> +    ;; Tries to build with SSE2 and AVX support on ARM, so disable
>> building for
>> +    ;; those systems.
> Comments should be full sentences.  Also, this is a hint that it uses
> SSE2 and AVX on the platforms below too – we should disable them, as
> they won't work with every CPU.
I've investigated on disabling them, but it seems that embree 2 (and 3
for that matter) has a hard requirement for SSE2 and have updated the
comment as such. I've gone ahead and implemented your suggestions for
the other patches though and will be sending them shortly.
>> +    (supported-systems (list "i686-linux" "x86_64-linux"))))
>> +
>
> Cheers
  

Patch

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 3d03802245..d893c9dfee 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -37,6 +37,7 @@ 
 ;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
 ;;; Copyright © 2023 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2023, 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2024 James Smith <jsubuntuxp@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -490,6 +491,27 @@  (define-public embree-3
                (base32
                 "1kcvz7g6j56anv9zjyd3gidxl46vipw0gg82lns12m45cd43iwxm"))))))
 
+(define-public embree-2
+  (package/inherit embree
+    (version "2.17.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference (url "https://github.com/RenderKit/embree")
+                           (commit (string-append "v" version))))
+       (file-name (git-file-name (package-name embree) version))
+       (sha256
+        (base32 "19v60zdfix33c772x6dzmhsarhafsns8qy7c2ysqr7a9j16whgql"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments embree)
+       ((#:configure-flags configure-flags)
+        #~(append (list "-DEMBREE_TUTORIALS=OFF") #$configure-flags))))
+    (inputs (modify-inputs (package-inputs embree)
+              (replace "tbb" tbb-2020)))
+    ;; Tries to build with SSE2 and AVX support on ARM, so disable building for
+    ;; those systems.
+    (supported-systems (list "i686-linux" "x86_64-linux"))))
+
 (define-public openvdb
   (package
     (name "openvdb")