Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 319383 - media-gfx/xloadimage-4.1-r10 will not compile against tiff-4.0.0_beta5
Summary: media-gfx/xloadimage-4.1-r10 will not compile against tiff-4.0.0_beta5
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
: 319441 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-12 10:16 UTC by Billy DeVincentis
Modified: 2012-01-22 20:16 UTC (History)
15 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for new tiff-4 (xloadimage-4.1-tiff.patch,570 bytes, patch)
2010-05-14 08:08 UTC, Helmut Jarausch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Billy DeVincentis 2010-05-12 10:16:11 UTC
tiff.c: In function ‘is_tiff’:
tiff.c:45: error: ‘TIFFHeader’ undeclared (first use in this function)
tiff.c:45: error: (Each undeclared identifier is reported only once
tiff.c:45: error: for each function it appears in.)
tiff.c:45: error: expected ‘;’ before ‘th’
tiff.c:52: error: ‘th’ undeclared (first use in this function)
make: *** [tiff.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: media-gfx/xloadimage-4.1-r10 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line   48:  Called src_compile
 *   environment, line 2371:  Called _eapi2_src_compile
 *     ebuild.sh, line  640:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"
 * 
 * If you need support, post the output of 'emerge --info =media-gfx/xloadimage-4.1-r10',
 * the complete build log and the output of 'emerge -pqv =media-gfx/xloadimage-4.1-r10'.
 * The complete build log is located at '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/environment'.
 * S: '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/work/xloadimage.4.1'

>>> Failed to emerge media-gfx/xloadimage-4.1-r10, Log file:

>>>  '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/build.log'
 * 
 * The following package has failed to build or install:
 * 
 *  ('ebuild', '/', 'media-gfx/xloadimage-4.1-r10', 'merge'), Log file:
 *   '/var/tmp/portage/media-gfx/xloadimage-4.1-r10/temp/build.log'


Reproducible: Always
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2010-05-12 20:47:28 UTC
*** Bug 319441 has been marked as a duplicate of this bug. ***
Comment 2 Florian Faber 2010-05-13 08:07:38 UTC
This happens also if "-tiff" is used. Probably passing the tiff USE flag along to the configuration part is broken.
Comment 3 Helmut Jarausch 2010-05-14 08:08:09 UTC
Created attachment 231403 [details, diff]
Patch for new tiff-4

Builds fine here with this patch using media-libs/tiff-4.0.0_beta5
Comment 4 Ravi Pinjala 2010-05-14 23:17:12 UTC
The proposed patch works for me, on amd64
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2010-05-14 23:33:03 UTC
Has anyone tested the patch with tiff-3.9.2? It "needs" to be backwards compatible.
Comment 6 fkhp 2010-05-18 11:52:07 UTC
(In reply to comment #3)
> Created an attachment (id=231403) [details]
> Patch for new tiff-4
> 
> Builds fine here with this patch using media-libs/tiff-4.0.0_beta5
> 

this patch works, please put it in the package.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2010-05-18 16:36:31 UTC
(In reply to comment #6)
> (In reply to comment #3)
> > Created an attachment (id=231403) [details] [details]
> > Patch for new tiff-4
> > 
> > Builds fine here with this patch using media-libs/tiff-4.0.0_beta5
> > 
> 
> this patch works, please put it in the package.
> 

nope, it breaks the building with tiff-3.9.2

tiff.c: In function ‘is_tiff’:
tiff.c:45:3: error: ‘TIFFHeaderCommon’ undeclared (first use in this function)
tiff.c:45:3: note: each undeclared identifier is reported only once for each function it appears in
tiff.c:45:20: error: expected ‘;’ before ‘th’
tiff.c:52:27: error: ‘th’ undeclared (first use in this function)
Comment 8 Marca Alessandro 2010-05-19 14:05:38 UTC
Patch work for xloadimage-4.1-r10 +tiff
Comment 9 Honza Macháček 2010-05-20 04:00:13 UTC
(In reply to comment #5)
> Has anyone tested the patch with tiff-3.9.2? It "needs" to be backwards
> compatible.
> 

Not tested, just compared with the old tiff library sources. It is not backwards compatible.

I've hoped some #ifdef-ing might help, but I've found that the situation is much worse.

The good news: The old tiff library defines TIFF_VERSION, the new one TIFF_VERSION_CLASSIC. Testing #ifdef TIFF_VERSION_CLASSIC should do the work.

The bad news: The patch cannot actually work. If it works, or seems to work, its shear luck, or rather just an illusion. For one, it does not patch all the appearances of TIFFHeader in the code, try `grep -r TIFFHeader /var/tmp/portage/media-gfx/xloadimage-4.1-r10/work/xloadimage.4.1/` after unpacking the ebuild. What's worse, it does not deal with TIFFDirEntry at all -- and try grepping for that.

Having unpacked the media-libs/tiff-4.0.0_beta5 ebuild, look at /var/tmp/portage/media-libs/tiff-4.0.0_beta5/work/tiff-4.0.0beta5/html/v4.0.0.html It says:

<quote>
Although it's rare, some application code does use structures like TIFFHeader or TIFFDirEntry that used to be an exact binary representation of TIFF structures. These need to change. The old TIFFHeader structure is replaced by the new TIFFHeaderClassic, TIFFHeaderBig, and TIFFHeaderCommon structures that are an exact binary representation of the ClassicTIFF and BigTIFF header, and of the part that is common to both. There is no new equivalent for the old TIFFDirEntry structure (or more precisely, there is still a TIFFDirEntry structure, but it is changed, moved to library-private definition, and no longer an exact binary representation of the tag structure of either TIFF version).
</quote>

Looks like adapting the xloadimage code to the new tiff library version will require cleaning of its use of boath TIFFHeader and TIFFDirEntry. It likely should have never used them at the first place. Parts of code will have to be identified, understood, and rewritten completely to use the (new) tiff library interface properly.

Since xloadimage seems to be completely dead upstream, no longer has a homepage available, hence no upstream whatsoever likely, it is probably going to be phased out unless somebody takes over it and becomes its new upstream.

Any volunteers?
Comment 10 J.Taimr 2010-05-23 17:54:42 UTC
(In reply to comment #9)
I do not know, how crucial it is, but I successfully merge xloadimage with the next patch:

--- tiff.c.orig 2010-05-10 19:24:57.000000000 +0200
+++ tiff.c      2010-05-10 19:26:49.000000000 +0200
@@ -18,7 +18,9 @@
  * lib.  But we want to use the system's shared libraries */
 /*#include "tiff/tiffio.h"*/
 #include <tiffio.h>
-
+#ifndef TIFFHeader
+  #define TIFFHeader TIFFHeaderClassic
+#endif  
 /* this structure contains all the information we care about WRT a TIFF
  * image.
  */

And, so far I did not observe any problems with tiff images...
Comment 11 Juergen Rose 2010-05-30 12:05:49 UTC
Also xloadimage-4.1-r11 fails to compile:
...
x86_64-pc-linux-gnu-gcc -march=nocona -O2 -pipe -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" undither.c
tiff.c: In function 'is_tiff':
tiff.c:45: error: 'TIFFHeader' undeclared (first use in this function)
tiff.c:45: error: (Each undeclared identifier is reported only once
tiff.c:45: error: for each function it appears in.)
tiff.c:45: error: expected ';' before 'th'
tiff.c:52: error: 'th' undeclared (first use in this function)
x86_64-pc-linux-gnu-gcc -march=nocona -O2 -pipe -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" value.c
make: *** [tiff.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: media-gfx/xloadimage-4.1-r11 failed:
 *   emake failed
Comment 12 Helmut Jarausch 2010-05-31 10:48:13 UTC
(In reply to comment #11)
> Also xloadimage-4.1-r11 fails to compile:
> ...
> x86_64-pc-linux-gnu-gcc -march=nocona -O2 -pipe -fomit-frame-pointer -c
> -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" undither.c
> tiff.c: In function 'is_tiff':
> tiff.c:45: error: 'TIFFHeader' undeclared (first use in this function)

Same here with tiff-4.0.0_beta5.
Applying my patch (see my attachment) solves this.
Helmut.
Comment 13 thanasis 2010-06-08 08:41:07 UTC
~x86:
...
686-pc-linux-gnu-gcc -march=native -O2 -pipe -msse3 -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" smooth.c
i686-pc-linux-gnu-gcc -march=native -O2 -pipe -msse3 -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" sunraster.c
i686-pc-linux-gnu-gcc -march=native -O2 -pipe -msse3 -fomit-frame-pointer -c -DHAVE_CONFIG_H -DSYSPATHFILE=\"/etc/X11/Xloadimage\" tiff.c
tiff.c: In function ‘is_tiff’:
tiff.c:45: σφάλμα: ‘TIFFHeader’ undeclared (first use in this function)
tiff.c:45: σφάλμα: (Each undeclared identifier is reported only once
tiff.c:45: σφάλμα: for each function it appears in.)
tiff.c:45: σφάλμα: expected ‘;’ before ‘th’
tiff.c:52: σφάλμα: ‘th’ undeclared (first use in this function)
make: *** [tiff.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: media-gfx/xloadimage-4.1-r11 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line   54:  Called src_compile
 *   environment, line 2849:  Called _eapi2_src_compile
 *     ebuild.sh, line  646:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"
Comment 14 Andrew Savchenko gentoo-dev 2010-06-16 20:29:57 UTC
Patch xloadimage-4.1-tiff.patch from Helmut works for me.
I tested on xloadimage-4.1-r11, tiff-4.0.0_beta5 and some tiff images.

However, xloadimage is unable to open several tiff files with the following:
"Can't handle TIFF RGB images with 4 samples per pixel, sorry"
Though, it seems to be unrelated issue.
Comment 15 Ricardo I. Vieitez 2010-08-08 04:57:01 UTC
In my case, with tiff-4.0.0_beta6, and the same version of xloadimage, I need the TIFFHeaderCommon construct rather than the proposed TIFFHeader.
Comment 16 Kornelis 2011-01-02 13:26:10 UTC
Problem still exists in xloadimage-4.1-r11 (+tiff). Building with USE="-tiff" works around the problem though.

My build log (using +tiff): http://pastebin.com/vQBy6jxc.
Comment 17 Andrew Savchenko gentoo-dev 2011-01-05 08:09:53 UTC
(In reply to comment #16)
> Problem still exists in xloadimage-4.1-r11 (+tiff). Building with USE="-tiff"
> works around the problem though.

Have you tried proposed patch? It works for me with xloadimage-4.1-r11 (+tiff) and tiff-4.0.0._beta6.
Comment 18 Ludovic Bellier 2011-01-15 13:43:28 UTC
I had the same problem with xloadimage 4.1-r11 and tiff 4.0.0_beta6, and the above Helmut Jarausch patch resolved it.

Thank's Helmut.
Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2012-01-22 20:16:32 UTC
I used a bit different method, but essentially it's the same as the attached patch...

+  22 Jan 2012; Samuli Suominen <ssuominen@gentoo.org>
+  xloadimage-4.1-r11.ebuild:
+  Fix building with media-libs/tiff >= 4.0.0_pre wrt #319383 by Helmut Jarausch