photo.scm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014, 2015 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. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. (define-module (gnu packages photo)
  23. #:use-module (guix build-system cmake)
  24. #:use-module (guix build-system gnu)
  25. #:use-module (guix build-system perl)
  26. #:use-module (guix download)
  27. #:use-module ((guix licenses) #:prefix license:)
  28. #:use-module (guix packages)
  29. #:use-module (guix utils)
  30. #:use-module (gnu packages algebra)
  31. #:use-module (gnu packages autotools)
  32. #:use-module (gnu packages base)
  33. #:use-module (gnu packages boost)
  34. #:use-module (gnu packages compression)
  35. #:use-module (gnu packages curl)
  36. #:use-module (gnu packages databases)
  37. #:use-module (gnu packages gettext)
  38. #:use-module (gnu packages ghostscript)
  39. #:use-module (gnu packages gl)
  40. #:use-module (gnu packages gnome)
  41. #:use-module (gnu packages glib)
  42. #:use-module (gnu packages graphics)
  43. #:use-module (gnu packages gtk)
  44. #:use-module (gnu packages image)
  45. #:use-module (gnu packages imagemagick)
  46. #:use-module (gnu packages libusb)
  47. #:use-module (gnu packages llvm)
  48. #:use-module (gnu packages man)
  49. #:use-module (gnu packages maths)
  50. #:use-module (gnu packages perl)
  51. #:use-module (gnu packages pkg-config)
  52. #:use-module (gnu packages popt)
  53. #:use-module (gnu packages python)
  54. #:use-module (gnu packages readline)
  55. #:use-module (gnu packages tex)
  56. #:use-module (gnu packages web)
  57. #:use-module (gnu packages wxwidgets)
  58. #:use-module (gnu packages xfig)
  59. #:use-module (gnu packages xorg)
  60. #:use-module (gnu packages xml)
  61. #:use-module (srfi srfi-1)
  62. #:use-module (srfi srfi-26))
  63. (define-public libraw
  64. (package
  65. (name "libraw")
  66. (version "0.18.5")
  67. (source (origin
  68. (method url-fetch)
  69. (uri (string-append "https://www.libraw.org/data/LibRaw-"
  70. version ".tar.gz"))
  71. (sha256
  72. (base32
  73. "0y519nlvl4bfnnxbwry35f6gbcv6jbbpd2lmiwv6pbyzv4a7saps"))))
  74. (build-system gnu-build-system)
  75. (home-page "https://www.libraw.org")
  76. (synopsis "Raw image decoder")
  77. (description
  78. "LibRaw is a library for reading RAW files obtained from digital photo
  79. cameras (CRW/CR2, NEF, RAF, DNG, and others).")
  80. (license license:lgpl2.1+)))
  81. (define-public libexif
  82. (package
  83. (name "libexif")
  84. (version "0.6.21")
  85. (source (origin
  86. (method url-fetch)
  87. (uri (string-append "mirror://sourceforge/libexif/libexif/"
  88. version "/libexif-" version ".tar.bz2"))
  89. (sha256
  90. (base32
  91. "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
  92. (build-system gnu-build-system)
  93. (home-page "http://libexif.sourceforge.net/")
  94. (synopsis "Read and manipulate EXIF data in digital photographs")
  95. (description
  96. "The libexif C library allows applications to read, edit, and save EXIF
  97. data as produced by digital cameras.")
  98. (license license:lgpl2.1+)))
  99. (define-public libgphoto2
  100. (package
  101. (name "libgphoto2")
  102. (version "2.5.11")
  103. (source (origin
  104. (method url-fetch)
  105. (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
  106. version "/libgphoto2-" version ".tar.bz2"))
  107. (sha256
  108. (base32
  109. "1ap070zz6l4kn2mbyxb1yj4x5ar8hpdbmf2pvjxgnly1ss319dkz"))))
  110. (build-system gnu-build-system)
  111. (native-inputs `(("pkg-config" ,pkg-config)))
  112. (inputs
  113. `(("libjpeg-turbo" ,libjpeg-turbo)
  114. ("libltdl" ,libltdl)
  115. ("libusb" ,libusb)
  116. ("libxml2" ,libxml2)))
  117. (propagated-inputs
  118. `(;; The .pc refers to libexif.
  119. ("libexif" ,libexif)))
  120. (home-page "http://www.gphoto.org/proj/libgphoto2/")
  121. (synopsis "Accessing digital cameras")
  122. (description
  123. "This is the library backend for gphoto2. It contains the code for PTP,
  124. MTP, and other vendor specific protocols for controlling and transferring data
  125. from digital cameras.")
  126. ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
  127. (license license:lgpl2.1+)))
  128. (define-public gphoto2
  129. (package
  130. (name "gphoto2")
  131. (version "2.5.11")
  132. (source (origin
  133. (method url-fetch)
  134. (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
  135. "/gphoto2-" version ".tar.bz2"))
  136. (sha256
  137. (base32
  138. "1sgr6rsvzzagcwhc8fxbnvz3k02wr2hab0vrbvcb04k5l3b48a1r"))))
  139. (build-system gnu-build-system)
  140. (native-inputs
  141. `(("pkg-config" ,pkg-config)))
  142. (inputs
  143. `(("readline" ,readline)
  144. ("libjpeg-turbo" ,libjpeg-turbo)
  145. ("popt" ,popt)
  146. ("libexif" ,libexif)
  147. ("libgphoto2" ,libgphoto2)))
  148. (arguments
  149. '(#:phases (alist-cons-before
  150. 'check 'pre-check
  151. (lambda* (#:key inputs #:allow-other-keys)
  152. (substitute* (find-files "tests/data" "\\.param$")
  153. (("/usr/bin/env")
  154. (which "env"))))
  155. %standard-phases)
  156. ;; FIXME: There are 2 test failures, most likely related to the build
  157. ;; environment.
  158. #:tests? #f))
  159. (home-page "http://www.gphoto.org/")
  160. (synopsis "Command-line tools to access digital cameras")
  161. (description
  162. "Gphoto2 is a set of command line utilities for manipulating a large
  163. number of different digital cameras. Through libgphoto2, it supports PTP,
  164. MTP, and much more.")
  165. ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
  166. (license license:gpl2+)))
  167. (define-public perl-image-exiftool
  168. (package
  169. (name "perl-image-exiftool")
  170. (version "10.55")
  171. (source (origin
  172. (method url-fetch)
  173. (uri (string-append
  174. "mirror://cpan/authors/id/E/EX/EXIFTOOL/Image-ExifTool-"
  175. version ".tar.gz"))
  176. (sha256
  177. (base32
  178. "0z8zwjjfvyllnhsafhddbybywpgqv0pl1dbn1g034cs27yj836q2"))))
  179. (build-system perl-build-system)
  180. (arguments
  181. '(#:phases
  182. (modify-phases %standard-phases
  183. (add-after 'install 'post-install
  184. (lambda* (#:key outputs #:allow-other-keys)
  185. ;; Make sure the 'exiftool' commands finds the library.
  186. ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
  187. (let* ((out (assoc-ref outputs "out"))
  188. (pm (find-files out "^ExifTool\\.pm$"))
  189. (lib (dirname (dirname (car pm)))))
  190. (wrap-program (string-append out "/bin/exiftool")
  191. `("PERL5LIB" prefix (,lib)))))))))
  192. (home-page "http://search.cpan.org/dist/Image-ExifTool")
  193. (synopsis "Program and Perl library to manipulate EXIF and other metadata")
  194. (description "This package provides the @code{exiftool} command and the
  195. @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
  196. and a wide variety of other metadata.")
  197. (license license:perl-license)))
  198. (define-public libpano13
  199. (package
  200. (name "libpano13")
  201. (version "2.9.19")
  202. (source (origin
  203. (method url-fetch)
  204. (uri (string-append "mirror://sourceforge/panotools/libpano13/"
  205. "libpano13-" version "/"
  206. "libpano13-" version ".tar.gz"))
  207. (sha256
  208. (base32
  209. "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
  210. (build-system cmake-build-system)
  211. (inputs
  212. `(("libjpeg" ,libjpeg)
  213. ("libpng" ,libpng)
  214. ("libtiff" ,libtiff)
  215. ("zlib" ,zlib)))
  216. (home-page "http://panotools.sourceforge.net/")
  217. (synopsis "Library for panoramic images")
  218. (description
  219. "The libpano13 package contains the backend library written by the
  220. Panorama Tools project for building panoramic images from a set of
  221. overlapping images, as well as some command line tools.")
  222. (license license:gpl2+)))
  223. (define-public enblend-enfuse
  224. (package
  225. (name "enblend-enfuse")
  226. (version "4.2")
  227. (source (origin
  228. (method url-fetch)
  229. (uri (string-append "mirror://sourceforge/enblend/"
  230. name "/"
  231. name "-" (version-major+minor version) "/"
  232. name "-" version ".tar.gz"))
  233. (sha256
  234. (base32
  235. "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
  236. (build-system gnu-build-system)
  237. (native-inputs
  238. `(("pkg-config" ,pkg-config)
  239. ("perl" ,perl)
  240. ("perl-timedate" ,perl-timedate)
  241. ;; for building the documentation
  242. ("gnuplot" ,gnuplot)
  243. ("help2man" ,help2man)
  244. ("imagemagick" ,imagemagick)
  245. ("libxml2" ,libxml2)
  246. ("texlive-minimal" ,texlive-tiny)
  247. ("tidy" ,tidy)
  248. ("transfig" ,transfig)))
  249. (inputs
  250. `(("boost" ,boost)
  251. ("gsl" ,gsl)
  252. ("lcms" ,lcms)
  253. ("libjpeg" ,libjpeg)
  254. ("libpng" ,libpng)
  255. ("libtiff" ,libtiff)
  256. ("openexr" ,openexr)
  257. ("vigra" ,vigra)
  258. ("zlib" ,zlib)))
  259. (arguments
  260. `(#:configure-flags `("--enable-openmp")))
  261. (home-page "http://enblend.sourceforge.net/")
  262. (synopsis "Tools for combining and blending images")
  263. (description
  264. "Enblend blends away the seams in a panoramic image mosaic using a
  265. multi-resolution spline. Enfuse merges different exposures of the same
  266. scene to produce an image that looks much like a tone-mapped image.")
  267. (license license:gpl2+)))
  268. (define-public lensfun
  269. (package
  270. (name "lensfun")
  271. (version "0.3.2")
  272. (source (origin
  273. (method url-fetch)
  274. (uri (string-append
  275. "mirror://sourceforge/lensfun/"
  276. version "/lensfun-" version ".tar.gz"))
  277. (sha256
  278. (base32
  279. "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
  280. (build-system cmake-build-system)
  281. (arguments
  282. `(,@(if (any (cute string-prefix? <> (or (%current-system)
  283. (%current-target-system)))
  284. '("x86_64" "i686"))
  285. ;; SSE and SSE2 are supported only on Intel processors.
  286. '()
  287. '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
  288. #:tests? #f)) ; There are no tests to run.
  289. (native-inputs
  290. `(("pkg-config" ,pkg-config)))
  291. (inputs
  292. `(("glib" ,glib)))
  293. (home-page "https://sourceforge.net/projects/lensfun/")
  294. (synopsis "Library to correct optical lens defects with a lens database")
  295. (description "Digital photographs are not ideal. Of course, the better is
  296. your camera, the better the results will be, but in any case if you look
  297. carefully at shots taken even by the most expensive cameras equipped with the
  298. most expensive lenses you will see various artifacts. It is very hard to make
  299. ideal cameras, because there are a lot of factors that affect the final image
  300. quality, and at some point camera and lens designers have to trade one factor
  301. for another to achieve the optimal image quality, within the given design
  302. restrictions and budget. But we all want ideal shots, don't we? So that's
  303. what's Lensfun is all about: rectifying the defects introduced by your
  304. photographic equipment.")
  305. ;; The libraries are licensed under the LGPL3, the programs are
  306. ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
  307. ;; README.md file for this clarification.
  308. (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
  309. (define-public darktable
  310. (package
  311. (name "darktable")
  312. (version "2.2.5")
  313. (source (origin
  314. (method url-fetch)
  315. (uri (string-append
  316. "https://github.com/darktable-org/darktable/releases/"
  317. "download/release-"
  318. version "/darktable-" version ".tar.xz"))
  319. (sha256
  320. (base32
  321. "10gjzd4irxhladh4jyss9kgp627k8vgx2divipsb33pp6cms80z3"))))
  322. (build-system cmake-build-system)
  323. (arguments
  324. `(#:tests? #f ; There are no tests.
  325. #:configure-flags '("-DCMAKE_INSTALL_LIBDIR=lib")
  326. #:make-flags
  327. (list
  328. (string-append "CPATH=" (assoc-ref %build-inputs "ilmbase")
  329. "/include/OpenEXR:" (or (getenv "CPATH") "")))
  330. #:phases
  331. (modify-phases %standard-phases
  332. (add-before 'configure 'set-ldflags
  333. (lambda* (#:key outputs #:allow-other-keys)
  334. (setenv "LDFLAGS"
  335. (string-append
  336. "-Wl,-rpath="
  337. (assoc-ref outputs "out") "/lib/darktable"))
  338. #t)))))
  339. (native-inputs
  340. `(("llvm" ,llvm-3.9.1)
  341. ("clang" ,clang-3.9.1)))
  342. (inputs
  343. `(("libxslt" ,libxslt)
  344. ("libxml2" ,libxml2)
  345. ("pugixml" ,pugixml)
  346. ("gtk+" ,gtk+)
  347. ("sqlite" ,sqlite)
  348. ("libjpeg" ,libjpeg)
  349. ("libpng" ,libpng)
  350. ("cairo" ,cairo)
  351. ("lcms" ,lcms)
  352. ("exiv2" ,exiv2)
  353. ("libtiff" ,libtiff)
  354. ("curl" ,curl)
  355. ("libgphoto2" ,libgphoto2)
  356. ("dbus-glib" ,dbus-glib)
  357. ("openexr" ,openexr)
  358. ("ilmbase" ,ilmbase)
  359. ("libsoup" ,libsoup)
  360. ("python-jsonschema" ,python-jsonschema)
  361. ("intltool" ,intltool)
  362. ("perl" ,perl)
  363. ("pkg-config" ,pkg-config)
  364. ("libwebp" ,libwebp)
  365. ("lensfun" ,lensfun)
  366. ("librsvg" ,librsvg)
  367. ("json-glib" ,json-glib)
  368. ("freeimage" ,freeimage)))
  369. (home-page "https://www.darktable.org")
  370. (synopsis "Virtual lighttable and darkroom for photographers")
  371. (description "Darktable is a photography workflow application and RAW
  372. developer. It manages your digital negatives in a database, lets you view
  373. them through a zoomable lighttable and enables you to develop raw images
  374. and enhance them.")
  375. ;; see src/is_supported_platform.h for supported platforms
  376. (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
  377. (license license:gpl3+)))
  378. (define-public hugin
  379. (package
  380. (name "hugin")
  381. (version "2016.2.0")
  382. (source (origin
  383. (method url-fetch)
  384. (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
  385. (version-major+minor version)
  386. "/hugin-" version ".tar.bz2"))
  387. (sha256
  388. (base32
  389. "058zd63vx29yrx2pphbbll7kzcxkai22q26lpw13rn4lvp41pasl"))))
  390. (build-system cmake-build-system)
  391. (native-inputs
  392. `(("gettext" ,gnu-gettext)
  393. ("pkg-config" ,pkg-config)))
  394. (inputs
  395. `(("boost" ,boost)
  396. ("enblend-enfuse" ,enblend-enfuse)
  397. ("exiv2" ,exiv2)
  398. ("fftw" ,fftw)
  399. ("flann" ,flann)
  400. ("freeglut" ,freeglut)
  401. ("glew" ,glew)
  402. ("lcms" ,lcms)
  403. ("libjpeg" ,libjpeg)
  404. ("libpano13" ,libpano13)
  405. ("libpng" ,libpng)
  406. ("libtiff" ,libtiff)
  407. ("libxi" ,libxi)
  408. ("libxmu" ,libxmu)
  409. ("mesa" ,mesa)
  410. ("openexr" ,openexr)
  411. ("sqlite" ,sqlite)
  412. ("vigra" ,vigra)
  413. ("wxwidgets" ,wxwidgets)
  414. ("zlib" ,zlib)))
  415. (arguments
  416. `(#:tests? #f ; no check target
  417. #:configure-flags
  418. (list
  419. ;; The header files of ilmbase (propagated by openexr) are not found
  420. ;; when included by the header files of openexr, and an explicit
  421. ;; flag needs to be set.
  422. (string-append "-DCMAKE_CXX_FLAGS=-I"
  423. (assoc-ref %build-inputs "ilmbase")
  424. "/include/OpenEXR")
  425. ;; Disable installation of the Python scripting interface.
  426. ;; It would require the additional inputs python and swig.
  427. ;; Installation would need to be tweaked, as it tries to install
  428. ;; into the python directory.
  429. "-DBUILD_HSI=OFF")
  430. #:phases
  431. (modify-phases %standard-phases
  432. (add-before 'configure 'substitute
  433. (lambda _
  434. (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
  435. (("wxT\\(\"enblend\"\\)")
  436. (string-append "wxT(\"" (which "enblend") "\")"))
  437. (("wxT\\(\"enfuse\"\\)")
  438. (string-append "wxT(\"" (which "enfuse") "\")")))
  439. #t)))))
  440. (home-page "http://hugin.sourceforge.net/")
  441. (synopsis "Panorama photo stitcher")
  442. (description
  443. "Hugin is an easy to use panoramic imaging toolchain with a graphical
  444. user interface. It can be used to assemble a mosaic of photographs into
  445. a complete panorama and stitch any series of overlapping pictures.")
  446. (license license:gpl2+)))