gnu: w3m: Update to 0.5.3+git20180125 [fixes CVE-2018-{6196,6197,6198}].
[jackhill/guix/guix.git] / gnu / packages / gl.scm
CommitLineData
daca8666 1;;; GNU Guix --- Functional package management for GNU
187731a5 2;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
822efdff 3;;; Copyright © 2013 Joshua Grant <tadni@riseup.net>
432360d7 4;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
d0d0f8d1 5;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
cc7a5c71 6;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
093c6f8b 7;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
b4c8c413 8;;; Copyright © 2016 David Thompson <davet@gnu.org>
c5e91014 9;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
725d8d2c 10;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
d64f3439 11;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
905d15e1 12;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
daca8666
JG
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages gl)
c4a667bf 30 #:use-module (gnu packages)
b021a2ad 31 #:use-module (gnu packages autotools)
200726ed 32 #:use-module (gnu packages bison)
725d8d2c 33 #:use-module (gnu packages compression)
432360d7 34 #:use-module (gnu packages documentation)
653569e8 35 #:use-module (gnu packages elf)
200726ed 36 #:use-module (gnu packages flex)
3a92a5b3
DC
37 #:use-module (gnu packages fontutils)
38 #:use-module (gnu packages freedesktop)
ce4d7abf 39 #:use-module (gnu packages gettext)
3a92a5b3 40 #:use-module (gnu packages guile)
725d8d2c 41 #:use-module (gnu packages image)
ce4d7abf 42 #:use-module (gnu packages linux)
093c6f8b 43 #:use-module (gnu packages llvm)
3a92a5b3 44 #:use-module (gnu packages pkg-config)
200726ed 45 #:use-module (gnu packages python)
d64f3439 46 #:use-module (gnu packages tls)
7e31978b 47 #:use-module (gnu packages video)
2b226af1 48 #:use-module (gnu packages xdisorg)
3a92a5b3
DC
49 #:use-module (gnu packages xml)
50 #:use-module (gnu packages xorg)
3a92a5b3
DC
51 #:use-module (guix download)
52 #:use-module (guix build utils)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system cmake)
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix packages)
57 #:use-module (guix utils)
58 #:use-module (ice-9 match))
daca8666
JG
59
60(define-public glu
61 (package
62 (name "glu")
63 (version "9.0.0")
64 (source (origin
a124bbd2
SB
65 (method url-fetch)
66 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-"
67 version ".tar.gz"))
68 (sha256
69 (base32
70 "0r72yyhj09x3krn3kn629jqbwyq50ji8w5ri2pn6zwrk35m4g1s3"))))
daca8666 71 (build-system gnu-build-system)
187731a5 72 (propagated-inputs
a124bbd2 73 `(("mesa" ,mesa))) ; according to glu.pc
daca8666
JG
74 (home-page "http://www.opengl.org/archives/resources/faq/technical/glu.htm")
75 (synopsis "Mesa OpenGL Utility library")
76 (description
77 "GLU, or OpenGL Utility Library provides some higher-level functionality
35b9e423 78not provided by just OpenGL itself. Some of GLU's Features
daca8666
JG
79include: Scaling of 2D images and creation of mipmap pyramids,
80Transformation of object coordinates into device coordinates and
81vice versa, Support for NURBS surfaces, Support for tessellation
82of concave or bow tie polygonal primitives, Specialty transformation
83matrices for creating perspective and orthographic projections,
84positioning a camera, and selection/picking, Rendering of disk,
85cylinder, and sphere primitives, Interpreting OpenGL error values
86as ASCII text.")
584f2e1b 87 (license (license:x11-style "http://directory.fsf.org/wiki/License:SGIFreeBv2"))))
daca8666
JG
88
89(define-public freeglut
90 (package
91 (name "freeglut")
8ce36e81 92 (version "3.0.0")
daca8666 93 (source (origin
a124bbd2
SB
94 (method url-fetch)
95 (uri (string-append
0f971a04 96 "mirror://sourceforge/freeglut/freeglut/"
a124bbd2
SB
97 version "/freeglut-" version ".tar.gz"))
98 (sha256
99 (base32
100 "18knkyczzwbmyg8hr4zh8a1i5ga01np2jzd1rwmsh7mh2n2vwhra"))))
8ce36e81
SB
101 (build-system cmake-build-system)
102 (arguments '(#:tests? #f)) ; no test target
daca8666 103 (inputs `(("mesa" ,mesa)
a124bbd2
SB
104 ("libx11" ,libx11)
105 ("libxi" ,libxi)
106 ("libxrandr" ,libxrandr)
107 ("libxxf86vm" ,libxxf86vm)
108 ("inputproto" ,inputproto)
109 ("xinput" ,xinput)))
9b5db9be
TUBK
110 (propagated-inputs
111 ;; Headers from Mesa and GLU are needed.
112 `(("glu" ,glu)
113 ("mesa" ,mesa)))
daca8666
JG
114 (home-page "http://freeglut.sourceforge.net/")
115 (synopsis "Alternative to the OpenGL Utility Toolkit (GLUT)")
116 (description
117 "Freeglut is a completely Free/OpenSourced alternative to
35b9e423 118the OpenGL Utility Toolkit (GLUT) library. GLUT was originally
daca8666 119written by Mark Kilgard to support the sample programs in the
35b9e423 120second edition OpenGL 'RedBook'. Since then, GLUT has been used
daca8666
JG
121in a wide variety of practical applications because it is simple,
122widely available and highly portable.
123
124GLUT (and hence freeglut) allows the user to create and manage windows
125containing OpenGL contexts on a wide range of platforms and also read
35b9e423 126the mouse, keyboard and joystick functions. Freeglut is released under
daca8666 127the X-Consortium license.")
584f2e1b 128 (license license:x11)))
daca8666 129
0da0f434
RW
130;; Needed for "kiki".
131(define-public freeglut-2.8
132 (package (inherit freeglut)
133 (name "freeglut")
134 (version "2.8.1")
135 (source (origin
136 (method url-fetch)
137 (uri (string-append
138 "mirror://sourceforge/freeglut/freeglut/"
139 version "/freeglut-" version ".tar.gz"))
140 (sha256
141 (base32
142 "16lrxxxd9ps9l69y3zsw6iy0drwjsp6m26d1937xj71alqk6dr6x"))))
143 (build-system gnu-build-system)))
144
daca8666
JG
145(define-public ftgl
146 (package
147 (name "ftgl")
148 (version "2.1.3-rc5")
149 (source (origin
a124bbd2
SB
150 (method url-fetch)
151 (uri (string-append
0f971a04 152 "mirror://sourceforge/ftgl/FTGL%20Source/2.1.3~rc5/"
a124bbd2
SB
153 "ftgl-" version ".tar.gz"))
154 (sha256
155 (base32
156 "0nsn4s6vnv5xcgxcw6q031amvh2zfj2smy1r5mbnjj2548hxcn2l"))))
daca8666 157 (build-system gnu-build-system)
9e850534
RW
158 ;; The pkg-config file lists "freetype2" as Requires.private.
159 (propagated-inputs `(("freetype" ,freetype)))
160 (inputs `(("libx11" ,libx11)
a124bbd2
SB
161 ("mesa" ,mesa)
162 ("glu" ,glu)))
daca8666
JG
163 (home-page "http://ftgl.sourceforge.net")
164 (synopsis "Font rendering library for OpenGL applications")
165 (description
35b9e423 166 "FTGL is a font rendering library for OpenGL applications. Supported
daca8666 167rendering modes are: Bitmaps, Anti-aliased pixmaps, Texture maps, Outlines,
e881752c 168Polygon meshes, and Extruded polygon meshes.")
584f2e1b 169 (license license:x11)))
200726ed 170
b021a2ad
TUBK
171(define-public s2tc
172 (package
173 (name "s2tc")
174 (version "1.0")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (string-append
179 "https://github.com/divVerent/s2tc/archive/v" version ".tar.gz"))
180 (sha256
181 (base32 "0ibfdib277fhbqvxzan0bmglwnsl1y1rw2g8skvz82l1sfmmn752"))
182 (file-name (string-append name "-" version ".tar.gz"))))
183 (build-system gnu-build-system)
184 (native-inputs
185 `(("autoconf" ,autoconf)
186 ("automake" ,automake)
187 ("libtool" ,libtool)))
188 (inputs
189 `(("mesa-headers" ,mesa-headers)))
190 (arguments
191 '(#:phases
192 (modify-phases %standard-phases
f8503e2b 193 (add-after 'unpack 'autogen
b021a2ad
TUBK
194 (lambda _
195 (zero? (system* "sh" "autogen.sh")))))))
196 (home-page "https://github.com/divVerent/s2tc")
197 (synopsis "S3 Texture Compression implementation")
198 (description
199 "S2TC is a patent-free implementation of S3 Texture Compression (S3TC,
200also known as DXTn or DXTC) for Mesa.")
584f2e1b 201 (license license:expat)))
b021a2ad 202
7e31978b
TUBK
203;;; Mesa needs LibVA headers to build its Gallium-based VA API implementation;
204;;; LibVA itself depends on Mesa. We use the following to solve the circular
205;;; dependency.
206(define libva-without-mesa
207 ;; Delay to work around circular import problem.
208 (delay
209 (package
210 (inherit libva)
211 (name "libva-without-mesa")
212 (inputs (alist-delete "mesa" (package-inputs libva)))
213 (arguments
214 (strip-keyword-arguments
215 '(#:make-flags)
216 (substitute-keyword-arguments (package-arguments libva)
217 ((#:configure-flags flags)
218 '(list "--disable-glx" "--disable-egl"))))))))
219
200726ed
JD
220(define-public mesa
221 (package
222 (name "mesa")
cb639269 223 (version "17.2.1")
200726ed
JD
224 (source
225 (origin
226 (method url-fetch)
57cdc1fa
MB
227 (uri (list (string-append "https://mesa.freedesktop.org/archive/"
228 "mesa-" version ".tar.xz")
229 (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
0315b20a
MB
230 "mesa-" version ".tar.xz")
231 (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
232 version "/mesa-" version ".tar.xz")))
200726ed 233 (sha256
ce4d7abf 234 (base32
cb639269 235 "07msr6xismw2jq87irwhz7vygvzj6hi38d71paij9zvwh8bmsf3p"))
17f2b485 236 (patches
653569e8 237 (search-patches "mesa-wayland-egl-symbols-check-mips.patch"
0315b20a 238 "mesa-skip-disk-cache-test.patch"))))
200726ed
JD
239 (build-system gnu-build-system)
240 (propagated-inputs
241 `(("glproto" ,glproto)
45191970 242 ;; The following are in the Requires.private field of gl.pc.
ce4d7abf 243 ("libdrm" ,libdrm)
4ea1ad91 244 ("libvdpau" ,libvdpau)
8bb1699b 245 ("libx11" ,libx11)
200726ed 246 ("libxdamage" ,libxdamage)
45191970
TUBK
247 ("libxfixes" ,libxfixes)
248 ("libxshmfence" ,libxshmfence)
200726ed
JD
249 ("libxxf86vm" ,libxxf86vm)))
250 (inputs
e0b744f1 251 `(("expat" ,expat)
ce4d7abf
MW
252 ("dri2proto" ,dri2proto)
253 ("dri3proto" ,dri3proto)
653569e8 254 ("libelf" ,libelf) ;required for r600 when using llvm
7e31978b 255 ("libva" ,(force libva-without-mesa))
200726ed 256 ("libxml2" ,libxml2)
ce4d7abf 257 ;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support
0272ee49 258 ("libxvmc" ,libxvmc)
c5e91014
EF
259 ,@(match (%current-system)
260 ((or "x86_64-linux" "i686-linux")
4c2aaa60 261 `(("llvm" ,llvm-3.9.1))) ; exactly 3.9.0 or 3.9.1 for swrast
c5e91014
EF
262 (_
263 `()))
3e71b9ff 264 ("makedepend" ,makedepend)
e0b744f1
DC
265 ("presentproto" ,presentproto)
266 ("s2tc" ,s2tc)
cb639269
MB
267 ("wayland" ,wayland)
268 ("wayland-protocols" ,wayland-protocols)))
200726ed 269 (native-inputs
e0b744f1 270 `(("pkg-config" ,pkg-config)
653569e8
MB
271 ("python" ,python-2)
272 ("which" ,(@ (gnu packages base) which))))
200726ed 273 (arguments
ce4d7abf 274 `(#:configure-flags
2a8b89c2 275 '(,@(match (%current-system)
665c0958 276 ("armhf-linux"
2a087882 277 ;; TODO: Add etnaviv,imx when libdrm supports etnaviv.
31c70cce 278 '("--with-gallium-drivers=freedreno,nouveau,r300,r600,swrast,vc4,virgl"))
665c0958 279 ("aarch64-linux"
31c70cce 280 ;; TODO: Fix svga driver for aarch64 and armhf.
ffb4da7a 281 '("--with-gallium-drivers=freedreno,nouveau,r300,r600,swrast,vc4,virgl"))
2a8b89c2
EF
282 (_
283 '("--with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast,virgl")))
3e2570d8
TUBK
284 ;; Enable various optional features. TODO: opencl requires libclc,
285 ;; omx requires libomxil-bellagio
665c0958 286 "--with-platforms=x11,drm,wayland,surfaceless"
3e2570d8
TUBK
287 "--enable-glx-tls" ;Thread Local Storage, improves performance
288 ;; "--enable-opencl"
289 ;; "--enable-omx"
290 "--enable-osmesa"
0f481f06 291 "--enable-xa"
8ea75f27
DC
292 ;; features required by wayland
293 "--enable-gles2"
294 "--enable-gbm"
295 "--enable-shared-glapi"
b4c8c413
DT
296 ;; Without floating point texture support, drivers such as Nouveau
297 ;; are stuck at OpenGL 2.1 instead of OpenGL 3.0+.
298 "--enable-texture-float"
0315b20a 299
044006f3
EF
300 ;; Also enable the tests.
301 "--enable-gallium-tests"
0f481f06
MW
302
303 ;; on non-intel systems, drop i915 and i965
304 ;; from the default dri drivers
305 ,@(match (%current-system)
306 ((or "x86_64-linux" "i686-linux")
38c4ca41 307 '("--with-dri-drivers=i915,i965,nouveau,r200,radeon,swrast"
653569e8 308 "--enable-llvm")) ; default is x86/x86_64 only
0f481f06
MW
309 (_
310 '("--with-dri-drivers=nouveau,r200,radeon,swrast"))))
e8a7a180
EF
311 #:phases
312 (modify-phases %standard-phases
313 (add-after
314 'unpack 'patch-create_test_cases
315 (lambda _
316 (substitute* "src/compiler/glsl/tests/lower_jumps/create_test_cases.py"
317 (("/usr/bin/env bash") (which "bash")))
318 (substitute* "src/intel/genxml/gen_pack_header.py"
0315b20a
MB
319 (("/usr/bin/env python2") (which "python")))
320 #t))
e8a7a180
EF
321 (add-before
322 'build 'fix-dlopen-libnames
323 (lambda* (#:key inputs outputs #:allow-other-keys)
324 (let ((s2tc (assoc-ref inputs "s2tc"))
e8a7a180
EF
325 (out (assoc-ref outputs "out")))
326 ;; Remain agnostic to .so.X.Y.Z versions while doing
327 ;; the substitutions so we're future-safe.
328 (substitute*
329 '("src/gallium/auxiliary/util/u_format_s3tc.c"
330 "src/mesa/main/texcompress_s3tc.c")
331 (("\"libtxc_dxtn\\.so")
332 (string-append "\"" s2tc "/lib/libtxc_dxtn.so")))
e8a7a180
EF
333 (substitute* "src/glx/dri_common.c"
334 (("dlopen\\(\"libGL\\.so")
335 (string-append "dlopen(\"" out "/lib/libGL.so")))
336 (substitute* "src/egl/drivers/dri2/egl_dri2.c"
337 (("\"libglapi\\.so")
338 (string-append "\"" out "/lib/libglapi.so")))
339 (substitute* "src/gbm/main/backend.c"
340 ;; No need to patch the gbm_gallium_drm.so reference;
341 ;; it's never installed since Mesa removed its
342 ;; egl_gallium support.
343 (("\"gbm_dri\\.so")
0315b20a
MB
344 (string-append "\"" out "/lib/dri/gbm_dri.so")))
345 #t))))))
346 (home-page "https://mesa3d.org/")
35b9e423 347 (synopsis "OpenGL implementation")
200726ed 348 (description "Mesa is a free implementation of the OpenGL specification -
35b9e423 349a system for rendering interactive 3D graphics. A variety of device drivers
200726ed
JD
350allows Mesa to be used in many different environments ranging from software
351emulation to complete hardware acceleration for modern GPUs.")
584f2e1b 352 (license license:x11)))
7025a035 353
b021a2ad
TUBK
354(define-public mesa-headers
355 (package
356 (inherit mesa)
357 (name "mesa-headers")
358 (propagated-inputs '())
359 (inputs '())
360 (native-inputs '())
361 (arguments
362 '(#:phases
363 (modify-phases %standard-phases
f8503e2b
LC
364 (delete 'configure)
365 (delete 'build)
366 (delete 'check)
367 (replace 'install
b021a2ad
TUBK
368 (lambda* (#:key outputs #:allow-other-keys)
369 (copy-recursively "include" (string-append
370 (assoc-ref outputs "out")
371 "/include")))))))))
372
c90a50eb
TUBK
373;;; The mesa-demos distribution contains non-free files, many files with no
374;;; clear license information, and many demos that aren't useful for most
375;;; people, so we just use this for the mesa-utils package below, and possibly
376;;; other packages in the future. This is modeled after Debian's solution.
377(define (mesa-demos-source version)
378 (origin
379 (method url-fetch)
380 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/demos/" version
381 "/mesa-demos-" version ".tar.bz2"))
7fe3f8cf 382 (sha256 (base32 "1vqb7s5m3fcg2csbiz45mha1pys2xx6rhw94fcyvapqdpm5iawy1"))))
c90a50eb
TUBK
383
384(define-public mesa-utils
385 (package
386 (name "mesa-utils")
7fe3f8cf 387 (version "8.3.0")
c90a50eb
TUBK
388 (source (mesa-demos-source version))
389 (build-system gnu-build-system)
390 (inputs
391 `(("mesa" ,mesa)
392 ("glut" ,freeglut)
393 ("glew" ,glew)))
394 (native-inputs
395 `(("pkg-config" ,pkg-config)))
396 (arguments
7fe3f8cf 397 '(#:phases
c90a50eb
TUBK
398 (modify-phases %standard-phases
399 (replace
f8503e2b 400 'install
c90a50eb
TUBK
401 (lambda* (#:key outputs #:allow-other-keys)
402 (let ((out (assoc-ref outputs "out")))
403 (mkdir-p (string-append out "/bin"))
404 (for-each
405 (lambda (file)
406 (copy-file file (string-append out "/bin/" (basename file))))
407 '("src/xdemos/glxdemo" "src/xdemos/glxgears"
408 "src/xdemos/glxinfo" "src/xdemos/glxheads"))))))))
409 (home-page "http://mesa3d.org/")
410 (synopsis "Utility tools for Mesa")
411 (description
412 "The mesa-utils package contains several utility tools for Mesa: glxdemo,
413glxgears, glxheads, and glxinfo.")
414 ;; glxdemo is public domain; others expat.
584f2e1b 415 (license (list license:expat license:public-domain))))
c90a50eb 416
524f4bec
LC
417(define-public glew
418 (package
419 (name "glew")
766c1488 420 (version "2.0.0")
524f4bec
LC
421 (source (origin
422 (method url-fetch)
de67e922
LF
423 (uri (string-append "mirror://sourceforge/glew/glew/" version
424 "/glew-" version ".tgz"))
524f4bec
LC
425 (sha256
426 (base32
766c1488 427 "0r37fg2s1f0jrvwh6c8cz5x6v4wqmhq42qm15cs9qs349q5c6wn5"))
524f4bec
LC
428 (modules '((guix build utils)))
429 (snippet
430 '(substitute* "config/Makefile.linux"
431 (("= cc") "= gcc")
432 (("/lib64") "/lib")))))
433 (build-system gnu-build-system)
434 (arguments
dc1d3cde 435 '(#:phases (modify-phases %standard-phases (delete 'configure))
524f4bec
LC
436 #:make-flags (list (string-append "GLEW_PREFIX="
437 (assoc-ref %outputs "out"))
438 (string-append "GLEW_DEST="
439 (assoc-ref %outputs "out")))
440 #:tests? #f)) ;no 'check' target
441 (inputs
442 `(("libxi" ,libxi)
443 ("libxmu" ,libxmu)
444 ("libx11" ,libx11)
445 ("mesa" ,mesa)))
446
447 ;; <GL/glew.h> includes <GL/glu.h>.
448 (propagated-inputs `(("glu" ,glu)))
449
450 (home-page "http://glew.sourceforge.net/")
451 (synopsis "OpenGL extension loading library for C and C++")
452 (description
453 "The OpenGL Extension Wrangler Library (GLEW) is a C/C++ extension
454loading library. GLEW provides efficient run-time mechanisms for determining
455which OpenGL extensions are supported on the target platform. OpenGL core and
456extension functionality is exposed in a single header file.")
584f2e1b 457 (license license:bsd-3)))
524f4bec 458
7025a035
DT
459(define-public guile-opengl
460 (package
461 (name "guile-opengl")
462 (version "0.1.0")
463 (source (origin
464 (method url-fetch)
465 (uri (string-append "mirror://gnu/guile-opengl/guile-opengl-"
466 version ".tar.gz"))
467 (sha256
468 (base32
469 "13qfx4xh8baryxqrv986l848ygd0piqwm6s2s90pxk9c0m9vklim"))))
470 (build-system gnu-build-system)
471 (native-inputs `(("pkg-config" ,pkg-config)))
42994090 472 (inputs `(("guile" ,guile-2.2)
7025a035 473 ("mesa" ,mesa)
4becc792 474 ("glu" ,glu)
7025a035
DT
475 ("freeglut" ,freeglut)))
476 (arguments
0e215f49
DT
477 '(#:phases (modify-phases %standard-phases
478 (add-after 'configure 'patch-makefile
479 (lambda _
480 ;; Install compiled Guile files in the expected place.
481 (substitute* '("Makefile")
482 (("^godir = .*$")
483 "godir = $(moddir)\n"))))
484 (add-before 'build 'patch-dynamic-link
485 (lambda* (#:key inputs outputs #:allow-other-keys)
486 (define (dynamic-link-substitute file lib input)
487 (substitute* file
488 (("dynamic-link \"lib([a-zA-Z]+)\"" _ lib)
489 (string-append "dynamic-link \""
490 (assoc-ref inputs input)
491 "/lib/lib" lib "\""))))
492 ;; Replace dynamic-link calls for libGL, libGLU, and
493 ;; libglut with absolute paths to the store.
494 (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa")
495 (dynamic-link-substitute "glu/runtime.scm" "GLU" "glu")
496 (dynamic-link-substitute "glut/runtime.scm" "glut"
497 "freeglut"))))))
cc7a5c71 498 (home-page "https://gnu.org/s/guile-opengl")
66672a45 499 (synopsis "Guile binding for the OpenGL graphics API")
7025a035 500 (description
66672a45
LC
501 "Guile-OpenGL is a library for Guile that provides bindings to the
502OpenGL graphics API.")
584f2e1b 503 (license license:lgpl3+)))
131ddf99
AW
504
505(define-public libepoxy
506 (package
507 (name "libepoxy")
3d3d4014 508 (version "1.4.1")
131ddf99
AW
509 (source (origin
510 (method url-fetch)
511 (uri (string-append
3d3d4014
EF
512 "https://github.com/anholt/libepoxy/releases/download/"
513 version "/libepoxy-" version ".tar.xz"))
131ddf99
AW
514 (sha256
515 (base32
3d3d4014 516 "19hsyap2p0sflj75ycf4af9bsp453bamymbcgnmrphigabsspil8"))))
131ddf99 517 (arguments
9bbd52e5 518 `(#:phases
5f8dd6dc 519 (modify-phases %standard-phases
5f8dd6dc
EF
520 (add-before
521 'configure 'patch-paths
522 (lambda* (#:key inputs #:allow-other-keys)
523 (let ((python (assoc-ref inputs "python"))
524 (mesa (assoc-ref inputs "mesa")))
525 (substitute* "src/gen_dispatch.py"
526 (("/usr/bin/env python") python))
ea50fb8d
EF
527 ;; Add support for aarch64, see upstream:
528 ;; https://github.com/anholt/libepoxy/pull/114
529 (substitute* "test/dlwrap.c"
530 (("GLIBC_2.4") "GLIBC_2.17\", \"GLIBC_2.4"))
5f8dd6dc
EF
531 (substitute* (find-files "." "\\.[ch]$")
532 (("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
533 (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
5f8dd6dc 534 #t))))))
131ddf99
AW
535 (build-system gnu-build-system)
536 (native-inputs
827dc629 537 `(("pkg-config" ,pkg-config)
131ddf99
AW
538 ("python" ,python)))
539 (inputs
540 `(("mesa" ,mesa)))
3d3d4014 541 (home-page "https://github.com/anholt/libepoxy/")
131ddf99
AW
542 (synopsis "A library for handling OpenGL function pointer management")
543 (description
544 "A library for handling OpenGL function pointer management.")
584f2e1b 545 (license license:x11)))
2b226af1
DT
546
547(define-public soil
548 (package
549 (name "soil")
550 (version "1.0.7")
551 (source (origin
552 (method url-fetch)
553 ;; No versioned archive available.
554 (uri "http://www.lonesock.net/files/soil.zip")
555 (sha256
556 (base32
557 "00gpwp9dldzhsdhksjvmbhsd2ialraqbv6v6dpikdmpncj6mnc52"))))
558 (build-system gnu-build-system)
559 (arguments
560 '(#:tests? #f ; no tests
561 #:phases (modify-phases %standard-phases
562 (delete 'configure)
563 (add-before 'build 'init-build
564 (lambda* (#:key outputs #:allow-other-keys)
565 (let ((out (assoc-ref outputs "out")))
566 (setenv "CFLAGS" "-fPIC") ; needed for shared library
567 ;; Use alternate Makefile
568 (copy-file "projects/makefile/alternate Makefile.txt"
569 "src/Makefile")
570 (chdir "src")
571 (substitute* '("Makefile")
572 (("INCLUDEDIR = /usr/include/SOIL")
573 (string-append "INCLUDEDIR = " out "/include/SOIL"))
574 (("LIBDIR = /usr/lib")
575 (string-append "LIBDIR = " out "/lib"))
576 ;; Remove these flags from 'install' commands.
577 (("-o root -g root") ""))))))))
578 (native-inputs
579 `(("unzip" ,unzip)))
580 (inputs
581 `(("mesa" ,mesa)))
582 (home-page "http://www.lonesock.net/soil.html")
583 (synopsis "OpenGL texture loading library")
584 (description
585 "SOIL is a tiny C library used primarily for uploading textures into
586OpenGL.")
584f2e1b 587 (license license:public-domain)))
432360d7
DT
588
589(define-public glfw
590 (package
591 (name "glfw")
592 (version "3.2.1")
593 (source (origin
594 (method url-fetch)
595 (uri (string-append "https://github.com/glfw/glfw"
596 "/releases/download/" version
597 "/glfw-" version ".zip"))
598 (sha256
599 (base32
600 "09kk5yc1zhss9add8ryqrngrr16hdmc94rszgng135bhw09mxmdp"))))
601 (build-system cmake-build-system)
602 (arguments
603 '(#:tests? #f ; no test target
604 #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
605 (native-inputs
606 `(("doxygen" ,doxygen)
607 ("unzip" ,unzip)))
a966281f
LC
608 (propagated-inputs
609 `(("mesa" ,mesa) ;included in public headers
610
611 ;; These are in 'Requires.private' of 'glfw3.pc'.
432360d7
DT
612 ("libx11" ,libx11)
613 ("libxrandr" ,libxrandr)
614 ("libxinerama" ,libxinerama)
a966281f
LC
615 ("libxcursor" ,libxcursor)
616 ("libxxf86vm" ,libxxf86vm)))
432360d7
DT
617 (home-page "http://www.glfw.org")
618 (synopsis "OpenGL application development library")
619 (description
620 "GLFW is a library for OpenGL, OpenGL ES and Vulkan development for
621desktop computers. It provides a simple API for creating windows, contexts
622and surfaces, receiving input and events.")
623 (license license:zlib)))
78acbcb5
RW
624
625(define-public nanovg-for-extempore
626 (package
627 (name "nanovg-for-extempore")
628 (version "0.7.1")
629 (source (origin
630 (method url-fetch)
631 (uri (string-append "https://github.com/extemporelang/nanovg/"
632 "archive/" version ".tar.gz"))
633 (file-name (string-append name "-" version ".tar.gz"))
634 (sha256
635 (base32
636 "0ivs1sagq19xiw8jxd9f8w2b39svi0n9hrbmdvckwvqg95r8701g"))))
637 (build-system cmake-build-system)
638 (arguments `(#:tests? #f)) ; no tests included
639 (inputs
640 `(("mesa" ,mesa)))
39162ee4
RW
641 ;; Extempore refuses to build on architectures other than x86_64
642 (supported-systems '("x86_64-linux"))
78acbcb5
RW
643 (home-page "https://github.com/extemporelang/nanovg")
644 (synopsis "2D vector drawing library on top of OpenGL")
645 (description "NanoVG is small antialiased vector graphics rendering
646library for OpenGL. It has lean API modeled after HTML5 canvas API. It is
647aimed to be a practical and fun toolset for building scalable user interfaces
648and visualizations.")
649 (license license:zlib)))
725d8d2c
AI
650
651(define-public gl2ps
652 (package
653 (name "gl2ps")
905d15e1 654 (version "1.4.0")
725d8d2c
AI
655 (source
656 (origin
657 (method url-fetch)
658 (uri (string-append
659 "http://geuz.org/gl2ps/src/gl2ps-"
660 version ".tgz"))
661 (sha256
662 (base32
905d15e1 663 "1qpidkz8x3bxqf69hlhyz1m0jmfi9kq24fxsp7rq6wfqzinmxjq3"))))
725d8d2c
AI
664 (build-system cmake-build-system)
665 (inputs
666 `(("libpng" ,libpng)
667 ("mesa" ,mesa)
668 ("zlib" ,zlib)))
669 (arguments
670 `(#:tests? #f)) ;; no tests
671 (home-page "http://www.geuz.org/gl2ps/")
672 (synopsis "OpenGL to PostScript printing library")
673 (description "GL2PS is a C library providing high quality vector
674output for any OpenGL application. GL2PS uses sorting algorithms
675capable of handling intersecting and stretched polygons, as well as
676non-manifold objects. GL2PS provides many features including advanced
677smooth shading and text rendering, culling of invisible primitives and
678mixed vector/bitmap output.")
905d15e1 679 ;; GL2PS is dual-licenced and can be used under the terms of either.
725d8d2c
AI
680 (license (list license:lgpl2.0+
681 (license:fsf-free "http://www.geuz.org/gl2ps/COPYING.GL2PS"
682 "GPL-incompatible copyleft license")))))
d64f3439
RH
683
684(define-public virtualgl
685 (package
686 (name "virtualgl")
687 (version "2.5.2")
688 (source
689 (origin
690 (method url-fetch)
691 (uri (string-append "https://github.com/VirtualGL/virtualgl/archive/"
692 version ".tar.gz"))
693 (file-name (string-append name "-" version ".tar.gz"))
694 (sha256
695 (base32
696 "0rnid3hwrry9d5d4m7sygq00xxx976rgk00a3557m9r5kxbmy476"))))
697 (arguments
698 `(#:tests? #f ;; no tests are available
699 #:configure-flags (list "-DVGL_USESSL=1" ;; use OpenSSL
700 (string-append "-DCMAKE_INSTALL_LIBDIR="
701 (assoc-ref %outputs "out") "/lib"))))
702 (build-system cmake-build-system)
703 (inputs `(("glu" ,glu)
704 ("libjpeg-turbo" ,libjpeg-turbo)
705 ("mesa" ,mesa)
706 ("openssl" ,openssl)))
707 (native-inputs `(("pkg-config", pkg-config)))
708 (home-page "https://www.virtualgl.org")
709 (synopsis "Redirects 3D commands from an OpenGL application onto a 3D
710graphics card")
711 (description "VirtualGL redirects the 3D rendering commands from OpenGL
712applications to 3D accelerator hardware in a dedicated server and displays the
713rendered output interactively to a thin client located elsewhere on the
714network.")
715 (license license:wxwindows3.1+)))