diff --git a/DevIL-1.7.5-il_endian_h.patch b/DevIL-1.7.5-il_endian_h.patch new file mode 100644 index 0000000000000000000000000000000000000000..25047529760150e6a01b57672a802c36e3005193 --- /dev/null +++ b/DevIL-1.7.5-il_endian_h.patch @@ -0,0 +1,36 @@ +diff -up devil-1.7.8/src-IL/include/il_endian.h~ devil-1.7.8/src-IL/include/il_endian.h +--- devil-1.7.8/src-IL/include/il_endian.h~ 2009-03-08 08:10:08.000000000 +0100 ++++ devil-1.7.8/src-IL/include/il_endian.h 2009-03-09 10:11:33.000000000 +0100 +@@ -15,6 +15,10 @@ + + #include "il_internal.h" + ++#ifdef GCC_X86_ASM ++#include ++#endif ++ + #ifdef WORDS_BIGENDIAN // This is defined by ./configure. + #ifndef __BIG_ENDIAN__ + #define __BIG_ENDIAN__ 1 +@@ -104,9 +108,7 @@ INLINE void iSwapUShort(ILushort *s) { + } + #else + #ifdef GCC_X86_ASM +- asm("ror $8,%0" +- : "=r" (*s) +- : "0" (*s)); ++ *s = __bswap_16(*s); + #else + *s = ((*s)>>8) | ((*s)<<8); + #endif //GCC_X86_ASM +@@ -127,8 +129,7 @@ INLINE void iSwapUInt(ILuint *i) { + } + #else + #ifdef GCC_X86_ASM +- asm("bswap %0;" +- : "+r" (*i)); ++ *i = __bswap_32(*i); + #else + *i = ((*i)>>24) | (((*i)>>8) & 0xff00) | (((*i)<<8) & 0xff0000) | ((*i)<<24); + #endif //GCC_X86_ASM + diff --git a/DevIL-1.7.8-CVE-2009-3994.patch b/DevIL-1.7.8-CVE-2009-3994.patch new file mode 100644 index 0000000000000000000000000000000000000000..75d7e5bc385c1ed50437ada8e6a43cb476130d2e --- /dev/null +++ b/DevIL-1.7.8-CVE-2009-3994.patch @@ -0,0 +1,17 @@ +diff -up devil-1.7.8/src-IL/src/il_dicom.c~ devil-1.7.8/src-IL/src/il_dicom.c +--- devil-1.7.8/src-IL/src/il_dicom.c~ 2009-03-08 08:10:09.000000000 +0100 ++++ devil-1.7.8/src-IL/src/il_dicom.c 2009-12-03 12:07:45.000000000 +0100 +@@ -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/DevIL-1.7.8-gcc5.patch b/DevIL-1.7.8-gcc5.patch new file mode 100644 index 0000000000000000000000000000000000000000..506246aebdbe21afebb633b571affbbd3a994638 --- /dev/null +++ b/DevIL-1.7.8-gcc5.patch @@ -0,0 +1,13 @@ +diff -up devil-1.7.8/include/IL/il.h~ devil-1.7.8/include/IL/il.h +--- devil-1.7.8/include/IL/il.h~ 2009-03-08 08:10:08.000000000 +0100 ++++ devil-1.7.8/include/IL/il.h 2015-06-18 12:34:38.656310094 +0200 +@@ -65,7 +65,7 @@ extern "C" { + + #ifdef RESTRICT_KEYWORD + #define RESTRICT restrict +-#define CONST_RESTRICT const restrict ++#define CONST_RESTRICT const __restrict + #else + #define RESTRICT + #define CONST_RESTRICT const + diff --git a/DevIL-1.7.8-libpng15.patch b/DevIL-1.7.8-libpng15.patch new file mode 100644 index 0000000000000000000000000000000000000000..aaa57d6684916b6ed896264430d6558d2001e0ba --- /dev/null +++ b/DevIL-1.7.8-libpng15.patch @@ -0,0 +1,29 @@ +--- devil-1.7.8/src-IL/src/il_png.c.orig 2011-11-05 18:21:39.980007624 -0400 ++++ devil-1.7.8/src-IL/src/il_png.c 2011-11-05 18:46:18.644000033 -0400 +@@ -278,7 +278,11 @@ + + // Expand low-bit-depth grayscale images to 8 bits + if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { ++#if PNG_LIBPNG_VER > 10400 ++ png_set_expand_gray_1_2_4_to_8(png_ptr); ++#else + png_set_gray_1_2_4_to_8(png_ptr); ++#endif + } + + // Expand RGB images with transparency to full alpha channels +--- devil-1.7.8/src-IL/src/il_icon.c.orig 2011-11-05 18:21:27.560000432 -0400 ++++ devil-1.7.8/src-IL/src/il_icon.c 2011-11-05 18:46:44.626000535 -0400 +@@ -525,7 +525,11 @@ + + // Expand low-bit-depth grayscale images to 8 bits + if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { ++#if PNG_LIBPNG_VER > 10400 ++ png_set_expand_gray_1_2_4_to_8(ico_png_ptr); ++#else + png_set_gray_1_2_4_to_8(ico_png_ptr); ++#endif + } + + // Expand RGB images with transparency to full alpha channels + diff --git a/DevIL-1.7.8.tar.gz b/DevIL-1.7.8.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..56f756434d97e280208e24593a37e8ee5772d496 Binary files /dev/null and b/DevIL-1.7.8.tar.gz differ diff --git a/DevIL.spec b/DevIL.spec new file mode 100644 index 0000000000000000000000000000000000000000..04dcdd4205718cf8d5a9617d083d538cfbf46182 --- /dev/null +++ b/DevIL.spec @@ -0,0 +1,112 @@ +Name: DevIL +Version: 1.7.8 +Release: 30 +Summary: Developer's Image Library +License: LGPLv2 +URL: http://openil.sourceforge.net/ +Source0: http://downloads.sourceforge.net/openil/%{name}-%{version}.tar.gz +Patch0000: DevIL-1.7.5-il_endian_h.patch +Patch0001: DevIL-1.7.8-CVE-2009-3994.patch +Patch0002: DevIL-1.7.8-libpng15.patch +Patch0003: DevIL-1.7.8-gcc5.patch +Patch0004: devil-1.7.8-jasper2.patch +BuildRequires: gcc-c++ allegro-devel libGLU-devel libICE-devel +BuildRequires: libXext-devel libjpeg-devel libmng-devel libpng-devel +BuildRequires: libtiff-devel jasper-devel SDL-devel => 1.2.5 + +%description +DevIL is an application program for development with very powerful image +loading function, which can load, save, convert, operate, filter and +display various image formats. DevIL leaves the final control of the +image to the developer, so unnecessary conversion is not performed, etc. + +%package help +Summary: Help document for DevIL + +%description help +Help document for DevIL. + +%package devel +Summary: Development files for DevIL +Requires: DevIL = {version}-%{release} +Requires(post): info +Requires(preun):info + +%description devel +Development files for DevIL. + +%package ILUT +Summary: The libILUT component of DevIL +Requires: DevIL = {version}-%{release} + +%description ILUT +The libILUT component of DevIL. + +%package ILUT-devel +Summary: Development files for the libILUT component of DevIL +Requires: DevIL-ILUT = {version}-%{release} DevIL-devel = {version}-%{release} allegro-devel libGLU-devel + +%description ILUT-devel +Development files for the libILUT component of DevIL. + +%prep +%autosetup -n devil-%{version} -p1 +iconv -f iso8859-1 CREDITS -t utf8 > CREDITS.conv +touch -r CREDITS CREDITS.conv +mv CREDITS.conv CREDITS +chmod -x src-IL/src/il_*.c +sed -i 's|png12|png16|g' configure + +%build +%ifarch x86_64 +DISABLE_SSE="--disable-sse3" +%endif +%configure --enable-ILU --enable-ILUT --disable-static --disable-allegrotest $DISABLE_SSE +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|LD_RUN_PATH|DIE_RPATH_DIE|g' libtool +%make_build + +%install +%make_install +rm %{buildroot}%{_infodir}/dir +rm %{buildroot}%{_libdir}/*.la + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%post devel +/sbin/install-info %{_infodir}/DevIL_manual.info %{_infodir}/dir 2> /dev/null || : +%preun devel +if [ $1 = 0 ] ; then + /sbin/install-info --delete %{_infodir}/DevIL_manual.info %{_infodir}/dir 2> /dev/null || : +fi + +%post ILUT -p /sbin/ldconfig +%postun ILUT -p /sbin/ldconfig + +%files +%doc AUTHORS +%{_bindir}/ilur +%{_libdir}/{libIL.so.*,libILU.so.*} + +%files devel +%{_libdir}/{libIL.so,libILU.so} +%{_libdir}/pkgconfig/{IL.pc,ILU.pc} +%dir %{_includedir}/IL +%{_includedir}/IL/{il.h,ilu.h,ilu_region.h} +%{_infodir}/DevIL_manual.info.gz + +%files ILUT +%{_libdir}/libILUT.so.* + +%files ILUT-devel +%{_libdir}/libILUT.so +%{_libdir}/pkgconfig/ILUT.pc +%{_includedir}/IL/{devil_cpp_wrapper.hpp,ilut.h} + +%files help +%doc ChangeLog COPYING CREDITS README TODO + +%changelog +* Mon Feb 24 2020 zhoumuchen - 1.7.8-30 +- Init package diff --git a/devil-1.7.8-jasper2.patch b/devil-1.7.8-jasper2.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c1386f623efd364e85ff688f8c0f33ae41e3511 --- /dev/null +++ b/devil-1.7.8-jasper2.patch @@ -0,0 +1,13 @@ +diff -up devil-1.7.8/src-IL/src/il_jp2.c~ devil-1.7.8/src-IL/src/il_jp2.c +--- devil-1.7.8/src-IL/src/il_jp2.c~ 2009-03-08 08:10:09.000000000 +0100 ++++ devil-1.7.8/src-IL/src/il_jp2.c 2016-12-04 14:03:14.853568085 +0100 +@@ -459,7 +459,7 @@ static void jas_stream_initbuf(jas_strea + /* The buffer must be large enough to accommodate maximum + putback. */ + assert(bufsize > JAS_STREAM_MAXPUTBACK); +- stream->bufbase_ = JAS_CAST(uchar *, buf); ++ stream->bufbase_ = JAS_CAST(unsigned char *, buf); + stream->bufsize_ = bufsize - JAS_STREAM_MAXPUTBACK; + } + } else { +