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