unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: Malte Frank Gerdes <malte.f.gerdes@gmail.com>
Cc: Kei Kebreau <kkebreau@posteo.net>, 43654@debbugs.gnu.org
Subject: [bug#43654] [PATCH] Add perl-opengl
Date: Tue, 6 Oct 2020 00:47:00 +0200	[thread overview]
Message-ID: <20201005224700.GA21768@jurong> (raw)
In-Reply-To: <20201005223543.GA19912@jurong>

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

On Tue, Oct 06, 2020 at 12:35:43AM +0200, Andreas Enge wrote:
> But it is already tomorrow, time to stop.

Did I mention that Guix is addictive?

Here is a patch that compiles and can run the examples in the subdirectory
of the same name.

If you feel like it, you could replace "cdr" by "match", and maybe test
if all of the inputs are actually needed.

Andreas


[-- Attachment #2: 0001-gnu-Add-perl-opengl.patch --]
[-- Type: text/plain, Size: 4548 bytes --]

From c6e00eac49ce859a53c1b00a6165c009f778885d Mon Sep 17 00:00:00 2001
From: Andreas Enge <andreas@enge.fr>
Date: Tue, 6 Oct 2020 00:43:45 +0200
Subject: [PATCH] gnu: Add perl-opengl.

* gnu/packages/perl.scm (perl-opengl): New variable.

Co-authored-by: Malte Frank Gerdes <malte.f.gerdes@gmail.com>
---
 gnu/packages/perl.scm | 67 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 65 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index e093a63770..24de203741 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2013, 2019 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2013, 2019, 2020 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015, 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
@@ -27,6 +27,7 @@
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2020 Malte Frank Gerdes <malte.f.gerdes@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -74,7 +75,8 @@
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages video)
-  #:use-module (gnu packages web))
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xorg))
 
 ;;;
 ;;; Please: Try to add new module packages in alphabetic order.
@@ -7870,6 +7872,67 @@ technology to store hierarchical information such as links to other
 documents within a single file.")
     (license (package-license perl))))
 
+(define-public perl-opengl
+  (package
+    (name "perl-opengl")
+    (version "0.70")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "mirror://cpan/authors/id/C/CH/CHM/OpenGL-"
+               version
+               ".tar.gz"))
+        (sha256
+          (base32
+            "1q3lz168q081iwl9jg21fbzhp9la79gav9mv6nmh2jab83s2l3mj"))))
+    (build-system perl-build-system)
+    (inputs `(("mesa" ,mesa) ; TODO: needed?
+              ("glu" ,glu) ; TODO: needed?
+              ("freeglut" ,freeglut) ; TODO: needed?
+              ("libxi" ,libxi)
+              ("libxmu" ,libxmu)))
+    (arguments
+     '(#:tests? #f ; test.pl fails with our empty glversion.txt, while
+                   ; the package still seems to work on the examples
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'glversion
+           ;; Building utils/glversion.txt fails, and is probably
+           ;; dependent on the graphics card in the build system.
+           ;; Replace it by a content-free file; while this breaks
+           ;; the tests, the examples in the examples/ subdirectory
+           ;; can be run.
+           (lambda _
+             (substitute* "Makefile.PL"
+               (("unlink") "# unlink") ; prevent utils/glversion.txt
+                                       ; from being deleted once...
+               (("\\.\"\\$make_ver clean\"") "")) ; ...and twice...
+             (substitute* "utils/Makefile"
+               (("all: glversion.txt") "all: ")) ; ...and thrice.
+             (call-with-output-file "utils/glversion.txt"
+               (lambda (port)
+                 (display (string-append "FREEGLUT=\nGLUT=\nVERSION=\n"
+                                         "VENDOR=\nRENDERER=\n"
+                                         "EXTENSIONS=\n")
+                          port)))
+             #t))
+         (add-before 'configure 'fix-library-flags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "Makefile.PL"
+               (("-L/usr/local/freeglut/lib")
+                (string-concatenate
+                 (map (lambda (input)
+                        (string-append "-L" (cdr input) "/lib\n"))
+                      inputs))))
+             #t)))))
+    (home-page "https://metacpan.org/release/OpenGL")
+    (synopsis
+      "Perl bindings to the OpenGL API, GLU, and GLUT/FreeGLUT")
+    (description "The package provides Perl bindings to OpenGL, GLU
+and FreeGLUT.")
+    (license (package-license perl))))
+
 (define-public perl-package-anon
   (package
     (name "perl-package-anon")
-- 
2.28.0


  reply	other threads:[~2020-10-05 22:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-27 19:06 [bug#43654] [PATCH] Add perl-opengl Malte Frank Gerdes
2020-10-02  4:13 ` Kei Kebreau
2020-10-02 17:59   ` Malte Frank Gerdes
2020-10-02 18:29   ` Andreas Enge
2020-10-02 19:33     ` Malte Frank Gerdes
2020-10-04  8:26       ` Andreas Enge
2020-10-04 12:28         ` Malte Frank Gerdes
2020-10-04 12:32         ` Malte Frank Gerdes
2020-10-05 20:51       ` Andreas Enge
2020-10-05 22:35         ` Andreas Enge
2020-10-05 22:47           ` Andreas Enge [this message]
2020-10-05 15:01   ` Malte Frank Gerdes
2020-10-05 20:05     ` Andreas Enge
2020-10-05 20:11     ` Andreas Enge
2020-10-05  8:10 ` Malte Frank Gerdes
2020-10-07 18:20 ` Malte Frank Gerdes
2020-10-10 13:09   ` bug#43654: " Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201005224700.GA21768@jurong \
    --to=andreas@enge.fr \
    --cc=43654@debbugs.gnu.org \
    --cc=kkebreau@posteo.net \
    --cc=malte.f.gerdes@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).