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