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@n0.is>
7 ;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
8 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
9 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
11 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
12 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages gl)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages bison)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages documentation)
36 #:use-module (gnu packages elf)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages fontutils)
39 #:use-module (gnu packages freedesktop)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages guile)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages llvm)
45 #:use-module (gnu packages mono)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages python-xyz)
49 #:use-module (gnu packages tls)
50 #:use-module (gnu packages video)
51 #:use-module (gnu packages vulkan)
52 #:use-module (gnu packages xdisorg)
53 #:use-module (gnu packages xml)
54 #:use-module (gnu packages xorg)
55 #:use-module (guix download)
56 #:use-module (guix git-download)
57 #:use-module (guix hg-download)
58 #:use-module (guix build-system gnu)
59 #:use-module (guix build-system cmake)
60 #:use-module (guix build-system meson)
61 #:use-module ((guix licenses) #:prefix license:)
62 #:use-module (guix packages)
63 #:use-module (guix utils)
64 #:use-module (ice-9 match)
65 #:use-module ((srfi srfi-1) #:hide (zip)))
73 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-"
77 "1xqhk9bn10nbvffw3r4p4rjslwz1l7gaycc0x2pqkr2irp7q9x7n"))))
78 (build-system gnu-build-system)
80 `(("mesa" ,mesa))) ; according to glu.pc
81 (home-page "http://www.opengl.org/archives/resources/faq/technical/glu.htm")
82 (synopsis "Mesa OpenGL Utility library")
84 "GLU, or OpenGL Utility Library provides some higher-level functionality
85 not provided by just OpenGL itself. Some of GLU's Features
86 include: Scaling of 2D images and creation of mipmap pyramids,
87 Transformation of object coordinates into device coordinates and
88 vice versa, Support for NURBS surfaces, Support for tessellation
89 of concave or bow tie polygonal primitives, Specialty transformation
90 matrices for creating perspective and orthographic projections,
91 positioning a camera, and selection/picking, Rendering of disk,
92 cylinder, and sphere primitives, Interpreting OpenGL error values
94 (license (license:x11-style "http://directory.fsf.org/wiki/License:SGIFreeBv2"))))
96 (define-public freeglut
103 "mirror://sourceforge/freeglut/freeglut/"
104 version "/freeglut-" version ".tar.gz"))
107 "18knkyczzwbmyg8hr4zh8a1i5ga01np2jzd1rwmsh7mh2n2vwhra"))))
108 (build-system cmake-build-system)
109 (arguments '(#:tests? #f)) ; no test target
110 (inputs `(("mesa" ,mesa)
113 ("libxrandr" ,libxrandr)
114 ("libxxf86vm" ,libxxf86vm)
115 ("xorgproto" ,xorgproto)
118 ;; Headers from Mesa and GLU are needed.
121 (home-page "http://freeglut.sourceforge.net/")
122 (synopsis "Alternative to the OpenGL Utility Toolkit (GLUT)")
124 "Freeglut is a completely Free/OpenSourced alternative to
125 the OpenGL Utility Toolkit (GLUT) library. GLUT was originally
126 written by Mark Kilgard to support the sample programs in the
127 second edition OpenGL @code{RedBook}. Since then, GLUT has been used
128 in a wide variety of practical applications because it is simple,
129 widely available and highly portable.
131 GLUT (and hence freeglut) allows the user to create and manage windows
132 containing OpenGL contexts on a wide range of platforms and also read
133 the mouse, keyboard and joystick functions. Freeglut is released under
134 the X-Consortium license.")
135 (license license:x11)))
137 ;; Needed for "kiki".
138 (define-public freeglut-2.8
139 (package (inherit freeglut)
145 "mirror://sourceforge/freeglut/freeglut/"
146 version "/freeglut-" version ".tar.gz"))
149 "16lrxxxd9ps9l69y3zsw6iy0drwjsp6m26d1937xj71alqk6dr6x"))))
150 (build-system gnu-build-system)))
156 (home-page "https://github.com/frankheckenbach/ftgl")
159 (uri (git-reference (url home-page)
160 (commit (string-append "v" version))))
161 (file-name (git-file-name name version))
164 "0zjs1h9w30gajq9lndzvjsa26rsmr1081lb1fbpbj10yhcdcsc79"))))
165 (build-system gnu-build-system)
167 `(#:configure-flags '("--disable-static")))
168 ;; The pkg-config file lists "freetype2" as Requires.private.
169 (propagated-inputs `(("freetype" ,freetype)))
170 (inputs `(("libx11" ,libx11)
174 `(("pkg-config" ,pkg-config)
175 ("autoconf" ,autoconf)
176 ("automake" ,automake)
177 ("libtool" ,libtool)))
178 (synopsis "Font rendering library for OpenGL applications")
180 "FTGL is a font rendering library for OpenGL applications. Supported
181 rendering modes are: Bitmaps, Anti-aliased pixmaps, Texture maps, Outlines,
182 Polygon meshes, and Extruded polygon meshes.")
183 (license license:x11)))
193 (url "https://github.com/divVerent/s2tc.git")
194 (commit (string-append "v" version))))
195 (file-name (git-file-name name version))
197 (base32 "1fg323fk7wlv2xh6lw66wswgcv6qi8aaadk7c28h2f2lj1s7njnf"))))
198 (build-system gnu-build-system)
200 `(("autoconf" ,autoconf)
201 ("automake" ,automake)
202 ("libtool" ,libtool)))
204 `(("mesa-headers" ,mesa-headers)))
205 (home-page "https://github.com/divVerent/s2tc")
206 (synopsis "S3 Texture Compression implementation")
208 "S2TC is a patent-free implementation of S3 Texture Compression (S3TC,
209 also known as DXTn or DXTC) for Mesa.")
210 (license license:expat)))
212 ;;; Mesa needs LibVA headers to build its Gallium-based VA API implementation;
213 ;;; LibVA itself depends on Mesa. We use the following to solve the circular
215 (define libva-without-mesa
216 ;; Delay to work around circular import problem.
220 (name "libva-without-mesa")
221 (inputs `(,@(fold alist-delete (package-inputs libva)
222 '("mesa" "wayland"))))
224 (strip-keyword-arguments
226 (substitute-keyword-arguments (package-arguments libva)
227 ((#:configure-flags flags)
228 '(list "--disable-glx" "--disable-egl"))))))))
237 (uri (list (string-append "https://mesa.freedesktop.org/archive/"
238 "mesa-" version ".tar.xz")
239 (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
240 "mesa-" version ".tar.xz")
241 (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
242 version "/mesa-" version ".tar.xz")))
245 "17jp8ghipgz62vqqz5llskxypkcmgf8gnlgnj0pyvnbgi6vryyg3"))
247 (search-patches "mesa-skip-disk-cache-test.patch"))))
248 (build-system meson-build-system)
250 `(;; The following are in the Requires.private field of gl.pc.
252 ("libvdpau" ,libvdpau)
254 ("libxdamage" ,libxdamage)
255 ("libxfixes" ,libxfixes)
256 ("libxshmfence" ,libxshmfence)
257 ("libxxf86vm" ,libxxf86vm)
258 ("xorgproto" ,xorgproto)))
261 ("libelf" ,elfutils) ;required for r600 when using llvm
262 ("libva" ,(force libva-without-mesa))
264 ;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support
265 ("libxrandr" ,libxrandr)
267 ,@(match (%current-system)
268 ((or "x86_64-linux" "i686-linux")
272 ("makedepend" ,makedepend)
274 ("wayland-protocols" ,wayland-protocols)))
278 ("gettext" ,gettext-minimal)
279 ,@(match (%current-system)
280 ((or "x86_64-linux" "i686-linux")
281 `(("glslang" ,glslang)))
284 ("pkg-config" ,pkg-config)
285 ("python" ,python-wrapper)
286 ("python-mako" ,python-mako)
287 ("which" ,(@ (gnu packages base) which))))
290 '(,@(match (%current-system)
291 ((or "armhf-linux" "aarch64-linux")
292 ;; TODO: Fix svga driver for aarch64 and armhf.
293 '("-Dgallium-drivers=etnaviv,freedreno,nouveau,r300,r600,swrast,tegra,v3d,vc4,virgl"))
295 '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
296 ;; Enable various optional features. TODO: opencl requires libclc,
297 ;; omx requires libomxil-bellagio
298 "-Dplatforms=x11,drm,surfaceless,wayland"
299 "-Dglx=dri" ;Thread Local Storage, improves performance
305 ;; features required by wayland
308 "-Dshared-glapi=true"
310 ;; Enable Vulkan on i686-linux and x86-64-linux.
311 ,@(match (%current-system)
312 ((or "i686-linux" "x86_64-linux")
313 '("-Dvulkan-drivers=intel,amd"))
315 '("-Dvulkan-drivers=auto")))
317 ;; Enable the Vulkan overlay layer on i686-linux and x86-64-linux.
318 ,@(match (%current-system)
319 ((or "x86_64-linux" "i686-linux")
320 '("-Dvulkan-overlay-layer=true"))
324 ;; Also enable the tests.
327 ;; on non-intel systems, drop i915 and i965
328 ;; from the default dri drivers
329 ,@(match (%current-system)
330 ((or "x86_64-linux" "i686-linux")
331 '("-Ddri-drivers=i915,i965,nouveau,r200,r100"
332 "-Dllvm=true")) ; default is x86/x86_64 only
334 '("-Ddri-drivers=nouveau,r200,r100"))))
336 ;; XXX: 'debugoptimized' causes LTO link failures on some drivers. The
337 ;; documentation recommends using 'release' for performance anyway.
338 #:build-type "release"
340 #:modules ((ice-9 match)
343 (guix build meson-build-system))
345 (modify-phases %standard-phases
347 'unpack 'patch-create_test_cases
349 (substitute* "src/intel/genxml/gen_pack_header.py"
350 (("/usr/bin/env python2") (which "python")))
352 ,@(if (string-prefix? "i686" (or (%current-target-system)
354 ;; Disable new test from Mesa 19 that fails on i686. Upstream
355 ;; report: <https://bugs.freedesktop.org/show_bug.cgi?id=110612>.
356 `((add-after 'unpack 'disable-failing-test
358 (substitute* "src/gallium/tests/unit/meson.build"
359 (("'u_format_test',") ""))
363 'configure 'fix-dlopen-libnames
364 (lambda* (#:key inputs outputs #:allow-other-keys)
365 (let ((out (assoc-ref outputs "out")))
366 ;; Remain agnostic to .so.X.Y.Z versions while doing
367 ;; the substitutions so we're future-safe.
368 (substitute* "src/glx/dri_common.c"
369 (("dlopen\\(\"libGL\\.so")
370 (string-append "dlopen(\"" out "/lib/libGL.so")))
371 (substitute* "src/egl/drivers/dri2/egl_dri2.c"
373 (string-append "\"" out "/lib/libglapi.so")))
374 (substitute* "src/gbm/main/backend.c"
375 ;; No need to patch the gbm_gallium_drm.so reference;
376 ;; it's never installed since Mesa removed its
377 ;; egl_gallium support.
379 (string-append "\"" out "/lib/dri/gbm_dri.so")))
381 (add-after 'install 'symlinks-instead-of-hard-links
382 (lambda* (#:key outputs #:allow-other-keys)
383 ;; All the drivers and gallium targets create hard links upon
384 ;; installation (search for "hardlink each megadriver instance"
385 ;; in the makefiles). This is no good for us since we'd produce
386 ;; nars that contain several copies of these files. Thus, turn
387 ;; them into symlinks, which saves ~124 MiB.
388 (let* ((out (assoc-ref outputs "out"))
389 (lib (string-append out "/lib"))
390 (files (find-files lib
392 (and (string-contains file ".so")
394 (stat:type stat))))))
395 (inodes (map (compose stat:ino stat) files)))
396 (for-each (lambda (inode)
397 (match (filter-map (match-lambda
399 (and (= ino inode) file)))
403 ((reference others ..1)
404 (format #t "creating ~a symlinks to '~a'~%"
405 (length others) reference)
406 (for-each delete-file others)
407 (for-each (lambda (file)
408 (if (string=? (dirname file)
410 (symlink (basename reference)
412 (symlink reference file)))
414 (delete-duplicates inodes))
416 (home-page "https://mesa3d.org/")
417 (synopsis "OpenGL and Vulkan implementations")
418 (description "Mesa is a free implementation of the OpenGL and Vulkan
419 specifications - systems for rendering interactive 3D graphics. A variety of
420 device drivers allows Mesa to be used in many different environments ranging
421 from software emulation to complete hardware acceleration for modern GPUs.")
422 (license license:x11)))
424 (define-public mesa-opencl
429 (substitute-keyword-arguments (package-arguments mesa)
430 ((#:configure-flags flags)
431 `(cons "-Dgallium-opencl=standalone" ,flags))))
434 ,@(package-inputs mesa)))
437 ,@(package-native-inputs mesa)))))
439 (define-public mesa-opencl-icd
441 (inherit mesa-opencl)
442 (name "mesa-opencl-icd")
444 (substitute-keyword-arguments (package-arguments mesa)
445 ((#:configure-flags flags)
446 `(cons "-Dgallium-opencl=icd"
447 ,(delete "-Dgallium-opencl=standalone" flags)))))))
449 (define-public mesa-headers
452 (name "mesa-headers")
453 (propagated-inputs '())
458 (modify-phases %standard-phases
463 (lambda* (#:key outputs #:allow-other-keys)
464 (copy-recursively "include" (string-append
465 (assoc-ref outputs "out")
469 ;;; The mesa-demos distribution contains non-free files, many files with no
470 ;;; clear license information, and many demos that aren't useful for most
471 ;;; people, so we just use this for the mesa-utils package below, and possibly
472 ;;; other packages in the future. This is modeled after Debian's solution.
473 (define (mesa-demos-source version)
476 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/demos"
477 "/mesa-demos-" version ".tar.bz2"))
478 (sha256 (base32 "0zgzbz55a14hz83gbmm0n9gpjnf5zadzi2kjjvkn6khql2a9rs81"))))
480 (define-public mesa-utils
484 (source (mesa-demos-source version))
485 (build-system gnu-build-system)
491 `(("pkg-config" ,pkg-config)))
494 (modify-phases %standard-phases
497 (lambda* (#:key outputs #:allow-other-keys)
498 (let ((out (assoc-ref outputs "out")))
499 (mkdir-p (string-append out "/bin"))
502 (copy-file file (string-append out "/bin/" (basename file))))
503 '("src/xdemos/glxdemo" "src/xdemos/glxgears"
504 "src/xdemos/glxinfo" "src/xdemos/glxheads"))
506 (home-page "https://mesa3d.org/")
507 (synopsis "Utility tools for Mesa")
509 "The mesa-utils package contains several utility tools for Mesa: glxdemo,
510 glxgears, glxheads, and glxinfo.")
511 ;; glxdemo is public domain; others expat.
512 (license (list license:expat license:public-domain))))
520 (uri (string-append "mirror://sourceforge/glew/glew/" version
521 "/glew-" version ".tgz"))
524 "159wk5dc0ykjbxvag5i1m2mhp23zkk6ra04l26y3jc3nwvkr3ph4"))
525 (modules '((guix build utils)))
528 (substitute* "config/Makefile.linux"
532 (build-system gnu-build-system)
534 '(#:phases (modify-phases %standard-phases (delete 'configure))
535 #:make-flags (list (string-append "GLEW_PREFIX="
536 (assoc-ref %outputs "out"))
537 (string-append "GLEW_DEST="
538 (assoc-ref %outputs "out")))
539 #:tests? #f)) ;no 'check' target
546 ;; <GL/glew.h> includes <GL/glu.h>.
547 (propagated-inputs `(("glu" ,glu)))
549 (home-page "http://glew.sourceforge.net/")
550 (synopsis "OpenGL extension loading library for C and C++")
552 "The OpenGL Extension Wrangler Library (GLEW) is a C/C++ extension
553 loading library. GLEW provides efficient run-time mechanisms for determining
554 which OpenGL extensions are supported on the target platform. OpenGL core and
555 extension functionality is exposed in a single header file.")
556 (license license:bsd-3)))
558 (define-public guile-opengl
560 (name "guile-opengl")
564 (uri (string-append "mirror://gnu/guile-opengl/guile-opengl-"
568 "13qfx4xh8baryxqrv986l848ygd0piqwm6s2s90pxk9c0m9vklim"))))
569 (build-system gnu-build-system)
570 (native-inputs `(("pkg-config" ,pkg-config)))
571 (inputs `(("guile" ,guile-2.2)
574 ("freeglut" ,freeglut)))
576 '(#:phases (modify-phases %standard-phases
577 (add-after 'configure 'patch-makefile
579 ;; Install compiled Guile files in the expected place.
580 (substitute* '("Makefile")
582 "godir = $(moddir)\n"))))
583 (add-before 'build 'patch-dynamic-link
584 (lambda* (#:key inputs outputs #:allow-other-keys)
585 (define (dynamic-link-substitute file lib input)
587 (("dynamic-link \"lib([a-zA-Z]+)\"" _ lib)
588 (string-append "dynamic-link \""
589 (assoc-ref inputs input)
590 "/lib/lib" lib "\""))))
591 ;; Replace dynamic-link calls for libGL, libGLU, and
592 ;; libglut with absolute paths to the store.
593 (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa")
594 (dynamic-link-substitute "glu/runtime.scm" "GLU" "glu")
595 (dynamic-link-substitute "glut/runtime.scm" "glut"
597 (home-page "https://gnu.org/s/guile-opengl")
598 (synopsis "Guile binding for the OpenGL graphics API")
600 "Guile-OpenGL is a library for Guile that provides bindings to the
601 OpenGL graphics API.")
602 (license license:lgpl3+)))
604 (define-public libepoxy
611 "https://github.com/anholt/libepoxy/releases/download/"
612 version "/libepoxy-" version ".tar.xz"))
615 "1ll9fach4v30dsyd47s5ial4gaiwihzr2afb77vxxzzy3mlcrlhb"))))
618 (modify-phases %standard-phases
621 'configure 'patch-paths
622 (lambda* (#:key inputs #:allow-other-keys)
623 (let ((python (assoc-ref inputs "python"))
624 (mesa (assoc-ref inputs "mesa")))
625 (substitute* "src/gen_dispatch.py"
626 (("/usr/bin/env python") python))
627 (substitute* (find-files "." "\\.[ch]$")
628 (("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
629 (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
631 (build-system meson-build-system)
633 `(("pkg-config" ,pkg-config)
637 (home-page "https://github.com/anholt/libepoxy/")
638 (synopsis "A library for handling OpenGL function pointer management")
640 "A library for handling OpenGL function pointer management.")
641 (license license:x11)))
649 ;; No versioned archive available.
650 (uri "http://www.lonesock.net/files/soil.zip")
653 "00gpwp9dldzhsdhksjvmbhsd2ialraqbv6v6dpikdmpncj6mnc52"))))
654 (build-system gnu-build-system)
656 '(#:tests? #f ; no tests
657 #:phases (modify-phases %standard-phases
659 (add-before 'build 'init-build
660 (lambda* (#:key outputs #:allow-other-keys)
661 (let ((out (assoc-ref outputs "out")))
662 (setenv "CFLAGS" "-fPIC") ; needed for shared library
663 ;; Use alternate Makefile
664 (copy-file "projects/makefile/alternate Makefile.txt"
667 (substitute* '("Makefile")
668 (("INCLUDEDIR = /usr/include/SOIL")
669 (string-append "INCLUDEDIR = " out "/include/SOIL"))
670 (("LIBDIR = /usr/lib")
671 (string-append "LIBDIR = " out "/lib"))
672 ;; Remove these flags from 'install' commands.
673 (("-o root -g root") ""))))))))
678 (home-page "https://www.lonesock.net/soil.html")
679 (synopsis "OpenGL texture loading library")
681 "SOIL is a tiny C library used primarily for uploading textures into
683 (license license:public-domain)))
691 (uri (string-append "https://github.com/glfw/glfw"
692 "/releases/download/" version
693 "/glfw-" version ".zip"))
696 "09kk5yc1zhss9add8ryqrngrr16hdmc94rszgng135bhw09mxmdp"))))
697 (build-system cmake-build-system)
699 '(#:tests? #f ; no test target
700 #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
702 `(("doxygen" ,doxygen)
705 `(("mesa" ,mesa) ;included in public headers
707 ;; These are in 'Requires.private' of 'glfw3.pc'.
709 ("libxrandr" ,libxrandr)
710 ("libxinerama" ,libxinerama)
711 ("libxcursor" ,libxcursor)
712 ("libxxf86vm" ,libxxf86vm)))
713 (home-page "http://www.glfw.org")
714 (synopsis "OpenGL application development library")
716 "GLFW is a library for OpenGL, OpenGL ES and Vulkan development for
717 desktop computers. It provides a simple API for creating windows, contexts
718 and surfaces, receiving input and events.")
719 (license license:zlib)))
721 (define-public nanovg-for-extempore
723 (name "nanovg-for-extempore")
727 (uri (string-append "https://github.com/extemporelang/nanovg/"
728 "archive/" version ".tar.gz"))
729 (file-name (string-append name "-" version ".tar.gz"))
732 "0ivs1sagq19xiw8jxd9f8w2b39svi0n9hrbmdvckwvqg95r8701g"))))
733 (build-system cmake-build-system)
734 (arguments `(#:tests? #f)) ; no tests included
737 ;; Extempore refuses to build on architectures other than x86_64
738 (supported-systems '("x86_64-linux"))
739 (home-page "https://github.com/extemporelang/nanovg")
740 (synopsis "2D vector drawing library on top of OpenGL")
741 (description "NanoVG is small antialiased vector graphics rendering
742 library for OpenGL. It has lean API modeled after HTML5 canvas API. It is
743 aimed to be a practical and fun toolset for building scalable user interfaces
744 and visualizations.")
745 (license license:zlib)))
755 "http://geuz.org/gl2ps/src/gl2ps-"
759 "1qpidkz8x3bxqf69hlhyz1m0jmfi9kq24fxsp7rq6wfqzinmxjq3"))))
760 (build-system cmake-build-system)
766 `(#:tests? #f)) ;; no tests
767 (home-page "http://www.geuz.org/gl2ps/")
768 (synopsis "OpenGL to PostScript printing library")
769 (description "GL2PS is a C library providing high quality vector
770 output for any OpenGL application. GL2PS uses sorting algorithms
771 capable of handling intersecting and stretched polygons, as well as
772 non-manifold objects. GL2PS provides many features including advanced
773 smooth shading and text rendering, culling of invisible primitives and
774 mixed vector/bitmap output.")
775 ;; GL2PS is dual-licenced and can be used under the terms of either.
776 (license (list license:lgpl2.0+
777 (license:fsf-free "http://www.geuz.org/gl2ps/COPYING.GL2PS"
778 "GPL-incompatible copyleft license")))))
780 (define-public virtualgl
788 (url "https://github.com/VirtualGL/virtualgl.git")
790 (file-name (git-file-name name version))
792 (base32 "0yyc553xsb5n0rx7jp9p4wdbd7md07b3qrkf3ssyjavqqg908qg9"))))
794 `(#:tests? #f ; no tests are available
795 #:configure-flags (list
796 (string-append "-DCMAKE_INSTALL_LIBDIR="
797 (assoc-ref %outputs "out") "/lib")
798 "-DVGL_USESSL=1"))) ; use OpenSSL
799 (build-system cmake-build-system)
800 (inputs `(("glu" ,glu)
801 ("libjpeg-turbo" ,libjpeg-turbo)
804 ("openssl" ,openssl)))
805 (native-inputs `(("pkg-config" ,pkg-config)))
806 (home-page "https://www.virtualgl.org")
807 (synopsis "Redirects 3D commands from an OpenGL application onto a 3D
809 (description "VirtualGL redirects the 3D rendering commands from OpenGL
810 applications to 3D accelerator hardware in a dedicated server and displays the
811 rendered output interactively to a thin client located elsewhere on the
813 (license license:wxwindows3.1+)))
815 (define-public mojoshader
816 (let ((changeset "5887634ea695"))
819 (version (string-append "20190825" "-" changeset))
824 (url "https://hg.icculus.org/icculus/mojoshader/")
825 (changeset changeset)))
826 (file-name (git-file-name name version))
828 (base32 "0ibl4z1696jiifv9j5drir7jm0b5px0vwkwckbi7cfd46p7p6wcy"))))
830 ;; Tests only for COMPILER_SUPPORT=ON.
832 #:configure-flags '("-DBUILD_SHARED=ON"
834 "-DDEPTH_CLIPPING=ON")
836 (modify-phases %standard-phases
838 (lambda* (#:key outputs #:allow-other-keys)
839 (let* ((out (assoc-ref outputs "out"))
840 (lib (string-append out "/lib"))
841 (header (string-append out "/include")))
842 (install-file "libmojoshader.so" lib)
843 (for-each (lambda (f)
844 (install-file f header))
845 (find-files "../source" "mojoshader.*\\.h$"))
846 (let ((profiles-header (string-append header "/profiles")))
847 (mkdir-p profiles-header)
848 (rename-file (string-append header "/mojoshader_profile.h")
849 (string-append profiles-header "/mojoshader_profile.h"))))
851 (build-system cmake-build-system)
852 (home-page "https://www.icculus.org/mojoshader/")
853 (synopsis "Work with Direct3D shaders on alternate 3D APIs")
854 (description "MojoShader is a library to work with Direct3D shaders on
855 alternate 3D APIs and non-Windows platforms. The primary motivation is moving
856 shaders to OpenGL languages on the fly. The developer deals with \"profiles\"
857 that represent various target languages, such as GLSL or ARB_*_program.
859 This allows a developer to manage one set of shaders, presumably written in
860 Direct3D HLSL, and use them across multiple rendering backends. This also
861 means that the developer only has to worry about one (offline) compiler to
862 manage program complexity, while MojoShader itself deals with the reduced
863 complexity of the bytecode at runtime.
865 MojoShader provides both a simple API to convert bytecode to various profiles,
866 and (optionally) basic glue to rendering APIs to abstract the management of
867 the shaders at runtime.")
868 (license license:zlib))))
870 (define-public mojoshader-with-viewport-flip
871 ;; Changeset c586d4590241 replaced glProgramViewportFlip with
872 ;; glProgramViewportInfo.
873 ;; https://hg.icculus.org/icculus/mojoshader/rev/c586d4590241
874 (let ((changeset "2e37299b13d8"))
877 (name "mojoshader-with-viewport-flip")
878 (version (string-append "20190725" "-" changeset))
883 (url "https://hg.icculus.org/icculus/mojoshader/")
884 (changeset changeset)))
885 (file-name (git-file-name name version))
887 (base32 "0ffws7cqbskxwc3hjsnnzq4r2bbf008kdr3b11pa3kr7dsi50y6i"))))
888 (synopsis "Work with Direct3D shaders on alternate 3D APIs (with viewport flip)")
889 (description "This is the last version of the mojoshader library with
890 the glProgramViewportFlip before it was replaced with glProgramViewportInfo.")
891 (license license:zlib))))
893 (define-public mojoshader-cs
894 (let ((commit "10d0dba21ff1cfe332eb7de328a2adce01286bd7"))
896 (name "mojoshader-cs")
897 (version (git-version "20191205" "1" commit))
901 (url "https://github.com/FNA-XNA/MojoShader")
903 (file-name (git-file-name name version))
906 "11mdhf3fmb9rsn2iv753gmb596j4dh5j2iipgw078vg0lj23rml7"))))
907 (build-system gnu-build-system)
909 '(#:tests? #f ; No tests.
911 (modify-phases %standard-phases
915 (invoke "make" "-C" "csharp")))
917 (lambda* (#:key outputs #:allow-other-keys)
918 (let ((out (assoc-ref outputs "out")))
919 (install-file "csharp/bin/MojoShader-CS.dll" (string-append out "/lib"))
923 (home-page "https://github.com/FNA-XNA/MojoShader")
924 (synopsis "C# wrapper for MojoShader")
926 "Mojoshader-CS provides C# bindings for the Mojoshader library.
927 The C# wrapper was written to be used for FNA's platform support. However, this
928 is written in a way that can be used for any general C# application.")
929 (license license:zlib))))