guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnu: Add guile-opengl


From: David Thompson
Subject: [PATCH] gnu: Add guile-opengl
Date: Tue, 24 Jun 2014 22:03:20 -0400
User-agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

Finally got around to finishing up this package.  I ran the example
programs shipped with guile-opengl and confirmed that they work as
expected. :)

How does it look?

>From 3368e741ce35751f050663ee58d8ea4da1afd0e0 Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Tue, 24 Jun 2014 21:59:47 -0400
Subject: [PATCH] gnu: Add guile-opengl.

* gnu/packages/gl.scm (guile-opengl): New variable.
---
 gnu/packages/gl.scm | 43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 2741595..d314b03 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <address@hidden>
 ;;; Copyright © 2013 Guy Grant <address@hidden>
+;;; Copyright © 2014 David Thompson <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,7 +31,8 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages fontutils))
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages guile))
 
 (define-public glu
   (package
@@ -170,3 +172,42 @@ a system for rendering interactive 3D graphics. A variety 
of device drivers
 allows Mesa to be used in many different environments ranging from software
 emulation to complete hardware acceleration for modern GPUs.")
     (license l:x11)))
+
+(define-public guile-opengl
+  (package
+    (name "guile-opengl")
+    (version "0.1.0")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "mirror://gnu/guile-opengl/guile-opengl-"
+                                 version ".tar.gz"))
+             (sha256
+              (base32
+               "13qfx4xh8baryxqrv986l848ygd0piqwm6s2s90pxk9c0m9vklim"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("guile" ,guile-2.0)
+              ("mesa" ,mesa)
+              ("freeglut" ,freeglut)))
+    (arguments
+     '(#:phases (alist-cons-before
+                 'build 'patch-dynamic-link
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (define (dynamic-link-substitute file lib input)
+                     (substitute* file
+                       (((string-append "dynamic-link \"" lib "\""))
+                        (string-append "dynamic-link \""
+                                       (assoc-ref inputs input)
+                                       "/lib/" lib "\""))))
+                   ;; Replace dynamic-link calls for libGL, libGLU, and
+                   ;; libglut with absolute paths to the store.
+                   (dynamic-link-substitute "glx/runtime.scm" "libGL" "mesa")
+                   (dynamic-link-substitute "glu/runtime.scm" "libGLU" "mesa")
+                   (dynamic-link-substitute "glut/runtime.scm" "libglut" 
"freeglut"))
+                 %standard-phases)))
+    (home-page "http://gnu.org/s/guile-opengl";)
+    (synopsis "OpenGL bindings for Guile")
+    (description
+     "GNU Guile-OpenGL is a library providing access to the OpenGL graphics
+API from GNU Guile.")
+    (license l:lgpl3+)))
-- 
2.0.0

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

reply via email to

[Prev in Thread] Current Thread [Next in Thread]