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 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages photo)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system perl)
28 #:use-module (guix download)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix utils)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages algebra)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages databases)
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 libusb)
50 #:use-module (gnu packages llvm)
51 #:use-module (gnu packages man)
52 #:use-module (gnu packages maths)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages popt)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages readline)
58 #:use-module (gnu packages tex)
59 #:use-module (gnu packages web)
60 #:use-module (gnu packages wxwidgets)
61 #:use-module (gnu packages xfig)
62 #:use-module (gnu packages xorg)
63 #:use-module (gnu packages xml)
64 #:use-module ((srfi srfi-1) #:hide (zip))
65 #:use-module (srfi srfi-26))
73 (uri (string-append "https://www.libraw.org/data/LibRaw-"
77 "0fx5mwkg0rx37qgxnajc8g8i0mhc6822100ljay5g94aap5arf75"))))
78 (build-system gnu-build-system)
79 (home-page "https://www.libraw.org")
80 (synopsis "Raw image decoder")
82 "LibRaw is a library for reading RAW files obtained from digital photo
83 cameras (CRW/CR2, NEF, RAF, DNG, and others).")
84 (license license:lgpl2.1+)))
86 (define-public libexif
92 (uri (string-append "mirror://sourceforge/libexif/libexif/"
93 version "/libexif-" version ".tar.bz2"))
94 (patches (search-patches "libexif-CVE-2016-6328.patch"
95 "libexif-CVE-2017-7544.patch"))
98 "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
99 (build-system gnu-build-system)
100 (home-page "http://libexif.sourceforge.net/")
101 (synopsis "Read and manipulate EXIF data in digital photographs")
103 "The libexif C library allows applications to read, edit, and save EXIF
104 data as produced by digital cameras.")
105 (license license:lgpl2.1+)))
107 (define-public libgphoto2
113 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
114 version "/libgphoto2-" version ".tar.bz2"))
117 "01i95av28d0szyvx6l2gjv039r3205wjwjr91nfimq132rnl2mz7"))))
118 (build-system gnu-build-system)
119 (native-inputs `(("pkg-config" ,pkg-config)))
121 `(("libjpeg-turbo" ,libjpeg-turbo)
124 ("libxml2" ,libxml2)))
126 `(;; The .pc refers to libexif.
127 ("libexif" ,libexif)))
128 (home-page "http://www.gphoto.org/proj/libgphoto2/")
129 (synopsis "Accessing digital cameras")
131 "This is the library backend for gphoto2. It contains the code for PTP,
132 MTP, and other vendor specific protocols for controlling and transferring data
133 from digital cameras.")
135 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
136 (license license:lgpl2.1+)))
138 (define-public gphoto2
144 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
145 "/gphoto2-" version ".tar.bz2"))
148 "0xsa12k5fz49v8y4h3zahzr427a3ylxaf0k7hybrkp43g4i1lmxf"))))
149 (build-system gnu-build-system)
151 `(("pkg-config" ,pkg-config)))
153 `(("readline" ,readline)
154 ("libjpeg-turbo" ,libjpeg-turbo)
157 ("libgphoto2" ,libgphoto2)))
160 (modify-phases %standard-phases
161 (add-before 'check 'pre-check
162 (lambda* (#:key inputs #:allow-other-keys)
163 (substitute* (find-files "tests/data" "\\.param$")
168 ;; FIXME: There is 1 test failure, most likely related to the build
172 (home-page "http://www.gphoto.org/")
173 (synopsis "Command-line tools to access digital cameras")
175 "Gphoto2 is a set of command line utilities for manipulating a large
176 number of different digital cameras. Through libgphoto2, it supports PTP,
177 MTP, and much more.")
179 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
180 (license license:gpl2+)))
182 (define-public perl-image-exiftool
184 (name "perl-image-exiftool")
189 "mirror://cpan/authors/id/E/EX/EXIFTOOL/Image-ExifTool-"
193 "0z8zwjjfvyllnhsafhddbybywpgqv0pl1dbn1g034cs27yj836q2"))))
194 (build-system perl-build-system)
197 (modify-phases %standard-phases
198 (add-after 'install 'post-install
199 (lambda* (#:key outputs #:allow-other-keys)
200 ;; Make sure the 'exiftool' commands finds the library.
201 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
202 (let* ((out (assoc-ref outputs "out"))
203 (pm (find-files out "^ExifTool\\.pm$"))
204 (lib (dirname (dirname (car pm)))))
205 (wrap-program (string-append out "/bin/exiftool")
206 `("PERL5LIB" prefix (,lib)))))))))
207 (home-page "http://search.cpan.org/dist/Image-ExifTool")
208 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
209 (description "This package provides the @code{exiftool} command and the
210 @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
211 and a wide variety of other metadata.")
212 (license license:perl-license)))
214 (define-public libpano13
220 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
221 "libpano13-" version "/"
222 "libpano13-" version ".tar.gz"))
225 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
226 (build-system cmake-build-system)
228 `(("libjpeg" ,libjpeg)
232 (home-page "http://panotools.sourceforge.net/")
233 (synopsis "Library for panoramic images")
235 "The libpano13 package contains the backend library written by the
236 Panorama Tools project for building panoramic images from a set of
237 overlapping images, as well as some command line tools.")
238 (license license:gpl2+)))
240 (define-public enblend-enfuse
242 (name "enblend-enfuse")
246 (uri (string-append "mirror://sourceforge/enblend/"
248 name "-" (version-major+minor version) "/"
249 name "-" version ".tar.gz"))
252 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
253 (build-system gnu-build-system)
255 `(("pkg-config" ,pkg-config)
257 ("perl-timedate" ,perl-timedate)
258 ;; for building the documentation
260 ("help2man" ,help2man)
261 ("imagemagick" ,imagemagick)
263 ("texlive-minimal" ,texlive-tiny)
265 ("transfig" ,transfig)))
277 `(#:configure-flags `("--enable-openmp")))
278 (home-page "http://enblend.sourceforge.net/")
279 (synopsis "Tools for combining and blending images")
281 "Enblend blends away the seams in a panoramic image mosaic using a
282 multi-resolution spline. Enfuse merges different exposures of the same
283 scene to produce an image that looks much like a tone-mapped image.")
284 (license license:gpl2+)))
286 (define-public lensfun
293 "mirror://sourceforge/lensfun/"
294 version "/lensfun-" version ".tar.gz"))
297 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
298 (build-system cmake-build-system)
300 `(,@(if (any (cute string-prefix? <> (or (%current-system)
301 (%current-target-system)))
303 ;; SSE and SSE2 are supported only on Intel processors.
305 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
306 #:tests? #f)) ; There are no tests to run.
308 `(("pkg-config" ,pkg-config)))
311 (home-page "https://sourceforge.net/projects/lensfun/")
312 (synopsis "Library to correct optical lens defects with a lens database")
313 (description "Digital photographs are not ideal. Of course, the better is
314 your camera, the better the results will be, but in any case if you look
315 carefully at shots taken even by the most expensive cameras equipped with the
316 most expensive lenses you will see various artifacts. It is very hard to make
317 ideal cameras, because there are a lot of factors that affect the final image
318 quality, and at some point camera and lens designers have to trade one factor
319 for another to achieve the optimal image quality, within the given design
320 restrictions and budget. But we all want ideal shots, don't we? So that's
321 what's Lensfun is all about: rectifying the defects introduced by your
322 photographic equipment.")
323 ;; The libraries are licensed under the LGPL3, the programs are
324 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
325 ;; README.md file for this clarification.
326 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
328 (define-public darktable
335 "https://github.com/darktable-org/darktable/releases/"
337 version "/darktable-" version ".tar.xz"))
340 "0y0q7a7k09sbg05k5xl1lz8n2ak1v8yarfv222ksvmbrxs53hdwx"))))
341 (build-system cmake-build-system)
343 `(#:tests? #f ; There are no tests.
344 #:configure-flags '("-DBINARY_PACKAGE_BUILD=On")
347 (string-append "CPATH=" (assoc-ref %build-inputs "ilmbase")
348 "/include/OpenEXR:" (or (getenv "CPATH") "")))
350 (modify-phases %standard-phases
351 (add-before 'configure 'set-ldflags
352 (lambda* (#:key outputs #:allow-other-keys)
356 (assoc-ref outputs "out") "/lib/darktable"))
359 `(("llvm" ,llvm-3.9.1)
360 ("clang" ,clang-3.9.1)))
362 `(("libxslt" ,libxslt)
374 ("libgphoto2" ,libgphoto2)
375 ("dbus-glib" ,dbus-glib)
379 ("python-jsonschema" ,python-jsonschema)
380 ("intltool" ,intltool)
382 ("pkg-config" ,pkg-config)
386 ("json-glib" ,json-glib)
387 ("freeimage" ,freeimage)))
388 (home-page "https://www.darktable.org")
389 (synopsis "Virtual lighttable and darkroom for photographers")
390 (description "Darktable is a photography workflow application and RAW
391 developer. It manages your digital negatives in a database, lets you view
392 them through a zoomable lighttable and enables you to develop raw images
394 ;; see src/is_supported_platform.h for supported platforms
395 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
396 (license license:gpl3+)))
404 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
405 (version-major+minor version)
406 "/hugin-" version ".tar.bz2"))
409 "058zd63vx29yrx2pphbbll7kzcxkai22q26lpw13rn4lvp41pasl"))))
410 (build-system cmake-build-system)
412 `(("gettext" ,gnu-gettext)
413 ("pkg-config" ,pkg-config)))
416 ("enblend-enfuse" ,enblend-enfuse)
420 ("freeglut" ,freeglut)
424 ("libpano13" ,libpano13)
433 ("wxwidgets" ,wxwidgets)
436 `(#:tests? #f ; no check target
439 ;; The header files of ilmbase (propagated by openexr) are not found
440 ;; when included by the header files of openexr, and an explicit
441 ;; flag needs to be set.
442 (string-append "-DCMAKE_CXX_FLAGS=-I"
443 (assoc-ref %build-inputs "ilmbase")
445 ;; Disable installation of the Python scripting interface.
446 ;; It would require the additional inputs python and swig.
447 ;; Installation would need to be tweaked, as it tries to install
448 ;; into the python directory.
451 (modify-phases %standard-phases
452 (add-before 'configure 'substitute
454 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
455 (("wxT\\(\"enblend\"\\)")
456 (string-append "wxT(\"" (which "enblend") "\")"))
457 (("wxT\\(\"enfuse\"\\)")
458 (string-append "wxT(\"" (which "enfuse") "\")")))
460 (home-page "http://hugin.sourceforge.net/")
461 (synopsis "Panorama photo stitcher")
463 "Hugin is an easy to use panoramic imaging toolchain with a graphical
464 user interface. It can be used to assemble a mosaic of photographs into
465 a complete panorama and stitch any series of overlapping pictures.")
466 (license license:gpl2+)))