photo.scm 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014, 2015, 2017, 2019, 2021 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, 2021 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
  7. ;;; Copyright © 2018–2021 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>
  11. ;;; Copyright © 2020. 2021 Vinicius Monego <monego@posteo.net>
  12. ;;;
  13. ;;; This file is part of GNU Guix.
  14. ;;;
  15. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  16. ;;; under the terms of the GNU General Public License as published by
  17. ;;; the Free Software Foundation; either version 3 of the License, or (at
  18. ;;; your option) any later version.
  19. ;;;
  20. ;;; GNU Guix is distributed in the hope that it will be useful, but
  21. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;;; GNU General Public License for more details.
  24. ;;;
  25. ;;; You should have received a copy of the GNU General Public License
  26. ;;; 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 meson)
  31. #:use-module (guix build-system perl)
  32. #:use-module (guix build-system python)
  33. #:use-module (guix download)
  34. #:use-module (guix git-download)
  35. #:use-module ((guix licenses) #:prefix license:)
  36. #:use-module (guix packages)
  37. #:use-module (guix utils)
  38. #:use-module (gnu packages)
  39. #:use-module (gnu packages algebra)
  40. #:use-module (gnu packages autotools)
  41. #:use-module (gnu packages base)
  42. #:use-module (gnu packages boost)
  43. #:use-module (gnu packages check)
  44. #:use-module (gnu packages cmake)
  45. #:use-module (gnu packages compression)
  46. #:use-module (gnu packages cups)
  47. #:use-module (gnu packages curl)
  48. #:use-module (gnu packages file)
  49. #:use-module (gnu packages freedesktop)
  50. #:use-module (gnu packages geo)
  51. #:use-module (gnu packages gettext)
  52. #:use-module (gnu packages ghostscript)
  53. #:use-module (gnu packages gl)
  54. #:use-module (gnu packages gnome)
  55. #:use-module (gnu packages glib)
  56. #:use-module (gnu packages graphics)
  57. #:use-module (gnu packages gstreamer)
  58. #:use-module (gnu packages gtk)
  59. #:use-module (gnu packages image)
  60. #:use-module (gnu packages image-processing)
  61. #:use-module (gnu packages imagemagick)
  62. #:use-module (gnu packages iso-codes)
  63. #:use-module (gnu packages libcanberra)
  64. #:use-module (gnu packages libusb)
  65. #:use-module (gnu packages llvm)
  66. #:use-module (gnu packages lua)
  67. #:use-module (gnu packages man)
  68. #:use-module (gnu packages maths)
  69. #:use-module (gnu packages opencl)
  70. #:use-module (gnu packages perl)
  71. #:use-module (gnu packages pkg-config)
  72. #:use-module (gnu packages popt)
  73. #:use-module (gnu packages python)
  74. #:use-module (gnu packages python-xyz)
  75. #:use-module (gnu packages python-web)
  76. #:use-module (gnu packages qt)
  77. #:use-module (gnu packages readline)
  78. #:use-module (gnu packages ruby)
  79. #:use-module (gnu packages sqlite)
  80. #:use-module (gnu packages tex)
  81. #:use-module (gnu packages time)
  82. #:use-module (gnu packages video)
  83. #:use-module (gnu packages web)
  84. #:use-module (gnu packages wxwidgets)
  85. #:use-module (gnu packages xfig)
  86. #:use-module (gnu packages xorg)
  87. #:use-module (gnu packages xml)
  88. #:use-module ((srfi srfi-1) #:hide (zip))
  89. #:use-module (srfi srfi-26))
  90. (define-public rapid-photo-downloader
  91. (package
  92. (name "rapid-photo-downloader")
  93. (version "0.9.18")
  94. (source (origin
  95. (method url-fetch)
  96. (uri (string-append "https://launchpad.net/rapid/pyqt/"
  97. version "/+download/" name "-"
  98. version ".tar.gz"))
  99. (sha256
  100. (base32
  101. "15p7sssg6vmqbm5xnc4j5dr89d7gl7y5qyq44a240yl5aqkjnybw"))))
  102. (build-system python-build-system)
  103. (native-inputs
  104. `(("file" ,file)
  105. ("intltool" ,intltool)
  106. ("gobject-introspection" ,gobject-introspection)))
  107. (inputs
  108. `(("gdk-pixbuf" ,gdk-pixbuf)
  109. ("gexiv2" ,gexiv2)
  110. ("gst-libav" ,gst-libav)
  111. ("gst-plugins-base" ,gst-plugins-base)
  112. ("gst-plugins-good" ,gst-plugins-good)
  113. ("gstreamer" ,gstreamer)
  114. ("libgudev" ,libgudev)
  115. ("libnotify" ,libnotify)
  116. ("libmediainfo" ,libmediainfo)
  117. ("usdisks" ,udisks)
  118. ("python-pyqt" ,python-pyqt)
  119. ("python-pygobject" ,python-pygobject)
  120. ("python-gphoto2" ,python-gphoto2)
  121. ("python-pyzmq" ,python-pyzmq)
  122. ("python-tornado" ,python-tornado)
  123. ("python-psutil" ,python-psutil)
  124. ("python-pyxdg" ,python-pyxdg)
  125. ("python-arrow" ,python-arrow)
  126. ("python-dateutil" ,python-dateutil)
  127. ("python-easygui" ,python-easygui)
  128. ("python-colour" ,python-colour)
  129. ("python-pymediainfo" ,python-pymediainfo)
  130. ("python-sortedcontainers" ,python-sortedcontainers)
  131. ("python-rawkit" ,python-rawkit)
  132. ("python-requests" ,python-requests)
  133. ("python-colorlog" ,python-colorlog)
  134. ("python-pyprind" ,python-pyprind)
  135. ("python-tenacity" ,python-tenacity)
  136. ("perl-image-exiftool" ,perl-image-exiftool)))
  137. (arguments
  138. `(#:phases
  139. (modify-phases %standard-phases
  140. (add-after 'unpack 'patch-libmediainfo
  141. (lambda _
  142. (substitute* "raphodo/metadatavideo.py"
  143. (("pymedia_library_file = 'libmediainfo.so.0'")
  144. (string-append "pymedia_library_file = '"
  145. (assoc-ref %build-inputs "libmediainfo")
  146. "/lib/libmediainfo.so.0'")))
  147. #t))
  148. (add-after 'install 'wrap
  149. (lambda* (#:key inputs outputs #:allow-other-keys)
  150. (let ((out (assoc-ref outputs "out"))
  151. (path (string-join
  152. (list (string-append
  153. (assoc-ref inputs "perl-image-exiftool")
  154. "/bin"))
  155. ":"))
  156. (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
  157. (python-path (getenv "GUIX_PYTHONPATH")))
  158. (for-each
  159. (lambda (program)
  160. (wrap-program program
  161. `("PATH" ":" prefix (,path))
  162. `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
  163. `("GUIX_PYTHONPATH" ":" prefix (,python-path))))
  164. (map (lambda (name)
  165. (string-append out "/bin/" name))
  166. '("analyze-pv-structure"
  167. "rapid-photo-downloader"))))
  168. #t)))))
  169. (home-page "https://www.damonlynch.net/rapid/")
  170. (synopsis "Import photos and videos from cameras, phones and memory cards")
  171. (description "Import photos and videos from cameras, phones and memory
  172. cards and generate meaningful file and folder names.")
  173. (license license:gpl2+)))
  174. (define-public libraw
  175. (package
  176. (name "libraw")
  177. (version "0.20.0")
  178. (source (origin
  179. (method url-fetch)
  180. (uri (string-append "https://www.libraw.org/data/LibRaw-"
  181. version ".tar.gz"))
  182. (sha256
  183. (base32
  184. "18wlsvj6c1rv036ph3695kknpgzc3lk2ikgshy8417yfl8ykh2hz"))))
  185. (build-system gnu-build-system)
  186. (native-inputs
  187. `(("pkg-config" ,pkg-config)))
  188. (inputs
  189. `(("libjpeg" ,libjpeg-turbo))) ;for lossy DNGs and old Kodak cameras
  190. (propagated-inputs
  191. `(("lcms" ,lcms))) ;for color profiles
  192. (home-page "https://www.libraw.org")
  193. (synopsis "Raw image decoder")
  194. (description
  195. "LibRaw is a library for reading RAW files obtained from digital photo
  196. cameras (CRW/CR2, NEF, RAF, DNG, and others).")
  197. ;; LibRaw is distributed under both LGPL2.1 and CDDL 1.0. From the README:
  198. ;; "You may use one of these licensing modes and switch between them. If
  199. ;; you modify LibRaw source and made your changes public, you should accept
  200. ;; both two licensing modes for your changes/additions."
  201. (license (list license:lgpl2.1 license:cddl1.0))))
  202. (define-public libexif
  203. (package
  204. (name "libexif")
  205. (version "0.6.22")
  206. (source (origin
  207. (method url-fetch)
  208. (uri (string-append
  209. "https://github.com/libexif/libexif/releases"
  210. "/download/libexif-"
  211. (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
  212. "-release/libexif-" version ".tar.xz"))
  213. (sha256
  214. (base32
  215. "0mhcad5zab7fsn120rd585h8ncwkq904nzzrq8vcd72hzk4g2j2h"))))
  216. (build-system gnu-build-system)
  217. (home-page "https://libexif.github.io/")
  218. (synopsis "Read and manipulate EXIF data in digital photographs")
  219. (description
  220. "The libexif C library allows applications to read, edit, and save EXIF
  221. data as produced by digital cameras.")
  222. (license license:lgpl2.1+)))
  223. (define-public libgphoto2
  224. (package
  225. (name "libgphoto2")
  226. (version "2.5.27")
  227. (source (origin
  228. (method url-fetch)
  229. (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
  230. version "/libgphoto2-" version ".tar.bz2"))
  231. (sha256
  232. (base32
  233. "1ms06b3dj1p33aypcb16gg5pn7fylbylsk9cnnqa0j29qiw59f7q"))))
  234. (build-system gnu-build-system)
  235. (native-inputs `(("pkg-config" ,pkg-config)))
  236. (inputs
  237. `(("libjpeg-turbo" ,libjpeg-turbo)
  238. ("libltdl" ,libltdl)
  239. ("libusb" ,libusb)
  240. ("libxml2" ,libxml2)))
  241. (propagated-inputs
  242. `(;; The .pc refers to libexif.
  243. ("libexif" ,libexif)))
  244. (home-page "http://www.gphoto.org/proj/libgphoto2/")
  245. (synopsis "Accessing digital cameras")
  246. (description
  247. "This is the library backend for gphoto2. It contains the code for PTP,
  248. MTP, and other vendor specific protocols for controlling and transferring data
  249. from digital cameras.")
  250. ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
  251. (license license:lgpl2.1+)))
  252. (define-public gphoto2
  253. (package
  254. (name "gphoto2")
  255. (version "2.5.27")
  256. (source (origin
  257. (method url-fetch)
  258. (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
  259. "/gphoto2-" version ".tar.bz2"))
  260. (sha256
  261. (base32
  262. "0f4d3q381jnnkcqkb2dj1k709skp65qihl5xm80zandvl69lw19h"))))
  263. (build-system gnu-build-system)
  264. (native-inputs
  265. `(("pkg-config" ,pkg-config)))
  266. (inputs
  267. `(("readline" ,readline)
  268. ("libjpeg-turbo" ,libjpeg-turbo)
  269. ("popt" ,popt)
  270. ("libexif" ,libexif)
  271. ("libgphoto2" ,libgphoto2)))
  272. (arguments
  273. '(#:phases
  274. (modify-phases %standard-phases
  275. (add-before 'check 'pre-check
  276. (lambda* (#:key inputs #:allow-other-keys)
  277. (substitute* (find-files "tests/data" "\\.param$")
  278. (("/usr/bin/env")
  279. (which "env")))
  280. #t)))
  281. ;; FIXME: There is 1 test failure, most likely related to the build
  282. ;; environment.
  283. #:tests? #f))
  284. (home-page "http://www.gphoto.org/")
  285. (synopsis "Command-line tools to access digital cameras")
  286. (description
  287. "Gphoto2 is a set of command line utilities for manipulating a large
  288. number of different digital cameras. Through libgphoto2, it supports PTP,
  289. MTP, and much more.")
  290. ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
  291. (license license:gpl2+)))
  292. ;; Note: See <https://metacpan.org/pod/Image::ExifTool> for the latest
  293. ;; release. The versions at <https://www.sno.phy.queensu.ca/~phil/exiftool/>
  294. ;; are not meant for production use according to the Changes file.
  295. (define-public perl-image-exiftool
  296. (package
  297. (name "perl-image-exiftool")
  298. (version "12.16")
  299. (source
  300. (origin
  301. (method url-fetch)
  302. (uri (list
  303. (string-append "mirror://cpan/authors/id/E/EX/EXIFTOOL/"
  304. "Image-ExifTool-" version ".tar.gz")
  305. ;; New releases may take a while to hit CPAN.
  306. (string-append "https://www.sno.phy.queensu.ca/~phil/exiftool/"
  307. "Image-ExifTool-" version ".tar.gz")))
  308. (patches (search-patches "perl-image-exiftool-CVE-2021-22204.patch"))
  309. (sha256
  310. (base32
  311. "0skm22b3gg1bfk0amklrprpva41m6mkrhqp0gi7z1nmcf9ypjh61"))))
  312. (build-system perl-build-system)
  313. (arguments
  314. '(#:phases
  315. (modify-phases %standard-phases
  316. (add-after 'install 'post-install
  317. (lambda* (#:key outputs #:allow-other-keys)
  318. ;; Make sure the 'exiftool' commands finds the library.
  319. ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
  320. (let* ((out (assoc-ref outputs "out"))
  321. (pm (find-files out "^ExifTool\\.pm$"))
  322. (lib (dirname (dirname (car pm)))))
  323. (wrap-program (string-append out "/bin/exiftool")
  324. `("PERL5LIB" prefix (,lib)))
  325. #t))))))
  326. (home-page "https://metacpan.org/release/Image-ExifTool")
  327. (synopsis "Program and Perl library to manipulate EXIF and other metadata")
  328. (description "This package provides the @code{exiftool} command and the
  329. @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
  330. and a wide variety of other metadata.")
  331. (license license:perl-license)))
  332. (define-public libpano13
  333. (package
  334. (name "libpano13")
  335. (version "2.9.20_rc3")
  336. (source (origin
  337. (method url-fetch)
  338. (uri (string-append "mirror://sourceforge/panotools/libpano13/"
  339. "libpano13-" (first
  340. (string-split version #\_))
  341. "/libpano13-" version ".tar.gz"))
  342. (sha256
  343. (base32
  344. "12cv4886l1czfjwy7k6ipgf3zjksgwhdjzr2s9fdg33vqcv2hlrv"))))
  345. (build-system cmake-build-system)
  346. (inputs
  347. `(("libjpeg" ,libjpeg-turbo)
  348. ("libpng" ,libpng)
  349. ("libtiff" ,libtiff)
  350. ("zlib" ,zlib)))
  351. (home-page "http://panotools.sourceforge.net/")
  352. (synopsis "Library for panoramic images")
  353. (description
  354. "The libpano13 package contains the backend library written by the
  355. Panorama Tools project for building panoramic images from a set of
  356. overlapping images, as well as some command line tools.")
  357. (license license:gpl2+)))
  358. (define-public enblend-enfuse
  359. (package
  360. (name "enblend-enfuse")
  361. (version "4.2")
  362. (source (origin
  363. (method url-fetch)
  364. (uri (string-append "mirror://sourceforge/enblend/"
  365. name "/"
  366. name "-" (version-major+minor version) "/"
  367. name "-" version ".tar.gz"))
  368. (sha256
  369. (base32
  370. "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
  371. (build-system gnu-build-system)
  372. (native-inputs
  373. `(("pkg-config" ,pkg-config)
  374. ("perl" ,perl)
  375. ("perl-timedate" ,perl-timedate)
  376. ;; for building the documentation
  377. ("gnuplot" ,gnuplot)
  378. ("help2man" ,help2man)
  379. ("imagemagick" ,imagemagick)
  380. ("libxml2" ,libxml2)
  381. ("texlive-minimal" ,texlive-tiny)
  382. ("tidy" ,tidy)
  383. ("transfig" ,transfig)))
  384. (inputs
  385. `(("boost" ,boost)
  386. ("gsl" ,gsl)
  387. ("lcms" ,lcms)
  388. ("libjpeg" ,libjpeg-turbo)
  389. ("libpng" ,libpng)
  390. ("libtiff" ,libtiff)
  391. ("openexr" ,openexr)
  392. ("vigra" ,vigra)
  393. ("zlib" ,zlib)))
  394. (arguments
  395. `(#:configure-flags `("--enable-openmp")))
  396. (home-page "http://enblend.sourceforge.net/")
  397. (synopsis "Tools for combining and blending images")
  398. (description
  399. "Enblend blends away the seams in a panoramic image mosaic using a
  400. multi-resolution spline. Enfuse merges different exposures of the same
  401. scene to produce an image that looks much like a tone-mapped image.")
  402. (license license:gpl2+)))
  403. (define-public lensfun
  404. (package
  405. (name "lensfun")
  406. (version "0.3.2")
  407. (source (origin
  408. (method url-fetch)
  409. (uri (string-append
  410. "mirror://sourceforge/lensfun/"
  411. version "/lensfun-" version ".tar.gz"))
  412. (sha256
  413. (base32
  414. "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
  415. (build-system cmake-build-system)
  416. (arguments
  417. `(,@(if (any (cute string-prefix? <> (or (%current-system)
  418. (%current-target-system)))
  419. '("x86_64" "i686"))
  420. ;; SSE and SSE2 are supported only on Intel processors.
  421. '()
  422. '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
  423. #:tests? #f)) ; There are no tests to run.
  424. (native-inputs
  425. `(("pkg-config" ,pkg-config)))
  426. (inputs
  427. `(("glib" ,glib)))
  428. (home-page "https://sourceforge.net/projects/lensfun/")
  429. (synopsis "Library to correct optical lens defects with a lens database")
  430. (description "Digital photographs are not ideal. Of course, the better is
  431. your camera, the better the results will be, but in any case if you look
  432. carefully at shots taken even by the most expensive cameras equipped with the
  433. most expensive lenses you will see various artifacts. It is very hard to make
  434. ideal cameras, because there are a lot of factors that affect the final image
  435. quality, and at some point camera and lens designers have to trade one factor
  436. for another to achieve the optimal image quality, within the given design
  437. restrictions and budget. But we all want ideal shots, don't we? So that's
  438. what's Lensfun is all about: rectifying the defects introduced by your
  439. photographic equipment.")
  440. ;; The libraries are licensed under the LGPL3, the programs are
  441. ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
  442. ;; README.md file for this clarification.
  443. (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
  444. (define-public darktable
  445. (package
  446. (name "darktable")
  447. (version "3.6.1")
  448. (source
  449. (origin
  450. (method url-fetch)
  451. (uri (string-append
  452. "https://github.com/darktable-org/darktable/releases/"
  453. "download/release-" version "/darktable-" version ".tar.xz"))
  454. (sha256
  455. (base32 "051dwhdqa9q3zyrvr78g0cfzl1zhaagfvgx9axa9895q0g0wggx2"))))
  456. (build-system cmake-build-system)
  457. (arguments
  458. `(#:configure-flags '("-DBINARY_PACKAGE_BUILD=On"
  459. "-DBUILD_TESTING=On")
  460. #:phases
  461. (modify-phases %standard-phases
  462. (add-after 'unpack 'libOpenCL-path
  463. (lambda* (#:key inputs #:allow-other-keys)
  464. ;; Statically link to libOpenCL.
  465. (substitute* "./src/common/dlopencl.c"
  466. (("\"libOpenCL\"")
  467. (string-append "\"" (assoc-ref inputs "opencl-icd-loader")
  468. "/lib/libOpenCL.so\"")))))
  469. (add-before 'configure 'prepare-build-environment
  470. (lambda* (#:key inputs #:allow-other-keys)
  471. ;; Rawspeed fails to build with GCC due to OpenMP error:
  472. ;; "undefined reference to `GOMP_loop_nonmonotonic_dynamic_next'"
  473. (setenv "CC" "clang") (setenv "CXX" "clang++")
  474. ;; Darktable looks for opencl-c.h in the LLVM dir. Guix installs
  475. ;; it to the Clang dir. We fix this by patching CMakeLists.txt.
  476. (substitute* "CMakeLists.txt"
  477. (("\\$\\{LLVM_INSTALL_PREFIX\\}")
  478. (assoc-ref %build-inputs "clang")))))
  479. (add-before 'configure 'set-LDFLAGS-and-CPATH
  480. (lambda* (#:key inputs outputs #:allow-other-keys)
  481. (setenv "LDFLAGS"
  482. (string-append
  483. "-Wl,-rpath="
  484. (assoc-ref outputs "out") "/lib/darktable"))
  485. ;; Ensure the OpenEXR headers are found.
  486. (setenv "CPATH"
  487. (string-append
  488. (search-input-directory inputs "include/OpenEXR")
  489. ":" (or (getenv "CPATH") "")))))
  490. (add-after 'install 'wrap-program
  491. (lambda* (#:key inputs outputs #:allow-other-keys)
  492. (wrap-program (string-append (assoc-ref outputs "out")
  493. "/bin/darktable")
  494. ;; For GtkFileChooserDialog.
  495. `("GSETTINGS_SCHEMA_DIR" =
  496. (,(string-append (assoc-ref inputs "gtk+")
  497. "/share/glib-2.0/schemas")))))))))
  498. (native-inputs
  499. `(("clang" ,clang-11)
  500. ("cmocka" ,cmocka)
  501. ("desktop-file-utils" ,desktop-file-utils)
  502. ("glib:bin" ,glib "bin")
  503. ("gobject-introspection" ,gobject-introspection)
  504. ("intltool" ,intltool)
  505. ("llvm" ,llvm-11) ;should match the Clang version
  506. ("opencl-headers" ,opencl-headers)
  507. ("perl" ,perl)
  508. ("pkg-config" ,pkg-config)
  509. ("po4a" ,po4a)
  510. ("python" ,python-wrapper)
  511. ("ruby" ,ruby)))
  512. (inputs
  513. `(("cairo" ,cairo)
  514. ("colord-gtk" ,colord-gtk) ;optional, for color profile support
  515. ("cups" ,cups) ;optional, for printing support
  516. ("curl" ,curl)
  517. ("dbus-glib" ,dbus-glib)
  518. ("exiv2" ,exiv2)
  519. ("freeimage" ,freeimage)
  520. ("gmic" ,gmic) ;optional, for HaldcLUT support
  521. ("graphicsmagick" ,graphicsmagick)
  522. ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
  523. ("gtk+" ,gtk+)
  524. ("ilmbase" ,ilmbase)
  525. ("iso-codes" ,iso-codes) ;optional, for language names in the preferences
  526. ("json-glib" ,json-glib)
  527. ("lcms" ,lcms)
  528. ("lensfun" ,lensfun) ;optional, for the lens distortion plugin
  529. ("libgphoto2" ,libgphoto2) ;optional, for camera tethering
  530. ("libavif" ,libavif) ;optional, for AVIF support
  531. ("libjpeg" ,libjpeg-turbo)
  532. ("libomp" ,libomp)
  533. ("libpng" ,libpng)
  534. ("librsvg" ,librsvg)
  535. ("libsecret" ,libsecret) ;optional, for storing passwords
  536. ("libsoup" ,libsoup)
  537. ("libtiff" ,libtiff)
  538. ("libwebp" ,libwebp) ;optional, for WebP support
  539. ("libxml2" ,libxml2)
  540. ("libxslt" ,libxslt)
  541. ("lua" ,lua) ;optional, for plugins
  542. ("opencl-icd-loader" ,opencl-icd-loader) ;optional, for OpenCL support
  543. ("openexr" ,openexr) ;optional, for EXR import/export
  544. ("openjpeg" ,openjpeg) ;optional, for JPEG2000 export
  545. ("osm-gps-map" ,osm-gps-map) ;optional, for geotagging view
  546. ("pugixml" ,pugixml)
  547. ("python-jsonschema" ,python-jsonschema)
  548. ("sqlite" ,sqlite)))
  549. (home-page "https://www.darktable.org")
  550. (synopsis "Virtual lighttable and darkroom for photographers")
  551. (description "Darktable is a photography workflow application and RAW
  552. developer. It manages your digital negatives in a database, lets you view
  553. them through a zoomable lighttable and enables you to develop raw images
  554. and enhance them.")
  555. ;; See src/is_supported_platform.h for supported platforms.
  556. (supported-systems '("x86_64-linux" "aarch64-linux" "powerpc64le-linux"))
  557. (license (list license:gpl3+ ;; Darktable itself.
  558. license:lgpl2.1+)))) ;; Rawspeed library.
  559. (define-public photoflare
  560. (package
  561. (name "photoflare")
  562. (version "1.6.9")
  563. (source
  564. (origin
  565. (method git-fetch)
  566. (uri (git-reference
  567. (url "https://github.com/photoflare/photoflare")
  568. (commit (string-append "v" version))))
  569. (file-name (git-file-name name version))
  570. (sha256
  571. (base32 "121fhbggsh6jhrr7m41f27fd34ql7libdr2v0ig5bj6nc2ddwd40"))))
  572. (build-system gnu-build-system)
  573. (arguments
  574. '(#:tests? #f ;no tests
  575. #:phases
  576. (modify-phases %standard-phases
  577. (replace 'configure
  578. (lambda* (#:key inputs outputs #:allow-other-keys)
  579. (let ((magickpp (assoc-ref inputs "graphicsmagick"))
  580. (out (assoc-ref outputs "out")))
  581. (invoke "qmake"
  582. (string-append "INCLUDEPATH += " magickpp
  583. "/include/GraphicsMagick")
  584. (string-append "PREFIX=" out)
  585. "Photoflare.pro")))))))
  586. (native-inputs
  587. `(("pkg-config" ,pkg-config)
  588. ("qttools" ,qttools)))
  589. (inputs
  590. `(("graphicsmagick" ,graphicsmagick)
  591. ("libomp" ,libomp)
  592. ("qtbase" ,qtbase-5)))
  593. (home-page "https://photoflare.io")
  594. (synopsis "Quick, simple but powerful image editor")
  595. (description "Photoflare is a cross-platform image editor with an aim
  596. to balance between powerful features and a very friendly graphical user
  597. interface. It suits a wide variety of different tasks and users who value a
  598. more nimble workflow. Features include basic image editing capabilities,
  599. paint brushes, image filters, colour adjustments and more advanced features
  600. such as Batch image processing.")
  601. (license license:gpl3+)))
  602. (define-public entangle
  603. (package
  604. (name "entangle")
  605. (version "3.0")
  606. (source
  607. (origin
  608. (method git-fetch)
  609. (uri (git-reference
  610. (url "https://gitlab.com/entangle/entangle")
  611. (commit (string-append "v" version))))
  612. (file-name (git-file-name name version))
  613. (sha256
  614. (base32 "1pdmgxjdb3xlcqsaz7l8qzj5f7g7nwzhsrgid8929bm36d49cgc7"))))
  615. (build-system meson-build-system)
  616. (arguments
  617. `(#:glib-or-gtk? #t
  618. #:phases
  619. (modify-phases %standard-phases
  620. (add-after 'unpack 'skip-gtk-update-icon-cache
  621. ;; Don't create 'icon-theme.cache'.
  622. (lambda _
  623. (substitute* "meson_post_install.py"
  624. (("gtk-update-icon-cache") "true"))
  625. #t))
  626. (add-after 'install 'wrap-gi-python
  627. ;; Make GTK find files needed by plugins.
  628. (lambda* (#:key inputs outputs #:allow-other-keys)
  629. (let ((out (assoc-ref outputs "out"))
  630. (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
  631. (python-path (getenv "GUIX_PYTHONPATH")))
  632. (wrap-program (string-append out "/bin/entangle")
  633. `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
  634. `("GUIX_PYTHONPATH" ":" prefix (,python-path))))
  635. #t)))))
  636. (native-inputs
  637. `(("cmake" ,cmake)
  638. ("gettext" ,gettext-minimal)
  639. ("glib:bin" ,glib "bin")
  640. ("gobject-introspection" ,gobject-introspection)
  641. ("gtk-doc" ,gtk-doc)
  642. ("perl" ,perl)
  643. ("pkg-config" ,pkg-config)
  644. ("xmllint" ,libxml2)))
  645. (inputs
  646. `(("gdk-pixbuf" ,gdk-pixbuf)
  647. ("gexiv2" ,gexiv2)
  648. ("gst-plugins-base" ,gst-plugins-base)
  649. ("gstreamer" ,gstreamer)
  650. ("gtk+" ,gtk+)
  651. ("lcms" ,lcms)
  652. ("libgphoto2" ,libgphoto2)
  653. ("libgudev" ,libgudev)
  654. ("libpeas" ,libpeas)
  655. ("libraw" ,libraw)
  656. ("python" ,python)
  657. ("python-pygobject" ,python-pygobject)))
  658. (home-page "https://entangle-photo.org/")
  659. (synopsis "Camera control and capture")
  660. (description
  661. "Entangle is an application which uses GTK and libgphoto2 to provide a
  662. graphical interface for tethered photography with digital cameras. It
  663. includes control over camera shooting and configuration settings and 'hands
  664. off' shooting directly from the controlling computer.")
  665. (license license:gpl3+)))
  666. (define-public hugin
  667. (package
  668. (name "hugin")
  669. (version "2020.0.0")
  670. (source (origin
  671. (method url-fetch)
  672. (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
  673. (version-major+minor version)
  674. "/hugin-" version ".tar.bz2"))
  675. (sha256
  676. (base32
  677. "1jyazc0mbr9g7vrichpqqnfl72lj21244csk0z5i8ycs4l0pcgi8"))))
  678. (build-system cmake-build-system)
  679. (native-inputs
  680. `(("gettext" ,gettext-minimal)
  681. ("pkg-config" ,pkg-config)))
  682. (inputs
  683. `(("boost" ,boost)
  684. ("enblend-enfuse" ,enblend-enfuse)
  685. ("exiv2" ,exiv2)
  686. ("fftw" ,fftw)
  687. ("flann" ,flann)
  688. ("freeglut" ,freeglut)
  689. ("glew" ,glew)
  690. ("lcms" ,lcms)
  691. ("libjpeg" ,libjpeg-turbo)
  692. ("libpano13" ,libpano13)
  693. ("libpng" ,libpng)
  694. ("libtiff" ,libtiff)
  695. ("libxi" ,libxi)
  696. ("libxmu" ,libxmu)
  697. ("mesa" ,mesa)
  698. ("openexr" ,openexr)
  699. ("sqlite" ,sqlite)
  700. ("vigra" ,vigra)
  701. ("wxwidgets" ,wxwidgets)
  702. ("zlib" ,zlib)))
  703. (arguments
  704. `(#:tests? #f ; no check target
  705. #:configure-flags
  706. (list
  707. ;; The header files of ilmbase (propagated by openexr) are not found
  708. ;; when included by the header files of openexr, and an explicit
  709. ;; flag needs to be set.
  710. (string-append "-DCMAKE_CXX_FLAGS=-I"
  711. (assoc-ref %build-inputs "ilmbase")
  712. "/include/OpenEXR")
  713. ;; Disable installation of the Python scripting interface.
  714. ;; It would require the additional inputs python and swig.
  715. ;; Installation would need to be tweaked, as it tries to install
  716. ;; into the python directory.
  717. "-DBUILD_HSI=OFF")
  718. #:phases
  719. (modify-phases %standard-phases
  720. (add-before 'configure 'substitute
  721. (lambda _
  722. (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
  723. (("wxT\\(\"enblend\"\\)")
  724. (string-append "wxT(\"" (which "enblend") "\")"))
  725. (("wxT\\(\"enfuse\"\\)")
  726. (string-append "wxT(\"" (which "enfuse") "\")")))
  727. #t)))))
  728. (home-page "http://hugin.sourceforge.net/")
  729. (synopsis "Panorama photo stitcher")
  730. (description
  731. "Hugin is an easy to use panoramic imaging toolchain with a graphical
  732. user interface. It can be used to assemble a mosaic of photographs into
  733. a complete panorama and stitch any series of overlapping pictures.")
  734. (license license:gpl2+)))
  735. (define-public rawtherapee
  736. (package
  737. (name "rawtherapee")
  738. (version "5.8")
  739. (source (origin
  740. (method url-fetch)
  741. (uri (string-append "https://rawtherapee.com/shared/source/"
  742. "rawtherapee-" version ".tar.xz"))
  743. (sha256
  744. (base32
  745. "0lq8qi7g0a28h3rab7bk5bbbd4gvfma42bvlz1dfn8p9mah2h19n"))))
  746. (build-system cmake-build-system)
  747. (arguments
  748. '(#:tests? #f ; no test suite
  749. #:build-type "release"
  750. #:configure-flags
  751. (list (string-append "-DLENSFUNDBDIR="
  752. (assoc-ref %build-inputs "lensfun")
  753. "/share/lensfun")
  754. ;; Don't optimize the build for the host machine. See the file
  755. ;; 'ProcessorTargets.cmake' in the source distribution for more
  756. ;; information.
  757. "-DPROC_TARGET_NUMBER=1"
  758. ;; These flags are recommended by upstream for distributed packages.
  759. ;; See the file 'RELEASE_NOTES.txt' in the source distribution.
  760. "-O3"
  761. "-DCACHE_NAME_SUFFIX=\"\"")))
  762. (native-inputs
  763. `(("pkg-config" ,pkg-config)))
  764. (inputs
  765. `(("expat" ,expat)
  766. ("fftw" ,fftwf)
  767. ("glib" ,glib)
  768. ("glibmm" ,glibmm)
  769. ("gtk+" ,gtk+)
  770. ("gtkmm" ,gtkmm-3)
  771. ("lcms" ,lcms)
  772. ("lensfun" ,lensfun)
  773. ("libcanberra" ,libcanberra)
  774. ("libiptcdata" ,libiptcdata)
  775. ("libjpeg" ,libjpeg-turbo)
  776. ("libpng" ,libpng)
  777. ("librsvg" ,librsvg)
  778. ("libsigc++" ,libsigc++)
  779. ("libtiff" ,libtiff)
  780. ("zlib" ,zlib)))
  781. (home-page "https://rawtherapee.com")
  782. (synopsis "Raw image developing and processing")
  783. (description "RawTherapee is a raw image processing suite. It comprises a
  784. subset of image editing operations specifically aimed at non-destructive raw
  785. photo post-production and is primarily focused on improving a photographer's
  786. workflow by facilitating the handling of large numbers of images. Most raw
  787. formats are supported, including Pentax Pixel Shift, Canon Dual-Pixel, and those
  788. from Foveon and X-Trans sensors.")
  789. (license license:gpl3+)))