image.scm 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
  4. ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
  6. ;;; Copyright © 2014, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
  7. ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
  8. ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
  9. ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
  10. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  11. ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
  12. ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
  13. ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
  14. ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
  15. ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
  16. ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
  17. ;;; Copyright © 2017 ng0 <ng0@infotropique.org>
  18. ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
  19. ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
  20. ;;;
  21. ;;; This file is part of GNU Guix.
  22. ;;;
  23. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  24. ;;; under the terms of the GNU General Public License as published by
  25. ;;; the Free Software Foundation; either version 3 of the License, or (at
  26. ;;; your option) any later version.
  27. ;;;
  28. ;;; GNU Guix is distributed in the hope that it will be useful, but
  29. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  30. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  31. ;;; GNU General Public License for more details.
  32. ;;;
  33. ;;; You should have received a copy of the GNU General Public License
  34. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  35. (define-module (gnu packages image)
  36. #:use-module (gnu packages)
  37. #:use-module (gnu packages algebra)
  38. #:use-module (gnu packages assembly)
  39. #:use-module (gnu packages autotools)
  40. #:use-module (gnu packages boost)
  41. #:use-module (gnu packages compression)
  42. #:use-module (gnu packages documentation)
  43. #:use-module (gnu packages fontutils)
  44. ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
  45. #:use-module (gnu packages gcc)
  46. #:use-module (gnu packages gettext)
  47. #:use-module (gnu packages ghostscript)
  48. #:use-module (gnu packages gl)
  49. #:use-module (gnu packages glib)
  50. #:use-module (gnu packages graphics)
  51. #:use-module (gnu packages gtk)
  52. #:use-module (gnu packages lua)
  53. #:use-module (gnu packages maths)
  54. #:use-module (gnu packages mcrypt)
  55. #:use-module (gnu packages perl)
  56. #:use-module (gnu packages pkg-config)
  57. #:use-module (gnu packages python)
  58. #:use-module (gnu packages xml)
  59. #:use-module (gnu packages xorg)
  60. #:use-module ((guix licenses) #:prefix license:)
  61. #:use-module (guix packages)
  62. #:use-module (guix download)
  63. #:use-module (guix git-download)
  64. #:use-module (guix build-system gnu)
  65. #:use-module (guix build-system cmake)
  66. #:use-module (guix build-system python)
  67. #:use-module (guix build-system r)
  68. #:use-module (srfi srfi-1))
  69. (define-public libpng
  70. (package
  71. (name "libpng")
  72. (version "1.6.29")
  73. (source (origin
  74. (method url-fetch)
  75. (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
  76. version "/libpng-" version ".tar.xz")
  77. (string-append
  78. "ftp://ftp.simplesystems.org/pub/libpng/png/src"
  79. "/libpng16/libpng-" version ".tar.xz")
  80. (string-append
  81. "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
  82. "/libpng16/libpng-" version ".tar.xz")))
  83. (sha256
  84. (base32
  85. "0fgjqp7x6jynacmqh6dj72cn6nnf6yxjfqqqfsxrx0pyx22bcia2"))))
  86. (build-system gnu-build-system)
  87. ;; libpng.la says "-lz", so propagate it.
  88. (propagated-inputs `(("zlib" ,zlib)))
  89. (synopsis "Library for handling PNG files")
  90. (description
  91. "Libpng is the official PNG (Portable Network Graphics) reference
  92. library. It supports almost all PNG features and is extensible.")
  93. (license license:zlib)
  94. (home-page "http://www.libpng.org/pub/png/libpng.html")))
  95. ;; libpng-apng should be updated when the APNG patch is released:
  96. ;; <https://bugs.gnu.org/27556>
  97. (define-public libpng-apng
  98. (package
  99. (name "libpng-apng")
  100. (version "1.6.28")
  101. (source
  102. (origin
  103. (method url-fetch)
  104. (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
  105. version "/libpng-" version ".tar.xz")
  106. (string-append
  107. "ftp://ftp.simplesystems.org/pub/libpng/png/src"
  108. "/libpng16/libpng-" version ".tar.xz")
  109. (string-append
  110. "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
  111. "/libpng16/libpng-" version ".tar.xz")))
  112. (sha256
  113. (base32
  114. "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
  115. (build-system gnu-build-system)
  116. (arguments
  117. `(#:modules ((guix build gnu-build-system)
  118. (guix build utils)
  119. (srfi srfi-1))
  120. #:phases
  121. (modify-phases %standard-phases
  122. (add-after 'unpack 'patch-apng
  123. (lambda* (#:key inputs #:allow-other-keys)
  124. (define (apply-patch file)
  125. (zero? (system* "patch" "-p1" "--force"
  126. "--input" file)))
  127. (let ((apng.gz (assoc-ref inputs "apng")))
  128. (format #t "Applying APNG patch '~a'...~%"
  129. apng.gz)
  130. (and
  131. (zero?
  132. (system (string-append "gunzip < " apng.gz " > the-patch")))
  133. (apply-patch "the-patch")))))
  134. (add-before 'configure 'no-checks
  135. (lambda _
  136. (substitute* "Makefile.in"
  137. (("^scripts/symbols.chk") "")
  138. (("check: scripts/symbols.chk") ""))
  139. #t)))))
  140. (inputs
  141. `(("apng" ,(origin
  142. (method url-fetch)
  143. (uri
  144. (string-append "mirror://sourceforge/libpng-apng/libpng16/"
  145. version "/libpng-" version "-apng.patch.gz"))
  146. (sha256
  147. (base32
  148. "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
  149. (native-inputs
  150. `(("libtool" ,libtool)))
  151. ;; libpng.la says "-lz", so propagate it.
  152. (propagated-inputs
  153. `(("zlib" ,zlib)))
  154. (synopsis "APNG patch for libpng")
  155. (description
  156. "APNG (Animated Portable Network Graphics) is an unofficial
  157. extension of the APNG (Portable Network Graphics) format.
  158. APNG patch provides APNG support to libpng.")
  159. (home-page "https://sourceforge.net/projects/libpng-apng/")
  160. (license license:zlib)))
  161. (define-public libpng-1.2
  162. (package
  163. (inherit libpng)
  164. (version "1.2.59")
  165. (source
  166. (origin
  167. (method url-fetch)
  168. (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
  169. version "/libpng-" version ".tar.xz")
  170. (string-append
  171. "ftp://ftp.simplesystems.org/pub/libpng/png/src"
  172. "/libpng12/libpng-" version ".tar.xz")
  173. (string-append
  174. "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
  175. "/libpng12/libpng-" version ".tar.xz")))
  176. (sha256
  177. (base32
  178. "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
  179. (define-public r-png
  180. (package
  181. (name "r-png")
  182. (version "0.1-7")
  183. (source (origin
  184. (method url-fetch)
  185. (uri (cran-uri "png" version))
  186. (sha256
  187. (base32
  188. "0g2mcp55lvvpx4kd3mn225mpbxqcq73wy5qx8b4lyf04iybgysg2"))))
  189. (build-system r-build-system)
  190. (inputs
  191. `(("libpng" ,libpng)
  192. ("zlib" ,zlib)))
  193. (home-page "http://www.rforge.net/png/")
  194. (synopsis "Read and write PNG images")
  195. (description
  196. "This package provides an easy and simple way to read, write and display
  197. bitmap images stored in the PNG format. It can read and write both files and
  198. in-memory raw vectors.")
  199. ;; Any of these GPL versions.
  200. (license (list license:gpl2 license:gpl3))))
  201. (define-public pngcrunch
  202. (package
  203. (name "pngcrunch")
  204. (version "1.8.11")
  205. (source (origin
  206. (method url-fetch)
  207. (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
  208. version "/pngcrush-" version ".tar.xz"))
  209. (sha256 (base32
  210. "1c7m316i91jp3h1dj1ppppdv6zilm2njk1wrpqy2zj0fcll06lwd"))))
  211. (build-system gnu-build-system)
  212. (arguments
  213. '(#:make-flags '("-f" "Makefile-nolib")
  214. #:tests? #f ; no check target
  215. #:phases
  216. (modify-phases %standard-phases
  217. (replace 'configure
  218. (lambda* (#:key inputs outputs #:allow-other-keys)
  219. (substitute* "Makefile-nolib"
  220. (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
  221. (string-append vardef (assoc-ref inputs "libpng") "/"))
  222. (("^(Z(INC|LIB) = )/usr/local/" line vardef)
  223. (string-append vardef (assoc-ref inputs "zlib") "/"))
  224. ;; The Makefile is written by hand and not using $PREFIX
  225. (("\\$\\(DESTDIR\\)/usr/")
  226. (string-append (assoc-ref outputs "out") "/"))))))))
  227. (inputs
  228. `(("libpng" ,libpng)
  229. ("zlib" , zlib)))
  230. (home-page "https://pmt.sourceforge.net/pngcrush")
  231. (synopsis "Utility to compress PNG files")
  232. (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
  233. files. It can compress them as much as 40% losslessly.")
  234. (license license:zlib)))
  235. (define-public libjpeg
  236. (package
  237. (name "libjpeg")
  238. (version "9b")
  239. (source (origin
  240. (method url-fetch)
  241. (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
  242. version ".tar.gz"))
  243. (sha256 (base32
  244. "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
  245. (build-system gnu-build-system)
  246. (synopsis "Library for handling JPEG files")
  247. (description
  248. "Libjpeg implements JPEG image encoding, decoding, and transcoding.
  249. JPEG is a standardized compression method for full-color and gray-scale
  250. images.
  251. The included programs provide conversion between the JPEG format and
  252. image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
  253. (license license:ijg)
  254. (home-page "http://www.ijg.org/")))
  255. (define-public libjpeg-8
  256. (package (inherit libjpeg)
  257. (version "8d")
  258. (source (origin
  259. (method url-fetch)
  260. (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
  261. version ".tar.gz"))
  262. (sha256 (base32
  263. "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
  264. (define-public libjxr
  265. (package
  266. (name "libjxr")
  267. (version "1.1")
  268. (source (origin
  269. ;; We are using the Debian source because CodePlex does not
  270. ;; deliver an easily downloadable tarball.
  271. (method url-fetch)
  272. (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
  273. version ".orig.tar.gz"))
  274. (sha256
  275. (base32
  276. "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
  277. (patch-flags '("-p1" "--binary"))
  278. (patches (search-patches "libjxr-fix-function-signature.patch"
  279. "libjxr-fix-typos.patch"))))
  280. (build-system gnu-build-system)
  281. (arguments '(#:make-flags '("CC=gcc")
  282. #:tests? #f ; no check target
  283. #:phases
  284. (modify-phases %standard-phases
  285. (delete 'configure) ; no configure script
  286. ;; The upstream makefile does not include an install phase.
  287. (replace 'install
  288. (lambda* (#:key outputs #:allow-other-keys)
  289. (let* ((out (assoc-ref outputs "out"))
  290. (bin (string-append out "/bin"))
  291. (lib (string-append out "/lib"))
  292. (include (string-append out "/include/jxrlib")))
  293. (for-each (lambda (file)
  294. (install-file file include)
  295. (delete-file file))
  296. (append
  297. '("jxrgluelib/JXRGlue.h"
  298. "jxrgluelib/JXRMeta.h"
  299. "jxrtestlib/JXRTest.h"
  300. "image/sys/windowsmediaphoto.h")
  301. (find-files "common/include" "\\.h$")))
  302. (for-each (lambda (file)
  303. (install-file file lib)
  304. (delete-file file))
  305. (find-files "." "\\.a$"))
  306. (for-each (lambda (file)
  307. (install-file file bin)
  308. (delete-file file))
  309. '("JxrDecApp" "JxrEncApp")))
  310. #t)))))
  311. (synopsis "Implementation of the JPEG XR standard")
  312. (description "JPEG XR is an approved ISO/IEC International standard (its
  313. official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
  314. (license
  315. (license:non-copyleft
  316. "file://Makefile"
  317. "See the header of the Makefile in the distribution."))
  318. (home-page "https://jxrlib.codeplex.com/")))
  319. (define-public jpegoptim
  320. (package
  321. (name "jpegoptim")
  322. (version "1.4.4")
  323. (source (origin
  324. (method url-fetch)
  325. (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
  326. version ".tar.gz"))
  327. (sha256 (base32
  328. "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
  329. (build-system gnu-build-system)
  330. (inputs `(("libjpeg" ,libjpeg)))
  331. (arguments
  332. ;; no tests
  333. '(#:tests? #f))
  334. (synopsis "Optimize JPEG images")
  335. (description
  336. "jpegoptim provides lossless optimization (based on optimizing
  337. the Huffman tables) and \"lossy\" optimization based on setting
  338. maximum quality factor.")
  339. (license license:gpl2+)
  340. (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
  341. (define-public libicns
  342. (package
  343. (name "libicns")
  344. (version "0.8.1")
  345. (source (origin
  346. (method url-fetch)
  347. (uri (string-append
  348. "mirror://sourceforge/icns/"
  349. "libicns-" version ".tar.gz"))
  350. (sha256
  351. (base32
  352. "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
  353. (build-system gnu-build-system)
  354. (inputs
  355. `(("libpng" ,libpng)
  356. ("jasper" ,jasper)))
  357. (arguments
  358. `(#:tests? #t)) ; No tests.
  359. (home-page "http://icns.sourceforge.net/")
  360. (synopsis "Library for handling Mac OS icns resource files")
  361. (description
  362. "Libicns is a library for the manipulation of Mac OS IconFamily resource
  363. type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
  364. convert between PNG and ICNS. @command{icns2png} will extract image files from
  365. ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
  366. with .desktop files. Additionally, @command{icontainer2png} is provided for
  367. extracting icontainer icon files.")
  368. (license (list license:lgpl2.1+ ; libicns
  369. license:lgpl2.0+ ; src/apidocs.*
  370. license:gpl2+)))) ; icns2png, png2icns, icontainer2png
  371. (define-public libtiff
  372. (package
  373. (name "libtiff")
  374. (version "4.0.8")
  375. (source
  376. (origin
  377. (method url-fetch)
  378. (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
  379. version ".tar.gz"))
  380. (patches
  381. (search-patches "libtiff-tiffgetfield-bugs.patch"
  382. "libtiff-CVE-2016-10688.patch"
  383. "libtiff-CVE-2017-9936.patch"
  384. "libtiff-tiffycbcrtorgb-integer-overflow.patch"
  385. "libtiff-tiffycbcrtorgbinit-integer-overflow.patch"))
  386. (sha256
  387. (base32
  388. "0419mh6kkhz5fkyl77gv0in8x4d2jpdpfs147y8mj86rrjlabmsr"))))
  389. (build-system gnu-build-system)
  390. (outputs '("out"
  391. "doc")) ;1.3 MiB of HTML documentation
  392. (arguments
  393. ;; Instead of using --docdir, this package has its own --with-docdir.
  394. `(#:configure-flags (list (string-append "--with-docdir="
  395. (assoc-ref %outputs "doc")
  396. "/share/doc/"
  397. ,name "-" ,version))))
  398. (inputs `(("zlib" ,zlib)
  399. ("libjpeg" ,libjpeg)))
  400. (synopsis "Library for handling TIFF files")
  401. (description
  402. "Libtiff provides support for the Tag Image File Format (TIFF), a format
  403. used for storing image data.
  404. Included are a library, libtiff, for reading and writing TIFF and a small
  405. collection of tools for doing simple manipulations of TIFF images.")
  406. (license (license:non-copyleft "file://COPYRIGHT"
  407. "See COPYRIGHT in the distribution."))
  408. (home-page "http://www.simplesystems.org/libtiff/")))
  409. (define-public leptonica
  410. (package
  411. (name "leptonica")
  412. (version "1.74.4")
  413. (source
  414. (origin
  415. (method url-fetch)
  416. (uri (string-append
  417. "https://github.com/DanBloomberg/leptonica/archive/" version
  418. ".tar.gz"))
  419. (file-name (string-append "leptonica-" version ".tar.gz"))
  420. (sha256
  421. (base32 "10pw7pwccd0m0fc9rlrr2m41s7j1qvba2wcrav17pw1gclkf34i0"))))
  422. (build-system gnu-build-system)
  423. (native-inputs
  424. `(("gnuplot" ,gnuplot) ;needed for test suite
  425. ("autoconf" ,autoconf)
  426. ("automake" ,automake)
  427. ("libtool" ,libtool)
  428. ("pkg-config" ,pkg-config)))
  429. (inputs
  430. `(("giflib" ,giflib)
  431. ("libjpeg" ,libjpeg)
  432. ("libpng" ,libpng)
  433. ("libtiff" ,libtiff)
  434. ("libwebp" ,libwebp)))
  435. (propagated-inputs
  436. ;; Linking a program with leptonica also requires these.
  437. `(("openjpeg" ,openjpeg)
  438. ("zlib" ,zlib)))
  439. (arguments
  440. '(#:phases
  441. (modify-phases %standard-phases
  442. (add-after 'unpack 'autogen
  443. (lambda _
  444. (zero? (system* "sh" "autobuild"))))
  445. (add-after 'unpack 'patch-reg-wrapper
  446. (lambda _
  447. (substitute* "prog/reg_wrapper.sh"
  448. ((" /bin/sh ")
  449. (string-append " " (which "sh") " "))
  450. (("which gnuplot")
  451. "true")))))))
  452. (home-page "http://www.leptonica.com/")
  453. (synopsis "Library and tools for image processing and analysis")
  454. (description
  455. "Leptonica is a C library and set of command-line tools for efficient
  456. image processing and image analysis operations. It supports rasterop, affine
  457. transformations, binary and grayscale morphology, rank order, and convolution,
  458. seedfill and connected components, image transformations combining changes in
  459. scale and pixel depth, and pixelwise masking, blending, enhancement, and
  460. arithmetic ops.")
  461. (license license:bsd-2)))
  462. (define-public jbig2dec
  463. (package
  464. (name "jbig2dec")
  465. (version "0.13")
  466. (source
  467. (origin
  468. (method url-fetch)
  469. (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
  470. name "-" version ".tar.gz"))
  471. (sha256
  472. (base32 "04akiwab8iy5iy34razcvh9mcja9wy737civ3sbjxk4j143s1b2s"))
  473. (patches (search-patches "jbig2dec-ignore-testtest.patch"
  474. "jbig2dec-CVE-2016-9601.patch"
  475. "jbig2dec-CVE-2017-7885.patch"
  476. "jbig2dec-CVE-2017-7975.patch"
  477. "jbig2dec-CVE-2017-7976.patch"))))
  478. (build-system gnu-build-system)
  479. (synopsis "Decoder of the JBIG2 image compression format")
  480. (description
  481. "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
  482. monochrome) images at moderately high resolution, and in particular scanned
  483. paper documents. In this domain it is very efficient, offering compression
  484. ratios on the order of 100:1.
  485. This is a decoder only implementation, and currently is in the alpha
  486. stage, meaning it doesn't completely work yet. However, it is
  487. maintaining parity with available encoders, so it is useful for real
  488. work.")
  489. (home-page "http://www.ghostscript.com/jbig2dec.html")
  490. (license license:gpl2+)))
  491. (define-public openjpeg
  492. (package
  493. (name "openjpeg")
  494. (version "2.3.0")
  495. (source
  496. (origin
  497. (method url-fetch)
  498. (uri
  499. (string-append "https://github.com/uclouvain/openjpeg/archive/v"
  500. version ".tar.gz"))
  501. (file-name (string-append name "-" version ".tar.gz"))
  502. (sha256
  503. (base32
  504. "06npqzkg20avnygdwaqpap91r7qpdqgrn39adj2bl8v0pg0qgirx"))))
  505. (build-system cmake-build-system)
  506. (arguments
  507. ;; Trying to run `$ make check' results in a no rule fault.
  508. '(#:tests? #f))
  509. (inputs
  510. `(("lcms" ,lcms)
  511. ("libpng" ,libpng)
  512. ("libtiff" ,libtiff)
  513. ("zlib" ,zlib)))
  514. (synopsis "JPEG 2000 codec")
  515. (description
  516. "The OpenJPEG library is a JPEG 2000 codec written in C. It has
  517. been developed in order to promote the use of JPEG 2000, the new
  518. still-image compression standard from the Joint Photographic Experts
  519. Group (JPEG).
  520. In addition to the basic codec, various other features are under
  521. development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
  522. an indexing tool useful for the JPIP protocol, JPWL-tools for
  523. error-resilience, a Java-viewer for j2k-images, ...")
  524. (home-page "https://github.com/uclouvain/openjpeg")
  525. (license license:bsd-2)))
  526. (define-public openjpeg-1
  527. (package (inherit openjpeg)
  528. (name "openjpeg")
  529. (version "1.5.2")
  530. (source
  531. (origin
  532. (method url-fetch)
  533. (uri
  534. (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
  535. name "-" version ".tar.gz"))
  536. (sha256
  537. (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
  538. (define-public giflib
  539. (package
  540. (name "giflib")
  541. (version "5.1.4")
  542. (source (origin
  543. (method url-fetch)
  544. (uri (string-append "mirror://sourceforge/giflib/giflib-"
  545. version ".tar.bz2"))
  546. (sha256
  547. (base32
  548. "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
  549. (build-system gnu-build-system)
  550. (outputs '("bin" ; utility programs
  551. "out")) ; library
  552. (inputs `(("libx11" ,libx11)
  553. ("libice" ,libice)
  554. ("libsm" ,libsm)
  555. ("perl" ,perl)))
  556. (arguments
  557. `(#:phases
  558. (modify-phases %standard-phases
  559. (add-after 'unpack 'disable-html-doc-gen
  560. (lambda _
  561. (substitute* "doc/Makefile.in"
  562. (("^all: allhtml manpages") ""))))
  563. (add-after 'install 'install-manpages
  564. (lambda* (#:key outputs #:allow-other-keys)
  565. (let* ((bin (assoc-ref outputs "bin"))
  566. (man1dir (string-append bin "/share/man/man1")))
  567. (mkdir-p man1dir)
  568. (for-each (lambda (file)
  569. (let ((base (basename file)))
  570. (format #t "installing `~a' to `~a'~%"
  571. base man1dir)
  572. (copy-file file
  573. (string-append
  574. man1dir "/" base))))
  575. (find-files "doc" "\\.1"))))))))
  576. (synopsis "Tools and library for working with GIF images")
  577. (description
  578. "GIFLIB is a library for reading and writing GIF images. It is API and
  579. ABI compatible with libungif which was in wide use while the LZW compression
  580. algorithm was patented. Tools are also included to convert, manipulate,
  581. compose, and analyze GIF images.")
  582. (home-page "http://giflib.sourceforge.net/")
  583. (license license:x11)))
  584. (define-public libungif
  585. (package
  586. (name "libungif")
  587. (version "4.1.4")
  588. (source (origin
  589. (method url-fetch)
  590. (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
  591. "libungif-" version "/libungif-"
  592. version ".tar.bz2"))
  593. (sha256
  594. (base32
  595. "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
  596. (build-system gnu-build-system)
  597. (inputs `(("perl" ,perl))) ;package ships some perl tools
  598. (home-page "http://giflib.sourceforge.net/")
  599. (synopsis "GIF decompression library")
  600. (description
  601. "libungif is the old GIF decompression library by the GIFLIB project.")
  602. (license license:expat)))
  603. (define-public imlib2
  604. (package
  605. (name "imlib2")
  606. (version "1.4.10")
  607. (source (origin
  608. (method url-fetch)
  609. (uri (string-append
  610. "mirror://sourceforge/enlightenment/imlib2-src/" version
  611. "/imlib2-" version ".tar.bz2"))
  612. (sha256
  613. (base32
  614. "0wm2q2xlkbm71k7mw2jyzbxgzylrkcj5yh6nq58w5gybhp98qs9z"))))
  615. (build-system gnu-build-system)
  616. (native-inputs
  617. `(("pkgconfig" ,pkg-config)))
  618. (inputs
  619. `(("libx11" ,libx11)
  620. ("libxext" ,libxext)
  621. ("freetype" ,freetype)
  622. ("libjpeg" ,libjpeg)
  623. ("libpng" ,libpng)
  624. ("libtiff" ,libtiff)
  625. ("giflib" ,giflib)
  626. ("bzip2" ,bzip2)))
  627. (home-page "https://sourceforge.net/projects/enlightenment/")
  628. (synopsis
  629. "Loading, saving, rendering and manipulating image files")
  630. (description
  631. "Imlib2 is a library that does image file loading and saving as well as
  632. rendering, manipulation, arbitrary polygon support, etc.
  633. It does ALL of these operations FAST. Imlib2 also tries to be highly
  634. intelligent about doing them, so writing naive programs can be done easily,
  635. without sacrificing speed.
  636. This is a complete rewrite over the Imlib 1.x series. The architecture is
  637. more modular, simple, and flexible.")
  638. (license license:imlib2)))
  639. (define-public giblib
  640. (package
  641. (name "giblib")
  642. (version "1.2.4")
  643. (source (origin
  644. (method url-fetch)
  645. (uri (list
  646. (string-append
  647. "http://linuxbrit.co.uk/downloads/giblib-"
  648. version ".tar.gz")
  649. (string-append
  650. "https://sourceforge.net/projects/slackbuildsdirectlinks/"
  651. "files/giblib/giblib-" version ".tar.gz")))
  652. (sha256
  653. (base32
  654. "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
  655. (build-system gnu-build-system)
  656. (inputs
  657. `(("libx11" ,libx11)
  658. ("imlib2" ,imlib2)))
  659. (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
  660. (synopsis "Wrapper library for imlib2")
  661. (description
  662. "Giblib is a simple library which wraps imlib2's context API, avoiding
  663. all the context_get/set calls, adds fontstyles to the truetype renderer and
  664. supplies a generic doubly-linked list and some string functions.")
  665. ;; This license removes a clause about X Consortium from the original
  666. ;; X11 license.
  667. (license (license:x11-style "file://COPYING"
  668. "See 'COPYING' in the distribution."))))
  669. (define-public freeimage
  670. (package
  671. (name "freeimage")
  672. (version "3.17.0")
  673. (source (origin
  674. (method url-fetch)
  675. (uri (string-append
  676. "mirror://sourceforge/freeimage/Source%20Distribution/"
  677. version "/FreeImage"
  678. (string-concatenate (string-split version #\.))
  679. ".zip"))
  680. (sha256
  681. (base32
  682. "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
  683. (patches (search-patches "freeimage-CVE-2015-0852.patch"
  684. "freeimage-CVE-2016-5684.patch"
  685. "freeimage-fix-build-with-gcc-5.patch"))))
  686. (build-system gnu-build-system)
  687. (arguments
  688. '(#:phases
  689. (modify-phases %standard-phases
  690. (delete 'configure)
  691. (add-before 'build 'patch-makefile
  692. (lambda* (#:key outputs #:allow-other-keys)
  693. (substitute* "Makefile.gnu"
  694. (("/usr") (assoc-ref outputs "out"))
  695. (("-o root -g root") ""))
  696. #t)))
  697. #:make-flags '("CC=gcc")
  698. #:tests? #f)) ; no check target
  699. (native-inputs
  700. `(("unzip" ,unzip)))
  701. ;; Fails to build on MIPS due to assembly code in the source.
  702. (supported-systems (delete "mips64el-linux" %supported-systems))
  703. (synopsis "Library for handling popular graphics image formats")
  704. (description
  705. "FreeImage is a library for developers who would like to support popular
  706. graphics image formats like PNG, BMP, JPEG, TIFF and others.")
  707. (license license:gpl2+)
  708. (home-page "http://freeimage.sourceforge.net")))
  709. (define-public vigra
  710. (package
  711. (name "vigra")
  712. (version "1.11.0")
  713. (source
  714. (origin
  715. (method url-fetch)
  716. (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
  717. "Version-1-11-0/vigra-"
  718. version "-src.tar.gz"))
  719. (sha256 (base32
  720. "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
  721. (build-system cmake-build-system)
  722. (inputs
  723. `(("boost" ,boost)
  724. ("fftw" ,fftw)
  725. ("fftwf" ,fftwf)
  726. ("hdf5" ,hdf5)
  727. ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
  728. ; to create a configure-flag
  729. ("libjpeg" ,libjpeg)
  730. ("libpng" ,libpng)
  731. ("libtiff" ,libtiff)
  732. ("openexr" ,openexr)
  733. ("python" ,python-2) ; print syntax
  734. ("python2-numpy" ,python2-numpy)
  735. ("zlib" ,zlib)))
  736. (native-inputs
  737. `(("doxygen" ,doxygen)
  738. ("python2-nose" ,python2-nose)
  739. ("python2-sphinx" ,python2-sphinx)))
  740. (arguments
  741. `(#:test-target "check"
  742. #:parallel-build? #f ; parallel builds trigger an ICE
  743. #:configure-flags
  744. (list "-Wno-dev" ; suppress developer mode with lots of warnings
  745. (string-append "-DVIGRANUMPY_INSTALL_DIR="
  746. (assoc-ref %outputs "out")
  747. "/lib/python2.7/site-packages")
  748. ;; OpenEXR is not enabled by default.
  749. "-DWITH_OPENEXR=1"
  750. ;; Fix rounding error on 32-bit machines
  751. "-DCMAKE_C_FLAGS=-ffloat-store"
  752. ;; The header files of ilmbase are not found when included
  753. ;; by the header files of openexr, and an explicit flag
  754. ;; needs to be set.
  755. (string-append "-DCMAKE_CXX_FLAGS=-I"
  756. (assoc-ref %build-inputs "ilmbase")
  757. "/include/OpenEXR"
  758. " -ffloat-store"))))
  759. (synopsis "Computer vision library")
  760. (description
  761. "VIGRA stands for Vision with Generic Algorithms. It is an image
  762. processing and analysis library that puts its main emphasis on customizable
  763. algorithms and data structures. It is particularly strong for
  764. multi-dimensional image processing.")
  765. (license license:expat)
  766. (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
  767. (define-public libwebp
  768. (package
  769. (name "libwebp")
  770. (version "0.6.0")
  771. (source
  772. (origin
  773. (method url-fetch)
  774. (uri (string-append
  775. "http://downloads.webmproject.org/releases/webp/libwebp-" version
  776. ".tar.gz"))
  777. (sha256
  778. (base32
  779. "0h1brwkyxc7lb8lc53aacdks5vc1y9hzngqi41gg7y6l56912a69"))))
  780. (build-system gnu-build-system)
  781. (inputs
  782. `(("freeglut" ,freeglut)
  783. ("giflib" ,giflib)
  784. ("libjpeg" ,libjpeg)
  785. ("libpng" ,libpng)
  786. ("libtiff" ,libtiff)))
  787. (arguments
  788. '(#:configure-flags '("--enable-libwebpmux"
  789. "--enable-libwebpdemux"
  790. "--enable-libwebpdecoder")))
  791. (home-page "https://developers.google.com/speed/webp/")
  792. (synopsis "Lossless and lossy image compression")
  793. (description
  794. "WebP is a new image format that provides lossless and lossy compression
  795. for images. WebP lossless images are 26% smaller in size compared to
  796. PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
  797. equivalent SSIM index. WebP supports lossless transparency (also known as
  798. alpha channel) with just 22% additional bytes. Transparency is also supported
  799. with lossy compression and typically provides 3x smaller file sizes compared
  800. to PNG when lossy compression is acceptable for the red/green/blue color
  801. channels.")
  802. (license license:bsd-3)))
  803. (define-public libmng
  804. (package
  805. (name "libmng")
  806. (version "2.0.3")
  807. (source (origin
  808. (method url-fetch)
  809. (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
  810. version "/" name "-" version ".tar.xz"))
  811. (sha256
  812. (base32
  813. "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
  814. (build-system gnu-build-system)
  815. (propagated-inputs
  816. ;; These are all in the 'Libs.private' field of libmng.pc.
  817. `(("lcms" ,lcms)
  818. ("libjpeg" ,libjpeg)
  819. ("zlib" ,zlib)))
  820. (home-page "http://www.libmng.com/")
  821. (synopsis "Library for handling MNG files")
  822. (description
  823. "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
  824. (license license:bsd-3)))
  825. (define-public exiv2
  826. (package
  827. (name "exiv2")
  828. (version "0.26")
  829. (source (origin
  830. (method url-fetch)
  831. (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
  832. version "-trunk.tar.gz")
  833. (string-append "http://www.exiv2.org/exiv2-"
  834. version ".tar.gz")
  835. (string-append "https://fossies.org/linux/misc/exiv2-"
  836. version ".tar.gz")))
  837. (sha256
  838. (base32
  839. "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
  840. (build-system gnu-build-system)
  841. (arguments '(#:tests? #f)) ; no `check' target
  842. (propagated-inputs
  843. `(("expat" ,expat)
  844. ("zlib" ,zlib)))
  845. (native-inputs
  846. `(("intltool" ,intltool)))
  847. (home-page "http://www.exiv2.org/")
  848. (synopsis "Library and command-line utility to manage image metadata")
  849. (description
  850. "Exiv2 is a C++ library and a command line utility to manage image
  851. metadata. It provides fast and easy read and write access to the Exif, IPTC
  852. and XMP metadata of images in various formats.")
  853. ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
  854. ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
  855. ;; The core is GPLv2+:
  856. ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
  857. (license license:gpl2+)))
  858. (define-public devil
  859. (package
  860. (name "devil")
  861. (version "1.8.0")
  862. (source (origin
  863. (method url-fetch)
  864. (uri (string-append "http://downloads.sourceforge.net/openil/"
  865. "DevIL-" version ".tar.gz"))
  866. (sha256
  867. (base32
  868. "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
  869. (build-system cmake-build-system)
  870. (arguments
  871. '(;; XXX: Not supported in the released CMakeLists.txt.
  872. ;; Enable this for > 1.8.0.
  873. #:tests? #f
  874. #:phases
  875. (modify-phases %standard-phases
  876. (add-before 'configure 'change-directory
  877. (lambda _ (chdir "DevIL") #t)))))
  878. (native-inputs
  879. `(("pkg-config" ,pkg-config)))
  880. (inputs
  881. `(("lcms" ,lcms)
  882. ("libjpeg" ,libjpeg-turbo)
  883. ("libmng" ,libmng)
  884. ("libpng" ,libpng)
  885. ("libtiff" ,libtiff)
  886. ("openexr" ,openexr)
  887. ("zlib" ,zlib)))
  888. (synopsis "Library for manipulating many image formats")
  889. (description "Developer's Image Library (DevIL) is a library to develop
  890. applications with support for many types of images. DevIL can load, save,
  891. convert, manipulate, filter and display a wide variety of image formats.")
  892. (home-page "http://openil.sourceforge.net")
  893. (license license:lgpl2.1+)))
  894. (define-public jasper
  895. (package
  896. (name "jasper")
  897. (version "2.0.14")
  898. (source (origin
  899. (method url-fetch)
  900. (uri (string-append "https://github.com/mdadams/jasper/archive/"
  901. "version-" version ".tar.gz"))
  902. (file-name (string-append name "-" version ".tar.gz"))
  903. (sha256
  904. (base32
  905. "0yx9y5y0g6jv142vnqp50j3k8k5yqznz3smrblv192wgfbm6w9l5"))))
  906. (build-system cmake-build-system)
  907. (inputs `(("libjpeg" ,libjpeg)))
  908. (synopsis "JPEG-2000 library")
  909. (description "The JasPer Project is an initiative to provide a reference
  910. implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
  911. ISO/IEC 15444-1).")
  912. (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
  913. (license (license:x11-style "file://LICENSE"))))
  914. (define-public zimg
  915. (package
  916. (name "zimg")
  917. (version "2.5")
  918. (source
  919. (origin
  920. (method url-fetch)
  921. (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
  922. "release-" version ".tar.gz"))
  923. (file-name (string-append name "-" version ".tar.gz"))
  924. (sha256
  925. (base32
  926. "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
  927. (build-system gnu-build-system)
  928. (native-inputs
  929. `(("autoconf" ,autoconf)
  930. ("automake" ,automake)
  931. ("libtool" ,libtool)))
  932. (arguments
  933. '(#:phases
  934. (modify-phases %standard-phases
  935. (add-after 'unpack 'autogen
  936. (lambda _
  937. (zero? (system* "sh" "autogen.sh")))))))
  938. (synopsis "Scaling, colorspace conversion, and dithering library")
  939. (description "Zimg implements the commonly required image processing basics
  940. of scaling, colorspace conversion, and depth conversion. A simple API enables
  941. conversion between any supported formats to operate with minimal knowledge from
  942. the programmer.")
  943. (home-page "https://github.com/sekrit-twc/zimg")
  944. ;; test/extra/ contains musl-libm,
  945. ;; which is MIT/expat licensed, but only used for tests
  946. (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
  947. (define-public perceptualdiff
  948. (package
  949. (name "perceptualdiff")
  950. (version "1.3")
  951. (source
  952. (origin
  953. (method url-fetch)
  954. (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
  955. version ".tar.gz"))
  956. (file-name (string-append name "-" version ".tar.gz"))
  957. (sha256
  958. (base32
  959. "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
  960. (build-system cmake-build-system)
  961. (inputs `(("freeimage" ,freeimage)))
  962. (arguments
  963. '(#:phases (modify-phases %standard-phases
  964. (add-after 'unpack 'fix-tests
  965. ;; cmake-build-system uses a build/ directory outside
  966. ;; of the source tree, one level higher than expected
  967. (lambda _
  968. (substitute* "test/run_tests.bash"
  969. (("../build") "../../build")))))))
  970. (home-page "https://github.com/myint/perceptualdiff")
  971. (synopsis "Perceptual image comparison utility")
  972. (description "PerceptualDiff visually compares two images to determine
  973. whether they look alike. It uses a computational model of the human visual
  974. system to detect similarities. This allows it too see beyond irrelevant
  975. differences in file encoding, image quality, and other small variations.")
  976. (license license:gpl2+)))
  977. (define-public steghide
  978. (package
  979. (name "steghide")
  980. (version "0.5.1")
  981. (source (origin
  982. (method url-fetch)
  983. (uri (string-append "mirror://sourceforge/steghide/steghide/"
  984. version "/steghide-" version ".tar.bz2"))
  985. (sha256
  986. (base32
  987. "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
  988. (patches (list (search-patch "steghide-fixes.patch")))))
  989. (build-system gnu-build-system)
  990. (native-inputs
  991. `(("gettext" ,gettext-minimal)
  992. ("libtool" ,libtool)
  993. ("perl" ,perl))) ;for tests
  994. (inputs
  995. `(("libmhash" ,libmhash)
  996. ("libmcrypt" ,libmcrypt)
  997. ("libjpeg" ,libjpeg)
  998. ("zlib" ,zlib)))
  999. (arguments
  1000. `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
  1001. #:phases (modify-phases %standard-phases
  1002. (add-before 'configure 'set-perl-search-path
  1003. (lambda _
  1004. ;; Work around "dotless @INC" build failure.
  1005. (setenv "PERL5LIB"
  1006. (string-append (getcwd) "/tests:"
  1007. (getenv "PERL5LIB")))
  1008. #t)))))
  1009. (home-page "http://steghide.sourceforge.net")
  1010. (synopsis "Image and audio steganography")
  1011. (description
  1012. "Steghide is a steganography program that is able to hide data in various
  1013. kinds of image- and audio-files. The color- respectivly sample-frequencies
  1014. are not changed thus making the embedding resistant against first-order
  1015. statistical tests.")
  1016. (license license:gpl2+)))
  1017. (define-public stb-image-for-extempore
  1018. (let ((revision "1")
  1019. (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
  1020. (package
  1021. (name "stb-image-for-extempore")
  1022. (version (string-append "0-" revision "." (string-take commit 9)))
  1023. (source
  1024. (origin (method git-fetch)
  1025. (uri (git-reference
  1026. (url "https://github.com/extemporelang/stb.git")
  1027. (commit commit)))
  1028. (sha256
  1029. (base32
  1030. "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
  1031. (file-name (string-append name "-" version "-checkout"))))
  1032. (build-system cmake-build-system)
  1033. (arguments `(#:tests? #f)) ; no tests included
  1034. ;; Extempore refuses to build on architectures other than x86_64
  1035. (supported-systems '("x86_64-linux"))
  1036. (home-page "https://github.com/extemporelang/stb")
  1037. (synopsis "Image library for Extempore")
  1038. (description
  1039. "This package is a collection of assorted single-file libraries. Of
  1040. all included libraries only the image loading and decoding library is
  1041. installed as @code{stb_image}.")
  1042. (license license:public-domain))))
  1043. (define-public optipng
  1044. (package
  1045. (name "optipng")
  1046. (version "0.7.6")
  1047. (source
  1048. (origin
  1049. (method url-fetch)
  1050. (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
  1051. version ".tar.gz"))
  1052. (sha256
  1053. (base32
  1054. "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
  1055. (build-system gnu-build-system)
  1056. (inputs
  1057. `(("zlib" ,zlib)))
  1058. (arguments
  1059. '(#:phases
  1060. (modify-phases %standard-phases
  1061. ;; configure script does not accept arguments CONFIG_SHELL and SHELL
  1062. (replace 'configure
  1063. (lambda* (#:key outputs #:allow-other-keys)
  1064. (zero? (system* "sh" "configure"
  1065. (string-append "--prefix=" (assoc-ref outputs "out")))))))))
  1066. (synopsis "Optimizer that recompresses PNG image files to a
  1067. smaller size")
  1068. (description "OptiPNG is a PNG optimizer that recompresses image
  1069. files to a smaller size, without losing any information. This program
  1070. also converts external formats (BMP, GIF, PNM and TIFF) to optimized
  1071. PNG, and performs PNG integrity checks and corrections.")
  1072. (home-page "http://optipng.sourceforge.net/")
  1073. (license license:zlib)))
  1074. (define-public libjpeg-turbo
  1075. (package
  1076. (name "libjpeg-turbo")
  1077. (version "1.5.2")
  1078. (source (origin
  1079. (method url-fetch)
  1080. (uri (string-append "mirror://sourceforge/" name "/" version "/"
  1081. name "-" version ".tar.gz"))
  1082. (sha256
  1083. (base32
  1084. "0a5m0psfp5952y5vrcs0nbdz1y9wqzg2ms0xwrx752034wxr964h"))))
  1085. (build-system gnu-build-system)
  1086. (native-inputs
  1087. `(("nasm" ,nasm)))
  1088. (arguments
  1089. '(#:test-target "test"
  1090. #:configure-flags (list "--with-build-date=1970-01-01")))
  1091. (home-page "http://www.libjpeg-turbo.org/")
  1092. (synopsis "SIMD-accelerated JPEG image handling library")
  1093. (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
  1094. JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
  1095. x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
  1096. its highly-optimized Huffman coding routines allow it to outperform libjpeg by
  1097. a significant amount.
  1098. libjpeg-turbo implements both the traditional libjpeg API and the less powerful
  1099. but more straightforward TurboJPEG API, and provides a full-featured Java
  1100. interface. It supports color space extensions that allow it to compress from
  1101. and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
  1102. (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
  1103. license:ijg)))) ; the rest
  1104. (define-public niftilib
  1105. (package
  1106. (name "niftilib")
  1107. (version "2.0.0")
  1108. (source (origin
  1109. (method url-fetch)
  1110. (uri (list (string-append "mirror://sourceforge/niftilib/"
  1111. "nifticlib/nifticlib_"
  1112. (string-join (string-split version #\.) "_")
  1113. "/nifticlib-" version ".tar.gz")))
  1114. (sha256
  1115. (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
  1116. (build-system gnu-build-system)
  1117. (arguments
  1118. '(#:tests? #f ; there is no test target
  1119. #:parallel-build? #f ; not supported
  1120. #:make-flags
  1121. (list "SHELL=bash"
  1122. (string-append "ZLIB_INC="
  1123. (assoc-ref %build-inputs "zlib") "/include")
  1124. ;; Append "-fPIC" to CFLAGS.
  1125. (string-append "CFLAGS="
  1126. "-Wall -ansi -pedantic -fPIC"))
  1127. #:phases
  1128. (modify-phases %standard-phases
  1129. (replace 'install
  1130. (lambda* (#:key outputs #:allow-other-keys)
  1131. (let ((out (assoc-ref outputs "out")))
  1132. (for-each
  1133. (lambda (dir)
  1134. (copy-recursively dir (string-append out "/" dir)))
  1135. '("bin" "lib" "include")))
  1136. #t))
  1137. (delete 'configure))))
  1138. (inputs
  1139. `(("zlib" ,zlib)))
  1140. (synopsis "Library for reading and writing files in the nifti-1 format")
  1141. (description "Niftilib is a set of i/o libraries for reading and writing
  1142. files in the nifti-1 data format - a binary file format for storing
  1143. medical image data, e.g. magnetic resonance image (MRI) and functional MRI
  1144. (fMRI) brain images.")
  1145. (home-page "http://niftilib.sourceforge.net")
  1146. (license license:public-domain)))
  1147. (define-public gpick
  1148. (package
  1149. (name "gpick")
  1150. (version "0.2.5")
  1151. (source (origin
  1152. (method url-fetch)
  1153. (uri (string-append "https://github.com/thezbyg/gpick/archive/"
  1154. name "-" version ".tar.gz"))
  1155. (sha256
  1156. (base32
  1157. "0mxvxk15xhk2i5vfavjhnkk4j3bnii0gpf8di14rlbpq070hd5rs"))))
  1158. (build-system python-build-system)
  1159. (native-inputs
  1160. `(("boost" ,boost)
  1161. ("gettext" ,gnu-gettext)
  1162. ("pkg-config" ,pkg-config)
  1163. ("scons" ,scons)))
  1164. (inputs
  1165. `(("expat" ,expat)
  1166. ("gtk2" ,gtk+-2)
  1167. ("lua" ,lua-5.2)))
  1168. (arguments
  1169. `(#:tests? #f
  1170. #:phases
  1171. (modify-phases %standard-phases
  1172. (add-before 'build 'fix-lua-reference
  1173. (lambda _
  1174. (substitute* "SConscript"
  1175. (("lua5.2") "lua-5.2"))
  1176. #t))
  1177. (replace 'build
  1178. (lambda _
  1179. (zero? (system* "scons"))))
  1180. (replace 'install
  1181. (lambda* (#:key outputs #:allow-other-keys)
  1182. (let ((dest (assoc-ref outputs "out")))
  1183. (zero? (system* "scons" "install"
  1184. (string-append "DESTDIR=" dest)))))))))
  1185. (home-page "http://www.gpick.org/")
  1186. (synopsis "Color picker")
  1187. (description "Gpick is an advanced color picker and palette editing tool.")
  1188. (license license:bsd-3)))