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