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