1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Guy Grant <gzg@riseup.net>
4 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages gl)
22 #:use-module ((guix licenses)
23 #:renamer (symbol-prefix-proc 'l:))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix packages)
28 #:use-module (gnu packages bison)
29 #:use-module (gnu packages flex)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages xorg)
33 #:use-module (gnu packages xml)
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages guile))
43 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-"
46 (base32 "0r72yyhj09x3krn3kn629jqbwyq50ji8w5ri2pn6zwrk35m4g1s3"))))
47 (build-system gnu-build-system)
48 (inputs `(("mesa" ,mesa)))
49 (home-page "http://www.opengl.org/archives/resources/faq/technical/glu.htm")
50 (synopsis "Mesa OpenGL Utility library")
52 "GLU, or OpenGL Utility Library provides some higher-level functionality
53 not provided by just OpenGL itself. Some of GLU's Features
54 include: Scaling of 2D images and creation of mipmap pyramids,
55 Transformation of object coordinates into device coordinates and
56 vice versa, Support for NURBS surfaces, Support for tessellation
57 of concave or bow tie polygonal primitives, Specialty transformation
58 matrices for creating perspective and orthographic projections,
59 positioning a camera, and selection/picking, Rendering of disk,
60 cylinder, and sphere primitives, Interpreting OpenGL error values
62 (license (l:x11-style "http://directory.fsf.org/wiki/License:SGIFreeBv2"))))
64 (define-public freeglut
70 (uri (string-append "mirror://sourceforge/project/freeglut/freeglut/"
71 version "/freeglut-" version ".tar.gz"))
73 (base32 "16lrxxxd9ps9l69y3zsw6iy0drwjsp6m26d1937xj71alqk6dr6x"))))
74 (build-system gnu-build-system)
75 (inputs `(("mesa" ,mesa)
78 ("libxrandr" ,libxrandr)
79 ("libxxf86vm" ,libxxf86vm)
80 ("inputproto" ,inputproto)
83 (home-page "http://freeglut.sourceforge.net/")
84 (synopsis "Alternative to the OpenGL Utility Toolkit (GLUT)")
86 "Freeglut is a completely Free/OpenSourced alternative to
87 the OpenGL Utility Toolkit (GLUT) library. GLUT was originally
88 written by Mark Kilgard to support the sample programs in the
89 second edition OpenGL 'RedBook'. Since then, GLUT has been used
90 in a wide variety of practical applications because it is simple,
91 widely available and highly portable.
93 GLUT (and hence freeglut) allows the user to create and manage windows
94 containing OpenGL contexts on a wide range of platforms and also read
95 the mouse, keyboard and joystick functions. freeglut is released under
96 the X-Consortium license.")
102 (version "2.1.3-rc5")
105 (uri (string-append "mirror://sourceforge/project/ftgl/FTGL%20Source/2.1.3~rc5/ftgl-"
108 (base32 "0nsn4s6vnv5xcgxcw6q031amvh2zfj2smy1r5mbnjj2548hxcn2l"))))
109 (build-system gnu-build-system)
110 (inputs `(("freetype" ,freetype)
114 (home-page "http://ftgl.sourceforge.net")
115 (synopsis "Font rendering library for OpenGL applications")
117 "FTGL is a font rendering library for OpenGL applications. Supported
118 rendering modes are: Bitmaps, Anti-aliased pixmaps, Texture maps, Outlines,
119 Polygon meshes, and Extruded polygon meshes")
125 ;; In newer versions (9.0.5, 9.1 and 9.2 tested), "make" results in an
126 ;; infinite configure loop, see
127 ;; https://bugs.freedesktop.org/show_bug.cgi?id=58812
133 "ftp://ftp.freedesktop.org/pub/mesa/older-versions/8.x/"
139 "0pjs8x51c0i6mawgd4w03lxpyx5fnx7rc8plr8jfsscf9yiqs6si"))))
140 (build-system gnu-build-system)
142 `(("glproto" ,glproto)
143 ("libdrm" ,libdrm-2.4.33)
145 ("libxdamage" ,libxdamage)
146 ("libxxf86vm" ,libxxf86vm)))
148 `(("dri2proto" ,dri2proto)
150 ("libxfixes" ,libxfixes)
152 ("makedepend" ,makedepend)))
154 `(("pkg-config" ,pkg-config)
157 ("python" ,python-2))) ; incompatible with Python 3 (print syntax)
160 `("--with-gallium-drivers=r600,svga,swrast") ; drop r300 from the default list as it requires llvm
163 'unpack 'remove-symlink
165 ;; remove dangling symlink to /usr/include/wine/windows
166 (delete-file "src/gallium/state_trackers/d3d1x/w32api"))
168 (home-page "http://mesa3d.org/")
169 (synopsis "Mesa, an OpenGL implementation")
170 (description "Mesa is a free implementation of the OpenGL specification -
171 a system for rendering interactive 3D graphics. A variety of device drivers
172 allows Mesa to be used in many different environments ranging from software
173 emulation to complete hardware acceleration for modern GPUs.")
176 (define-public guile-opengl
178 (name "guile-opengl")
182 (uri (string-append "mirror://gnu/guile-opengl/guile-opengl-"
186 "13qfx4xh8baryxqrv986l848ygd0piqwm6s2s90pxk9c0m9vklim"))))
187 (build-system gnu-build-system)
188 (native-inputs `(("pkg-config" ,pkg-config)))
189 (inputs `(("guile" ,guile-2.0)
191 ("freeglut" ,freeglut)))
193 '(#:phases (alist-cons-before
194 'build 'patch-dynamic-link
195 (lambda* (#:key inputs outputs #:allow-other-keys)
196 (define (dynamic-link-substitute file lib input)
198 (("dynamic-link \"lib([a-zA-Z]+)\"" _ lib)
199 (string-append "dynamic-link \""
200 (assoc-ref inputs input)
201 "/lib/lib" lib "\""))))
202 ;; Replace dynamic-link calls for libGL, libGLU, and
203 ;; libglut with absolute paths to the store.
204 (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa")
205 (dynamic-link-substitute "glu/runtime.scm" "GLU" "mesa")
206 (dynamic-link-substitute "glut/runtime.scm" "glut"
209 (home-page "http://gnu.org/s/guile-opengl")
210 (synopsis "Guile binding for the OpenGL graphics API")
212 "Guile-OpenGL is a library for Guile that provides bindings to the
213 OpenGL graphics API.")