1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages graphics)
21 #:use-module (guix download)
22 #:use-module (guix svn-download)
23 #:use-module (guix packages)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix build-system cmake)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages boost)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages multiprecision)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages qt)
38 #:use-module (gnu packages sdl)
39 #:use-module (gnu packages xorg))
48 "http://gforge.inria.fr/frs/download.php/file/34402/CGAL-"
52 "1565ycbds92bxmhi09avc1jl6ks141ig00j110l49gqxp9swy6zv"))))
53 (build-system cmake-build-system)
55 '(;; "RelWithDebInfo" is not supported.
56 #:build-type "Release"
64 (home-page "http://cgal.org/")
65 (synopsis "Computational geometry algorithms library")
67 "CGAL provides easy access to efficient and reliable geometric algorithms
68 in the form of a C++ library. CGAL is used in various areas needing geometric
69 computation, such as: computer graphics, scientific visualization, computer
70 aided design and modeling, geographic information systems, molecular biology,
71 medical imaging, robotics and motion planning, mesh generation, numerical
72 methods, etc. It provides data structures and algorithms such as
73 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
76 ;; The 'LICENSE' file explains that a subset is available under more
77 ;; permissive licenses.
78 (license license:gpl3+)))
80 (define-public ilmbase
86 (uri (string-append "mirror://savannah/openexr/ilmbase-"
90 "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))))
91 (build-system gnu-build-system)
92 (home-page "http://www.openexr.com/")
93 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
95 "IlmBase provides several utility libraries for C++. Half is a class
96 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
97 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
98 quaternions and other useful 2D and 3D math functions. Iex is an
99 exception-handling library.")
100 (license license:bsd-3)))
102 (define-public openexr
108 (uri (string-append "mirror://savannah/openexr/openexr-"
112 "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n"))
113 (modules '((guix build utils)))
115 '(substitute* (find-files "." "tmpDir\\.h")
118 (patches (list (search-patch "openexr-missing-samples.patch")))))
119 (build-system gnu-build-system)
121 `(("pkg-config" ,pkg-config)))
123 `(("ilmbase" ,ilmbase) ;used in public headers
124 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
125 (home-page "http://www.openexr.com")
126 (synopsis "High-dynamic range file format library")
128 "OpenEXR is a high dynamic-range (HDR) image file format developed for
129 use in computer imaging applications. The IlmImf C++ libraries support
130 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
131 (license license:bsd-3)))
139 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
143 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
144 (build-system cmake-build-system)
145 (arguments '(#:tests? #f)) ;no 'test' target
147 ;; Headers include OpenEXR and IlmBase headers.
148 (propagated-inputs `(("openexr" ,openexr)))
150 (home-page "http://ampasctl.sourceforge.net")
151 (synopsis "Color Transformation Language")
153 "The Color Transformation Language, or CTL, is a small programming
154 language that was designed to serve as a building block for digital color
155 management systems. CTL allows users to describe color transforms in a
156 concise and unambiguous way by expressing them as programs. In order to apply
157 a given transform to an image, the color management system instructs a CTL
158 interpreter to load and run the CTL program that describes the transform. The
159 original and the transformed image constitute the CTL program's input and
162 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
163 ;; and headers use different wording.
164 (license (license:non-copyleft "file://LICENSE"))))
166 (define-public brdf-explorer
168 (name "brdf-explorer")
169 (version "17") ;svn revision
171 ;; There are no release tarballs, and not even tags in the repo,
172 ;; so use the latest revision.
175 (url "http://github.com/wdas/brdf")
176 (revision (string->number version))))
179 "1458fwsqxramh0gpnp24x7brfpl9afhvr1wqg6c78xqwf32960m5"))
180 (file-name (string-append name "-" version "-checkout"))))
181 (build-system gnu-build-system)
183 `(#:phases (modify-phases %standard-phases
185 (lambda* (#:key outputs #:allow-other-keys)
186 (let ((out (assoc-ref outputs "out")))
188 (zero? (system* "qmake"
191 (add-after 'install 'wrap-program
192 (lambda* (#:key outputs #:allow-other-keys)
193 (let* ((out (assoc-ref outputs "out"))
194 (bin (string-append out "/bin"))
197 (with-directory-excursion bin
198 (rename-file "brdf" ".brdf-real")
199 (call-with-output-file "brdf"
201 (format port "#!/bin/sh
202 # Run the thing from its home, otherwise it just bails out.
204 exec -a \"$0\" ~a/.brdf-real~%"
206 (chmod "brdf" #o555))))))))
208 `(("qt" ,qt-4))) ;for 'qmake'
213 ("freeglut" ,freeglut)
215 (home-page "http://www.disneyanimation.com/technology/brdf.html")
217 "Analyze bidirectional reflectance distribution functions (BRDFs)")
219 "BRDF Explorer is an application that allows the development and analysis
220 of bidirectional reflectance distribution functions (BRDFs). It can load and
221 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
222 language), measured material data from the MERL database, and anisotropic
223 measured material data from MIT CSAIL. Graphs and visualizations update in
224 real time as parameters are changed, making it a useful tool for evaluating
225 and understanding different BRDFs (and other component functions).")
226 (license license:ms-pl)))
234 (uri (string-append "http://www.antigrain.com/agg-"
237 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
238 (patches (list (search-patch "agg-am_c_prototype.patch")))))
239 (build-system gnu-build-system)
242 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
244 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
250 ;; let's call configure from configure phase and not now
251 (substitute* "autogen.sh" (("./configure") "# ./configure"))
252 (zero? (system* "sh" "autogen.sh")))
255 `(("pkg-config" ,pkg-config)
257 ("autoconf" ,autoconf)
258 ("automake" ,automake)
262 ("freetype" ,freetype)
264 (home-page "http://antigrain.com")
265 (synopsis "High-quality 2D graphics rendering engine for C++")
267 "Anti-Grain Geometry is a high quality rendering engine written in C++.
268 It supports sub-pixel resolutions and anti-aliasing. It is also library for
269 rendering SVG graphics.")
270 (license license:gpl2+)))