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