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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages photo)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system perl)
30 #:use-module (guix build-system python)
31 #:use-module (guix download)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix utils)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages file)
43 #:use-module (gnu packages freedesktop)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages ghostscript)
46 #:use-module (gnu packages gl)
47 #:use-module (gnu packages gnome)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages graphics)
50 #:use-module (gnu packages gstreamer)
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages image)
53 #:use-module (gnu packages imagemagick)
54 #:use-module (gnu packages libcanberra)
55 #:use-module (gnu packages libusb)
56 #:use-module (gnu packages llvm)
57 #:use-module (gnu packages man)
58 #:use-module (gnu packages maths)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages popt)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages python-web)
65 #:use-module (gnu packages qt)
66 #:use-module (gnu packages readline)
67 #:use-module (gnu packages sqlite)
68 #:use-module (gnu packages tex)
69 #:use-module (gnu packages time)
70 #:use-module (gnu packages video)
71 #:use-module (gnu packages web)
72 #:use-module (gnu packages wxwidgets)
73 #:use-module (gnu packages xfig)
74 #:use-module (gnu packages xorg)
75 #:use-module (gnu packages xml)
76 #:use-module ((srfi srfi-1) #:hide (zip))
77 #:use-module (srfi srfi-26))
79 (define-public rapid-photo-downloader
81 (name "rapid-photo-downloader")
85 (uri (string-append "https://launchpad.net/rapid/pyqt/"
86 version "/+download/" name "-"
90 "15p7sssg6vmqbm5xnc4j5dr89d7gl7y5qyq44a240yl5aqkjnybw"))))
91 (build-system python-build-system)
94 ("intltool" ,intltool)
95 ("gobject-introspection" ,gobject-introspection)))
97 `(("gdk-pixbuf" ,gdk-pixbuf)
99 ("gst-libav" ,gst-libav)
100 ("gst-plugins-base" ,gst-plugins-base)
101 ("gst-plugins-good" ,gst-plugins-good)
102 ("gstreamer" ,gstreamer)
103 ("libgudev" ,libgudev)
104 ("libnotify" ,libnotify)
105 ("libmediainfo" ,libmediainfo)
107 ("python-pyqt" ,python-pyqt)
108 ("python-pygobject" ,python-pygobject)
109 ("python-gphoto2" ,python-gphoto2)
110 ("python-pyzmq" ,python-pyzmq)
111 ("python-tornado" ,python-tornado)
112 ("python-psutil" ,python-psutil)
113 ("python-pyxdg" ,python-pyxdg)
114 ("python-arrow" ,python-arrow)
115 ("python-dateutil" ,python-dateutil)
116 ("python-easygui" ,python-easygui)
117 ("python-colour" ,python-colour)
118 ("python-pymediainfo" ,python-pymediainfo)
119 ("python-sortedcontainers" ,python-sortedcontainers)
120 ("python-rawkit" ,python-rawkit)
121 ("python-requests" ,python-requests)
122 ("python-colorlog" ,python-colorlog)
123 ("python-pyprind" ,python-pyprind)
124 ("python-tenacity" ,python-tenacity)
125 ("perl-image-exiftool" ,perl-image-exiftool)))
128 (modify-phases %standard-phases
129 (add-after 'unpack 'patch-libmediainfo
131 (substitute* "raphodo/metadatavideo.py"
132 (("pymedia_library_file = 'libmediainfo.so.0'")
133 (string-append "pymedia_library_file = '"
134 (assoc-ref %build-inputs "libmediainfo")
135 "/lib/libmediainfo.so.0'")))
137 (add-after 'install 'wrap
138 (lambda* (#:key inputs outputs #:allow-other-keys)
139 (let ((out (assoc-ref outputs "out"))
142 (assoc-ref inputs "perl-image-exiftool")
145 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
146 (python-path (getenv "PYTHONPATH")))
149 (wrap-program program
150 `("PATH" ":" prefix (,path))
151 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
152 `("PYTHONPATH" ":" prefix (,python-path))))
154 (string-append out "/bin/" name))
155 '("analyze-pv-structure"
156 "rapid-photo-downloader"))))
158 (home-page "https://www.damonlynch.net/rapid/")
159 (synopsis "Import photos and videos from cameras, phones and memory cards")
160 (description "Import photos and videos from cameras, phones and memory
161 cards and generate meaningful file and folder names.")
162 (license license:gpl2+)))
164 (define-public libraw
170 (uri (string-append "https://www.libraw.org/data/LibRaw-"
174 "1x827sh6vl8j3ll2ihkcr234y07f31hi1v7sl08jfw3irkbn58j0"))))
175 (build-system gnu-build-system)
177 `(("pkg-config" ,pkg-config)))
179 `(("libjpeg" ,libjpeg-turbo))) ;for lossy DNGs and old Kodak cameras
181 `(("lcms" ,lcms))) ;for color profiles
182 (home-page "https://www.libraw.org")
183 (synopsis "Raw image decoder")
185 "LibRaw is a library for reading RAW files obtained from digital photo
186 cameras (CRW/CR2, NEF, RAF, DNG, and others).")
187 ;; LibRaw is distributed under both LGPL2.1 and CDDL 1.0. From the README:
188 ;; "You may use one of these licensing modes and switch between them. If
189 ;; you modify LibRaw source and made your changes public, you should accept
190 ;; both two licensing modes for your changes/additions."
191 (license (list license:lgpl2.1 license:cddl1.0))))
193 (define-public libraw-0.18
194 (package (inherit libraw)
199 (uri (string-append "https://www.libraw.org/data/LibRaw-"
203 "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap"))))))
205 (define-public libexif
211 (uri (string-append "mirror://sourceforge/libexif/libexif/"
212 version "/libexif-" version ".tar.bz2"))
213 (patches (search-patches "libexif-CVE-2016-6328.patch"
214 "libexif-CVE-2017-7544.patch"
215 "libexif-CVE-2018-20030.patch"))
218 "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
219 (build-system gnu-build-system)
220 (home-page "https://libexif.github.io/")
221 (synopsis "Read and manipulate EXIF data in digital photographs")
223 "The libexif C library allows applications to read, edit, and save EXIF
224 data as produced by digital cameras.")
225 (license license:lgpl2.1+)))
227 (define-public libgphoto2
233 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
234 version "/libgphoto2-" version ".tar.bz2"))
237 "0cgvsk06c4kcfj16plc27nm7g16r9ci0y4k83sf3iyphd63mfg7x"))))
238 (build-system gnu-build-system)
239 (native-inputs `(("pkg-config" ,pkg-config)))
241 `(("libjpeg-turbo" ,libjpeg-turbo)
244 ("libxml2" ,libxml2)))
246 `(;; The .pc refers to libexif.
247 ("libexif" ,libexif)))
248 (home-page "http://www.gphoto.org/proj/libgphoto2/")
249 (synopsis "Accessing digital cameras")
251 "This is the library backend for gphoto2. It contains the code for PTP,
252 MTP, and other vendor specific protocols for controlling and transferring data
253 from digital cameras.")
255 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
256 (license license:lgpl2.1+)))
258 (define-public gphoto2
264 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
265 "/gphoto2-" version ".tar.bz2"))
268 "1laqwhxr0xhbykmp0dhd3j4rr2lhj5y228s31afnqxp700hhk1yz"))))
269 (build-system gnu-build-system)
271 `(("pkg-config" ,pkg-config)))
273 `(("readline" ,readline)
274 ("libjpeg-turbo" ,libjpeg-turbo)
277 ("libgphoto2" ,libgphoto2)))
280 (modify-phases %standard-phases
281 (add-before 'check 'pre-check
282 (lambda* (#:key inputs #:allow-other-keys)
283 (substitute* (find-files "tests/data" "\\.param$")
288 ;; FIXME: There is 1 test failure, most likely related to the build
292 (home-page "http://www.gphoto.org/")
293 (synopsis "Command-line tools to access digital cameras")
295 "Gphoto2 is a set of command line utilities for manipulating a large
296 number of different digital cameras. Through libgphoto2, it supports PTP,
297 MTP, and much more.")
299 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
300 (license license:gpl2+)))
302 ;; Note: See <https://metacpan.org/pod/Image::ExifTool> for the latest
303 ;; release. The versions at <https://www.sno.phy.queensu.ca/~phil/exiftool/>
304 ;; are not meant for production use according to the Changes file.
305 (define-public perl-image-exiftool
307 (name "perl-image-exiftool")
313 (string-append "mirror://cpan/authors/id/E/EX/EXIFTOOL/"
314 "Image-ExifTool-" version ".tar.gz")
315 ;; New releases may take a while to hit CPAN.
316 (string-append "https://www.sno.phy.queensu.ca/~phil/exiftool/"
317 "Image-ExifTool-" version ".tar.gz")))
320 "15zqm0ly2b3paqg0ym44ib2mvh6k18a9q5rvdirwipqa127al2lb"))))
321 (build-system perl-build-system)
324 (modify-phases %standard-phases
325 (add-after 'install 'post-install
326 (lambda* (#:key outputs #:allow-other-keys)
327 ;; Make sure the 'exiftool' commands finds the library.
328 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
329 (let* ((out (assoc-ref outputs "out"))
330 (pm (find-files out "^ExifTool\\.pm$"))
331 (lib (dirname (dirname (car pm)))))
332 (wrap-program (string-append out "/bin/exiftool")
333 `("PERL5LIB" prefix (,lib)))
335 (home-page "https://metacpan.org/release/Image-ExifTool")
336 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
337 (description "This package provides the @code{exiftool} command and the
338 @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
339 and a wide variety of other metadata.")
340 (license license:perl-license)))
342 (define-public libpano13
348 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
349 "libpano13-" version "/"
350 "libpano13-" version ".tar.gz"))
353 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
354 (build-system cmake-build-system)
356 `(("libjpeg" ,libjpeg-turbo)
360 (home-page "http://panotools.sourceforge.net/")
361 (synopsis "Library for panoramic images")
363 "The libpano13 package contains the backend library written by the
364 Panorama Tools project for building panoramic images from a set of
365 overlapping images, as well as some command line tools.")
366 (license license:gpl2+)))
368 (define-public enblend-enfuse
370 (name "enblend-enfuse")
374 (uri (string-append "mirror://sourceforge/enblend/"
376 name "-" (version-major+minor version) "/"
377 name "-" version ".tar.gz"))
380 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
381 (build-system gnu-build-system)
383 `(("pkg-config" ,pkg-config)
385 ("perl-timedate" ,perl-timedate)
386 ;; for building the documentation
388 ("help2man" ,help2man)
389 ("imagemagick" ,imagemagick)
391 ("texlive-minimal" ,texlive-tiny)
393 ("transfig" ,transfig)))
398 ("libjpeg" ,libjpeg-turbo)
405 `(#:configure-flags `("--enable-openmp")))
406 (home-page "http://enblend.sourceforge.net/")
407 (synopsis "Tools for combining and blending images")
409 "Enblend blends away the seams in a panoramic image mosaic using a
410 multi-resolution spline. Enfuse merges different exposures of the same
411 scene to produce an image that looks much like a tone-mapped image.")
412 (license license:gpl2+)))
414 (define-public lensfun
421 "mirror://sourceforge/lensfun/"
422 version "/lensfun-" version ".tar.gz"))
425 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
426 (build-system cmake-build-system)
428 `(,@(if (any (cute string-prefix? <> (or (%current-system)
429 (%current-target-system)))
431 ;; SSE and SSE2 are supported only on Intel processors.
433 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
434 #:tests? #f)) ; There are no tests to run.
436 `(("pkg-config" ,pkg-config)))
439 (home-page "https://sourceforge.net/projects/lensfun/")
440 (synopsis "Library to correct optical lens defects with a lens database")
441 (description "Digital photographs are not ideal. Of course, the better is
442 your camera, the better the results will be, but in any case if you look
443 carefully at shots taken even by the most expensive cameras equipped with the
444 most expensive lenses you will see various artifacts. It is very hard to make
445 ideal cameras, because there are a lot of factors that affect the final image
446 quality, and at some point camera and lens designers have to trade one factor
447 for another to achieve the optimal image quality, within the given design
448 restrictions and budget. But we all want ideal shots, don't we? So that's
449 what's Lensfun is all about: rectifying the defects introduced by your
450 photographic equipment.")
451 ;; The libraries are licensed under the LGPL3, the programs are
452 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
453 ;; README.md file for this clarification.
454 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
456 (define-public darktable
464 "https://github.com/darktable-org/darktable/releases/"
465 "download/release-" version "/darktable-" version ".tar.xz"))
467 (base32 "1w3q3dhcxa0bs590zbsj61ap8z84wmn04xs5q3gjwisqhjf9j655"))))
468 (build-system cmake-build-system)
470 `(#:tests? #f ; there are no tests
471 #:configure-flags '("-DBINARY_PACKAGE_BUILD=On")
473 (modify-phases %standard-phases
474 (add-before 'configure 'set-LDFLAGS-and-CPATH
475 (lambda* (#:key inputs outputs #:allow-other-keys)
479 (assoc-ref outputs "out") "/lib/darktable"))
481 ;; Ensure the OpenEXR headers are found.
483 (string-append (assoc-ref inputs "ilmbase")
484 "/include/OpenEXR:" (or (getenv "CPATH") "")))
487 `(("libxslt" ,libxslt)
492 ("libjpeg" ,libjpeg-turbo)
499 ("libgphoto2" ,libgphoto2)
500 ("dbus-glib" ,dbus-glib)
504 ("python-jsonschema" ,python-jsonschema)
505 ("intltool" ,intltool)
507 ("pkg-config" ,pkg-config)
511 ("json-glib" ,json-glib)
512 ("freeimage" ,freeimage)))
513 (home-page "https://www.darktable.org")
514 (synopsis "Virtual lighttable and darkroom for photographers")
515 (description "Darktable is a photography workflow application and RAW
516 developer. It manages your digital negatives in a database, lets you view
517 them through a zoomable lighttable and enables you to develop raw images
519 ;; See src/is_supported_platform.h for supported platforms.
520 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
521 (license license:gpl3+)))
529 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
530 (version-major+minor version)
531 "/hugin-" version ".tar.bz2"))
534 "1l925qslp98gg7yzmgps10h6dq0nb60wbfk345anlxsv0g2ifizr"))))
535 (build-system cmake-build-system)
537 `(("gettext" ,gnu-gettext)
538 ("pkg-config" ,pkg-config)))
541 ("enblend-enfuse" ,enblend-enfuse)
542 ("exiv2" ,exiv2-0.26)
545 ("freeglut" ,freeglut)
548 ("libjpeg" ,libjpeg-turbo)
549 ("libpano13" ,libpano13)
558 ("wxwidgets" ,wxwidgets)
561 `(#:tests? #f ; no check target
564 ;; The header files of ilmbase (propagated by openexr) are not found
565 ;; when included by the header files of openexr, and an explicit
566 ;; flag needs to be set.
567 (string-append "-DCMAKE_CXX_FLAGS=-I"
568 (assoc-ref %build-inputs "ilmbase")
570 ;; Disable installation of the Python scripting interface.
571 ;; It would require the additional inputs python and swig.
572 ;; Installation would need to be tweaked, as it tries to install
573 ;; into the python directory.
576 (modify-phases %standard-phases
577 (add-before 'configure 'substitute
579 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
580 (("wxT\\(\"enblend\"\\)")
581 (string-append "wxT(\"" (which "enblend") "\")"))
582 (("wxT\\(\"enfuse\"\\)")
583 (string-append "wxT(\"" (which "enfuse") "\")")))
585 (home-page "http://hugin.sourceforge.net/")
586 (synopsis "Panorama photo stitcher")
588 "Hugin is an easy to use panoramic imaging toolchain with a graphical
589 user interface. It can be used to assemble a mosaic of photographs into
590 a complete panorama and stitch any series of overlapping pictures.")
591 (license license:gpl2+)))
593 (define-public rawtherapee
599 (uri (string-append "http://rawtherapee.com/shared/source/"
600 "rawtherapee-" version ".tar.xz"))
603 "0lq8qi7g0a28h3rab7bk5bbbd4gvfma42bvlz1dfn8p9mah2h19n"))))
604 (build-system cmake-build-system)
606 '(#:tests? #f ; no test suite
607 #:build-type "release"
609 (list (string-append "-DLENSFUNDBDIR="
610 (assoc-ref %build-inputs "lensfun")
612 ;; Don't optimize the build for the host machine. See the file
613 ;; 'ProcessorTargets.cmake' in the source distribution for more
615 "-DPROC_TARGET_NUMBER=1"
616 ;; These flags are recommended by upstream for distributed packages.
617 ;; See the file 'RELEASE_NOTES.txt' in the source distribution.
619 "-DCACHE_NAME_SUFFIX=\"\"")))
621 `(("pkg-config" ,pkg-config)))
631 ("libcanberra" ,libcanberra)
632 ("libiptcdata" ,libiptcdata)
633 ("libjpeg" ,libjpeg-turbo)
636 ("libsigc++" ,libsigc++)
639 (home-page "http://rawtherapee.com")
640 (synopsis "Raw image developing and processing")
641 (description "RawTherapee is a raw image processing suite. It comprises a
642 subset of image editing operations specifically aimed at non-destructive raw
643 photo post-production and is primarily focused on improving a photographer's
644 workflow by facilitating the handling of large numbers of images. Most raw
645 formats are supported, including Pentax Pixel Shift, Canon Dual-Pixel, and those
646 from Foveon and X-Trans sensors.")
647 (license license:gpl3+)))