gnu: Add CTL.
[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)))
122
123 (define-public ctl
124 (package
125 (name "ctl")
126 (version "1.5.2")
127 (source (origin
128 (method url-fetch)
129 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
130 version ".tar.gz"))
131 (sha256
132 (base32
133 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
134 (build-system cmake-build-system)
135 (arguments '(#:tests? #f)) ;no 'test' target
136
137 ;; Headers include OpenEXR and IlmBase headers.
138 (propagated-inputs `(("openexr" ,openexr)))
139
140 (home-page "http://ampasctl.sourceforge.net")
141 (synopsis "Color Transformation Language")
142 (description
143 "The Color Transformation Language, or CTL, is a small programming
144 language that was designed to serve as a building block for digital color
145 management systems. CTL allows users to describe color transforms in a
146 concise and unambiguous way by expressing them as programs. In order to apply
147 a given transform to an image, the color management system instructs a CTL
148 interpreter to load and run the CTL program that describes the transform. The
149 original and the transformed image constitute the CTL program's input and
150 output.")
151
152 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
153 ;; and headers use different wording.
154 (license (license:bsd-style "file://LICENSE"))))