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>
10 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
76 (uri (string-append "https://www.libraw.org/data/LibRaw-"
80 "1xjyw4n9gfr2r637pjbpbi3h98h9mdjn61b0hsxwqynq2vdij452"))))
81 (build-system gnu-build-system)
83 `(("pkg-config" ,pkg-config)))
85 `(("libjpeg" ,libjpeg))) ;for lossy DNGs and old Kodak cameras
87 `(("lcms" ,lcms))) ;for color profiles
88 (home-page "https://www.libraw.org")
89 (synopsis "Raw image decoder")
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))))
99 (define-public libraw-0.18
100 (package (inherit libraw)
105 (uri (string-append "https://www.libraw.org/data/LibRaw-"
109 "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap"))))))
111 (define-public libexif
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"))
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")
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+)))
132 (define-public libgphoto2
138 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
139 version "/libgphoto2-" version ".tar.bz2"))
142 "0n6f6nagys775ib483nka1sbclhkm1dz3n5z3lgaz1m9m5x35mqm"))))
143 (build-system gnu-build-system)
144 (native-inputs `(("pkg-config" ,pkg-config)))
146 `(("libjpeg-turbo" ,libjpeg-turbo)
149 ("libxml2" ,libxml2)))
151 `(;; The .pc refers to libexif.
152 ("libexif" ,libexif)))
153 (home-page "http://www.gphoto.org/proj/libgphoto2/")
154 (synopsis "Accessing digital cameras")
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.")
160 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
161 (license license:lgpl2.1+)))
163 (define-public gphoto2
169 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
170 "/gphoto2-" version ".tar.bz2"))
173 "0kslwclyyzvnxjw3gdzhlagj7l5f8lba833ipr9s0s0c4hwi0mxa"))))
174 (build-system gnu-build-system)
176 `(("pkg-config" ,pkg-config)))
178 `(("readline" ,readline)
179 ("libjpeg-turbo" ,libjpeg-turbo)
182 ("libgphoto2" ,libgphoto2)))
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$")
193 ;; FIXME: There is 1 test failure, most likely related to the build
197 (home-page "http://www.gphoto.org/")
198 (synopsis "Command-line tools to access digital cameras")
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.")
204 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
205 (license license:gpl2+)))
207 (define-public perl-image-exiftool
209 (name "perl-image-exiftool")
214 "mirror://cpan/authors/id/E/EX/EXIFTOOL/Image-ExifTool-"
218 "1szg1k82nz88pp5n7lg71ja7q3hh5i5f9bcbb7m482dwrmsywkp6"))))
219 (build-system perl-build-system)
222 (modify-phases %standard-phases
223 (add-after 'install 'post-install
224 (lambda* (#:key outputs #:allow-other-keys)
225 ;; Make sure the 'exiftool' commands finds the library.
226 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
227 (let* ((out (assoc-ref outputs "out"))
228 (pm (find-files out "^ExifTool\\.pm$"))
229 (lib (dirname (dirname (car pm)))))
230 (wrap-program (string-append out "/bin/exiftool")
231 `("PERL5LIB" prefix (,lib)))
233 (home-page "https://metacpan.org/release/Image-ExifTool")
234 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
235 (description "This package provides the @code{exiftool} command and the
236 @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
237 and a wide variety of other metadata.")
238 (license license:perl-license)))
240 (define-public libpano13
246 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
247 "libpano13-" version "/"
248 "libpano13-" version ".tar.gz"))
251 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
252 (build-system cmake-build-system)
254 `(("libjpeg" ,libjpeg)
258 (home-page "http://panotools.sourceforge.net/")
259 (synopsis "Library for panoramic images")
261 "The libpano13 package contains the backend library written by the
262 Panorama Tools project for building panoramic images from a set of
263 overlapping images, as well as some command line tools.")
264 (license license:gpl2+)))
266 (define-public enblend-enfuse
268 (name "enblend-enfuse")
272 (uri (string-append "mirror://sourceforge/enblend/"
274 name "-" (version-major+minor version) "/"
275 name "-" version ".tar.gz"))
278 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
279 (build-system gnu-build-system)
281 `(("pkg-config" ,pkg-config)
283 ("perl-timedate" ,perl-timedate)
284 ;; for building the documentation
286 ("help2man" ,help2man)
287 ("imagemagick" ,imagemagick)
289 ("texlive-minimal" ,texlive-tiny)
291 ("transfig" ,transfig)))
303 `(#:configure-flags `("--enable-openmp")))
304 (home-page "http://enblend.sourceforge.net/")
305 (synopsis "Tools for combining and blending images")
307 "Enblend blends away the seams in a panoramic image mosaic using a
308 multi-resolution spline. Enfuse merges different exposures of the same
309 scene to produce an image that looks much like a tone-mapped image.")
310 (license license:gpl2+)))
312 (define-public lensfun
319 "mirror://sourceforge/lensfun/"
320 version "/lensfun-" version ".tar.gz"))
323 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
324 (build-system cmake-build-system)
326 `(,@(if (any (cute string-prefix? <> (or (%current-system)
327 (%current-target-system)))
329 ;; SSE and SSE2 are supported only on Intel processors.
331 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
332 #:tests? #f)) ; There are no tests to run.
334 `(("pkg-config" ,pkg-config)))
337 (home-page "https://sourceforge.net/projects/lensfun/")
338 (synopsis "Library to correct optical lens defects with a lens database")
339 (description "Digital photographs are not ideal. Of course, the better is
340 your camera, the better the results will be, but in any case if you look
341 carefully at shots taken even by the most expensive cameras equipped with the
342 most expensive lenses you will see various artifacts. It is very hard to make
343 ideal cameras, because there are a lot of factors that affect the final image
344 quality, and at some point camera and lens designers have to trade one factor
345 for another to achieve the optimal image quality, within the given design
346 restrictions and budget. But we all want ideal shots, don't we? So that's
347 what's Lensfun is all about: rectifying the defects introduced by your
348 photographic equipment.")
349 ;; The libraries are licensed under the LGPL3, the programs are
350 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
351 ;; README.md file for this clarification.
352 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
354 (define-public darktable
361 "https://github.com/darktable-org/darktable/releases/"
363 version "/darktable-" version ".tar.xz"))
366 "0y04cx0a0rwdclmn16f5y0z2vnm7yxly291gzjgdhcn59a77sga8"))))
367 (build-system cmake-build-system)
369 `(#:tests? #f ; There are no tests.
370 #:configure-flags '("-DBINARY_PACKAGE_BUILD=On")
373 (string-append "CPATH=" (assoc-ref %build-inputs "ilmbase")
374 "/include/OpenEXR:" (or (getenv "CPATH") "")))
376 (modify-phases %standard-phases
377 (add-before 'configure 'set-ldflags
378 (lambda* (#:key outputs #:allow-other-keys)
382 (assoc-ref outputs "out") "/lib/darktable"))
385 `(("llvm" ,llvm-3.9.1)
386 ("clang" ,clang-3.9.1)))
388 `(("libxslt" ,libxslt)
400 ("libgphoto2" ,libgphoto2)
401 ("dbus-glib" ,dbus-glib)
405 ("python-jsonschema" ,python-jsonschema)
406 ("intltool" ,intltool)
408 ("pkg-config" ,pkg-config)
412 ("json-glib" ,json-glib)
413 ("freeimage" ,freeimage)))
414 (home-page "https://www.darktable.org")
415 (synopsis "Virtual lighttable and darkroom for photographers")
416 (description "Darktable is a photography workflow application and RAW
417 developer. It manages your digital negatives in a database, lets you view
418 them through a zoomable lighttable and enables you to develop raw images
420 ;; see src/is_supported_platform.h for supported platforms
421 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
422 (license license:gpl3+)))
430 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
431 (version-major+minor version)
432 "/hugin-" version ".tar.bz2"))
435 "1jv5wpqbq49fhbl5g521g1qxhdm1rm7acxd18fr3n3n5d830vbyk"))))
436 (build-system cmake-build-system)
438 `(("gettext" ,gnu-gettext)
439 ("pkg-config" ,pkg-config)))
442 ("enblend-enfuse" ,enblend-enfuse)
446 ("freeglut" ,freeglut)
450 ("libpano13" ,libpano13)
459 ("wxwidgets" ,wxwidgets)
462 `(#:tests? #f ; no check target
465 ;; The header files of ilmbase (propagated by openexr) are not found
466 ;; when included by the header files of openexr, and an explicit
467 ;; flag needs to be set.
468 (string-append "-DCMAKE_CXX_FLAGS=-I"
469 (assoc-ref %build-inputs "ilmbase")
471 ;; Disable installation of the Python scripting interface.
472 ;; It would require the additional inputs python and swig.
473 ;; Installation would need to be tweaked, as it tries to install
474 ;; into the python directory.
477 (modify-phases %standard-phases
478 (add-before 'configure 'substitute
480 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
481 (("wxT\\(\"enblend\"\\)")
482 (string-append "wxT(\"" (which "enblend") "\")"))
483 (("wxT\\(\"enfuse\"\\)")
484 (string-append "wxT(\"" (which "enfuse") "\")")))
486 (home-page "http://hugin.sourceforge.net/")
487 (synopsis "Panorama photo stitcher")
489 "Hugin is an easy to use panoramic imaging toolchain with a graphical
490 user interface. It can be used to assemble a mosaic of photographs into
491 a complete panorama and stitch any series of overlapping pictures.")
492 (license license:gpl2+)))
494 (define-public rawtherapee
500 (uri (string-append "http://rawtherapee.com/shared/source/"
501 "rawtherapee-" version ".tar.xz"))
504 "1w28a2rnxnw8hs7s8x8zkccgi5z5y653602jg7g86lfx6zxwjsf1"))))
505 (build-system cmake-build-system)
507 '(#:tests? #f ; no test suite
508 #:build-type "release"
510 (list (string-append "-DLENSFUNDBDIR="
511 (assoc-ref %build-inputs "lensfun")
513 ; Don't optimize the build for the host machine. See the file
514 ; 'ProcessorTargets.cmake' in the source distribution for more
516 "-DPROC_TARGET_NUMBER=1"
517 ; These flags are recommended by upstream for distributed packages.
518 ; See the file 'RELEASE_NOTES.txt' in the source distribution.
520 "-DCACHE_NAME_SUFFIX=\"\"")))
522 `(("pkg-config" ,pkg-config)))
532 ("libcanberra" ,libcanberra)
533 ("libiptcdata" ,libiptcdata)
536 ("libsigc++" ,libsigc++)
539 (home-page "http://rawtherapee.com")
540 (synopsis "Raw image developing and processing")
541 (description "RawTherapee is a raw image processing suite. It comprises a
542 subset of image editing operations specifically aimed at non-destructive raw
543 photo post-production and is primarily focused on improving a photographer's
544 workflow by facilitating the handling of large numbers of images. Most raw
545 formats are supported, including Pentax Pixel Shift, Canon Dual-Pixel, and those
546 from Foveon and X-Trans sensors.")
547 (license license:gpl3+)))