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, 2020 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>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages gl)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages bison)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages elf)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages freedesktop)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages guile)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages llvm)
46 #:use-module (gnu packages mono)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages python-xyz)
50 #:use-module (gnu packages tls)
51 #:use-module (gnu packages video)
52 #:use-module (gnu packages vulkan)
53 #:use-module (gnu packages xdisorg)
54 #:use-module (gnu packages xml)
55 #:use-module (gnu packages xorg)
56 #:use-module (guix download)
57 #:use-module (guix git-download)
58 #:use-module (guix hg-download)
59 #:use-module (guix build-system gnu)
60 #:use-module (guix build-system cmake)
61 #:use-module (guix build-system meson)
62 #:use-module ((guix licenses) #:prefix license:)
63 #:use-module (guix packages)
64 #:use-module (guix utils)
65 #:use-module (ice-9 match)
66 #:use-module ((srfi srfi-1) #:hide (zip)))
74 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-"
78 "1xqhk9bn10nbvffw3r4p4rjslwz1l7gaycc0x2pqkr2irp7q9x7n"))))
79 (build-system gnu-build-system)
81 `(("mesa" ,mesa))) ; according to glu.pc
82 (home-page "http://www.opengl.org/archives/resources/faq/technical/glu.htm")
83 (synopsis "Mesa OpenGL Utility library")
85 "GLU, or OpenGL Utility Library provides some higher-level functionality
86 not provided by just OpenGL itself. Some of GLU's Features
87 include: Scaling of 2D images and creation of mipmap pyramids,
88 Transformation of object coordinates into device coordinates and
89 vice versa, Support for NURBS surfaces, Support for tessellation
90 of concave or bow tie polygonal primitives, Specialty transformation
91 matrices for creating perspective and orthographic projections,
92 positioning a camera, and selection/picking, Rendering of disk,
93 cylinder, and sphere primitives, Interpreting OpenGL error values
95 (license (license:x11-style "http://directory.fsf.org/wiki/License:SGIFreeBv2"))))
97 (define-public freeglut
104 "mirror://sourceforge/freeglut/freeglut/"
105 version "/freeglut-" version ".tar.gz"))
108 "0s6sk49q8ijgbsrrryb7dzqx2fa744jhx1wck5cz5jia2010w06l"))))
109 (build-system cmake-build-system)
111 '(#:tests? #f ;no test target
112 #:configure-flags '("-DFREEGLUT_BUILD_STATIC_LIBS=OFF")))
113 (inputs `(("libx11" ,libx11)
115 ("libxrandr" ,libxrandr)
116 ("libxxf86vm" ,libxxf86vm)))
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)
152 '(#:configure-flags '("--disable-static")))))
158 (home-page "https://github.com/frankheckenbach/ftgl")
161 (uri (git-reference (url home-page)
162 (commit (string-append "v" version))))
163 (file-name (git-file-name name version))
166 "0zjs1h9w30gajq9lndzvjsa26rsmr1081lb1fbpbj10yhcdcsc79"))))
167 (build-system gnu-build-system)
169 `(#:configure-flags '("--disable-static")))
170 ;; The pkg-config file lists "freetype2" as Requires.private.
171 (propagated-inputs `(("freetype" ,freetype)))
172 (inputs `(("libx11" ,libx11)
176 `(("pkg-config" ,pkg-config)
177 ("autoconf" ,autoconf)
178 ("automake" ,automake)
179 ("libtool" ,libtool)))
180 (synopsis "Font rendering library for OpenGL applications")
182 "FTGL is a font rendering library for OpenGL applications. Supported
183 rendering modes are: Bitmaps, Anti-aliased pixmaps, Texture maps, Outlines,
184 Polygon meshes, and Extruded polygon meshes.")
185 (license license:x11)))
195 (url "https://github.com/divVerent/s2tc.git")
196 (commit (string-append "v" version))))
197 (file-name (git-file-name name version))
199 (base32 "1fg323fk7wlv2xh6lw66wswgcv6qi8aaadk7c28h2f2lj1s7njnf"))))
200 (build-system gnu-build-system)
202 `(("autoconf" ,autoconf)
203 ("automake" ,automake)
204 ("libtool" ,libtool)))
206 `(("mesa-headers" ,mesa-headers)))
207 (home-page "https://github.com/divVerent/s2tc")
208 (synopsis "S3 Texture Compression implementation")
210 "S2TC is a patent-free implementation of S3 Texture Compression (S3TC,
211 also known as DXTn or DXTC) for Mesa.")
212 (license license:expat)))
214 ;;; Mesa needs LibVA headers to build its Gallium-based VA API implementation;
215 ;;; LibVA itself depends on Mesa. We use the following to solve the circular
217 (define libva-without-mesa
218 ;; Delay to work around circular import problem.
222 (name "libva-without-mesa")
223 (inputs `(,@(fold alist-delete (package-inputs libva)
224 '("mesa" "wayland"))))
226 (strip-keyword-arguments
228 (substitute-keyword-arguments (package-arguments libva)
229 ((#:configure-flags flags)
230 '(list "--disable-glx" "--disable-egl"))))))))
239 (uri (list (string-append "https://mesa.freedesktop.org/archive/"
240 "mesa-" version ".tar.xz")
241 (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
242 "mesa-" version ".tar.xz")
243 (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
244 version "/mesa-" version ".tar.xz")))
247 "1r4giqq7q7zqbn23lbw7v5vswagxx8qj6ij2w8bsb697mvk6g90x"))
249 (search-patches "mesa-skip-disk-cache-test.patch"))))
250 (build-system meson-build-system)
252 `(;; The following are in the Requires.private field of gl.pc.
254 ("libvdpau" ,libvdpau)
256 ("libxdamage" ,libxdamage)
257 ("libxfixes" ,libxfixes)
258 ("libxshmfence" ,libxshmfence)
259 ("libxxf86vm" ,libxxf86vm)
260 ("xorgproto" ,xorgproto)))
263 ("libelf" ,elfutils) ;required for r600 when using llvm
264 ("libva" ,(force libva-without-mesa))
266 ;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support
267 ("libxrandr" ,libxrandr)
269 ,@(match (%current-system)
270 ((or "x86_64-linux" "i686-linux")
271 ;; Note: update the 'clang' input of mesa-opencl when bumping this.
275 ("makedepend" ,makedepend)
277 ("wayland-protocols" ,wayland-protocols)))
281 ("gettext" ,gettext-minimal)
282 ,@(match (%current-system)
283 ((or "x86_64-linux" "i686-linux")
284 `(("glslang" ,glslang)))
287 ("pkg-config" ,pkg-config)
288 ("python" ,python-wrapper)
289 ("python-mako" ,python-mako)
290 ("which" ,(@ (gnu packages base) which))))
293 '(,@(match (%current-system)
294 ((or "armhf-linux" "aarch64-linux")
295 ;; TODO: Fix svga driver for aarch64 and armhf.
296 '("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl"))
298 '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
299 ;; Enable various optional features. TODO: opencl requires libclc,
300 ;; omx requires libomxil-bellagio
301 "-Dplatforms=x11,drm,surfaceless,wayland"
302 "-Dglx=dri" ;Thread Local Storage, improves performance
308 ;; features required by wayland
311 "-Dshared-glapi=true"
313 ;; Enable Vulkan on i686-linux and x86-64-linux.
314 ,@(match (%current-system)
315 ((or "i686-linux" "x86_64-linux")
316 '("-Dvulkan-drivers=intel,amd"))
318 '("-Dvulkan-drivers=auto")))
320 ;; Enable the Vulkan overlay layer on i686-linux and x86-64-linux.
321 ,@(match (%current-system)
322 ((or "x86_64-linux" "i686-linux")
323 '("-Dvulkan-overlay-layer=true"))
327 ;; Also enable the tests.
330 ;; on non-intel systems, drop i915 and i965
331 ;; from the default dri drivers
332 ,@(match (%current-system)
333 ((or "x86_64-linux" "i686-linux")
334 '("-Ddri-drivers=i915,i965,nouveau,r200,r100"
335 "-Dllvm=true")) ; default is x86/x86_64 only
337 '("-Ddri-drivers=nouveau,r200,r100"))))
339 ;; XXX: 'debugoptimized' causes LTO link failures on some drivers. The
340 ;; documentation recommends using 'release' for performance anyway.
341 #:build-type "release"
343 #:modules ((ice-9 match)
346 (guix build meson-build-system))
348 (modify-phases %standard-phases
350 'unpack 'patch-create_test_cases
352 (substitute* "src/intel/genxml/gen_pack_header.py"
353 (("/usr/bin/env python2") (which "python")))
355 ,@(if (string-prefix? "i686" (or (%current-target-system)
357 ;; Disable new test from Mesa 19 that fails on i686. Upstream
358 ;; report: <https://bugs.freedesktop.org/show_bug.cgi?id=110612>.
359 `((add-after 'unpack 'disable-failing-test
361 (substitute* "src/gallium/tests/unit/meson.build"
362 (("'u_format_test',") ""))
366 'configure 'fix-dlopen-libnames
367 (lambda* (#:key inputs outputs #:allow-other-keys)
368 (let ((out (assoc-ref outputs "out")))
369 ;; Remain agnostic to .so.X.Y.Z versions while doing
370 ;; the substitutions so we're future-safe.
371 (substitute* "src/glx/dri_common.c"
372 (("dlopen\\(\"libGL\\.so")
373 (string-append "dlopen(\"" out "/lib/libGL.so")))
374 (substitute* "src/egl/drivers/dri2/egl_dri2.c"
376 (string-append "\"" out "/lib/libglapi.so")))
377 (substitute* "src/gbm/main/backend.c"
378 ;; No need to patch the gbm_gallium_drm.so reference;
379 ;; it's never installed since Mesa removed its
380 ;; egl_gallium support.
382 (string-append "\"" out "/lib/dri/gbm_dri.so")))
384 (add-after 'install 'symlinks-instead-of-hard-links
385 (lambda* (#:key outputs #:allow-other-keys)
386 ;; All the drivers and gallium targets create hard links upon
387 ;; installation (search for "hardlink each megadriver instance"
388 ;; in the makefiles). This is no good for us since we'd produce
389 ;; nars that contain several copies of these files. Thus, turn
390 ;; them into symlinks, which saves ~124 MiB.
391 (let* ((out (assoc-ref outputs "out"))
392 (lib (string-append out "/lib"))
393 (files (find-files lib
395 (and (string-contains file ".so")
397 (stat:type stat))))))
398 (inodes (map (compose stat:ino stat) files)))
399 (for-each (lambda (inode)
400 (match (filter-map (match-lambda
402 (and (= ino inode) file)))
406 ((reference others ..1)
407 (format #t "creating ~a symlinks to '~a'~%"
408 (length others) reference)
409 (for-each delete-file others)
410 (for-each (lambda (file)
411 (if (string=? (dirname file)
413 (symlink (basename reference)
415 (symlink reference file)))
417 (delete-duplicates inodes))
419 (home-page "https://mesa3d.org/")
420 (synopsis "OpenGL and Vulkan implementations")
421 (description "Mesa is a free implementation of the OpenGL and Vulkan
422 specifications - systems for rendering interactive 3D graphics. A variety of
423 device drivers allows Mesa to be used in many different environments ranging
424 from software emulation to complete hardware acceleration for modern GPUs.")
425 (license license:x11)))
427 (define-public mesa-opencl
432 (substitute-keyword-arguments (package-arguments mesa)
433 ((#:configure-flags flags)
434 `(cons "-Dgallium-opencl=standalone" ,flags))))
437 ,@(package-inputs mesa)))
440 ,@(package-native-inputs mesa)))))
442 (define-public mesa-opencl-icd
444 (inherit mesa-opencl)
445 (name "mesa-opencl-icd")
447 (substitute-keyword-arguments (package-arguments mesa)
448 ((#:configure-flags flags)
449 `(cons "-Dgallium-opencl=icd"
450 ,(delete "-Dgallium-opencl=standalone" flags)))))))
452 (define-public mesa-headers
455 (name "mesa-headers")
456 (propagated-inputs '())
461 (modify-phases %standard-phases
466 (lambda* (#:key outputs #:allow-other-keys)
467 (copy-recursively "include" (string-append
468 (assoc-ref outputs "out")
472 ;;; The mesa-demos distribution contains non-free files, many files with no
473 ;;; clear license information, and many demos that aren't useful for most
474 ;;; people, so we just use this for the mesa-utils package below, and possibly
475 ;;; other packages in the future. This is modeled after Debian's solution.
476 (define (mesa-demos-source version)
479 (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/demos"
480 "/mesa-demos-" version ".tar.bz2"))
481 (sha256 (base32 "0zgzbz55a14hz83gbmm0n9gpjnf5zadzi2kjjvkn6khql2a9rs81"))))
483 (define-public mesa-utils
487 (source (mesa-demos-source version))
488 (build-system gnu-build-system)
494 `(("pkg-config" ,pkg-config)))
497 (modify-phases %standard-phases
500 (lambda* (#:key outputs #:allow-other-keys)
501 (let ((out (assoc-ref outputs "out")))
502 (mkdir-p (string-append out "/bin"))
505 (copy-file file (string-append out "/bin/" (basename file))))
506 '("src/xdemos/glxdemo" "src/xdemos/glxgears"
507 "src/xdemos/glxinfo" "src/xdemos/glxheads"))
509 (home-page "https://mesa3d.org/")
510 (synopsis "Utility tools for Mesa")
512 "The mesa-utils package contains several utility tools for Mesa: glxdemo,
513 glxgears, glxheads, and glxinfo.")
514 ;; glxdemo is public domain; others expat.
515 (license (list license:expat license:public-domain))))
523 (uri (string-append "mirror://sourceforge/glew/glew/" version
524 "/glew-" version ".tgz"))
527 "159wk5dc0ykjbxvag5i1m2mhp23zkk6ra04l26y3jc3nwvkr3ph4"))
528 (modules '((guix build utils)))
531 (substitute* "config/Makefile.linux"
535 (build-system gnu-build-system)
537 '(#:phases (modify-phases %standard-phases (delete 'configure))
538 #:make-flags (list (string-append "GLEW_PREFIX="
539 (assoc-ref %outputs "out"))
540 (string-append "GLEW_DEST="
541 (assoc-ref %outputs "out")))
542 #:tests? #f)) ;no 'check' target
549 ;; <GL/glew.h> includes <GL/glu.h>.
550 (propagated-inputs `(("glu" ,glu)))
552 (home-page "http://glew.sourceforge.net/")
553 (synopsis "OpenGL extension loading library for C and C++")
555 "The OpenGL Extension Wrangler Library (GLEW) is a C/C++ extension
556 loading library. GLEW provides efficient run-time mechanisms for determining
557 which OpenGL extensions are supported on the target platform. OpenGL core and
558 extension functionality is exposed in a single header file.")
559 (license license:bsd-3)))
561 (define-public guile-opengl
563 (name "guile-opengl")
567 (uri (string-append "mirror://gnu/guile-opengl/guile-opengl-"
571 "13qfx4xh8baryxqrv986l848ygd0piqwm6s2s90pxk9c0m9vklim"))))
572 (build-system gnu-build-system)
573 (native-inputs `(("pkg-config" ,pkg-config)))
574 (inputs `(("guile" ,guile-2.2)
577 ("freeglut" ,freeglut)))
579 '(#:phases (modify-phases %standard-phases
580 (add-after 'configure 'patch-makefile
582 ;; Install compiled Guile files in the expected place.
583 (substitute* '("Makefile")
585 "godir = $(moddir)\n"))))
586 (add-before 'build 'patch-dynamic-link
587 (lambda* (#:key inputs outputs #:allow-other-keys)
588 (define (dynamic-link-substitute file lib input)
590 (("dynamic-link \"lib([a-zA-Z]+)\"" _ lib)
591 (string-append "dynamic-link \""
592 (assoc-ref inputs input)
593 "/lib/lib" lib "\""))))
594 ;; Replace dynamic-link calls for libGL, libGLU, and
595 ;; libglut with absolute paths to the store.
596 (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa")
597 (dynamic-link-substitute "glu/runtime.scm" "GLU" "glu")
598 (dynamic-link-substitute "glut/runtime.scm" "glut"
600 (home-page "https://gnu.org/s/guile-opengl")
601 (synopsis "Guile binding for the OpenGL graphics API")
603 "Guile-OpenGL is a library for Guile that provides bindings to the
604 OpenGL graphics API.")
605 (license license:lgpl3+)))
607 (define-public guile3.0-opengl
609 (inherit guile-opengl)
610 (name "guile3.0-opengl")
612 (substitute-keyword-arguments (package-arguments guile-opengl)
614 `(modify-phases ,phases
615 (add-after 'unpack 'build-with-guile-3.0
617 (substitute* "configure"
618 (("_guile_versions_to_search=\"")
619 "_guile_versions_to_search=\"3.0 "))
622 `(("guile" ,guile-3.0)
625 ("freeglut" ,freeglut)))))
627 (define-public libepoxy
634 "https://github.com/anholt/libepoxy/releases/download/"
635 version "/libepoxy-" version ".tar.xz"))
638 "1ll9fach4v30dsyd47s5ial4gaiwihzr2afb77vxxzzy3mlcrlhb"))))
641 (modify-phases %standard-phases
644 'configure 'patch-paths
645 (lambda* (#:key inputs #:allow-other-keys)
646 (let ((python (assoc-ref inputs "python"))
647 (mesa (assoc-ref inputs "mesa")))
648 (substitute* "src/gen_dispatch.py"
649 (("/usr/bin/env python") python))
650 (substitute* (find-files "." "\\.[ch]$")
651 (("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
652 (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
654 (build-system meson-build-system)
656 `(("pkg-config" ,pkg-config)
660 (home-page "https://github.com/anholt/libepoxy/")
661 (synopsis "A library for handling OpenGL function pointer management")
663 "A library for handling OpenGL function pointer management.")
664 (license license:x11)))
672 ;; No versioned archive available.
673 (uri "http://www.lonesock.net/files/soil.zip")
676 "00gpwp9dldzhsdhksjvmbhsd2ialraqbv6v6dpikdmpncj6mnc52"))))
677 (build-system gnu-build-system)
679 '(#:tests? #f ; no tests
680 #:phases (modify-phases %standard-phases
682 (add-before 'build 'init-build
683 (lambda* (#:key outputs #:allow-other-keys)
684 (let ((out (assoc-ref outputs "out")))
685 (setenv "CFLAGS" "-fPIC") ; needed for shared library
686 ;; Use alternate Makefile
687 (copy-file "projects/makefile/alternate Makefile.txt"
690 (substitute* '("Makefile")
691 (("INCLUDEDIR = /usr/include/SOIL")
692 (string-append "INCLUDEDIR = " out "/include/SOIL"))
693 (("LIBDIR = /usr/lib")
694 (string-append "LIBDIR = " out "/lib"))
695 ;; Remove these flags from 'install' commands.
696 (("-o root -g root") ""))))))))
701 (home-page "https://www.lonesock.net/soil.html")
702 (synopsis "OpenGL texture loading library")
704 "SOIL is a tiny C library used primarily for uploading textures into
706 (license license:public-domain)))
714 (uri (string-append "https://github.com/glfw/glfw"
715 "/releases/download/" version
716 "/glfw-" version ".zip"))
719 "09kk5yc1zhss9add8ryqrngrr16hdmc94rszgng135bhw09mxmdp"))))
720 (build-system cmake-build-system)
722 '(#:tests? #f ; no test target
723 #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
725 `(("doxygen" ,doxygen)
728 `(("mesa" ,mesa) ;included in public headers
730 ;; These are in 'Requires.private' of 'glfw3.pc'.
732 ("libxrandr" ,libxrandr)
733 ("libxinerama" ,libxinerama)
734 ("libxcursor" ,libxcursor)
735 ("libxxf86vm" ,libxxf86vm)))
736 (home-page "https://www.glfw.org")
737 (synopsis "OpenGL application development library")
739 "GLFW is a library for OpenGL, OpenGL ES and Vulkan development for
740 desktop computers. It provides a simple API for creating windows, contexts
741 and surfaces, receiving input and events.")
742 (license license:zlib)))
744 (define-public nanovg-for-extempore
746 (name "nanovg-for-extempore")
750 (uri (string-append "https://github.com/extemporelang/nanovg/"
751 "archive/" version ".tar.gz"))
752 (file-name (string-append name "-" version ".tar.gz"))
755 "0ivs1sagq19xiw8jxd9f8w2b39svi0n9hrbmdvckwvqg95r8701g"))))
756 (build-system cmake-build-system)
757 (arguments `(#:tests? #f)) ; no tests included
760 ;; Extempore refuses to build on architectures other than x86_64
761 (supported-systems '("x86_64-linux"))
762 (home-page "https://github.com/extemporelang/nanovg")
763 (synopsis "2D vector drawing library on top of OpenGL")
764 (description "NanoVG is small antialiased vector graphics rendering
765 library for OpenGL. It has lean API modeled after HTML5 canvas API. It is
766 aimed to be a practical and fun toolset for building scalable user interfaces
767 and visualizations.")
768 (license license:zlib)))
778 "http://geuz.org/gl2ps/src/gl2ps-"
782 "1qpidkz8x3bxqf69hlhyz1m0jmfi9kq24fxsp7rq6wfqzinmxjq3"))))
783 (build-system cmake-build-system)
789 `(#:tests? #f)) ;; no tests
790 (home-page "http://www.geuz.org/gl2ps/")
791 (synopsis "OpenGL to PostScript printing library")
792 (description "GL2PS is a C library providing high quality vector
793 output for any OpenGL application. GL2PS uses sorting algorithms
794 capable of handling intersecting and stretched polygons, as well as
795 non-manifold objects. GL2PS provides many features including advanced
796 smooth shading and text rendering, culling of invisible primitives and
797 mixed vector/bitmap output.")
798 ;; GL2PS is dual-licenced and can be used under the terms of either.
799 (license (list license:lgpl2.0+
800 (license:fsf-free "http://www.geuz.org/gl2ps/COPYING.GL2PS"
801 "GPL-incompatible copyleft license")))))
803 (define-public virtualgl
811 (url "https://github.com/VirtualGL/virtualgl.git")
813 (file-name (git-file-name name version))
815 (base32 "0yyc553xsb5n0rx7jp9p4wdbd7md07b3qrkf3ssyjavqqg908qg9"))))
817 `(#:tests? #f ; no tests are available
818 #:configure-flags (list
819 (string-append "-DCMAKE_INSTALL_LIBDIR="
820 (assoc-ref %outputs "out") "/lib")
821 "-DVGL_USESSL=1"))) ; use OpenSSL
822 (build-system cmake-build-system)
823 (inputs `(("glu" ,glu)
824 ("libjpeg-turbo" ,libjpeg-turbo)
827 ("openssl" ,openssl)))
828 (native-inputs `(("pkg-config" ,pkg-config)))
829 (home-page "https://www.virtualgl.org")
830 (synopsis "Redirects 3D commands from an OpenGL application onto a 3D
832 (description "VirtualGL redirects the 3D rendering commands from OpenGL
833 applications to 3D accelerator hardware in a dedicated server and displays the
834 rendered output interactively to a thin client located elsewhere on the
836 (license license:wxwindows3.1+)))
838 (define-public mojoshader
839 (let ((changeset "5887634ea695"))
842 (version (string-append "20190825" "-" changeset))
847 (url "https://hg.icculus.org/icculus/mojoshader/")
848 (changeset changeset)))
849 (file-name (git-file-name name version))
851 (base32 "0ibl4z1696jiifv9j5drir7jm0b5px0vwkwckbi7cfd46p7p6wcy"))))
853 ;; Tests only for COMPILER_SUPPORT=ON.
855 #:configure-flags '("-DBUILD_SHARED=ON"
857 "-DDEPTH_CLIPPING=ON")
859 (modify-phases %standard-phases
861 (lambda* (#:key outputs #:allow-other-keys)
862 (let* ((out (assoc-ref outputs "out"))
863 (lib (string-append out "/lib"))
864 (header (string-append out "/include")))
865 (install-file "libmojoshader.so" lib)
866 (for-each (lambda (f)
867 (install-file f header))
868 (find-files "../source" "mojoshader.*\\.h$"))
869 (let ((profiles-header (string-append header "/profiles")))
870 (mkdir-p profiles-header)
871 (rename-file (string-append header "/mojoshader_profile.h")
872 (string-append profiles-header "/mojoshader_profile.h"))))
874 (build-system cmake-build-system)
875 (home-page "https://www.icculus.org/mojoshader/")
876 (synopsis "Work with Direct3D shaders on alternate 3D APIs")
877 (description "MojoShader is a library to work with Direct3D shaders on
878 alternate 3D APIs and non-Windows platforms. The primary motivation is moving
879 shaders to OpenGL languages on the fly. The developer deals with \"profiles\"
880 that represent various target languages, such as GLSL or ARB_*_program.
882 This allows a developer to manage one set of shaders, presumably written in
883 Direct3D HLSL, and use them across multiple rendering backends. This also
884 means that the developer only has to worry about one (offline) compiler to
885 manage program complexity, while MojoShader itself deals with the reduced
886 complexity of the bytecode at runtime.
888 MojoShader provides both a simple API to convert bytecode to various profiles,
889 and (optionally) basic glue to rendering APIs to abstract the management of
890 the shaders at runtime.")
891 (license license:zlib))))
893 (define-public mojoshader-with-viewport-flip
894 ;; Changeset c586d4590241 replaced glProgramViewportFlip with
895 ;; glProgramViewportInfo.
896 ;; https://hg.icculus.org/icculus/mojoshader/rev/c586d4590241
897 (let ((changeset "2e37299b13d8"))
900 (name "mojoshader-with-viewport-flip")
901 (version (string-append "20190725" "-" changeset))
906 (url "https://hg.icculus.org/icculus/mojoshader/")
907 (changeset changeset)))
908 (file-name (git-file-name name version))
910 (base32 "0ffws7cqbskxwc3hjsnnzq4r2bbf008kdr3b11pa3kr7dsi50y6i"))))
911 (synopsis "Work with Direct3D shaders on alternate 3D APIs (with viewport flip)")
912 (description "This is the last version of the mojoshader library with
913 the glProgramViewportFlip before it was replaced with glProgramViewportInfo.")
914 (license license:zlib))))
916 (define-public mojoshader-cs
917 (let ((commit "10d0dba21ff1cfe332eb7de328a2adce01286bd7"))
919 (name "mojoshader-cs")
920 (version (git-version "20191205" "1" commit))
924 (url "https://github.com/FNA-XNA/MojoShader")
926 (file-name (git-file-name name version))
929 "11mdhf3fmb9rsn2iv753gmb596j4dh5j2iipgw078vg0lj23rml7"))))
930 (build-system gnu-build-system)
932 '(#:tests? #f ; No tests.
934 (modify-phases %standard-phases
938 (invoke "make" "-C" "csharp")))
940 (lambda* (#:key outputs #:allow-other-keys)
941 (let ((out (assoc-ref outputs "out")))
942 (install-file "csharp/bin/MojoShader-CS.dll" (string-append out "/lib"))
946 (home-page "https://github.com/FNA-XNA/MojoShader")
947 (synopsis "C# wrapper for MojoShader")
949 "Mojoshader-CS provides C# bindings for the Mojoshader library.
950 The C# wrapper was written to be used for FNA's platform support. However, this
951 is written in a way that can be used for any general C# application.")
952 (license license:zlib))))