[vips/f18] Update to 7.28.5 and backport some patches
Benjamin Gilbert
bgilbert at fedoraproject.org
Thu Oct 18 22:06:43 UTC 2012
commit 76bea1f33b4274fccb39068ba0ffc7bf78e7495a
Author: Benjamin Gilbert <bgilbert at backtick.net>
Date: Wed Oct 17 23:18:41 2012 -0400
Update to 7.28.5 and backport some patches
.gitignore | 2 +-
sources | 2 +-
vips-7.28.5-cache-string-equality.patch | 23 +++++++++++++
vips-7.28.5-malformed-jpeg-double-free.patch | 45 +++++++++++++++++++++++++
vips-7.28.5-tiff-rowsperstrip.patch | 27 +++++++++++++++
vips-7.28.5-vips7-option-parsing.patch | 40 ++++++++++++++++++++++
vips-7.28.5-vips8-more-moreeq.patch | 29 ++++++++++++++++
vips-7.28.5-vips_sign.patch | 25 ++++++++++++++
vips-7.28.5-wopconst.patch | 16 +++++++++
vips.spec | 46 ++++++++++++++++++++++++--
10 files changed, 250 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7a71dc7..95c57d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/vips-7.28.2.tar.gz
+/vips-7.28.5.tar.gz
diff --git a/sources b/sources
index b28227b..db9bd04 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1a46826029a981ddbb31295dc56a7d4a vips-7.28.2.tar.gz
+1d90ce705b4d7f81176e23dd790e280a vips-7.28.5.tar.gz
diff --git a/vips-7.28.5-cache-string-equality.patch b/vips-7.28.5-cache-string-equality.patch
new file mode 100644
index 0000000..c842fb1
--- /dev/null
+++ b/vips-7.28.5-cache-string-equality.patch
@@ -0,0 +1,23 @@
+diff --git a/libvips/iofuncs/cache.c b/libvips/iofuncs/cache.c
+index 8acb992..5f02db9 100644
+--- a/libvips/iofuncs/cache.c
++++ b/libvips/iofuncs/cache.c
+@@ -253,9 +253,15 @@ vips_value_equal( GParamSpec *pspec, GValue *v1, GValue *v2 )
+ if( generic == G_TYPE_PARAM_DOUBLE )
+ return( g_value_get_double( v1 ) ==
+ g_value_get_double( v2 ) );
+- if( generic == G_TYPE_PARAM_STRING )
+- return( strcmp( g_value_get_string( v1 ),
+- g_value_get_string( v2 ) ) == 0 );
++ if( generic == G_TYPE_PARAM_STRING ) {
++ const char *s1 = g_value_get_string( v1 );
++ const char *s2 = g_value_get_string( v2 );
++
++ if( s1 == s2 )
++ return( TRUE );
++ else
++ return( s1 && s2 && strcmp( s1, s2 ) == 0 );
++ }
+ if( generic == G_TYPE_PARAM_BOXED )
+ return( g_value_get_boxed( v1 ) ==
+ g_value_get_boxed( v2 ) );
diff --git a/vips-7.28.5-malformed-jpeg-double-free.patch b/vips-7.28.5-malformed-jpeg-double-free.patch
new file mode 100644
index 0000000..4c3f901
--- /dev/null
+++ b/vips-7.28.5-malformed-jpeg-double-free.patch
@@ -0,0 +1,45 @@
+diff --git a/libvips/foreign/jpeg2vips.c b/libvips/foreign/jpeg2vips.c
+index 33908ed..925c801 100644
+--- a/libvips/foreign/jpeg2vips.c
++++ b/libvips/foreign/jpeg2vips.c
+@@ -135,7 +135,6 @@ typedef struct _ReadJpeg {
+
+ /* Used for file input only.
+ */
+- FILE *fp;
+ char *filename;
+
+ struct jpeg_decompress_struct cinfo;
+@@ -179,7 +178,7 @@ readjpeg_free( ReadJpeg *jpeg )
+ jpeg->decompressing = FALSE;
+ }
+
+- VIPS_FREEF( fclose, jpeg->fp );
++ VIPS_FREEF( fclose, jpeg->eman.fp );
+ VIPS_FREE( jpeg->filename );
+ jpeg->eman.fp = NULL;
+ jpeg_destroy_decompress( &jpeg->cinfo );
+@@ -203,7 +202,6 @@ readjpeg_new( VipsImage *out, int shrink, gboolean fail )
+ jpeg->out = out;
+ jpeg->shrink = shrink;
+ jpeg->fail = fail;
+- jpeg->fp = NULL;
+ jpeg->filename = NULL;
+ jpeg->decompressing = FALSE;
+
+@@ -225,10 +223,9 @@ static int
+ readjpeg_file( ReadJpeg *jpeg, const char *filename )
+ {
+ jpeg->filename = g_strdup( filename );
+- if( !(jpeg->fp = vips__file_open_read( filename, NULL, FALSE )) )
++ if( !(jpeg->eman.fp = vips__file_open_read( filename, NULL, FALSE )) )
+ return( -1 );
+- jpeg->eman.fp = jpeg->fp;
+- jpeg_stdio_src( &jpeg->cinfo, jpeg->fp );
++ jpeg_stdio_src( &jpeg->cinfo, jpeg->eman.fp );
+
+ return( 0 );
+ }
+--
+1.7.11.7
+
diff --git a/vips-7.28.5-tiff-rowsperstrip.patch b/vips-7.28.5-tiff-rowsperstrip.patch
new file mode 100644
index 0000000..5f1db1d
--- /dev/null
+++ b/vips-7.28.5-tiff-rowsperstrip.patch
@@ -0,0 +1,27 @@
+diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c
+index 212d16c..301fbb3 100644
+--- a/libvips/foreign/tiff2vips.c
++++ b/libvips/foreign/tiff2vips.c
+@@ -1335,8 +1335,8 @@ tiff2vips_stripwise_generate( VipsRegion *or,
+ /* If necessary, unpack to destination.
+ */
+ if( !rtiff->memcpy ) {
+- int height = VIPS_MIN( rtiff->rows_per_strip,
+- or->im->Ysize - (r->top + y) );
++ int height = VIPS_MIN( VIPS_MIN( rtiff->rows_per_strip,
++ or->im->Ysize - (r->top + y) ), r->height );
+ int z;
+
+ for( z = 0; z < height; z++ ) {
+@@ -1386,6 +1386,11 @@ read_stripwise( ReadTiff *rtiff, VipsImage *out )
+ rtiff->strip_size = TIFFStripSize( rtiff->tiff );
+ rtiff->number_of_strips = TIFFNumberOfStrips( rtiff->tiff );
+
++ /* rows_per_strip can be 2**32-1, meaning the whole image. Clip this
++ * down to ysize to avoid confusing vips.
++ */
++ rtiff->rows_per_strip = VIPS_MIN( rtiff->rows_per_strip, t[0]->Ysize );
++
+ #ifdef DEBUG
+ printf( "read_stripwise: rows_per_strip = %u\n",
+ rtiff->rows_per_strip );
diff --git a/vips-7.28.5-vips7-option-parsing.patch b/vips-7.28.5-vips7-option-parsing.patch
new file mode 100644
index 0000000..fa8757a
--- /dev/null
+++ b/vips-7.28.5-vips7-option-parsing.patch
@@ -0,0 +1,40 @@
+diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c
+index 383e171..348a38f 100644
+--- a/libvips/iofuncs/util.c
++++ b/libvips/iofuncs/util.c
+@@ -565,16 +565,28 @@ vips_filename_suffix_match( const char *path, const char *suffixes[] )
+ char *
+ vips_getnextoption( char **in )
+ {
+- char *p = *in;
+- char *q = p;
++ char *p;
++ char *q;
++
++ p = *in;
++ q = p;
+
+ if( !p || !*p )
+ return( NULL );
+
+- /* Find the next ',' not prefixed with a '\'.
++ /* Find the next ',' not prefixed with a '\'. If the first character
++ * of p is ',', there can't be a previous escape character.
+ */
+- while( (p = strchr( p, ',' )) && p[-1] == '\\' )
++ for(;;) {
++ if( !(p = strchr( p, ',' )) )
++ break;
++ if( p == q )
++ break;
++ if( p[-1] != '\\' )
++ break;
++
+ p += 1;
++ }
+
+ if( p ) {
+ /* Another option follows this one .. set up to pick that out
+--
+1.7.11.7
+
diff --git a/vips-7.28.5-vips8-more-moreeq.patch b/vips-7.28.5-vips8-more-moreeq.patch
new file mode 100644
index 0000000..57dab17
--- /dev/null
+++ b/vips-7.28.5-vips8-more-moreeq.patch
@@ -0,0 +1,29 @@
+diff --git a/libvips/arithmetic/relational.c b/libvips/arithmetic/relational.c
+index 10da5b4..14bbbae 100644
+--- a/libvips/arithmetic/relational.c
++++ b/libvips/arithmetic/relational.c
+@@ -88,18 +90,16 @@ static int
+ vips_relational_build( VipsObject *object )
+ {
+ VipsRelational *relational = (VipsRelational *) object;
+- VipsArithmetic *arithmetic = (VipsArithmetic *) object;
++ VipsBinary *binary = (VipsBinary *) object;
+
+ if( relational->relational == VIPS_OPERATION_RELATIONAL_MORE ) {
+ relational->relational = VIPS_OPERATION_RELATIONAL_LESS;
+- VIPS_SWAP( VipsImage *,
+- arithmetic->ready[0], arithmetic->ready[1] );
++ VIPS_SWAP( VipsImage *, binary->left, binary->right );
+ }
+
+ if( relational->relational == VIPS_OPERATION_RELATIONAL_MOREEQ ) {
+ relational->relational = VIPS_OPERATION_RELATIONAL_LESSEQ;
+- VIPS_SWAP( VipsImage *,
+- arithmetic->ready[0], arithmetic->ready[1] );
++ VIPS_SWAP( VipsImage *, binary->left, binary->right );
+ }
+
+ if( VIPS_OBJECT_CLASS( vips_relational_parent_class )->build( object ) )
+--
+1.7.11.7
+
diff --git a/vips-7.28.5-vips_sign.patch b/vips-7.28.5-vips_sign.patch
new file mode 100644
index 0000000..15e7e32
--- /dev/null
+++ b/vips-7.28.5-vips_sign.patch
@@ -0,0 +1,25 @@
+diff --git a/libvips/arithmetic/sign.c b/libvips/arithmetic/sign.c
+index d643091..72dc5d8 100644
+--- a/libvips/arithmetic/sign.c
++++ b/libvips/arithmetic/sign.c
+@@ -57,7 +57,7 @@ typedef VipsUnaryClass VipsSignClass;
+ G_DEFINE_TYPE( VipsSign, vips_sign, VIPS_TYPE_UNARY );
+
+ #define CSIGN( TYPE ) { \
+- TYPE *p = (TYPE *) in; \
++ TYPE *p = (TYPE *) in[0]; \
+ TYPE *q = (TYPE *) out; \
+ int x; \
+ \
+@@ -82,7 +82,7 @@ G_DEFINE_TYPE( VipsSign, vips_sign, VIPS_TYPE_UNARY );
+ }
+
+ #define SIGN( TYPE ) { \
+- TYPE *p = (TYPE *) in; \
++ TYPE *p = (TYPE *) in[0]; \
+ signed char *q = (signed char *) out; \
+ int x; \
+ \
+--
+1.7.11.7
+
diff --git a/vips-7.28.5-wopconst.patch b/vips-7.28.5-wopconst.patch
new file mode 100644
index 0000000..971c2cc
--- /dev/null
+++ b/vips-7.28.5-wopconst.patch
@@ -0,0 +1,16 @@
+diff --git a/libvips/arithmetic/math2.c b/libvips/arithmetic/math2.c
+index 3869e9c..b6cfe6f 100644
+--- a/libvips/arithmetic/math2.c
++++ b/libvips/arithmetic/math2.c
+@@ -401,7 +403,7 @@ vips_math2_const_class_init( VipsMath2ConstClass *class )
+ _( "Operation" ),
+ _( "math to perform" ),
+ VIPS_ARGUMENT_REQUIRED_INPUT,
+- G_STRUCT_OFFSET( VipsMath2, math2 ),
++ G_STRUCT_OFFSET( VipsMath2Const, math2 ),
+ VIPS_TYPE_OPERATION_MATH2, VIPS_OPERATION_MATH2_POW );
+ }
+
+--
+1.7.11.7
+
diff --git a/vips.spec b/vips.spec
index 9ff2362..e334bf3 100644
--- a/vips.spec
+++ b/vips.spec
@@ -1,8 +1,9 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Name: vips
-Version: 7.28.2
-Release: 3%{?dist}
+# We can't ship a later 7.28.x because 7.28.6 has a soname bump
+Version: 7.28.5
+Release: 1%{?dist}
Summary: C/C++ library for processing large images
Group: System Environment/Libraries
@@ -10,7 +11,27 @@ License: LGPLv2+
URL: http://www.vips.ecs.soton.ac.uk/
Source0: http://www.vips.ecs.soton.ac.uk/supported/7.28/%{name}-%{version}.tar.gz
+# Pick up the most serious fixes from later in 7.28.x
+# This is somewhat haphazard
+#
+# Part of 75a68100bd131a232df7130f4d927e7f664a108f
+Patch0: vips-7.28.5-tiff-rowsperstrip.patch
+# 2f897315ad8fcce137ee356105bb0c69db5228de
+Patch1: vips-7.28.5-malformed-jpeg-double-free.patch
+# 97424321ac195b2138ac477f841c43ed88e25e9b
+Patch2: vips-7.28.5-vips_sign.patch
+# 91628efdda178324bfd3a6323298d6c11eb6f38e
+Patch3: vips-7.28.5-vips7-option-parsing.patch
+# cd1b215579847929b0fcecdefd3a5110181cc5da
+Patch4: vips-7.28.5-vips8-more-moreeq.patch
+# Part of 5363aace3910f569baa61ca956df38bccc13244e
+Patch5: vips-7.28.5-wopconst.patch
+# 4171f2673da8ddd743ed867abfbafc77c1502f23
+Patch6: vips-7.28.5-cache-string-equality.patch
+
+
BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(fftw3)
BuildRequires: pkgconfig(MagickWand)
@@ -45,6 +66,7 @@ against VIPS.
Summary: Development files for %{name}
Group: Development/Libraries
Requires: libjpeg-devel%{?_isa} libtiff-devel%{?_isa} zlib-devel%{?_isa}
+Requires: vips%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains the header files and
@@ -55,6 +77,7 @@ contains a C++ API and development man pages.
%package tools
Summary: Command-line tools for %{name}
Group: Applications/Multimedia
+Requires: vips%{?_isa} = %{version}-%{release}
%description tools
The %{name}-tools package contains command-line tools for working with VIPS.
@@ -63,6 +86,7 @@ The %{name}-tools package contains command-line tools for working with VIPS.
%package python
Summary: Python support for %{name}
Group: Development/Languages
+Requires: vips%{?_isa} = %{version}-%{release}
%description python
The %{name}-python package contains Python support for VIPS.
@@ -80,6 +104,14 @@ HTML and PDF formats.
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+
find . -name 'CVS' -type d -print0 | xargs -0 rm -rf
# make the version string consistent for multiarch
@@ -98,7 +130,7 @@ make %{?_smp_mflags} LIBTOOL=libtool
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT \( -name '*.la' -o -name '*.a' \) -exec rm -f {} ';'
-# delete doc (we will get it later with %doc)
+# delete doc (we will get it later with %%doc)
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/vips
# locale stuff
@@ -113,12 +145,14 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/vips
%files -f vips7.lang
%doc AUTHORS NEWS THANKS TODO COPYING ChangeLog
%{_libdir}/*.so.*
+%{_libdir}/girepository-1.0
%files devel
%{_includedir}/vips
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
+%{_datadir}/gir-1.0
%{_datadir}/gtk-doc
@@ -136,6 +170,12 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/vips
%changelog
+* Wed Oct 17 2012 Benjamin Gilbert <bgilbert at backtick.net> - 7.28.5-1
+- New release
+- Add some fixes from later 7.28.x
+- Enable gobject introspection
+- Add versioned dependency on base package
+
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 7.28.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
More information about the scm-commits
mailing list