1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2017, 2019 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, 2019 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 ;;; Copyright © 2020 Sebastian Schott <sschott@mailbox.org>
10 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages photo)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system perl)
31 #:use-module (guix build-system python)
32 #:use-module (guix download)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix utils)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages curl)
43 #:use-module (gnu packages file)
44 #:use-module (gnu packages freedesktop)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages glib)
50 #:use-module (gnu packages graphics)
51 #:use-module (gnu packages gstreamer)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages image)
54 #:use-module (gnu packages imagemagick)
55 #:use-module (gnu packages libcanberra)
56 #:use-module (gnu packages libusb)
57 #:use-module (gnu packages llvm)
58 #:use-module (gnu packages man)
59 #:use-module (gnu packages maths)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages popt)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages python-web)
66 #:use-module (gnu packages qt)
67 #:use-module (gnu packages readline)
68 #:use-module (gnu packages sqlite)
69 #:use-module (gnu packages tex)
70 #:use-module (gnu packages time)
71 #:use-module (gnu packages video)
72 #:use-module (gnu packages web)
73 #:use-module (gnu packages wxwidgets)
74 #:use-module (gnu packages xfig)
75 #:use-module (gnu packages xorg)
76 #:use-module (gnu packages xml)
77 #:use-module ((srfi srfi-1) #:hide (zip))
78 #:use-module (srfi srfi-26))
80 (define-public rapid-photo-downloader
82 (name "rapid-photo-downloader")
86 (uri (string-append "https://launchpad.net/rapid/pyqt/"
87 version "/+download/" name "-"
91 "15p7sssg6vmqbm5xnc4j5dr89d7gl7y5qyq44a240yl5aqkjnybw"))))
92 (build-system python-build-system)
95 ("intltool" ,intltool)
96 ("gobject-introspection" ,gobject-introspection)))
98 `(("gdk-pixbuf" ,gdk-pixbuf)
100 ("gst-libav" ,gst-libav)
101 ("gst-plugins-base" ,gst-plugins-base)
102 ("gst-plugins-good" ,gst-plugins-good)
103 ("gstreamer" ,gstreamer)
104 ("libgudev" ,libgudev)
105 ("libnotify" ,libnotify)
106 ("libmediainfo" ,libmediainfo)
108 ("python-pyqt" ,python-pyqt)
109 ("python-pygobject" ,python-pygobject)
110 ("python-gphoto2" ,python-gphoto2)
111 ("python-pyzmq" ,python-pyzmq)
112 ("python-tornado" ,python-tornado)
113 ("python-psutil" ,python-psutil)
114 ("python-pyxdg" ,python-pyxdg)
115 ("python-arrow" ,python-arrow)
116 ("python-dateutil" ,python-dateutil)
117 ("python-easygui" ,python-easygui)
118 ("python-colour" ,python-colour)
119 ("python-pymediainfo" ,python-pymediainfo)
120 ("python-sortedcontainers" ,python-sortedcontainers)
121 ("python-rawkit" ,python-rawkit)
122 ("python-requests" ,python-requests)
123 ("python-colorlog" ,python-colorlog)
124 ("python-pyprind" ,python-pyprind)
125 ("python-tenacity" ,python-tenacity)
126 ("perl-image-exiftool" ,perl-image-exiftool)))
129 (modify-phases %standard-phases
130 (add-after 'unpack 'patch-libmediainfo
132 (substitute* "raphodo/metadatavideo.py"
133 (("pymedia_library_file = 'libmediainfo.so.0'")
134 (string-append "pymedia_library_file = '"
135 (assoc-ref %build-inputs "libmediainfo")
136 "/lib/libmediainfo.so.0'")))
138 (add-after 'install 'wrap
139 (lambda* (#:key inputs outputs #:allow-other-keys)
140 (let ((out (assoc-ref outputs "out"))
143 (assoc-ref inputs "perl-image-exiftool")
146 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
147 (python-path (getenv "PYTHONPATH")))
150 (wrap-program program
151 `("PATH" ":" prefix (,path))
152 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
153 `("PYTHONPATH" ":" prefix (,python-path))))
155 (string-append out "/bin/" name))
156 '("analyze-pv-structure"
157 "rapid-photo-downloader"))))
159 (home-page "https://www.damonlynch.net/rapid/")
160 (synopsis "Import photos and videos from cameras, phones and memory cards")
161 (description "Import photos and videos from cameras, phones and memory
162 cards and generate meaningful file and folder names.")
163 (license license:gpl2+)))
165 (define-public libraw
171 (uri (string-append "https://www.libraw.org/data/LibRaw-"
175 "1x827sh6vl8j3ll2ihkcr234y07f31hi1v7sl08jfw3irkbn58j0"))))
176 (build-system gnu-build-system)
178 `(("pkg-config" ,pkg-config)))
180 `(("libjpeg" ,libjpeg-turbo))) ;for lossy DNGs and old Kodak cameras
182 `(("lcms" ,lcms))) ;for color profiles
183 (home-page "https://www.libraw.org")
184 (synopsis "Raw image decoder")
186 "LibRaw is a library for reading RAW files obtained from digital photo
187 cameras (CRW/CR2, NEF, RAF, DNG, and others).")
188 ;; LibRaw is distributed under both LGPL2.1 and CDDL 1.0. From the README:
189 ;; "You may use one of these licensing modes and switch between them. If
190 ;; you modify LibRaw source and made your changes public, you should accept
191 ;; both two licensing modes for your changes/additions."
192 (license (list license:lgpl2.1 license:cddl1.0))))
194 (define-public libraw-0.18
195 (package (inherit libraw)
200 (uri (string-append "https://www.libraw.org/data/LibRaw-"
204 "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap"))))))
206 (define-public libexif
212 (uri (string-append "mirror://sourceforge/libexif/libexif/"
213 version "/libexif-" version ".tar.bz2"))
214 (patches (search-patches "libexif-CVE-2016-6328.patch"
215 "libexif-CVE-2017-7544.patch"
216 "libexif-CVE-2018-20030.patch"))
219 "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
220 (build-system gnu-build-system)
221 (home-page "https://libexif.github.io/")
222 (synopsis "Read and manipulate EXIF data in digital photographs")
224 "The libexif C library allows applications to read, edit, and save EXIF
225 data as produced by digital cameras.")
226 (license license:lgpl2.1+)))
228 (define-public libgphoto2
234 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
235 version "/libgphoto2-" version ".tar.bz2"))
238 "0cgvsk06c4kcfj16plc27nm7g16r9ci0y4k83sf3iyphd63mfg7x"))))
239 (build-system gnu-build-system)
240 (native-inputs `(("pkg-config" ,pkg-config)))
242 `(("libjpeg-turbo" ,libjpeg-turbo)
245 ("libxml2" ,libxml2)))
247 `(;; The .pc refers to libexif.
248 ("libexif" ,libexif)))
249 (home-page "http://www.gphoto.org/proj/libgphoto2/")
250 (synopsis "Accessing digital cameras")
252 "This is the library backend for gphoto2. It contains the code for PTP,
253 MTP, and other vendor specific protocols for controlling and transferring data
254 from digital cameras.")
256 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
257 (license license:lgpl2.1+)))
259 (define-public gphoto2
265 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
266 "/gphoto2-" version ".tar.bz2"))
269 "1laqwhxr0xhbykmp0dhd3j4rr2lhj5y228s31afnqxp700hhk1yz"))))
270 (build-system gnu-build-system)
272 `(("pkg-config" ,pkg-config)))
274 `(("readline" ,readline)
275 ("libjpeg-turbo" ,libjpeg-turbo)
278 ("libgphoto2" ,libgphoto2)))
281 (modify-phases %standard-phases
282 (add-before 'check 'pre-check
283 (lambda* (#:key inputs #:allow-other-keys)
284 (substitute* (find-files "tests/data" "\\.param$")
289 ;; FIXME: There is 1 test failure, most likely related to the build
293 (home-page "http://www.gphoto.org/")
294 (synopsis "Command-line tools to access digital cameras")
296 "Gphoto2 is a set of command line utilities for manipulating a large
297 number of different digital cameras. Through libgphoto2, it supports PTP,
298 MTP, and much more.")
300 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
301 (license license:gpl2+)))
303 ;; Note: See <https://metacpan.org/pod/Image::ExifTool> for the latest
304 ;; release. The versions at <https://www.sno.phy.queensu.ca/~phil/exiftool/>
305 ;; are not meant for production use according to the Changes file.
306 (define-public perl-image-exiftool
308 (name "perl-image-exiftool")
314 (string-append "mirror://cpan/authors/id/E/EX/EXIFTOOL/"
315 "Image-ExifTool-" version ".tar.gz")
316 ;; New releases may take a while to hit CPAN.
317 (string-append "https://www.sno.phy.queensu.ca/~phil/exiftool/"
318 "Image-ExifTool-" version ".tar.gz")))
321 "15zqm0ly2b3paqg0ym44ib2mvh6k18a9q5rvdirwipqa127al2lb"))))
322 (build-system perl-build-system)
325 (modify-phases %standard-phases
326 (add-after 'install 'post-install
327 (lambda* (#:key outputs #:allow-other-keys)
328 ;; Make sure the 'exiftool' commands finds the library.
329 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
330 (let* ((out (assoc-ref outputs "out"))
331 (pm (find-files out "^ExifTool\\.pm$"))
332 (lib (dirname (dirname (car pm)))))
333 (wrap-program (string-append out "/bin/exiftool")
334 `("PERL5LIB" prefix (,lib)))
336 (home-page "https://metacpan.org/release/Image-ExifTool")
337 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
338 (description "This package provides the @code{exiftool} command and the
339 @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
340 and a wide variety of other metadata.")
341 (license license:perl-license)))
343 (define-public libpano13
349 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
350 "libpano13-" version "/"
351 "libpano13-" version ".tar.gz"))
354 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
355 (build-system cmake-build-system)
357 `(("libjpeg" ,libjpeg-turbo)
361 (home-page "http://panotools.sourceforge.net/")
362 (synopsis "Library for panoramic images")
364 "The libpano13 package contains the backend library written by the
365 Panorama Tools project for building panoramic images from a set of
366 overlapping images, as well as some command line tools.")
367 (license license:gpl2+)))
369 (define-public enblend-enfuse
371 (name "enblend-enfuse")
375 (uri (string-append "mirror://sourceforge/enblend/"
377 name "-" (version-major+minor version) "/"
378 name "-" version ".tar.gz"))
381 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
382 (build-system gnu-build-system)
384 `(("pkg-config" ,pkg-config)
386 ("perl-timedate" ,perl-timedate)
387 ;; for building the documentation
389 ("help2man" ,help2man)
390 ("imagemagick" ,imagemagick)
392 ("texlive-minimal" ,texlive-tiny)
394 ("transfig" ,transfig)))
399 ("libjpeg" ,libjpeg-turbo)
406 `(#:configure-flags `("--enable-openmp")))
407 (home-page "http://enblend.sourceforge.net/")
408 (synopsis "Tools for combining and blending images")
410 "Enblend blends away the seams in a panoramic image mosaic using a
411 multi-resolution spline. Enfuse merges different exposures of the same
412 scene to produce an image that looks much like a tone-mapped image.")
413 (license license:gpl2+)))
415 (define-public lensfun
422 "mirror://sourceforge/lensfun/"
423 version "/lensfun-" version ".tar.gz"))
426 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
427 (build-system cmake-build-system)
429 `(,@(if (any (cute string-prefix? <> (or (%current-system)
430 (%current-target-system)))
432 ;; SSE and SSE2 are supported only on Intel processors.
434 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
435 #:tests? #f)) ; There are no tests to run.
437 `(("pkg-config" ,pkg-config)))
440 (home-page "https://sourceforge.net/projects/lensfun/")
441 (synopsis "Library to correct optical lens defects with a lens database")
442 (description "Digital photographs are not ideal. Of course, the better is
443 your camera, the better the results will be, but in any case if you look
444 carefully at shots taken even by the most expensive cameras equipped with the
445 most expensive lenses you will see various artifacts. It is very hard to make
446 ideal cameras, because there are a lot of factors that affect the final image
447 quality, and at some point camera and lens designers have to trade one factor
448 for another to achieve the optimal image quality, within the given design
449 restrictions and budget. But we all want ideal shots, don't we? So that's
450 what's Lensfun is all about: rectifying the defects introduced by your
451 photographic equipment.")
452 ;; The libraries are licensed under the LGPL3, the programs are
453 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
454 ;; README.md file for this clarification.
455 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
457 (define-public darktable
465 "https://github.com/darktable-org/darktable/releases/"
466 "download/release-" version "/darktable-" version ".tar.xz"))
468 (base32 "1w3q3dhcxa0bs590zbsj61ap8z84wmn04xs5q3gjwisqhjf9j655"))))
469 (build-system cmake-build-system)
471 `(#:tests? #f ; there are no tests
472 #:configure-flags '("-DBINARY_PACKAGE_BUILD=On")
474 (modify-phases %standard-phases
475 (add-before 'configure 'set-LDFLAGS-and-CPATH
476 (lambda* (#:key inputs outputs #:allow-other-keys)
480 (assoc-ref outputs "out") "/lib/darktable"))
482 ;; Ensure the OpenEXR headers are found.
484 (string-append (assoc-ref inputs "ilmbase")
485 "/include/OpenEXR:" (or (getenv "CPATH") "")))
488 `(("intltool" ,intltool)
490 ("pkg-config" ,pkg-config)))
492 `(("libxslt" ,libxslt)
497 ("libjpeg" ,libjpeg-turbo)
504 ("libgphoto2" ,libgphoto2)
505 ("dbus-glib" ,dbus-glib)
509 ("python-jsonschema" ,python-jsonschema)
513 ("json-glib" ,json-glib)
514 ("freeimage" ,freeimage)))
515 (home-page "https://www.darktable.org")
516 (synopsis "Virtual lighttable and darkroom for photographers")
517 (description "Darktable is a photography workflow application and RAW
518 developer. It manages your digital negatives in a database, lets you view
519 them through a zoomable lighttable and enables you to develop raw images
521 ;; See src/is_supported_platform.h for supported platforms.
522 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
523 (license license:gpl3+)))
531 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
532 (version-major+minor version)
533 "/hugin-" version ".tar.bz2"))
536 "0gjsm5bgz10wbr5q3y74f8dzb238dh32xx0p5wa3yca6lbzbv9lb"))))
537 (build-system cmake-build-system)
539 `(("gettext" ,gettext-minimal)
540 ("pkg-config" ,pkg-config)))
543 ("enblend-enfuse" ,enblend-enfuse)
544 ("exiv2" ,exiv2-0.26)
547 ("freeglut" ,freeglut)
550 ("libjpeg" ,libjpeg-turbo)
551 ("libpano13" ,libpano13)
560 ("wxwidgets" ,wxwidgets)
563 `(#:tests? #f ; no check target
566 ;; The header files of ilmbase (propagated by openexr) are not found
567 ;; when included by the header files of openexr, and an explicit
568 ;; flag needs to be set.
569 (string-append "-DCMAKE_CXX_FLAGS=-I"
570 (assoc-ref %build-inputs "ilmbase")
572 ;; Disable installation of the Python scripting interface.
573 ;; It would require the additional inputs python and swig.
574 ;; Installation would need to be tweaked, as it tries to install
575 ;; into the python directory.
578 (modify-phases %standard-phases
579 (add-before 'configure 'substitute
581 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
582 (("wxT\\(\"enblend\"\\)")
583 (string-append "wxT(\"" (which "enblend") "\")"))
584 (("wxT\\(\"enfuse\"\\)")
585 (string-append "wxT(\"" (which "enfuse") "\")")))
587 (home-page "http://hugin.sourceforge.net/")
588 (synopsis "Panorama photo stitcher")
590 "Hugin is an easy to use panoramic imaging toolchain with a graphical
591 user interface. It can be used to assemble a mosaic of photographs into
592 a complete panorama and stitch any series of overlapping pictures.")
593 (license license:gpl2+)))
595 (define-public rawtherapee
601 (uri (string-append "http://rawtherapee.com/shared/source/"
602 "rawtherapee-" version ".tar.xz"))
605 "0lq8qi7g0a28h3rab7bk5bbbd4gvfma42bvlz1dfn8p9mah2h19n"))))
606 (build-system cmake-build-system)
608 '(#:tests? #f ; no test suite
609 #:build-type "release"
611 (list (string-append "-DLENSFUNDBDIR="
612 (assoc-ref %build-inputs "lensfun")
614 ;; Don't optimize the build for the host machine. See the file
615 ;; 'ProcessorTargets.cmake' in the source distribution for more
617 "-DPROC_TARGET_NUMBER=1"
618 ;; These flags are recommended by upstream for distributed packages.
619 ;; See the file 'RELEASE_NOTES.txt' in the source distribution.
621 "-DCACHE_NAME_SUFFIX=\"\"")))
623 `(("pkg-config" ,pkg-config)))
633 ("libcanberra" ,libcanberra)
634 ("libiptcdata" ,libiptcdata)
635 ("libjpeg" ,libjpeg-turbo)
638 ("libsigc++" ,libsigc++)
641 (home-page "http://rawtherapee.com")
642 (synopsis "Raw image developing and processing")
643 (description "RawTherapee is a raw image processing suite. It comprises a
644 subset of image editing operations specifically aimed at non-destructive raw
645 photo post-production and is primarily focused on improving a photographer's
646 workflow by facilitating the handling of large numbers of images. Most raw
647 formats are supported, including Pentax Pixel Shift, Canon Dual-Pixel, and those
648 from Foveon and X-Trans sensors.")
649 (license license:gpl3+)))