photo.scm 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  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 libraw-0.18
  203. (package (inherit libraw)
  204. (name "libraw")
  205. (version "0.18.12")
  206. (source (origin
  207. (method url-fetch)
  208. (uri (string-append "https://www.libraw.org/data/LibRaw-"
  209. version ".tar.gz"))
  210. (sha256
  211. (base32
  212. "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap"))))))
  213. (define-public libexif
  214. (package
  215. (name "libexif")
  216. (version "0.6.22")
  217. (source (origin
  218. (method url-fetch)
  219. (uri (string-append
  220. "https://github.com/libexif/libexif/releases"
  221. "/download/libexif-"
  222. (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
  223. "-release/libexif-" version ".tar.xz"))
  224. (sha256
  225. (base32
  226. "0mhcad5zab7fsn120rd585h8ncwkq904nzzrq8vcd72hzk4g2j2h"))))
  227. (build-system gnu-build-system)
  228. (home-page "https://libexif.github.io/")
  229. (synopsis "Read and manipulate EXIF data in digital photographs")
  230. (description
  231. "The libexif C library allows applications to read, edit, and save EXIF
  232. data as produced by digital cameras.")
  233. (license license:lgpl2.1+)))
  234. (define-public libgphoto2
  235. (package
  236. (name "libgphoto2")
  237. (version "2.5.27")
  238. (source (origin
  239. (method url-fetch)
  240. (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
  241. version "/libgphoto2-" version ".tar.bz2"))
  242. (sha256
  243. (base32
  244. "1ms06b3dj1p33aypcb16gg5pn7fylbylsk9cnnqa0j29qiw59f7q"))))
  245. (build-system gnu-build-system)
  246. (native-inputs `(("pkg-config" ,pkg-config)))
  247. (inputs
  248. `(("libjpeg-turbo" ,libjpeg-turbo)
  249. ("libltdl" ,libltdl)
  250. ("libusb" ,libusb)
  251. ("libxml2" ,libxml2)))
  252. (propagated-inputs
  253. `(;; The .pc refers to libexif.
  254. ("libexif" ,libexif)))
  255. (home-page "http://www.gphoto.org/proj/libgphoto2/")
  256. (synopsis "Accessing digital cameras")
  257. (description
  258. "This is the library backend for gphoto2. It contains the code for PTP,
  259. MTP, and other vendor specific protocols for controlling and transferring data
  260. from digital cameras.")
  261. ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
  262. (license license:lgpl2.1+)))
  263. (define-public gphoto2
  264. (package
  265. (name "gphoto2")
  266. (version "2.5.27")
  267. (source (origin
  268. (method url-fetch)
  269. (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
  270. "/gphoto2-" version ".tar.bz2"))
  271. (sha256
  272. (base32
  273. "0f4d3q381jnnkcqkb2dj1k709skp65qihl5xm80zandvl69lw19h"))))
  274. (build-system gnu-build-system)
  275. (native-inputs
  276. `(("pkg-config" ,pkg-config)))
  277. (inputs
  278. `(("readline" ,readline)
  279. ("libjpeg-turbo" ,libjpeg-turbo)
  280. ("popt" ,popt)
  281. ("libexif" ,libexif)
  282. ("libgphoto2" ,libgphoto2)))
  283. (arguments
  284. '(#:phases
  285. (modify-phases %standard-phases
  286. (add-before 'check 'pre-check
  287. (lambda* (#:key inputs #:allow-other-keys)
  288. (substitute* (find-files "tests/data" "\\.param$")
  289. (("/usr/bin/env")
  290. (which "env")))
  291. #t)))
  292. ;; FIXME: There is 1 test failure, most likely related to the build
  293. ;; environment.
  294. #:tests? #f))
  295. (home-page "http://www.gphoto.org/")
  296. (synopsis "Command-line tools to access digital cameras")
  297. (description
  298. "Gphoto2 is a set of command line utilities for manipulating a large
  299. number of different digital cameras. Through libgphoto2, it supports PTP,
  300. MTP, and much more.")
  301. ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
  302. (license license:gpl2+)))
  303. ;; Note: See <https://metacpan.org/pod/Image::ExifTool> for the latest
  304. ;; release. The versions at <https://www.sno.phy.queensu.ca/~phil/exiftool/>
  305. ;; are not meant for production use according to the Changes file.
  306. (define-public perl-image-exiftool
  307. (package
  308. (name "perl-image-exiftool")
  309. (version "12.16")
  310. (source
  311. (origin
  312. (method url-fetch)
  313. (uri (list
  314. (string-append "mirror://cpan/authors/id/E/EX/EXIFTOOL/"
  315. "Image-ExifTool-" version ".tar.gz")
  316. ;; New releases may take a while to hit CPAN.
  317. (string-append "https://www.sno.phy.queensu.ca/~phil/exiftool/"
  318. "Image-ExifTool-" version ".tar.gz")))
  319. (patches (search-patches "perl-image-exiftool-CVE-2021-22204.patch"))
  320. (sha256
  321. (base32
  322. "0skm22b3gg1bfk0amklrprpva41m6mkrhqp0gi7z1nmcf9ypjh61"))))
  323. (build-system perl-build-system)
  324. (arguments
  325. '(#:phases
  326. (modify-phases %standard-phases
  327. (add-after 'install 'post-install
  328. (lambda* (#:key outputs #:allow-other-keys)
  329. ;; Make sure the 'exiftool' commands finds the library.
  330. ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
  331. (let* ((out (assoc-ref outputs "out"))
  332. (pm (find-files out "^ExifTool\\.pm$"))
  333. (lib (dirname (dirname (car pm)))))
  334. (wrap-program (string-append out "/bin/exiftool")
  335. `("PERL5LIB" prefix (,lib)))
  336. #t))))))
  337. (home-page "https://metacpan.org/release/Image-ExifTool")
  338. (synopsis "Program and Perl library to manipulate EXIF and other metadata")
  339. (description "This package provides the @code{exiftool} command and the
  340. @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
  341. and a wide variety of other metadata.")
  342. (license license:perl-license)))
  343. (define-public libpano13
  344. (package
  345. (name "libpano13")
  346. (version "2.9.20_rc3")
  347. (source (origin
  348. (method url-fetch)
  349. (uri (string-append "mirror://sourceforge/panotools/libpano13/"
  350. "libpano13-" (first
  351. (string-split version #\_))
  352. "/libpano13-" version ".tar.gz"))
  353. (sha256
  354. (base32
  355. "12cv4886l1czfjwy7k6ipgf3zjksgwhdjzr2s9fdg33vqcv2hlrv"))))
  356. (build-system cmake-build-system)
  357. (inputs
  358. `(("libjpeg" ,libjpeg-turbo)
  359. ("libpng" ,libpng)
  360. ("libtiff" ,libtiff)
  361. ("zlib" ,zlib)))
  362. (home-page "http://panotools.sourceforge.net/")
  363. (synopsis "Library for panoramic images")
  364. (description
  365. "The libpano13 package contains the backend library written by the
  366. Panorama Tools project for building panoramic images from a set of
  367. overlapping images, as well as some command line tools.")
  368. (license license:gpl2+)))
  369. (define-public enblend-enfuse
  370. (package
  371. (name "enblend-enfuse")
  372. (version "4.2")
  373. (source (origin
  374. (method url-fetch)
  375. (uri (string-append "mirror://sourceforge/enblend/"
  376. name "/"
  377. name "-" (version-major+minor version) "/"
  378. name "-" version ".tar.gz"))
  379. (sha256
  380. (base32
  381. "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
  382. (build-system gnu-build-system)
  383. (native-inputs
  384. `(("pkg-config" ,pkg-config)
  385. ("perl" ,perl)
  386. ("perl-timedate" ,perl-timedate)
  387. ;; for building the documentation
  388. ("gnuplot" ,gnuplot)
  389. ("help2man" ,help2man)
  390. ("imagemagick" ,imagemagick)
  391. ("libxml2" ,libxml2)
  392. ("texlive-minimal" ,texlive-tiny)
  393. ("tidy" ,tidy)
  394. ("transfig" ,transfig)))
  395. (inputs
  396. `(("boost" ,boost)
  397. ("gsl" ,gsl)
  398. ("lcms" ,lcms)
  399. ("libjpeg" ,libjpeg-turbo)
  400. ("libpng" ,libpng)
  401. ("libtiff" ,libtiff)
  402. ("openexr" ,openexr)
  403. ("vigra" ,vigra)
  404. ("zlib" ,zlib)))
  405. (arguments
  406. `(#:configure-flags `("--enable-openmp")))
  407. (home-page "http://enblend.sourceforge.net/")
  408. (synopsis "Tools for combining and blending images")
  409. (description
  410. "Enblend blends away the seams in a panoramic image mosaic using a
  411. multi-resolution spline. Enfuse merges different exposures of the same
  412. scene to produce an image that looks much like a tone-mapped image.")
  413. (license license:gpl2+)))
  414. (define-public lensfun
  415. (package
  416. (name "lensfun")
  417. (version "0.3.2")
  418. (source (origin
  419. (method url-fetch)
  420. (uri (string-append
  421. "mirror://sourceforge/lensfun/"
  422. version "/lensfun-" version ".tar.gz"))
  423. (sha256
  424. (base32
  425. "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
  426. (build-system cmake-build-system)
  427. (arguments
  428. `(,@(if (any (cute string-prefix? <> (or (%current-system)
  429. (%current-target-system)))
  430. '("x86_64" "i686"))
  431. ;; SSE and SSE2 are supported only on Intel processors.
  432. '()
  433. '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
  434. #:tests? #f)) ; There are no tests to run.
  435. (native-inputs
  436. `(("pkg-config" ,pkg-config)))
  437. (inputs
  438. `(("glib" ,glib)))
  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))))
  455. (define-public darktable
  456. (package
  457. (name "darktable")
  458. (version "3.6.0")
  459. (source
  460. (origin
  461. (method url-fetch)
  462. (uri (string-append
  463. "https://github.com/darktable-org/darktable/releases/"
  464. "download/release-" version "/darktable-" version ".tar.xz"))
  465. (sha256
  466. (base32 "0f8aqwkgw4gs97b5i4ygiqk5zilwq7ax7zwdd31r72zk98cd1g46"))))
  467. (build-system cmake-build-system)
  468. (arguments
  469. `(#:configure-flags '("-DBINARY_PACKAGE_BUILD=On"
  470. "-DBUILD_TESTING=On")
  471. #:phases
  472. (modify-phases %standard-phases
  473. (add-after 'unpack 'libOpenCL-path
  474. (lambda* (#:key inputs #:allow-other-keys)
  475. ;; Statically link to libOpenCL.
  476. (substitute* "./src/common/dlopencl.c"
  477. (("\"libOpenCL\"")
  478. (string-append "\"" (assoc-ref inputs "opencl-icd-loader")
  479. "/lib/libOpenCL.so\"")))
  480. #t))
  481. ;; The use of inline is wrong and darktable cannot compile its kernels
  482. ;; with ROCm. See upstream commit
  483. ;; https://github.com/darktable-org/darktable/commit/f0d8710f5ef34eb7e33b4064e022ebf3057b9e53
  484. (add-after 'unpack 'opencl-inline
  485. (lambda* (#:key inputs #:allow-other-keys)
  486. ;; This is a feature of OpenCL 1.2 and later.
  487. (substitute* "data/kernels/CMakeLists.txt"
  488. (("CL1\\.1") "CL1.2"))
  489. (substitute* (find-files "data/kernels" "\\.(cl|h)$")
  490. (("inline") "static inline"))
  491. #t))
  492. (add-before 'configure 'prepare-build-environment
  493. (lambda* (#:key inputs #:allow-other-keys)
  494. ;; Rawspeed fails to build with GCC due to OpenMP error:
  495. ;; "undefined reference to `GOMP_loop_nonmonotonic_dynamic_next'"
  496. (setenv "CC" "clang") (setenv "CXX" "clang++")
  497. ;; Darktable looks for opencl-c.h in the LLVM dir. Guix installs
  498. ;; it to the Clang dir. We fix this by patching CMakeLists.txt.
  499. (substitute* "CMakeLists.txt"
  500. (("\\$\\{LLVM_INSTALL_PREFIX\\}")
  501. (assoc-ref %build-inputs "clang")))
  502. #t))
  503. (add-before 'configure 'set-LDFLAGS-and-CPATH
  504. (lambda* (#:key inputs outputs #:allow-other-keys)
  505. (setenv "LDFLAGS"
  506. (string-append
  507. "-Wl,-rpath="
  508. (assoc-ref outputs "out") "/lib/darktable"))
  509. ;; Ensure the OpenEXR headers are found.
  510. (setenv "CPATH"
  511. (string-append
  512. (search-input-directory inputs "include/OpenEXR")
  513. ":" (or (getenv "CPATH") "")))))
  514. (add-after 'install 'wrap-program
  515. (lambda* (#:key inputs outputs #:allow-other-keys)
  516. (wrap-program (string-append (assoc-ref outputs "out")
  517. "/bin/darktable")
  518. ;; For GtkFileChooserDialog.
  519. `("GSETTINGS_SCHEMA_DIR" =
  520. (,(string-append (assoc-ref inputs "gtk+")
  521. "/share/glib-2.0/schemas"))))
  522. #t)))))
  523. (native-inputs
  524. `(("clang" ,clang-11)
  525. ("cmocka" ,cmocka)
  526. ("desktop-file-utils" ,desktop-file-utils)
  527. ("glib:bin" ,glib "bin")
  528. ("gobject-introspection" ,gobject-introspection)
  529. ("intltool" ,intltool)
  530. ("llvm" ,llvm-11) ;should match the Clang version
  531. ("opencl-headers" ,opencl-headers)
  532. ("perl" ,perl)
  533. ("pkg-config" ,pkg-config)
  534. ("po4a" ,po4a)
  535. ("python" ,python-wrapper)
  536. ("ruby" ,ruby)))
  537. (inputs
  538. `(("cairo" ,cairo)
  539. ("colord-gtk" ,colord-gtk) ;optional, for color profile support
  540. ("cups" ,cups) ;optional, for printing support
  541. ("curl" ,curl)
  542. ("dbus-glib" ,dbus-glib)
  543. ("exiv2" ,exiv2)
  544. ("freeimage" ,freeimage)
  545. ("gmic" ,gmic) ;optional, for HaldcLUT support
  546. ("graphicsmagick" ,graphicsmagick)
  547. ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
  548. ("gtk+" ,gtk+)
  549. ("ilmbase" ,ilmbase)
  550. ("iso-codes" ,iso-codes) ;optional, for language names in the preferences
  551. ("json-glib" ,json-glib)
  552. ("lcms" ,lcms)
  553. ("lensfun" ,lensfun) ;optional, for the lens distortion plugin
  554. ("libgphoto2" ,libgphoto2) ;optional, for camera tethering
  555. ("libavif" ,libavif) ;optional, for AVIF support
  556. ("libjpeg" ,libjpeg-turbo)
  557. ("libomp" ,libomp)
  558. ("libpng" ,libpng)
  559. ("librsvg" ,librsvg)
  560. ("libsecret" ,libsecret) ;optional, for storing passwords
  561. ("libsoup" ,libsoup)
  562. ("libtiff" ,libtiff)
  563. ("libwebp" ,libwebp) ;optional, for WebP support
  564. ("libxml2" ,libxml2)
  565. ("libxslt" ,libxslt)
  566. ("lua" ,lua) ;optional, for plugins
  567. ("opencl-icd-loader" ,opencl-icd-loader) ;optional, for OpenCL support
  568. ("openexr" ,openexr) ;optional, for EXR import/export
  569. ("openjpeg" ,openjpeg) ;optional, for JPEG2000 export
  570. ("osm-gps-map" ,osm-gps-map) ;optional, for geotagging view
  571. ("pugixml" ,pugixml)
  572. ("python-jsonschema" ,python-jsonschema)
  573. ("sqlite" ,sqlite)))
  574. (home-page "https://www.darktable.org")
  575. (synopsis "Virtual lighttable and darkroom for photographers")
  576. (description "Darktable is a photography workflow application and RAW
  577. developer. It manages your digital negatives in a database, lets you view
  578. them through a zoomable lighttable and enables you to develop raw images
  579. and enhance them.")
  580. ;; See src/is_supported_platform.h for supported platforms.
  581. (supported-systems '("x86_64-linux" "aarch64-linux"))
  582. (license (list license:gpl3+ ;; Darktable itself.
  583. license:lgpl2.1+)))) ;; Rawspeed library.
  584. (define-public photoflare
  585. (package
  586. (name "photoflare")
  587. (version "1.6.9")
  588. (source
  589. (origin
  590. (method git-fetch)
  591. (uri (git-reference
  592. (url "https://github.com/photoflare/photoflare")
  593. (commit (string-append "v" version))))
  594. (file-name (git-file-name name version))
  595. (sha256
  596. (base32 "121fhbggsh6jhrr7m41f27fd34ql7libdr2v0ig5bj6nc2ddwd40"))))
  597. (build-system gnu-build-system)
  598. (arguments
  599. '(#:tests? #f ;no tests
  600. #:phases
  601. (modify-phases %standard-phases
  602. (replace 'configure
  603. (lambda* (#:key inputs outputs #:allow-other-keys)
  604. (let ((magickpp (assoc-ref inputs "graphicsmagick"))
  605. (out (assoc-ref outputs "out")))
  606. (invoke "qmake"
  607. (string-append "INCLUDEPATH += " magickpp
  608. "/include/GraphicsMagick")
  609. (string-append "PREFIX=" out)
  610. "Photoflare.pro")))))))
  611. (native-inputs
  612. `(("pkg-config" ,pkg-config)
  613. ("qttools" ,qttools)))
  614. (inputs
  615. `(("graphicsmagick" ,graphicsmagick)
  616. ("libomp" ,libomp)
  617. ("qtbase" ,qtbase-5)))
  618. (home-page "https://photoflare.io")
  619. (synopsis "Quick, simple but powerful image editor")
  620. (description "Photoflare is a cross-platform image editor with an aim
  621. to balance between powerful features and a very friendly graphical user
  622. interface. It suits a wide variety of different tasks and users who value a
  623. more nimble workflow. Features include basic image editing capabilities,
  624. paint brushes, image filters, colour adjustments and more advanced features
  625. such as Batch image processing.")
  626. (license license:gpl3+)))
  627. (define-public entangle
  628. (package
  629. (name "entangle")
  630. (version "3.0")
  631. (source
  632. (origin
  633. (method git-fetch)
  634. (uri (git-reference
  635. (url "https://gitlab.com/entangle/entangle")
  636. (commit (string-append "v" version))))
  637. (file-name (git-file-name name version))
  638. (sha256
  639. (base32 "1pdmgxjdb3xlcqsaz7l8qzj5f7g7nwzhsrgid8929bm36d49cgc7"))))
  640. (build-system meson-build-system)
  641. (arguments
  642. `(#:glib-or-gtk? #t
  643. #:phases
  644. (modify-phases %standard-phases
  645. (add-after 'unpack 'skip-gtk-update-icon-cache
  646. ;; Don't create 'icon-theme.cache'.
  647. (lambda _
  648. (substitute* "meson_post_install.py"
  649. (("gtk-update-icon-cache") "true"))
  650. #t))
  651. (add-after 'install 'wrap-gi-python
  652. ;; Make GTK find files needed by plugins.
  653. (lambda* (#:key inputs outputs #:allow-other-keys)
  654. (let ((out (assoc-ref outputs "out"))
  655. (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
  656. (python-path (getenv "GUIX_PYTHONPATH")))
  657. (wrap-program (string-append out "/bin/entangle")
  658. `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
  659. `("GUIX_PYTHONPATH" ":" prefix (,python-path))))
  660. #t)))))
  661. (native-inputs
  662. `(("cmake" ,cmake)
  663. ("gettext" ,gettext-minimal)
  664. ("glib:bin" ,glib "bin")
  665. ("gobject-introspection" ,gobject-introspection)
  666. ("gtk-doc" ,gtk-doc)
  667. ("perl" ,perl)
  668. ("pkg-config" ,pkg-config)
  669. ("xmllint" ,libxml2)))
  670. (inputs
  671. `(("gdk-pixbuf" ,gdk-pixbuf)
  672. ("gexiv2" ,gexiv2)
  673. ("gst-plugins-base" ,gst-plugins-base)
  674. ("gstreamer" ,gstreamer)
  675. ("gtk+" ,gtk+)
  676. ("lcms" ,lcms)
  677. ("libgphoto2" ,libgphoto2)
  678. ("libgudev" ,libgudev)
  679. ("libpeas" ,libpeas)
  680. ("libraw" ,libraw)
  681. ("python" ,python)
  682. ("python-pygobject" ,python-pygobject)))
  683. (home-page "https://entangle-photo.org/")
  684. (synopsis "Camera control and capture")
  685. (description
  686. "Entangle is an application which uses GTK and libgphoto2 to provide a
  687. graphical interface for tethered photography with digital cameras. It
  688. includes control over camera shooting and configuration settings and 'hands
  689. off' shooting directly from the controlling computer.")
  690. (license license:gpl3+)))
  691. (define-public hugin
  692. (package
  693. (name "hugin")
  694. (version "2020.0.0")
  695. (source (origin
  696. (method url-fetch)
  697. (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
  698. (version-major+minor version)
  699. "/hugin-" version ".tar.bz2"))
  700. (sha256
  701. (base32
  702. "1jyazc0mbr9g7vrichpqqnfl72lj21244csk0z5i8ycs4l0pcgi8"))))
  703. (build-system cmake-build-system)
  704. (native-inputs
  705. `(("gettext" ,gettext-minimal)
  706. ("pkg-config" ,pkg-config)))
  707. (inputs
  708. `(("boost" ,boost)
  709. ("enblend-enfuse" ,enblend-enfuse)
  710. ("exiv2" ,exiv2)
  711. ("fftw" ,fftw)
  712. ("flann" ,flann)
  713. ("freeglut" ,freeglut)
  714. ("glew" ,glew)
  715. ("lcms" ,lcms)
  716. ("libjpeg" ,libjpeg-turbo)
  717. ("libpano13" ,libpano13)
  718. ("libpng" ,libpng)
  719. ("libtiff" ,libtiff)
  720. ("libxi" ,libxi)
  721. ("libxmu" ,libxmu)
  722. ("mesa" ,mesa)
  723. ("openexr" ,openexr)
  724. ("sqlite" ,sqlite)
  725. ("vigra" ,vigra)
  726. ("wxwidgets" ,wxwidgets)
  727. ("zlib" ,zlib)))
  728. (arguments
  729. `(#:tests? #f ; no check target
  730. #:configure-flags
  731. (list
  732. ;; The header files of ilmbase (propagated by openexr) are not found
  733. ;; when included by the header files of openexr, and an explicit
  734. ;; flag needs to be set.
  735. (string-append "-DCMAKE_CXX_FLAGS=-I"
  736. (assoc-ref %build-inputs "ilmbase")
  737. "/include/OpenEXR")
  738. ;; Disable installation of the Python scripting interface.
  739. ;; It would require the additional inputs python and swig.
  740. ;; Installation would need to be tweaked, as it tries to install
  741. ;; into the python directory.
  742. "-DBUILD_HSI=OFF")
  743. #:phases
  744. (modify-phases %standard-phases
  745. (add-before 'configure 'substitute
  746. (lambda _
  747. (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
  748. (("wxT\\(\"enblend\"\\)")
  749. (string-append "wxT(\"" (which "enblend") "\")"))
  750. (("wxT\\(\"enfuse\"\\)")
  751. (string-append "wxT(\"" (which "enfuse") "\")")))
  752. #t)))))
  753. (home-page "http://hugin.sourceforge.net/")
  754. (synopsis "Panorama photo stitcher")
  755. (description
  756. "Hugin is an easy to use panoramic imaging toolchain with a graphical
  757. user interface. It can be used to assemble a mosaic of photographs into
  758. a complete panorama and stitch any series of overlapping pictures.")
  759. (license license:gpl2+)))
  760. (define-public rawtherapee
  761. (package
  762. (name "rawtherapee")
  763. (version "5.8")
  764. (source (origin
  765. (method url-fetch)
  766. (uri (string-append "https://rawtherapee.com/shared/source/"
  767. "rawtherapee-" version ".tar.xz"))
  768. (sha256
  769. (base32
  770. "0lq8qi7g0a28h3rab7bk5bbbd4gvfma42bvlz1dfn8p9mah2h19n"))))
  771. (build-system cmake-build-system)
  772. (arguments
  773. '(#:tests? #f ; no test suite
  774. #:build-type "release"
  775. #:configure-flags
  776. (list (string-append "-DLENSFUNDBDIR="
  777. (assoc-ref %build-inputs "lensfun")
  778. "/share/lensfun")
  779. ;; Don't optimize the build for the host machine. See the file
  780. ;; 'ProcessorTargets.cmake' in the source distribution for more
  781. ;; information.
  782. "-DPROC_TARGET_NUMBER=1"
  783. ;; These flags are recommended by upstream for distributed packages.
  784. ;; See the file 'RELEASE_NOTES.txt' in the source distribution.
  785. "-O3"
  786. "-DCACHE_NAME_SUFFIX=\"\"")))
  787. (native-inputs
  788. `(("pkg-config" ,pkg-config)))
  789. (inputs
  790. `(("expat" ,expat)
  791. ("fftw" ,fftwf)
  792. ("glib" ,glib)
  793. ("glibmm" ,glibmm)
  794. ("gtk+" ,gtk+)
  795. ("gtkmm" ,gtkmm)
  796. ("lcms" ,lcms)
  797. ("lensfun" ,lensfun)
  798. ("libcanberra" ,libcanberra)
  799. ("libiptcdata" ,libiptcdata)
  800. ("libjpeg" ,libjpeg-turbo)
  801. ("libpng" ,libpng)
  802. ("librsvg" ,librsvg)
  803. ("libsigc++" ,libsigc++)
  804. ("libtiff" ,libtiff)
  805. ("zlib" ,zlib)))
  806. (home-page "https://rawtherapee.com")
  807. (synopsis "Raw image developing and processing")
  808. (description "RawTherapee is a raw image processing suite. It comprises a
  809. subset of image editing operations specifically aimed at non-destructive raw
  810. photo post-production and is primarily focused on improving a photographer's
  811. workflow by facilitating the handling of large numbers of images. Most raw
  812. formats are supported, including Pentax Pixel Shift, Canon Dual-Pixel, and those
  813. from Foveon and X-Trans sensors.")
  814. (license license:gpl3+)))