gnu: Add OpenEXR and IlmBase.
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages graphics)
20 #:use-module (guix download)
21 #:use-module (guix packages)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix build-system cmake)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages pkg-config)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages multiprecision)
29 #:use-module (gnu packages boost))
30
31 (define-public cgal
32 (package
33 (name "cgal")
34 (version "4.5.1")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append
38 "http://gforge.inria.fr/frs/download.php/file/34402/CGAL-"
39 version ".tar.xz"))
40 (sha256
41 (base32
42 "1565ycbds92bxmhi09avc1jl6ks141ig00j110l49gqxp9swy6zv"))))
43 (build-system cmake-build-system)
44 (arguments
45 '(;; "RelWithDebInfo" is not supported.
46 #:build-type "Release"
47
48 ;; No 'test' target.
49 #:tests? #f))
50 (inputs
51 `(("mpfr" ,mpfr)
52 ("gmp" ,gmp)
53 ("boost" ,boost)))
54 (home-page "http://cgal.org/")
55 (synopsis "Computational geometry algorithms library")
56 (description
57 "CGAL provides easy access to efficient and reliable geometric algorithms
58 in the form of a C++ library. CGAL is used in various areas needing geometric
59 computation, such as: computer graphics, scientific visualization, computer
60 aided design and modeling, geographic information systems, molecular biology,
61 medical imaging, robotics and motion planning, mesh generation, numerical
62 methods, etc. It provides data structures and algorithms such as
63 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
64 many more.")
65
66 ;; The 'LICENSE' file explains that a subset is available under more
67 ;; permissive licenses.
68 (license license:gpl3+)))
69
70 (define-public ilmbase
71 (package
72 (name "ilmbase")
73 (version "2.2.0")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "mirror://savannah/openexr/ilmbase-"
77 version ".tar.gz"))
78 (sha256
79 (base32
80 "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))))
81 (build-system gnu-build-system)
82 (home-page "http://www.openexr.com/")
83 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
84 (description
85 "IlmBase provides several utility libraries for C++. Half is a class
86 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
87 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
88 quaternions and other useful 2D and 3D math functions. Iex is an
89 exception-handling library.")
90 (license license:bsd-3)))
91
92 (define-public openexr
93 (package
94 (name "openexr")
95 (version "2.2.0")
96 (source (origin
97 (method url-fetch)
98 (uri (string-append "mirror://savannah/openexr/openexr-"
99 version ".tar.gz"))
100 (sha256
101 (base32
102 "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n"))
103 (modules '((guix build utils)))
104 (snippet
105 '(substitute* (find-files "." "tmpDir\\.h")
106 (("\"/var/tmp/\"")
107 "\"/tmp/\"")))
108 (patches (list (search-patch "openexr-missing-samples.patch")))))
109 (build-system gnu-build-system)
110 (native-inputs
111 `(("pkg-config" ,pkg-config)))
112 (propagated-inputs
113 `(("ilmbase" ,ilmbase) ;used in public headers
114 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
115 (home-page "http://www.openexr.com")
116 (synopsis #f)
117 (description
118 "OpenEXR is a high dynamic-range (HDR) image file format developed for
119 use in computer imaging applications. The IlmImf libraries supports storage
120 of the \"EXR\" file format for storing 16-bit floating-point images.")
121 (license license:bsd-3)))