Subject: [bug#43654] [PATCH] Add perl-opengl

From: Malte Frank Gerdes <[email-masked]>
Date: Mon, 05 Oct 2020 10:10:39 +0200

In order to run the test.pl file from the official repo those packages
are also needed. Unfortunately i only get a black screen... I'm using
sway so that might make a difference even though xwayland is enabled.

It's also interesting that this app dynamically determines which OpenGL
features and which driver is installed. And juding from the output this
also gets run when perl-opengl is built. 

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 853968f5f1..31ddbb1e54 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -7931,6 +7931,66 @@ documents within a single file.")
 and FreeGLUT.")
     (license (package-license perl))))
 
+(define-public perl-opengl-shader
+  (package
+    (name "perl-opengl-shader")
+    (version "1.01")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/B/BF/BFREE/OpenGL-Shader-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0wmd76smyd9qzr3ga86vjhkzjj9ga6prqhyvdi41l1jfk0x82pcz"))))
+    (build-system perl-build-system)
+    (native-inputs
+     `(("xvfb" ,xorg-server-for-tests)))
+    (propagated-inputs
+     `(("perl-opengl" ,perl-opengl)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'pre-check
+           (lambda _
+             ;; Tests require a running X server.
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")
+             #t))
+         )))
+    (home-page
+     "https://metacpan.org/release/OpenGL-Shader")
+    (synopsis
+     "empty")
+    (description "empty")
+    (license #f)))
+
+(define-public perl-opengl-image
+  (package
+  (name "perl-opengl-image")
+  (version "1.03")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://cpan/authors/id/B/BF/BFREE/OpenGL-Image-"
+             version
+             ".tar.gz"))
+      (sha256
+        (base32
+          "1cf7c0fgba7g3r09y5hbj6ljs6dyjbzaqf9mv3qz807np3msqqa6"))))
+  (build-system perl-build-system)
+  (propagated-inputs
+    `(("perl-opengl" ,perl-opengl)))
+  (home-page
+    "https://metacpan.org/release/OpenGL-Image")
+  (synopsis
+    "empty")
+  (description "empty")
+  (license #f)))
+
 (define-public perl-package-anon
   (package
     (name "perl-package-anon")

Malte