gnu: Add devil.

* gnu/packages/image.scm (devil): New variable.
* gnu/packages/patches/devil-fix-libpng.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
This commit is contained in:
David Thompson 2015-11-14 13:56:40 -05:00
parent 333c376c45
commit 3aab2c839f
3 changed files with 89 additions and 0 deletions

View file

@ -433,6 +433,7 @@ dist_patch_DATA = \
gnu/packages/patches/cursynth-wave-rand.patch \ gnu/packages/patches/cursynth-wave-rand.patch \
gnu/packages/patches/dbus-helper-search-path.patch \ gnu/packages/patches/dbus-helper-search-path.patch \
gnu/packages/patches/dealii-p4est-interface.patch \ gnu/packages/patches/dealii-p4est-interface.patch \
gnu/packages/patches/devil-fix-libpng.patch \
gnu/packages/patches/diffutils-gets-undeclared.patch \ gnu/packages/patches/diffutils-gets-undeclared.patch \
gnu/packages/patches/dfu-programmer-fix-libusb.patch \ gnu/packages/patches/dfu-programmer-fix-libusb.patch \
gnu/packages/patches/doxygen-test.patch \ gnu/packages/patches/doxygen-test.patch \

View file

@ -666,3 +666,55 @@ (define-public libmng
(description (description
"Libmng is the MNG (Multiple-image Network Graphics) reference library.") "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
(license license:bsd-3))) (license license:bsd-3)))
(define-public devil
(package
(name "devil")
(version "1.7.8")
(source (origin
(method url-fetch)
(uri (string-append "http://downloads.sourceforge.net/openil/"
"DevIL-" version ".tar.gz"))
(sha256
(base32
"1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"))
;; Backported from upstream:
;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch
(patches (list (search-patch "devil-fix-libpng.patch")))
(modules '((guix build utils)))
(snippet
;; Fix old lcms include directives and lib flags.
'(substitute* '("configure" "src-IL/src/il_profiles.c")
(("-llcms") "-llcms2")
(("lcms/lcms\\.h") "lcms2/lcms2.h")
(("lcms\\.h") "lcms2.h")))))
(build-system gnu-build-system)
(arguments
'(#:configure-flags '("--enable-ILUT=yes") ; build utility library
#:phases
(modify-phases %standard-phases
(add-before 'check 'fix-tests
(lambda* (#:key inputs #:allow-other-keys)
;; Fix hard-coded /bin/bash reference.
(substitute* '("test/Makefile")
(("TESTS_ENVIRONMENT = /bin/bash")
(string-append "TESTS_ENVIRONMENT = "
(assoc-ref inputs "bash")
"/bin/bash")))
#t)))))
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("lcms" ,lcms)
("libjpeg" ,libjpeg)
("libmng" ,libmng)
("libpng" ,libpng)
("libtiff" ,libtiff)
("openexr" ,openexr)
("zlib" ,zlib)))
(synopsis "Library for manipulating many image formats")
(description "Developer's Image Library (DevIL) is a library to develop
applications with support for many types of images. DevIL can load, save,
convert, manipulate, filter and display a wide variety of image formats.")
(home-page "http://openil.sourceforge.net")
(license license:lgpl2.1+)))

View file

@ -0,0 +1,36 @@
From 724194d7a9a91221a564579f64bdd6f0abd64219 Mon Sep 17 00:00:00 2001
From: Noah Mayr <max96at@gmail.com>
Date: Sun, 1 Mar 2015 10:10:56 +0100
Subject: [PATCH] Fixed deprecated libpng API usage.
---
src-IL/src/il_icon.c | 2 +-
src-IL/src/il_png.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src-IL/src/il_icon.c b/src-IL/src/il_icon.c
index 2ccb1a3..fd9475d 100644
--- a/src-IL/src/il_icon.c
+++ b/src-IL/src/il_icon.c
@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdouble display_exponent)
// Expand low-bit-depth grayscale images to 8 bits
if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_gray_1_2_4_to_8(ico_png_ptr);
+ png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
}
// Expand RGB images with transparency to full alpha channels
diff --git a/src-IL/src/il_png.c b/src-IL/src/il_png.c
index da9517d..2866508 100644
--- a/src-IL/src/il_png.c
+++ b/src-IL/src/il_png.c
@@ -277,7 +277,7 @@ ILboolean readpng_get_image(ILdouble display_exponent)
// Expand low-bit-depth grayscale images to 8 bits
if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
}
// Expand RGB images with transparency to full alpha channels