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