guix: cmake-build-system: Install libraries to /lib.
[jackhill/guix/guix.git] / gnu / packages / photo.scm
CommitLineData
9208d0c1 1;;; GNU Guix --- Functional package management for GNU
4e9dfe39 2;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
d9cef612 3;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
1d093724 4;;; Copyright © 2015, 2017 Andreas Enge <andreas@enge.fr>
4dbef239 5;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
c49840f8 6;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
9208d0c1
LC
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages photo)
0e6412c1 24 #:use-module (guix build-system cmake)
9208d0c1 25 #:use-module (guix build-system gnu)
b138ec94 26 #:use-module (guix build-system perl)
f0644195
AE
27 #:use-module (guix download)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
8957241d 30 #:use-module (guix utils)
1d093724 31 #:use-module (gnu packages algebra)
9208d0c1 32 #:use-module (gnu packages autotools)
f0644195 33 #:use-module (gnu packages base)
8957241d 34 #:use-module (gnu packages boost)
0e6412c1 35 #:use-module (gnu packages compression)
91a9c65c
RJ
36 #:use-module (gnu packages curl)
37 #:use-module (gnu packages databases)
1d093724 38 #:use-module (gnu packages gettext)
8957241d
AE
39 #:use-module (gnu packages ghostscript)
40 #:use-module (gnu packages gl)
91a9c65c 41 #:use-module (gnu packages gnome)
c49840f8 42 #:use-module (gnu packages glib)
8957241d 43 #:use-module (gnu packages graphics)
91a9c65c 44 #:use-module (gnu packages gtk)
0e6412c1 45 #:use-module (gnu packages image)
8957241d 46 #:use-module (gnu packages imagemagick)
f0644195 47 #:use-module (gnu packages libusb)
91a9c65c 48 #:use-module (gnu packages llvm)
d16479c5 49 #:use-module (gnu packages man)
8957241d 50 #:use-module (gnu packages maths)
b138ec94 51 #:use-module (gnu packages perl)
f0644195
AE
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages popt)
91a9c65c 54 #:use-module (gnu packages python)
8957241d 55 #:use-module (gnu packages readline)
8f9ac901 56 #:use-module (gnu packages tex)
8957241d 57 #:use-module (gnu packages web)
1d093724 58 #:use-module (gnu packages wxwidgets)
8957241d 59 #:use-module (gnu packages xfig)
1d093724 60 #:use-module (gnu packages xorg)
4dbef239 61 #:use-module (gnu packages xml)
4e9dfe39 62 #:use-module ((srfi srfi-1) #:hide (zip))
4dbef239 63 #:use-module (srfi srfi-26))
9208d0c1 64
d9cef612
RW
65(define-public libraw
66 (package
67 (name "libraw")
0e7cb137 68 (version "0.18.6")
d9cef612
RW
69 (source (origin
70 (method url-fetch)
fe535d81 71 (uri (string-append "https://www.libraw.org/data/LibRaw-"
d9cef612
RW
72 version ".tar.gz"))
73 (sha256
74 (base32
0e7cb137 75 "0fx5mwkg0rx37qgxnajc8g8i0mhc6822100ljay5g94aap5arf75"))))
d9cef612 76 (build-system gnu-build-system)
fe535d81 77 (home-page "https://www.libraw.org")
d9cef612
RW
78 (synopsis "Raw image decoder")
79 (description
80 "LibRaw is a library for reading RAW files obtained from digital photo
81cameras (CRW/CR2, NEF, RAF, DNG, and others).")
341f4965 82 (license license:lgpl2.1+)))
d9cef612 83
9208d0c1
LC
84(define-public libexif
85 (package
86 (name "libexif")
87 (version "0.6.21")
88 (source (origin
89 (method url-fetch)
de67e922
LF
90 (uri (string-append "mirror://sourceforge/libexif/libexif/"
91 version "/libexif-" version ".tar.bz2"))
9208d0c1
LC
92 (sha256
93 (base32
94 "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
95 (build-system gnu-build-system)
96 (home-page "http://libexif.sourceforge.net/")
97 (synopsis "Read and manipulate EXIF data in digital photographs")
98 (description
99 "The libexif C library allows applications to read, edit, and save EXIF
100data as produced by digital cameras.")
341f4965 101 (license license:lgpl2.1+)))
9208d0c1
LC
102
103(define-public libgphoto2
104 (package
105 (name "libgphoto2")
69874f5f 106 (version "2.5.11")
9208d0c1
LC
107 (source (origin
108 (method url-fetch)
de67e922
LF
109 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
110 version "/libgphoto2-" version ".tar.bz2"))
9208d0c1
LC
111 (sha256
112 (base32
69874f5f 113 "1ap070zz6l4kn2mbyxb1yj4x5ar8hpdbmf2pvjxgnly1ss319dkz"))))
9208d0c1
LC
114 (build-system gnu-build-system)
115 (native-inputs `(("pkg-config" ,pkg-config)))
116 (inputs
7e49a851 117 `(("libjpeg-turbo" ,libjpeg-turbo)
3246cc91 118 ("libltdl" ,libltdl)
d32f4800
TGR
119 ("libusb" ,libusb)
120 ("libxml2" ,libxml2)))
9208d0c1
LC
121 (propagated-inputs
122 `(;; The .pc refers to libexif.
123 ("libexif" ,libexif)))
124 (home-page "http://www.gphoto.org/proj/libgphoto2/")
125 (synopsis "Accessing digital cameras")
126 (description
127 "This is the library backend for gphoto2. It contains the code for PTP,
128MTP, and other vendor specific protocols for controlling and transferring data
129from digital cameras.")
130
131 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
341f4965 132 (license license:lgpl2.1+)))
9208d0c1
LC
133
134(define-public gphoto2
135 (package
136 (name "gphoto2")
f6c44a3f 137 (version "2.5.11")
9208d0c1
LC
138 (source (origin
139 (method url-fetch)
de67e922
LF
140 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
141 "/gphoto2-" version ".tar.bz2"))
9208d0c1
LC
142 (sha256
143 (base32
f6c44a3f 144 "1sgr6rsvzzagcwhc8fxbnvz3k02wr2hab0vrbvcb04k5l3b48a1r"))))
9208d0c1
LC
145 (build-system gnu-build-system)
146 (native-inputs
147 `(("pkg-config" ,pkg-config)))
148 (inputs
149 `(("readline" ,readline)
7e49a851 150 ("libjpeg-turbo" ,libjpeg-turbo)
9208d0c1
LC
151 ("popt" ,popt)
152 ("libexif" ,libexif)
153 ("libgphoto2" ,libgphoto2)))
154 (arguments
dc1d3cde
KK
155 '(#:phases
156 (modify-phases %standard-phases
157 (add-before 'check 'pre-check
158 (lambda* (#:key inputs #:allow-other-keys)
159 (substitute* (find-files "tests/data" "\\.param$")
160 (("/usr/bin/env")
161 (which "env")))
162 #t)))
9208d0c1
LC
163
164 ;; FIXME: There are 2 test failures, most likely related to the build
165 ;; environment.
166 #:tests? #f))
167
168 (home-page "http://www.gphoto.org/")
169 (synopsis "Command-line tools to access digital cameras")
170 (description
171 "Gphoto2 is a set of command line utilities for manipulating a large
172number of different digital cameras. Through libgphoto2, it supports PTP,
173MTP, and much more.")
174
175 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
341f4965 176 (license license:gpl2+)))
b138ec94
LC
177
178(define-public perl-image-exiftool
179 (package
180 (name "perl-image-exiftool")
33717a17 181 (version "10.55")
b138ec94
LC
182 (source (origin
183 (method url-fetch)
184 (uri (string-append
185 "mirror://cpan/authors/id/E/EX/EXIFTOOL/Image-ExifTool-"
186 version ".tar.gz"))
187 (sha256
188 (base32
33717a17 189 "0z8zwjjfvyllnhsafhddbybywpgqv0pl1dbn1g034cs27yj836q2"))))
b138ec94
LC
190 (build-system perl-build-system)
191 (arguments
33717a17
LF
192 '(#:phases
193 (modify-phases %standard-phases
194 (add-after 'install 'post-install
195 (lambda* (#:key outputs #:allow-other-keys)
196 ;; Make sure the 'exiftool' commands finds the library.
197 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
198 (let* ((out (assoc-ref outputs "out"))
199 (pm (find-files out "^ExifTool\\.pm$"))
200 (lib (dirname (dirname (car pm)))))
201 (wrap-program (string-append out "/bin/exiftool")
202 `("PERL5LIB" prefix (,lib)))))))))
67abcc05 203 (home-page "http://search.cpan.org/dist/Image-ExifTool")
ae6591ef
LF
204 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
205 (description "This package provides the @code{exiftool} command and the
206@code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
207and a wide variety of other metadata.")
2f3108ad 208 (license license:perl-license)))
0e6412c1
AE
209
210(define-public libpano13
211 (package
212 (name "libpano13")
213 (version "2.9.19")
214 (source (origin
215 (method url-fetch)
216 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
217 "libpano13-" version "/"
218 "libpano13-" version ".tar.gz"))
219 (sha256
220 (base32
221 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
222 (build-system cmake-build-system)
223 (inputs
224 `(("libjpeg" ,libjpeg)
225 ("libpng" ,libpng)
226 ("libtiff" ,libtiff)
227 ("zlib" ,zlib)))
228 (home-page "http://panotools.sourceforge.net/")
229 (synopsis "Library for panoramic images")
230 (description
231 "The libpano13 package contains the backend library written by the
232Panorama Tools project for building panoramic images from a set of
233overlapping images, as well as some command line tools.")
234 (license license:gpl2+)))
8957241d
AE
235
236(define-public enblend-enfuse
237 (package
238 (name "enblend-enfuse")
d16479c5 239 (version "4.2")
8957241d
AE
240 (source (origin
241 (method url-fetch)
242 (uri (string-append "mirror://sourceforge/enblend/"
243 name "/"
244 name "-" (version-major+minor version) "/"
245 name "-" version ".tar.gz"))
246 (sha256
247 (base32
d16479c5 248 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
8957241d
AE
249 (build-system gnu-build-system)
250 (native-inputs
251 `(("pkg-config" ,pkg-config)
252 ("perl" ,perl)
253 ("perl-timedate" ,perl-timedate)
254 ;; for building the documentation
255 ("gnuplot" ,gnuplot)
d16479c5 256 ("help2man" ,help2man)
8957241d
AE
257 ("imagemagick" ,imagemagick)
258 ("libxml2" ,libxml2)
84de27c8 259 ("texlive-minimal" ,texlive-tiny)
8957241d
AE
260 ("tidy" ,tidy)
261 ("transfig" ,transfig)))
262 (inputs
263 `(("boost" ,boost)
264 ("gsl" ,gsl)
265 ("lcms" ,lcms)
266 ("libjpeg" ,libjpeg)
267 ("libpng" ,libpng)
268 ("libtiff" ,libtiff)
269 ("openexr" ,openexr)
270 ("vigra" ,vigra)
271 ("zlib" ,zlib)))
272 (arguments
273 `(#:configure-flags `("--enable-openmp")))
274 (home-page "http://enblend.sourceforge.net/")
275 (synopsis "Tools for combining and blending images")
276 (description
277 "Enblend blends away the seams in a panoramic image mosaic using a
278multi-resolution spline. Enfuse merges different exposures of the same
279scene to produce an image that looks much like a tone-mapped image.")
280 (license license:gpl2+)))
c49840f8
RJ
281
282(define-public lensfun
283 (package
284 (name "lensfun")
285 (version "0.3.2")
286 (source (origin
287 (method url-fetch)
288 (uri (string-append
289 "mirror://sourceforge/lensfun/"
290 version "/lensfun-" version ".tar.gz"))
291 (sha256
292 (base32
293 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
294 (build-system cmake-build-system)
4dbef239
EF
295 (arguments
296 `(,@(if (any (cute string-prefix? <> (or (%current-system)
297 (%current-target-system)))
298 '("x86_64" "i686"))
299 ;; SSE and SSE2 are supported only on Intel processors.
300 '()
301 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
302 #:tests? #f)) ; There are no tests to run.
c49840f8
RJ
303 (native-inputs
304 `(("pkg-config" ,pkg-config)))
305 (inputs
306 `(("glib" ,glib)))
307 (home-page "https://sourceforge.net/projects/lensfun/")
308 (synopsis "Library to correct optical lens defects with a lens database")
309 (description "Digital photographs are not ideal. Of course, the better is
310your camera, the better the results will be, but in any case if you look
311carefully at shots taken even by the most expensive cameras equipped with the
312most expensive lenses you will see various artifacts. It is very hard to make
313ideal cameras, because there are a lot of factors that affect the final image
314quality, and at some point camera and lens designers have to trade one factor
315for another to achieve the optimal image quality, within the given design
316restrictions and budget. But we all want ideal shots, don't we? So that's
317what's Lensfun is all about: rectifying the defects introduced by your
318photographic equipment.")
319 ;; The libraries are licensed under the LGPL3, the programs are
320 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
321 ;; README.md file for this clarification.
322 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
91a9c65c
RJ
323
324(define-public darktable
325 (package
326 (name "darktable")
e4073104 327 (version "2.2.5")
91a9c65c
RJ
328 (source (origin
329 (method url-fetch)
330 (uri (string-append
331 "https://github.com/darktable-org/darktable/releases/"
332 "download/release-"
333 version "/darktable-" version ".tar.xz"))
334 (sha256
335 (base32
e4073104 336 "10gjzd4irxhladh4jyss9kgp627k8vgx2divipsb33pp6cms80z3"))))
91a9c65c
RJ
337 (build-system cmake-build-system)
338 (arguments
339 `(#:tests? #f ; There are no tests.
8be84d31 340 #:configure-flags '("-DCMAKE_INSTALL_LIBDIR=lib" "-DBINARY_PACKAGE_BUILD=On")
91a9c65c
RJ
341 #:make-flags
342 (list
343 (string-append "CPATH=" (assoc-ref %build-inputs "ilmbase")
344 "/include/OpenEXR:" (or (getenv "CPATH") "")))
345 #:phases
346 (modify-phases %standard-phases
347 (add-before 'configure 'set-ldflags
348 (lambda* (#:key outputs #:allow-other-keys)
349 (setenv "LDFLAGS"
350 (string-append
351 "-Wl,-rpath="
352 (assoc-ref outputs "out") "/lib/darktable"))
353 #t)))))
354 (native-inputs
355 `(("llvm" ,llvm-3.9.1)
356 ("clang" ,clang-3.9.1)))
357 (inputs
358 `(("libxslt" ,libxslt)
359 ("libxml2" ,libxml2)
360 ("pugixml" ,pugixml)
361 ("gtk+" ,gtk+)
362 ("sqlite" ,sqlite)
363 ("libjpeg" ,libjpeg)
364 ("libpng" ,libpng)
365 ("cairo" ,cairo)
366 ("lcms" ,lcms)
367 ("exiv2" ,exiv2)
368 ("libtiff" ,libtiff)
369 ("curl" ,curl)
370 ("libgphoto2" ,libgphoto2)
371 ("dbus-glib" ,dbus-glib)
372 ("openexr" ,openexr)
373 ("ilmbase" ,ilmbase)
374 ("libsoup" ,libsoup)
375 ("python-jsonschema" ,python-jsonschema)
376 ("intltool" ,intltool)
377 ("perl" ,perl)
378 ("pkg-config" ,pkg-config)
379 ("libwebp" ,libwebp)
380 ("lensfun" ,lensfun)
381 ("librsvg" ,librsvg)
382 ("json-glib" ,json-glib)
383 ("freeimage" ,freeimage)))
384 (home-page "https://www.darktable.org")
385 (synopsis "Virtual lighttable and darkroom for photographers")
386 (description "Darktable is a photography workflow application and RAW
387developer. It manages your digital negatives in a database, lets you view
388them through a zoomable lighttable and enables you to develop raw images
389and enhance them.")
03b055a1
EF
390 ;; see src/is_supported_platform.h for supported platforms
391 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
91a9c65c 392 (license license:gpl3+)))
1d093724
AE
393
394(define-public hugin
395 (package
396 (name "hugin")
397 (version "2016.2.0")
398 (source (origin
399 (method url-fetch)
400 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
401 (version-major+minor version)
402 "/hugin-" version ".tar.bz2"))
403 (sha256
404 (base32
405 "058zd63vx29yrx2pphbbll7kzcxkai22q26lpw13rn4lvp41pasl"))))
406 (build-system cmake-build-system)
407 (native-inputs
408 `(("gettext" ,gnu-gettext)
409 ("pkg-config" ,pkg-config)))
410 (inputs
411 `(("boost" ,boost)
412 ("enblend-enfuse" ,enblend-enfuse)
413 ("exiv2" ,exiv2)
414 ("fftw" ,fftw)
415 ("flann" ,flann)
416 ("freeglut" ,freeglut)
417 ("glew" ,glew)
418 ("lcms" ,lcms)
419 ("libjpeg" ,libjpeg)
420 ("libpano13" ,libpano13)
421 ("libpng" ,libpng)
422 ("libtiff" ,libtiff)
423 ("libxi" ,libxi)
424 ("libxmu" ,libxmu)
425 ("mesa" ,mesa)
426 ("openexr" ,openexr)
427 ("sqlite" ,sqlite)
428 ("vigra" ,vigra)
429 ("wxwidgets" ,wxwidgets)
430 ("zlib" ,zlib)))
431 (arguments
432 `(#:tests? #f ; no check target
433 #:configure-flags
434 (list
435 ;; The header files of ilmbase (propagated by openexr) are not found
436 ;; when included by the header files of openexr, and an explicit
437 ;; flag needs to be set.
438 (string-append "-DCMAKE_CXX_FLAGS=-I"
439 (assoc-ref %build-inputs "ilmbase")
440 "/include/OpenEXR")
441 ;; Disable installation of the Python scripting interface.
442 ;; It would require the additional inputs python and swig.
443 ;; Installation would need to be tweaked, as it tries to install
444 ;; into the python directory.
445 "-DBUILD_HSI=OFF")
446 #:phases
447 (modify-phases %standard-phases
448 (add-before 'configure 'substitute
449 (lambda _
450 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
451 (("wxT\\(\"enblend\"\\)")
452 (string-append "wxT(\"" (which "enblend") "\")"))
453 (("wxT\\(\"enfuse\"\\)")
454 (string-append "wxT(\"" (which "enfuse") "\")")))
455 #t)))))
456 (home-page "http://hugin.sourceforge.net/")
457 (synopsis "Panorama photo stitcher")
458 (description
459 "Hugin is an easy to use panoramic imaging toolchain with a graphical
460user interface. It can be used to assemble a mosaic of photographs into
461a complete panorama and stitch any series of overlapping pictures.")
462 (license license:gpl2+)))
463