summaryrefslogtreecommitdiff
path: root/media-libs/devil
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-libs/devil
reinit the tree, so we can have metadata
Diffstat (limited to 'media-libs/devil')
-rw-r--r--media-libs/devil/Manifest12
-rw-r--r--media-libs/devil/devil-1.7.8-r2.ebuild91
-rw-r--r--media-libs/devil/files/devil-1.7.8-CVE-2009-3994.patch17
-rw-r--r--media-libs/devil/files/devil-1.7.8-ILUT.patch17
-rw-r--r--media-libs/devil/files/devil-1.7.8-fix-test.patch10
-rw-r--r--media-libs/devil/files/devil-1.7.8-jasper-remove-uchar.patch96
-rw-r--r--media-libs/devil/files/devil-1.7.8-libpng14.patch33
-rw-r--r--media-libs/devil/files/devil-1.7.8-nvtt-glut.patch83
-rw-r--r--media-libs/devil/files/devil-1.7.8-restrict.patch23
-rw-r--r--media-libs/devil/metadata.xml15
10 files changed, 397 insertions, 0 deletions
diff --git a/media-libs/devil/Manifest b/media-libs/devil/Manifest
new file mode 100644
index 000000000000..da4e2c114690
--- /dev/null
+++ b/media-libs/devil/Manifest
@@ -0,0 +1,12 @@
+AUX devil-1.7.8-CVE-2009-3994.patch 447 SHA256 c1e7ec4b04d28feaf5849ac8a3532291c0e17bde5aa80e71a77fbfe12cdf4c0b SHA512 0d669f1df71e71bb43f5ef3ce90e5e0566118d6b9cc9aeaf8099d8833fa026dd073d96ed6d61de8a954b9d66d2033d3c5c60d77f4b4b2c1276ca1996533574c7 WHIRLPOOL 3e52bf62c90cc1f9e45507fcf61f06aa471b2fc9c81ec273f4d06399209210bbc812af41750b2c2739080dfb4397b67b5e00311eeb71ec7627e2bc1fc8bd03e6
+AUX devil-1.7.8-ILUT.patch 671 SHA256 869678fd287d058581d2667dbfde9718eff9bafdc6e76d629ab549a10ac8312c SHA512 b9edda900e9ef7b295abd76a41877b3275472c7b0736c5aa46b8af1fa06d632d18067aea8c02e118db45ae0e682d23e5468f54183774d3437544921f48263f09 WHIRLPOOL a4699df22a834e58dc50f29d1a2a26eea3c4e65f4be8626a1a94fbd0b0785febe21f98acb6425a4ea3c67b33f7995aa309eca5c1a541cfaecfb4244cb5616fbf
+AUX devil-1.7.8-fix-test.patch 214 SHA256 14a244ab86832b2ceb6fe1508140b29920136d0dd871ce2d388303baedb70ab2 SHA512 87e0cbaed214b243c4991fdd86271e27479eb6dbad058e73b583f911e79479f74b182cd62d0e7d35df3bf8a267c705abb947a42461d2c3bbbc1e1fe2bfadedeb WHIRLPOOL 5da47c1609ac5dabb3e4ef938842cbff187ad824205510e131b98149da8136496c51dd66c5ed5c5d15a5fb295a0f8f30f09e16f2b171440c5bda0234b9b5ba66
+AUX devil-1.7.8-jasper-remove-uchar.patch 3883 SHA256 68c528762bc7d845960eb5eaf9568f9e21c6d39e4169c141ae7d5c6e6579002f SHA512 4ef532c38bce4ee6130bf7baf1df7a47d36b97bfc35557e8e53f8e3fbf454627258b78fabaa1fd2c3d0bb05ec91018ee6359b964be0ed8cdf27f07ed3f05bc18 WHIRLPOOL 9f9042aca93112077b469e52bddb8d6650a31fbecd6304ff64044b3c0489a2352471fe3957429f93e25a1b2796891166cd7d291e9a9fee1356cea1885da35fba
+AUX devil-1.7.8-libpng14.patch 1221 SHA256 bd1da681157678fcffcaba5ec2f7f2d33ad9971816ea33dedcf2721ad0ab4536 SHA512 cca76f7f6702ee8341ef68f36f36ade358662a38294e6e2badf7944e2c5b194d1098eb24e9c57e4101b3b110548d106cf8e3ed7ac55281d96428c07cbf6396d0 WHIRLPOOL 06178a97bfa6a67ef50bc26887f6ec4067c0db21c97a518032d75005b18658500262ad22c74e7df0cbe6a66e09eedbb3e57fac25eb06590a2be2e3828af748e9
+AUX devil-1.7.8-nvtt-glut.patch 2493 SHA256 ca71052737a94cb76edc47f7fe143d871cfdb397cc5039fd3703ee6d34e73cc1 SHA512 c9adacd0b2c2c1d8980ee87b69b27f0bd3f7f3285ef695499ee90bf4aff55cd8f65c990590478a45d02257c8bb9f01ccc463afe9313efe31a02ee67e15b3207f WHIRLPOOL e8de26fb890bf0b5e2d5418d63316a3685c797a751ac78953108d47fc8b3b6e0d10405ecff6bd67d49596dec693896c9d5ad6277ad8f09a0ce521bfef53a486e
+AUX devil-1.7.8-restrict.patch 587 SHA256 f30f4f95a208963af7fcf5de68c2a94db55911b34b9feef2c4324673388784c3 SHA512 9370a94406e98979266d027857d7dd04069eefb6e2ccfb52d254b9eb658d932e5e7e9bd3a38aad57099b870c54aaa0a2d8b337f9bad42d06f6521c10d0a6f8db WHIRLPOOL d7633320ba62b81f80aa91a42228c70afe647f466f63ecc68e55afcfd3875ff05f00669a08db7bbcfa2e3c26e29d12fc02c0947dc46116ee3ca4460c8f4e3b9f
+DIST DevIL-1.7.8.tar.gz 2051993 SHA256 682ffa3fc894686156337b8ce473c954bf3f4fb0f3ecac159c73db632d28a8fd SHA512 a67e1488d6cb366431d9fcb460b8fe5b8a1dd79426ac77f8abd0db4a5aad7512697f72ef0c49ddb0e806469cc37ba1319e10ccd2ebd73942332df2c3c507458e WHIRLPOOL 749bf0ce73786709414d6f2c3bf29b20c56397cb6f9f92b4158902a98a4f4d0ef66d78096ce8daea3d65b1718c5255421055cd223e9269f6c773ca310c2df146
+EBUILD devil-1.7.8-r2.ebuild 2177 SHA256 b92eea3f45616f0420c41f8309ab27ebf0926e809a418133e0dc145367804659 SHA512 df753c555f9a7ecd356c1d56735b3270b97ce276e7a10344e90ca98a90876827002275e13d0afc0c99fa7f520bfadf1527cfddb635aca78068c9aff844071b9b WHIRLPOOL c129813f548aa79edd4dbd9bcaae16b68e77d6e0623e374a5f097bce22be09907311a75d42e7a9b3fc21a373a9b51413843155153800ad1bfe53fb84205876be
+MISC ChangeLog 4199 SHA256 c90dc9c936d80fe996dbb0e85332dcf0d7b94f3c134d7c4ec65c184a0cf2aa98 SHA512 c3bfd37cef1503a8339ade287b69a29425f1c8ed66caccb755ba741f9e3d8f5103918d58016a4264f49cf34d5bbc1cbc129fd778b3a01e98c9233ebeed7a60d8 WHIRLPOOL 3c84de4be5aee9921cff8f47fddc8e4e2c3d1a08bbab9fe35126881344121e1d73e529ff517a6cc16ec15188f899face053a0a2d4c4c89dbee256db45fead418
+MISC ChangeLog-2015 8235 SHA256 f6231602c5e22c3e5206c8e955621c7edb7059487385f001c92f16ffe86eee87 SHA512 bed9d2863d2f0dd5cddf60f515e420a473373db425f849bb4175d267c5d2a15f44da87a2d5f6386f50d31701cc5d510bc0885403dda5996e959a5c791667b9fb WHIRLPOOL a1889cee5bf479d4804bc7c0354ebfcfee205513700af10aa9258ed4b057449974fe9d5bddfa3e5b17b24ae30c4a3852e82429136d42bc99efc5ba5a65e2565a
+MISC metadata.xml 499 SHA256 d4cf93176bedb75d01c37dcd8d29a49fbfebfa7fd49f2dfcdf6cadb7365a7c39 SHA512 68440791a1c641a6983d297e924bee78038905b1ee383592b220f0ef51980d8f9eb237a6d70b0d848781d08e72fe02f4b4f36691d37a72b4003ea59fe3764cfc WHIRLPOOL f83bbbadaf75bb031417c47910870f8529d60ef1bb06f2b7aa431d7878ca54486befcbc9020cc5ab2cba6d2512b883d3798e1425df445cdb794335e4d2a5096e
diff --git a/media-libs/devil/devil-1.7.8-r2.ebuild b/media-libs/devil/devil-1.7.8-r2.ebuild
new file mode 100644
index 000000000000..9c833edd6833
--- /dev/null
+++ b/media-libs/devil/devil-1.7.8-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+MY_P=DevIL-${PV}
+
+DESCRIPTION="DevIL image library"
+HOMEPAGE="http://openil.sourceforge.net/"
+SRC_URI="mirror://sourceforge/openil/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ~mips ppc ppc64 x86"
+IUSE="allegro cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 gif glut jpeg jpeg2k mng nvtt openexr opengl png sdl static-libs tiff X xpm"
+
+RDEPEND="
+ allegro? ( media-libs/allegro:0 )
+ gif? ( media-libs/giflib:= )
+ glut? ( media-libs/freeglut )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper:= )
+ mng? ( media-libs/libmng:= )
+ nvtt? ( media-gfx/nvidia-texture-tools )
+ openexr? ( media-libs/openexr:= )
+ opengl? ( virtual/opengl
+ virtual/glu )
+ png? ( media-libs/libpng:0= )
+ sdl? ( media-libs/libsdl )
+ tiff? ( media-libs/tiff:0 )
+ X? ( x11-libs/libXext
+ x11-libs/libX11
+ x11-libs/libXrender )
+ xpm? ( x11-libs/libXpm )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ X? ( x11-proto/xextproto )"
+
+PATCHES=(
+ "${FILESDIR}/${P}"-CVE-2009-3994.patch
+ "${FILESDIR}/${P}"-libpng14.patch
+ "${FILESDIR}/${P}"-nvtt-glut.patch
+ "${FILESDIR}/${P}"-ILUT.patch
+ "${FILESDIR}/${P}"-restrict.patch
+ "${FILESDIR}/${P}"-fix-test.patch
+ "${FILESDIR}/${P}"-jasper-remove-uchar.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ --disable-lcms \
+ --enable-ILU \
+ --enable-ILUT \
+ $(use_enable cpu_flags_x86_sse sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable openexr exr) \
+ $(use_enable gif) \
+ $(use_enable jpeg) \
+ $(use_enable jpeg2k jp2) \
+ $(use_enable mng) \
+ $(use_enable png) \
+ $(use_enable tiff) \
+ $(use_enable xpm) \
+ $(use_enable allegro) \
+ --disable-directx8 \
+ --disable-directx9 \
+ $(use_enable opengl) \
+ $(use_enable sdl) \
+ $(use_enable X x11) \
+ $(use_enable X shm) \
+ $(use_enable X render) \
+ $(use_enable glut) \
+ $(use_with X x) \
+ $(use_with nvtt)
+}
+
+src_install() {
+ default
+
+ # package provides .pc files
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/media-libs/devil/files/devil-1.7.8-CVE-2009-3994.patch b/media-libs/devil/files/devil-1.7.8-CVE-2009-3994.patch
new file mode 100644
index 000000000000..77e684a7b43b
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-CVE-2009-3994.patch
@@ -0,0 +1,17 @@
+http://bugs.gentoo.org/297760
+
+--- a/src-IL/src/il_dicom.c
++++ b/src-IL/src/il_dicom.c
+@@ -427,9 +427,11 @@ ILboolean GetUID(ILubyte *UID)
+ return IL_FALSE;
+
+ ValLen = GetLittleUShort();
++ if (ValLen > 64)
++ return IL_FALSE;
+ if (iread(UID, ValLen, 1) != 1)
+ return IL_FALSE;
+- UID[64] = 0; // Just to make sure that our string is terminated.
++ UID[ValLen] = 0; // Just to make sure that our string is terminated.
+
+ return IL_TRUE;
+ }
diff --git a/media-libs/devil/files/devil-1.7.8-ILUT.patch b/media-libs/devil/files/devil-1.7.8-ILUT.patch
new file mode 100644
index 000000000000..f14d43b730d6
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-ILUT.patch
@@ -0,0 +1,17 @@
+From: hasufell <hasufell@gentoo.org>
+Date: Thu May 3 22:23:21 UTC 2012
+
+use_x11=no was not set when --disable-x11 was
+
+--- a/m4/devil-api_checks.m4
++++ b/m4/devil-api_checks.m4
+@@ -137,7 +137,8 @@
+ [main],
+ [dnl The use_x11 var is either "yes" already, or we don't want "no" to be overwritten
+ ILUT_LIBS="-lX11 $ILUT_LIBS"],
+- [use_x11="no"]) ])
++ [use_x11="no"]) ],
++ [use_x11="no"])
+ TEST_API([shm])
+ AS_IF([test "x$enable_shm" = "xyes"],
+ [AC_CHECK_HEADER([X11/extensions/XShm.h],
diff --git a/media-libs/devil/files/devil-1.7.8-fix-test.patch b/media-libs/devil/files/devil-1.7.8-fix-test.patch
new file mode 100644
index 000000000000..eda05e726ca2
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-fix-test.patch
@@ -0,0 +1,10 @@
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -12,5 +12,6 @@ else
+ testil_LDADD += ../lib/libIL.la
+ endif
+
+-TESTS_ENVIRONMENT = /bin/bash
++TESTS_ENVIRONMENT =
+ TESTS = $(check_SCRIPTS)
++LOG_COMPILER = $(SHELL)
diff --git a/media-libs/devil/files/devil-1.7.8-jasper-remove-uchar.patch b/media-libs/devil/files/devil-1.7.8-jasper-remove-uchar.patch
new file mode 100644
index 000000000000..79fb18894216
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-jasper-remove-uchar.patch
@@ -0,0 +1,96 @@
+From 8b5e3cb38f46afd063a5258af0da1eb6a942dec5 Mon Sep 17 00:00:00 2001
+From: Ben Campbell <ben@scumways.com>
+Date: Wed, 16 Nov 2016 14:41:05 +1300
+Subject: [PATCH] jp2: remove use of uchar define from older jasPer
+
+fixes #41
+jasPer now defines jas_uchar instead of uchar, but it's a moot
+point since the offending code in DevIL was never executed and could
+be removed.
+---
+ DevIL/src-IL/src/il_jp2.c | 42 ++++++++++++++----------------------------
+ 1 file changed, 14 insertions(+), 28 deletions(-)
+
+diff --git a/src-IL/src/il_jp2.c b/src-IL/src/il_jp2.c
+index acc5787..3fd397b 100644
+--- a/src-IL/src/il_jp2.c
++++ b/src-IL/src/il_jp2.c
+@@ -358,7 +358,7 @@ static jas_stream_ops_t jas_stream_devilops = {
+
+ static jas_stream_t *jas_stream_create(void);
+ static void jas_stream_destroy(jas_stream_t *stream);
+-static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf, int bufsize);
++static void jas_stream_initbuf(jas_stream_t *stream, int bufmode );
+
+
+ // Modified version of jas_stream_fopen and jas_stream_memopen from jas_stream.c of JasPer
+@@ -377,7 +377,7 @@ jas_stream_t *iJp2ReadStream()
+ stream->openmode_ = JAS_STREAM_READ | JAS_STREAM_BINARY;
+
+ /* We use buffering whether it is from memory or a file. */
+- jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
++ jas_stream_initbuf(stream, JAS_STREAM_FULLBUF);
+
+ /* Select the operations for a memory stream. */
+ stream->ops_ = &jas_stream_devilops;
+@@ -432,8 +432,7 @@ jas_stream_t *iJp2ReadStream()
+ // The following functions are taken directly from jas_stream.c of JasPer,
+ // since they are designed to be used within JasPer only.
+
+-static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf,
+- int bufsize)
++static void jas_stream_initbuf(jas_stream_t *stream, int bufmode )
+ {
+ /* If this function is being called, the buffer should not have been
+ initialized yet. */
+@@ -441,31 +440,18 @@ static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf,
+
+ if (bufmode != JAS_STREAM_UNBUF) {
+ /* The full- or line-buffered mode is being employed. */
+- if (!buf) {
+- /* The caller has not specified a buffer to employ, so allocate
+- one. */
+- if ((stream->bufbase_ = jas_malloc(JAS_STREAM_BUFSIZE +
+- JAS_STREAM_MAXPUTBACK))) {
+- stream->bufmode_ |= JAS_STREAM_FREEBUF;
+- stream->bufsize_ = JAS_STREAM_BUFSIZE;
+- } else {
+- /* The buffer allocation has failed. Resort to unbuffered
+- operation. */
+- stream->bufbase_ = stream->tinybuf_;
+- stream->bufsize_ = 1;
+- }
+- } else {
+- /* The caller has specified a buffer to employ. */
+- /* The buffer must be large enough to accommodate maximum
+- putback. */
+- assert(bufsize > JAS_STREAM_MAXPUTBACK);
+- stream->bufbase_ = JAS_CAST(uchar *, buf);
+- stream->bufsize_ = bufsize - JAS_STREAM_MAXPUTBACK;
+- }
++ if ((stream->bufbase_ = jas_malloc(JAS_STREAM_BUFSIZE +
++ JAS_STREAM_MAXPUTBACK))) {
++ stream->bufmode_ |= JAS_STREAM_FREEBUF;
++ stream->bufsize_ = JAS_STREAM_BUFSIZE;
++ } else {
++ /* The buffer allocation has failed. Resort to unbuffered
++ operation. */
++ stream->bufbase_ = stream->tinybuf_;
++ stream->bufsize_ = 1;
++ }
+ } else {
+ /* The unbuffered mode is being employed. */
+- /* A buffer should not have been supplied by the caller. */
+- assert(!buf);
+ /* Use a trivial one-character buffer. */
+ stream->bufbase_ = stream->tinybuf_;
+ stream->bufsize_ = 1;
+@@ -527,7 +513,7 @@ jas_stream_t *iJp2WriteStream()
+ stream->openmode_ = JAS_STREAM_WRITE | JAS_STREAM_BINARY;
+
+ /* We use buffering whether it is from memory or a file. */
+- jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
++ jas_stream_initbuf(stream, JAS_STREAM_FULLBUF);
+
+ /* Select the operations for a memory stream. */
+ stream->ops_ = &jas_stream_devilops;
diff --git a/media-libs/devil/files/devil-1.7.8-libpng14.patch b/media-libs/devil/files/devil-1.7.8-libpng14.patch
new file mode 100644
index 000000000000..b8434692b8bd
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-libpng14.patch
@@ -0,0 +1,33 @@
+diff -Nur devil-1.7.8.orig/src-IL/src/il_icon.c devil-1.7.8/src-IL/src/il_icon.c
+--- devil-1.7.8.orig/src-IL/src/il_icon.c 2009-03-08 09:10:09.000000000 +0200
++++ devil-1.7.8/src-IL/src/il_icon.c 2010-01-17 00:54:09.000000000 +0200
+@@ -525,7 +525,7 @@
+
+ // 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 -Nur devil-1.7.8.orig/src-IL/src/il_png.c devil-1.7.8/src-IL/src/il_png.c
+--- devil-1.7.8.orig/src-IL/src/il_png.c 2009-03-08 09:10:09.000000000 +0200
++++ devil-1.7.8/src-IL/src/il_png.c 2010-01-17 00:55:26.000000000 +0200
+@@ -105,7 +105,7 @@
+ Read = iread(Signature, 1, 8);
+ iseek(-Read, IL_SEEK_CUR);
+
+- return png_check_sig(Signature, 8);
++ return png_sig_cmp(Signature, 0, 8) == 0;
+ }
+
+
+@@ -278,7 +278,7 @@
+
+ // 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
diff --git a/media-libs/devil/files/devil-1.7.8-nvtt-glut.patch b/media-libs/devil/files/devil-1.7.8-nvtt-glut.patch
new file mode 100644
index 000000000000..571d76bf81ec
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-nvtt-glut.patch
@@ -0,0 +1,83 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Tue May 1 20:00:44 UTC 2012
+Subject: build system
+
+remove automagic handling of glut and add configure option
+fix "header present but cannot be compiled" warning for nvtt
+
+--- a/m4/ax_check_glut.m4
++++ b/m4/ax_check_glut.m4
+@@ -114,4 +114,11 @@
+
+ AC_SUBST([GLUT_CFLAGS])
+ AC_SUBST([GLUT_LIBS])
++
++AC_ARG_ENABLE([glut],
++ [AS_HELP_STRING([--enable-glut],
++ [Enable support for glut (default=yes)]) ],
++ [enable_glut=$enableval],
++ [enable_glut="yes"])
++
+ ])dnl
+--- a/m4/devil-api_checks.m4
++++ b/m4/devil-api_checks.m4
+@@ -31,8 +31,8 @@
+ AS_IF([test "x$no_gl" != "xyes" -a "x$no_glu" != "xyes"],
+ [use_ogl="yes"
+ ILUT_LIBS="$GLU_LIBS $GL_LIBS $ILUT_LIBS"
+- AS_IF([test "x$no_glut" != "xyes"],
+- [have_glut="yes"
++ AS_IF([test "x$no_glut" != "xyes" -a "x$enable_glut" = "xyes"],
++ [use_glut="yes"
+ ILUT_LIBS="$GLUT_LIBS $ILUT_LIBS"])
+ AC_DEFINE([ILUT_USE_OPENGL],
+ [1],
+--- a/configure.ac
++++ b/configure.ac
+@@ -343,8 +343,10 @@
+ [Do you want to use the Nvidia texture tools if possible? (enables GPU accelerated image manipulation, default="yes")]) ],
+ [],
+ [with_nvtt="yes"])
++AC_LANG_PUSH([C++])
+ AS_IF([test "x$with_nvtt" = "xyes"],
+ [DEVIL_CHECK_NVIDIA_TEXTOOLS])
++AC_LANG_POP
+
+ dnl
+ dnl ILUT APIs library checking
+@@ -392,8 +394,8 @@
+ AM_CONDITIONAL([USE_OPENGL],
+ [test "x$use_ogl" = "xyes"])
+
+-AM_CONDITIONAL([HAVE_GLUT],
+- [test "x$have_glut" = "xyes"])
++AM_CONDITIONAL([USE_GLUT],
++ [test "x$use_glut" = "xyes"])
+
+ AM_CONDITIONAL([USE_SDL],
+ [test "x$use_sdl" = "xyes"])
+@@ -410,7 +412,7 @@
+ AM_CONDITIONAL([USE_X11],
+ [test "x$use_x11" = "xyes"])
+ #this is instedad AM_COND_IF([USE_OPENGL && USE_X11])
+-AS_IF([test "x$have_glut" = "xyes" -a "x$use_x11" = "xyes"],
++AS_IF([test "x$use_glut" = "xyes" -a "x$use_x11" = "xyes"],
+ [EXAMPLES_TO_BUILD="$EXAMPLES_TO_BUILD ILUT_gl ILUT_volume"])
+
+ dnl Win32
+--- a/bin/Makefile.am
++++ b/bin/Makefile.am
+@@ -45,11 +45,11 @@
+ examples_PROGRAMS += ILUT_animation
+ endif #USE_W32
+
+-if HAVE_GLUT
++if USE_GLUT
+ if USE_X11
+ examples_PROGRAMS += ILUT_gl ILUT_volume
+ endif #USE_X11
+-endif #HAVE_GLUT
++endif #USE_GLUT
+
+ endif #BUILD_ILUT
+
diff --git a/media-libs/devil/files/devil-1.7.8-restrict.patch b/media-libs/devil/files/devil-1.7.8-restrict.patch
new file mode 100644
index 000000000000..d99ccb3a3008
--- /dev/null
+++ b/media-libs/devil/files/devil-1.7.8-restrict.patch
@@ -0,0 +1,23 @@
+Patch from Sven Eden via bug 552370
+https://bugs.gentoo.org/show_bug.cgi?id=552370
+
+--- a/include/IL/il.h 2009-03-08 08:10:08.000000000 +0100
++++ b/include/IL/il.h 2015-09-03 16:22:04.056637044 +0200
+@@ -63,13 +63,13 @@
+ #endif
+ #endif
+
+-#ifdef RESTRICT_KEYWORD
+-#define RESTRICT restrict
+-#define CONST_RESTRICT const restrict
++#if defined(RESTRICT_KEYWORD) && !defined(__cplusplus)
++#define RESTRICT __restrict__
++#define CONST_RESTRICT const __restrict__
+ #else
+ #define RESTRICT
+ #define CONST_RESTRICT const
+-#endif
++#endif // RESTRICT keyword and not C++
+
+ #include <stdio.h>
+
diff --git a/media-libs/devil/metadata.xml b/media-libs/devil/metadata.xml
new file mode 100644
index 000000000000..e44a24dd552b
--- /dev/null
+++ b/media-libs/devil/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="allegro">Add support for Allegro</flag>
+ <flag name="nvtt">Add support for <pkg>media-gfx/nvidia-texture-tools</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">openil</remote-id>
+ </upstream>
+</pkgmetadata>