Bug 689466

Summary: GS doesn't install headers (iapi.h, ierrors.h, ...)
Product: Ghostscript Reporter: Sebastian <sebastian_ml>
Component: Config/InstallAssignee: Ralph Giles <ralph.giles>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: 8.54   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---

Description Sebastian 2007-09-19 06:05:40 UTC
Hello all,

I found that ghostscript-gpl doesn't install any headers other applications 
might rely upon.

For instance, imagemagick runs ghostscript tests and checks for iapi.h and 
ierrors.h in /usr/include/ghostscript but can't find them.

I'm not sure how "grave" this really is, but I thought I should bring it up.

Regards
Sebastian
Comment 1 Sebastian 2007-09-19 06:35:00 UTC
There are actually two tests for ghostscript in imagemagick.
First:

-------------------------------------------------------------
Checking for Ghostscript support
-------------------------------------------------------------
checking ghostscript/iapi.h usability... no
checking ghostscript/iapi.h presence... no
checking for ghostscript/iapi.h... no
checking ghostscript/ierrors.h usability... no
checking ghostscript/ierrors.h presence... no
checking for ghostscript/ierrors.h... no
checking for gsapi_new_instance in Ghostscript framework... no
checking for gsapi_new_instance in -lgs... yes
checking if Ghostscript package is complete... no -- some components failed 
test

Second:
-------------------------------------------------------------
Checking for Ghostscript support
-------------------------------------------------------------
checking for Ghostscript version... 8.54
checking for gs alpha device... pngalpha
checking for gs color device... pnmraw
checking for gs CMYK device... Unknown device: pam
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
    defaultdevice
    bmpsep8
    checking for gs mono device... pnmraw
    checking for gs PDF writing device... pdfwrite
    checking for gs PS writing device... pswrite
    checking for gs EPS writing device... epswrite
    -------------------------------------------------------------

When the ghostscript headers are installed the imagemagick libs pdf.so and 
ps.so at least show different linking.

ldd output when ghostscript headers aren't installed before installing 
imagemagick:

ldd /usr/lib/ImageMagick-6.3.4/modules-Q16/coders/ps.so
        linux-gate.so.1 =>  (0xb7f9f000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f06000)
        libz.so.1 => /lib/libz.so.1 (0xb7ef4000)
        libMagick.so.10 => /usr/lib/libMagick.so.10 (0xb7cfb000)
        libm.so.6 => /lib/libm.so.6 (0xb7cd6000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7cbf000)
        libc.so.6 => /lib/libc.so.6 (0xb7b99000)
        liblcms.so.1 => /usr/lib/liblcms.so.1 (0xb7b69000)
        libtiff.so.3 => /usr/lib/libtiff.so.3 (0xb7b14000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb7af5000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7aca000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb7abc000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0xb7ab3000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0xb7a9c000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb79b0000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0xb7960000)
        libbz2.so.1 => /lib/libbz2.so.1 (0xb7951000)
        libdl.so.2 => /lib/libdl.so.2 (0xb794d000)
        /lib/ld-linux.so.2 (0x80000000)
        libjbig.so => /usr/lib/libjbig.so (0xb7940000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7823000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb7820000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb781b000)

When the headers are installed it looks like this:
ldd /usr/lib/ImageMagick-6.3.4/modules-Q16/coders/ps.so
        linux-gate.so.1 =>  (0xb7f0e000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7e75000)
        libz.so.1 => /lib/libz.so.1 (0xb7e63000)
        libMagick.so.10 => /usr/lib/libMagick.so.10 (0xb7c6a000)
        libgs.so.8 => /usr/lib/libgs.so.8 (0xb7711000)
        libm.so.6 => /lib/libm.so.6 (0xb76ec000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb76d5000)
        libc.so.6 => /lib/libc.so.6 (0xb75ae000)
        liblcms.so.1 => /usr/lib/liblcms.so.1 (0xb757f000)
        libtiff.so.3 => /usr/lib/libtiff.so.3 (0xb752a000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb750b000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb74e0000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb74d2000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0xb74c8000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0xb74b2000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb73c6000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0xb7376000)
        libbz2.so.1 => /lib/libbz2.so.1 (0xb7367000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7363000)
        libcups.so.2 => /usr/lib/libcups.so.2 (0xb7333000)
        libcupsimage.so.2 => /usr/lib/libcupsimage.so.2 (0xb731d000)
        /lib/ld-linux.so.2 (0x80000000)
        libjbig.so => /usr/lib/libjbig.so (0xb7311000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb71f4000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb71f1000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb71eb000)
        libgnutls.so.13 => /usr/lib/libgnutls.so.13 (0xb717d000)
        libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb716e000)
        libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0xb7121000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb711d000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb70ee000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb70cb000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb70b5000)
Comment 2 Sebastian 2007-09-19 06:36:29 UTC
Just to clarify: In case the headers are missing the imagemagick libs don't 
link to libgs.so.8.
Comment 3 Ralph Giles 2007-09-27 13:29:43 UTC
Fixed in r8255. Thanks for the report.
Comment 4 Sebastian 2007-09-28 03:22:20 UTC
Thank you!
Comment 5 Sebastian 2007-10-18 07:23:03 UTC
Ralph, the patch doesn't work :) The headers aren't installed when using 8.60
with patch applied.
Comment 6 Ralph Giles 2007-10-18 15:50:17 UTC
$ ls /usr/local/include/ghostscript
ls: /usr/local/include/ghostscript: No such file or directory
$ sudo make soinstall
[...]
$ ls /usr/local/include/ghostscript
iapi.h  ierrors.h

Can you be more specific?
Comment 7 Sebastian 2007-10-18 19:36:16 UTC
Sorry, was on the move when I wrote yesterday.

I'm using the Gentoo 8.60 ebuild with changes. The original is here:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/ghostscript-gpl-8.60.ebuild?rev=1.1&view=markup

I added ghostscript-8.60-headers.diff which is the same as your patch (
http://cvs.ghostscript.com/cgi-bin/viewcvs.cgi/ghostscript/trunk/gs/src/Makefile.in?rev=8255&r1=8250&r2=8255
)

I also added autogen.sh execution before running configure but that didn't
change things wrt header installation.

The last change I made was the "make install" line. It was "make install" and
now it's "make soinstall install". Building is done with "make so all".

Headers still don't get installed. I'm probably just missing something basic.

Any ideas? I could wait for a new release but I'd rather have it working with a
patched 8.60 because who knows when a new release would hit Gentoo.

Thanks!
Sebastian
Comment 8 Sebastian 2007-10-20 00:08:58 UTC
Ok, it's all my fault :) I did apply the Makefile.in diff but forgot about some
.mak files.

One thing, though. The new headers are installed 755 instead 644 (the ijs
headers are installed 644 just fine).
Comment 9 Ralph Giles 2007-10-20 10:44:27 UTC
Oh good. And it wasn't a total loss. I noticed the permissions problem too and
fixed it in r8302.

http://ghostscript.com/pipermail/gs-cvs/2007-October/007881.html
Comment 10 Sebastian 2007-10-20 23:23:16 UTC
Thanks!