summaryrefslogtreecommitdiff
path: root/media-libs/devil
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /media-libs/devil
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'media-libs/devil')
-rw-r--r--media-libs/devil/Manifest1
-rw-r--r--media-libs/devil/devil-1.7.8-r2.ebuild90
-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.xml16
10 files changed, 386 insertions, 0 deletions
diff --git a/media-libs/devil/Manifest b/media-libs/devil/Manifest
new file mode 100644
index 000000000000..b24481edd75c
--- /dev/null
+++ b/media-libs/devil/Manifest
@@ -0,0 +1 @@
+DIST DevIL-1.7.8.tar.gz 2051993 BLAKE2B 7c06549f7d90965fe6dcd7c6b460119a8491ca50f3103c745195fa5483885878717e9ae417eda51f25cbb60c0a96be180b12727115212709199ded13156ecb3e SHA512 a67e1488d6cb366431d9fcb460b8fe5b8a1dd79426ac77f8abd0db4a5aad7512697f72ef0c49ddb0e806469cc37ba1319e10ccd2ebd73942332df2c3c507458e
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..fad8f814c325
--- /dev/null
+++ b/media-libs/devil/devil-1.7.8-r2.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2019 Gentoo Authors
+# 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 ~hppa ~mips ppc ppc64 x86"
+IUSE="allegro cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 gif glut jpeg 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 )
+ 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-base/xorg-proto )"
+
+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) \
+ --enable-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..7802f4963f25
--- /dev/null
+++ b/media-libs/devil/metadata.xml
@@ -0,0 +1,16 @@
+<?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>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>