Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / photo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2015, 2017 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages photo)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system perl)
29 #:use-module (guix download)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix utils)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages curl)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages gl)
43 #:use-module (gnu packages gnome)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages graphics)
46 #:use-module (gnu packages gtk)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages imagemagick)
49 #:use-module (gnu packages libcanberra)
50 #:use-module (gnu packages libusb)
51 #:use-module (gnu packages llvm)
52 #:use-module (gnu packages man)
53 #:use-module (gnu packages maths)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages popt)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-xyz)
59 #:use-module (gnu packages readline)
60 #:use-module (gnu packages sqlite)
61 #:use-module (gnu packages tex)
62 #:use-module (gnu packages web)
63 #:use-module (gnu packages wxwidgets)
64 #:use-module (gnu packages xfig)
65 #:use-module (gnu packages xorg)
66 #:use-module (gnu packages xml)
67 #:use-module ((srfi srfi-1) #:hide (zip))
68 #:use-module (srfi srfi-26))
69
70 (define-public libraw
71 (package
72 (name "libraw")
73 (version "0.19.2")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "https://www.libraw.org/data/LibRaw-"
77 version ".tar.gz"))
78 (sha256
79 (base32
80 "0i4nhjm5556xgn966x0i503ygk2wafq6z83kg0lisacjjab4f3a0"))))
81 (build-system gnu-build-system)
82 (native-inputs
83 `(("pkg-config" ,pkg-config)))
84 (inputs
85 `(("libjpeg" ,libjpeg))) ;for lossy DNGs and old Kodak cameras
86 (propagated-inputs
87 `(("lcms" ,lcms))) ;for color profiles
88 (home-page "https://www.libraw.org")
89 (synopsis "Raw image decoder")
90 (description
91 "LibRaw is a library for reading RAW files obtained from digital photo
92 cameras (CRW/CR2, NEF, RAF, DNG, and others).")
93 ;; LibRaw is distributed under both LGPL2.1 and CDDL 1.0. From the README:
94 ;; "You may use one of these licensing modes and switch between them. If
95 ;; you modify LibRaw source and made your changes public, you should accept
96 ;; both two licensing modes for your changes/additions."
97 (license (list license:lgpl2.1 license:cddl1.0))))
98
99 (define-public libraw-0.18
100 (package (inherit libraw)
101 (name "libraw")
102 (version "0.18.12")
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "https://www.libraw.org/data/LibRaw-"
106 version ".tar.gz"))
107 (sha256
108 (base32
109 "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap"))))))
110
111 (define-public libexif
112 (package
113 (name "libexif")
114 (version "0.6.21")
115 (source (origin
116 (method url-fetch)
117 (uri (string-append "mirror://sourceforge/libexif/libexif/"
118 version "/libexif-" version ".tar.bz2"))
119 (patches (search-patches "libexif-CVE-2016-6328.patch"
120 "libexif-CVE-2017-7544.patch"))
121 (sha256
122 (base32
123 "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
124 (build-system gnu-build-system)
125 (home-page "https://libexif.github.io/")
126 (synopsis "Read and manipulate EXIF data in digital photographs")
127 (description
128 "The libexif C library allows applications to read, edit, and save EXIF
129 data as produced by digital cameras.")
130 (license license:lgpl2.1+)))
131
132 (define-public libgphoto2
133 (package
134 (name "libgphoto2")
135 (version "2.5.22")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
139 version "/libgphoto2-" version ".tar.bz2"))
140 (sha256
141 (base32
142 "0n6f6nagys775ib483nka1sbclhkm1dz3n5z3lgaz1m9m5x35mqm"))))
143 (build-system gnu-build-system)
144 (native-inputs `(("pkg-config" ,pkg-config)))
145 (inputs
146 `(("libjpeg-turbo" ,libjpeg-turbo)
147 ("libltdl" ,libltdl)
148 ("libusb" ,libusb)
149 ("libxml2" ,libxml2)))
150 (propagated-inputs
151 `(;; The .pc refers to libexif.
152 ("libexif" ,libexif)))
153 (home-page "http://www.gphoto.org/proj/libgphoto2/")
154 (synopsis "Accessing digital cameras")
155 (description
156 "This is the library backend for gphoto2. It contains the code for PTP,
157 MTP, and other vendor specific protocols for controlling and transferring data
158 from digital cameras.")
159
160 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
161 (license license:lgpl2.1+)))
162
163 (define-public gphoto2
164 (package
165 (name "gphoto2")
166 (version "2.5.20")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
170 "/gphoto2-" version ".tar.bz2"))
171 (sha256
172 (base32
173 "1xj80abkzvqrd6g1j1q946lhbp03gyapyxdwbhc0y14g1ash6vx3"))))
174 (build-system gnu-build-system)
175 (native-inputs
176 `(("pkg-config" ,pkg-config)))
177 (inputs
178 `(("readline" ,readline)
179 ("libjpeg-turbo" ,libjpeg-turbo)
180 ("popt" ,popt)
181 ("libexif" ,libexif)
182 ("libgphoto2" ,libgphoto2)))
183 (arguments
184 '(#:phases
185 (modify-phases %standard-phases
186 (add-before 'check 'pre-check
187 (lambda* (#:key inputs #:allow-other-keys)
188 (substitute* (find-files "tests/data" "\\.param$")
189 (("/usr/bin/env")
190 (which "env")))
191 #t)))
192
193 ;; FIXME: There is 1 test failure, most likely related to the build
194 ;; environment.
195 #:tests? #f))
196
197 (home-page "http://www.gphoto.org/")
198 (synopsis "Command-line tools to access digital cameras")
199 (description
200 "Gphoto2 is a set of command line utilities for manipulating a large
201 number of different digital cameras. Through libgphoto2, it supports PTP,
202 MTP, and much more.")
203
204 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
205 (license license:gpl2+)))
206
207 ;; Note: See <https://metacpan.org/pod/Image::ExifTool> for the latest
208 ;; release. The versions at <https://www.sno.phy.queensu.ca/~phil/exiftool/>
209 ;; are not meant for production use according to the Changes file.
210 (define-public perl-image-exiftool
211 (package
212 (name "perl-image-exiftool")
213 (version "11.30")
214 (source
215 (origin
216 (method url-fetch)
217 (uri (list
218 (string-append "mirror://cpan/authors/id/E/EX/EXIFTOOL/"
219 "Image-ExifTool-" version ".tar.gz")
220 ;; New releases may take a while to hit CPAN.
221 (string-append "https://www.sno.phy.queensu.ca/~phil/exiftool/"
222 "Image-ExifTool-" version ".tar.gz")))
223 (sha256
224 (base32 "0vkjb2c1a3jdlq8rx1jywx4p3f1bmgjn7rzfwx6dxgij2lx76lrs"))))
225 (build-system perl-build-system)
226 (arguments
227 '(#:phases
228 (modify-phases %standard-phases
229 (add-after 'install 'post-install
230 (lambda* (#:key outputs #:allow-other-keys)
231 ;; Make sure the 'exiftool' commands finds the library.
232 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
233 (let* ((out (assoc-ref outputs "out"))
234 (pm (find-files out "^ExifTool\\.pm$"))
235 (lib (dirname (dirname (car pm)))))
236 (wrap-program (string-append out "/bin/exiftool")
237 `("PERL5LIB" prefix (,lib)))
238 #t))))))
239 (home-page "https://metacpan.org/release/Image-ExifTool")
240 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
241 (description "This package provides the @code{exiftool} command and the
242 @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
243 and a wide variety of other metadata.")
244 (license license:perl-license)))
245
246 (define-public libpano13
247 (package
248 (name "libpano13")
249 (version "2.9.19")
250 (source (origin
251 (method url-fetch)
252 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
253 "libpano13-" version "/"
254 "libpano13-" version ".tar.gz"))
255 (sha256
256 (base32
257 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
258 (build-system cmake-build-system)
259 (inputs
260 `(("libjpeg" ,libjpeg)
261 ("libpng" ,libpng)
262 ("libtiff" ,libtiff)
263 ("zlib" ,zlib)))
264 (home-page "http://panotools.sourceforge.net/")
265 (synopsis "Library for panoramic images")
266 (description
267 "The libpano13 package contains the backend library written by the
268 Panorama Tools project for building panoramic images from a set of
269 overlapping images, as well as some command line tools.")
270 (license license:gpl2+)))
271
272 (define-public enblend-enfuse
273 (package
274 (name "enblend-enfuse")
275 (version "4.2")
276 (source (origin
277 (method url-fetch)
278 (uri (string-append "mirror://sourceforge/enblend/"
279 name "/"
280 name "-" (version-major+minor version) "/"
281 name "-" version ".tar.gz"))
282 (sha256
283 (base32
284 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
285 (build-system gnu-build-system)
286 (native-inputs
287 `(("pkg-config" ,pkg-config)
288 ("perl" ,perl)
289 ("perl-timedate" ,perl-timedate)
290 ;; for building the documentation
291 ("gnuplot" ,gnuplot)
292 ("help2man" ,help2man)
293 ("imagemagick" ,imagemagick)
294 ("libxml2" ,libxml2)
295 ("texlive-minimal" ,texlive-tiny)
296 ("tidy" ,tidy)
297 ("transfig" ,transfig)))
298 (inputs
299 `(("boost" ,boost)
300 ("gsl" ,gsl)
301 ("lcms" ,lcms)
302 ("libjpeg" ,libjpeg)
303 ("libpng" ,libpng)
304 ("libtiff" ,libtiff)
305 ("openexr" ,openexr)
306 ("vigra" ,vigra)
307 ("zlib" ,zlib)))
308 (arguments
309 `(#:configure-flags `("--enable-openmp")))
310 (home-page "http://enblend.sourceforge.net/")
311 (synopsis "Tools for combining and blending images")
312 (description
313 "Enblend blends away the seams in a panoramic image mosaic using a
314 multi-resolution spline. Enfuse merges different exposures of the same
315 scene to produce an image that looks much like a tone-mapped image.")
316 (license license:gpl2+)))
317
318 (define-public lensfun
319 (package
320 (name "lensfun")
321 (version "0.3.2")
322 (source (origin
323 (method url-fetch)
324 (uri (string-append
325 "mirror://sourceforge/lensfun/"
326 version "/lensfun-" version ".tar.gz"))
327 (sha256
328 (base32
329 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
330 (build-system cmake-build-system)
331 (arguments
332 `(,@(if (any (cute string-prefix? <> (or (%current-system)
333 (%current-target-system)))
334 '("x86_64" "i686"))
335 ;; SSE and SSE2 are supported only on Intel processors.
336 '()
337 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
338 #:tests? #f)) ; There are no tests to run.
339 (native-inputs
340 `(("pkg-config" ,pkg-config)))
341 (inputs
342 `(("glib" ,glib)))
343 (home-page "https://sourceforge.net/projects/lensfun/")
344 (synopsis "Library to correct optical lens defects with a lens database")
345 (description "Digital photographs are not ideal. Of course, the better is
346 your camera, the better the results will be, but in any case if you look
347 carefully at shots taken even by the most expensive cameras equipped with the
348 most expensive lenses you will see various artifacts. It is very hard to make
349 ideal cameras, because there are a lot of factors that affect the final image
350 quality, and at some point camera and lens designers have to trade one factor
351 for another to achieve the optimal image quality, within the given design
352 restrictions and budget. But we all want ideal shots, don't we? So that's
353 what's Lensfun is all about: rectifying the defects introduced by your
354 photographic equipment.")
355 ;; The libraries are licensed under the LGPL3, the programs are
356 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
357 ;; README.md file for this clarification.
358 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
359
360 (define-public darktable
361 (package
362 (name "darktable")
363 (version "2.6.2")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (string-append
368 "https://github.com/darktable-org/darktable/releases/"
369 "download/release-" version "/darktable-" version ".tar.xz"))
370 (sha256
371 (base32 "0igvgyd042j7hm4y8fcm6dc1qqjs4d1r7y6f0pzpa0x416xyzfcw"))))
372 (build-system cmake-build-system)
373 (arguments
374 `(#:tests? #f ; there are no tests
375 #:configure-flags '("-DBINARY_PACKAGE_BUILD=On")
376 #:make-flags
377 (list
378 (string-append "CPATH=" (assoc-ref %build-inputs "ilmbase")
379 "/include/OpenEXR:" (or (getenv "CPATH") "")))
380 #:phases
381 (modify-phases %standard-phases
382 (add-before 'configure 'set-ldflags
383 (lambda* (#:key outputs #:allow-other-keys)
384 (setenv "LDFLAGS"
385 (string-append
386 "-Wl,-rpath="
387 (assoc-ref outputs "out") "/lib/darktable"))
388 #t)))))
389 (native-inputs
390 `(("llvm" ,llvm-3.9.1)
391 ("clang" ,clang-3.9.1)))
392 (inputs
393 `(("libxslt" ,libxslt)
394 ("libxml2" ,libxml2)
395 ("pugixml" ,pugixml)
396 ("gtk+" ,gtk+)
397 ("sqlite" ,sqlite)
398 ("libjpeg" ,libjpeg)
399 ("libpng" ,libpng)
400 ("cairo" ,cairo)
401 ("lcms" ,lcms)
402 ("exiv2" ,exiv2)
403 ("libtiff" ,libtiff)
404 ("curl" ,curl)
405 ("libgphoto2" ,libgphoto2)
406 ("dbus-glib" ,dbus-glib)
407 ("openexr" ,openexr)
408 ("ilmbase" ,ilmbase)
409 ("libsoup" ,libsoup)
410 ("python-jsonschema" ,python-jsonschema)
411 ("intltool" ,intltool)
412 ("perl" ,perl)
413 ("pkg-config" ,pkg-config)
414 ("libwebp" ,libwebp)
415 ("lensfun" ,lensfun)
416 ("librsvg" ,librsvg)
417 ("json-glib" ,json-glib)
418 ("freeimage" ,freeimage)))
419 (home-page "https://www.darktable.org")
420 (synopsis "Virtual lighttable and darkroom for photographers")
421 (description "Darktable is a photography workflow application and RAW
422 developer. It manages your digital negatives in a database, lets you view
423 them through a zoomable lighttable and enables you to develop raw images
424 and enhance them.")
425 ;; See src/is_supported_platform.h for supported platforms.
426 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
427 (license license:gpl3+)))
428
429 (define-public hugin
430 (package
431 (name "hugin")
432 (version "2019.0.0")
433 (source (origin
434 (method url-fetch)
435 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
436 (version-major+minor version)
437 "/hugin-" version ".tar.bz2"))
438 (sha256
439 (base32
440 "1l925qslp98gg7yzmgps10h6dq0nb60wbfk345anlxsv0g2ifizr"))))
441 (build-system cmake-build-system)
442 (native-inputs
443 `(("gettext" ,gnu-gettext)
444 ("pkg-config" ,pkg-config)))
445 (inputs
446 `(("boost" ,boost)
447 ("enblend-enfuse" ,enblend-enfuse)
448 ("exiv2" ,exiv2)
449 ("fftw" ,fftw)
450 ("flann" ,flann)
451 ("freeglut" ,freeglut)
452 ("glew" ,glew)
453 ("lcms" ,lcms)
454 ("libjpeg" ,libjpeg)
455 ("libpano13" ,libpano13)
456 ("libpng" ,libpng)
457 ("libtiff" ,libtiff)
458 ("libxi" ,libxi)
459 ("libxmu" ,libxmu)
460 ("mesa" ,mesa)
461 ("openexr" ,openexr)
462 ("sqlite" ,sqlite)
463 ("vigra" ,vigra)
464 ("wxwidgets" ,wxwidgets)
465 ("zlib" ,zlib)))
466 (arguments
467 `(#:tests? #f ; no check target
468 #:configure-flags
469 (list
470 ;; The header files of ilmbase (propagated by openexr) are not found
471 ;; when included by the header files of openexr, and an explicit
472 ;; flag needs to be set.
473 (string-append "-DCMAKE_CXX_FLAGS=-I"
474 (assoc-ref %build-inputs "ilmbase")
475 "/include/OpenEXR")
476 ;; Disable installation of the Python scripting interface.
477 ;; It would require the additional inputs python and swig.
478 ;; Installation would need to be tweaked, as it tries to install
479 ;; into the python directory.
480 "-DBUILD_HSI=OFF")
481 #:phases
482 (modify-phases %standard-phases
483 (add-before 'configure 'substitute
484 (lambda _
485 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
486 (("wxT\\(\"enblend\"\\)")
487 (string-append "wxT(\"" (which "enblend") "\")"))
488 (("wxT\\(\"enfuse\"\\)")
489 (string-append "wxT(\"" (which "enfuse") "\")")))
490 #t)))))
491 (home-page "http://hugin.sourceforge.net/")
492 (synopsis "Panorama photo stitcher")
493 (description
494 "Hugin is an easy to use panoramic imaging toolchain with a graphical
495 user interface. It can be used to assemble a mosaic of photographs into
496 a complete panorama and stitch any series of overlapping pictures.")
497 (license license:gpl2+)))
498
499 (define-public rawtherapee
500 (package
501 (name "rawtherapee")
502 (version "5.6")
503 (source (origin
504 (method url-fetch)
505 (uri (string-append "http://rawtherapee.com/shared/source/"
506 "rawtherapee-" version ".tar.xz"))
507 (sha256
508 (base32
509 "0x0dcfp6f3j08gr11wq5ah4prp790xy4iadbgsm9kgc0jlalpspr"))))
510 (build-system cmake-build-system)
511 (arguments
512 '(#:tests? #f ; no test suite
513 #:build-type "release"
514 #:configure-flags
515 (list (string-append "-DLENSFUNDBDIR="
516 (assoc-ref %build-inputs "lensfun")
517 "/share/lensfun")
518 ;; Don't optimize the build for the host machine. See the file
519 ;; 'ProcessorTargets.cmake' in the source distribution for more
520 ;; information.
521 "-DPROC_TARGET_NUMBER=1"
522 ;; These flags are recommended by upstream for distributed packages.
523 ;; See the file 'RELEASE_NOTES.txt' in the source distribution.
524 "-O3"
525 "-DCACHE_NAME_SUFFIX=\"\"")))
526 (native-inputs
527 `(("pkg-config" ,pkg-config)))
528 (inputs
529 `(("expat" ,expat)
530 ("fftw" ,fftwf)
531 ("glib" ,glib)
532 ("glibmm" ,glibmm)
533 ("gtk+" ,gtk+)
534 ("gtkmm" ,gtkmm)
535 ("lcms" ,lcms)
536 ("lensfun" ,lensfun)
537 ("libcanberra" ,libcanberra)
538 ("libiptcdata" ,libiptcdata)
539 ("libjpeg" ,libjpeg)
540 ("libpng" ,libpng)
541 ("librsvg" ,librsvg)
542 ("libsigc++" ,libsigc++)
543 ("libtiff" ,libtiff)
544 ("zlib" ,zlib)))
545 (home-page "http://rawtherapee.com")
546 (synopsis "Raw image developing and processing")
547 (description "RawTherapee is a raw image processing suite. It comprises a
548 subset of image editing operations specifically aimed at non-destructive raw
549 photo post-production and is primarily focused on improving a photographer's
550 workflow by facilitating the handling of large numbers of images. Most raw
551 formats are supported, including Pentax Pixel Shift, Canon Dual-Pixel, and those
552 from Foveon and X-Trans sensors.")
553 (license license:gpl3+)))