Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 503690 - media-gfx/imagemagick-6.8.8.5 USE=pdf with app-text/mupdf-1.2 - configure: checking for fz_new_context in -lmupdf... no
Summary: media-gfx/imagemagick-6.8.8.5 USE=pdf with app-text/mupdf-1.2 - configure: ch...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Graphics Project
URL: http://www.imagemagick.org/discourse-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-07 04:56 UTC by Alexander Miller
Modified: 2014-04-07 19:24 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Miller 2014-03-07 04:56:07 UTC
(1) imagemagick-6.8.8.5 does not use mupdf anywhere in its code except for the configure script. The pdf coder does not need mupdf. 
(2) configure fails to recognize mupdf-1.2 (didn't bother to check other versions because of (1)).

So please remove mupdf from *DEPEND.

Here's the reason for (2):

from imagemagick's build log:
-------------------------------------------------------------
checking for MUPDF... 
checking mupdf/fitz.h usability... no
checking mupdf/fitz.h presence... no
checking for mupdf/fitz.h... no
checking for fz_new_context in -lmupdf... no
checking if MUPDF package is complete... no
-------------------------------------------------------------
[...]
                  Option                        Value
-------------------------------------------------------------------------------
[...]
MUPDF             --with-mupdf=yes              no

but mupdf provides the following files:
$ qlist mupdf|egrep 'include|lib.*so'
/usr/include/memento.h
/usr/include/muxps.h
/usr/include/mupdf-internal.h
/usr/include/mupdf.h
/usr/include/mucbz.h
/usr/include/fitz-internal.h
/usr/include/fitz.h
/usr/include/muxps-internal.h
/usr/lib64/libfitz.so.1.2
/usr/lib64/libfitz.so

Both the header and the library names differ from the values imagemagick's configure expects. But again: it wouldn't be used anyway.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-07 15:45:11 UTC
(In reply to Alexander Miller from comment #0)
> (1) imagemagick-6.8.8.5 does not use mupdf anywhere in its code except for
> the configure script. The pdf coder does not need mupdf.

You're wrong there.

> (2) configure fails to recognize mupdf-1.2 (didn't bother to check other
> versions because of (1)).

This is the important bit.

> checking for MUPDF... 
> checking mupdf/fitz.h usability... no
> checking mupdf/fitz.h presence... no
> checking for mupdf/fitz.h... no

app-text/mupdf-1.2 installs this as /usr/include/fitz.h .

> checking for fz_new_context in -lmupdf... no

app-text/mupdf-1.2 installs this as /usr/${libdir}/libfitz.so* .

> checking if MUPDF package is complete... no


> -------------------------------------------------------------
> [...]
>                   Option                        Value
> -----------------------------------------------------------------------------
> --
> [...]
> MUPDF             --with-mupdf=yes              no
> 
> but mupdf provides the following files:
> $ qlist mupdf|egrep 'include|lib.*so'
> /usr/include/memento.h
> /usr/include/muxps.h
> /usr/include/mupdf-internal.h
> /usr/include/mupdf.h
> /usr/include/mucbz.h
> /usr/include/fitz-internal.h
> /usr/include/fitz.h
> /usr/include/muxps-internal.h
> /usr/lib64/libfitz.so.1.2
> /usr/lib64/libfitz.so
> 
> Both the header and the library names differ from the values imagemagick's
> configure expects. But again: it wouldn't be used anyway.

Yes it would. imagemagick wants to link against libmupdf (but it isn't found):
# pkg-config --libs mupdf
-lfitz -ljpeg -ljbig2dec -lfreetype -lopenjpeg

It ought to have used pkg-config instead.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2014-03-07 15:55:16 UTC
(In reply to Jeroen Roovers from comment #1)
> (In reply to Alexander Miller from comment #0)
> > (1) imagemagick-6.8.8.5 does not use mupdf anywhere in its code except for
> > the configure script. The pdf coder does not need mupdf.
> 
> You're wrong there.
> 
> > (2) configure fails to recognize mupdf-1.2 (didn't bother to check other
> > versions because of (1)).
> 
> This is the important bit.
> 
> > checking for MUPDF... 
> > checking mupdf/fitz.h usability... no
> > checking mupdf/fitz.h presence... no
> > checking for mupdf/fitz.h... no
> 
> app-text/mupdf-1.2 installs this as /usr/include/fitz.h .

$ grep -r -i fitz *
configure:    ac_fn_c_check_header_mongrel "$LINENO" "mupdf/fitz.h" "ac_cv_header_mupdf_fitz_h" "$ac_includes_default"
configure:if test "x$ac_cv_header_mupdf_fitz_h" = xyes; then :
configure.ac:    AC_CHECK_HEADER(mupdf/fitz.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)

Only configure.ac is using it, so doesn't make much sense.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2014-03-07 16:32:35 UTC
Fixed in 6.8.8.5 by dropping the dependency and forcing configure to detect the files, even if they are not there

Fixed in 6.8.8.7 otherwise the same way, but it also removes USE="pdf" and always compiles the plug-in since it doesn't have any external dependencies

Major upstream issues indeed with the configure.ac, I can't figure out why it's checking for them.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-07 16:47:45 UTC
(In reply to Samuli Suominen from comment #2)
> (In reply to Jeroen Roovers from comment #1)
> > (In reply to Alexander Miller from comment #0)
> > > (1) imagemagick-6.8.8.5 does not use mupdf anywhere in its code except for
> > > the configure script. The pdf coder does not need mupdf.
> > 
> > You're wrong there.
> > 
> > > (2) configure fails to recognize mupdf-1.2 (didn't bother to check other
> > > versions because of (1)).
> > 
> > This is the important bit.
> > 
> > > checking for MUPDF... 
> > > checking mupdf/fitz.h usability... no
> > > checking mupdf/fitz.h presence... no
> > > checking for mupdf/fitz.h... no
> > 
> > app-text/mupdf-1.2 installs this as /usr/include/fitz.h .
> 
> $ grep -r -i fitz *
> configure:    ac_fn_c_check_header_mongrel "$LINENO" "mupdf/fitz.h"
> "ac_cv_header_mupdf_fitz_h" "$ac_includes_default"
> configure:if test "x$ac_cv_header_mupdf_fitz_h" = xyes; then :
> configure.ac:    AC_CHECK_HEADER(mupdf/fitz.h,passed=`expr $passed +
> 1`,failed=`expr $failed + 1`,)
> 
> Only configure.ac is using it, so doesn't make much sense.

MUPDF_LIBS is set to the wrong value, but it certainly is used:

work/ImageMagick-6.8.8-5 # grep -r MUPDF
coders/Makefile.am:coders_xps_la_LIBADD       = $(MAGICKCORE_LIBS) $(MUPDF_LIBS) $(FREETYPE_LIBS) $(MATH_LIBS)
configure.ac:# Check for MUPDF delegate library.
configure.ac:                    [enable MUPDF support])],
configure.ac:MUPDF_LIBS=''
configure.ac:    AC_MSG_CHECKING([for MUPDF])
configure.ac:    AC_MSG_CHECKING([if MUPDF package is complete])
configure.ac:            MUPDF_LIBS='-lmupdf'
configure.ac:            LIBS="$MUPDF_LIBS $LIBS"
configure.ac:            AC_DEFINE(MUPDF_DELEGATE,1,Define if you have MUPDF library)
configure.ac:AM_CONDITIONAL(MUPDF_DELEGATE,test "$have_mupdf" = 'yes')
configure.ac:AC_SUBST(MUPDF_LIBS)
configure.ac:MUPDF             --with-mupdf=$with_mupdf         $have_mupdf
magick/magick-baseconfig.h:/* Define if you have MUPDF library */
magick/magick-baseconfig.h:/* #undef MUPDF_DELEGATE */
Makefile.in:MUPDF_LIBS = @MUPDF_LIBS@
Makefile.in:coders_xps_la_LIBADD = $(MAGICKCORE_LIBS) $(MUPDF_LIBS) $(FREETYPE_LIBS) $(MATH_LIBS)
config/config.h.in:/* Define if you have MUPDF library */
config/config.h.in:#undef MUPDF_DELEGATE
configure:MUPDF_LIBS
configure:MUPDF_DELEGATE_FALSE
configure:MUPDF_DELEGATE_TRUE
configure:  --with-mupdf            enable MUPDF support
configure:# Check for MUPDF delegate library.
configure:MUPDF_LIBS=''
configure:    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MUPDF" >&5
configure:$as_echo_n "checking for MUPDF... " >&6; }
configure:    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if MUPDF package is complete" >&5
configure:$as_echo_n "checking if MUPDF package is complete... " >&6; }
configure:            MUPDF_LIBS='-lmupdf'
configure:            LIBS="$MUPDF_LIBS $LIBS"
configure:$as_echo "#define MUPDF_DELEGATE 1" >>confdefs.h
configure:  MUPDF_DELEGATE_TRUE=
configure:  MUPDF_DELEGATE_FALSE='#'
configure:  MUPDF_DELEGATE_TRUE='#'
configure:  MUPDF_DELEGATE_FALSE=
configure:if test -z "${MUPDF_DELEGATE_TRUE}" && test -z "${MUPDF_DELEGATE_FALSE}"; then
configure:  as_fn_error $? "conditional \"MUPDF_DELEGATE\" was never defined.
configure:MUPDF             --with-mupdf=$with_mupdf            $have_mupdf
configure:MUPDF             --with-mupdf=$with_mupdf            $have_mupdf
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-03-07 16:50:17 UTC
Yeah. It's insane. This works:

$ grep sed.*pdf imagemagick-6.8.8.*
imagemagick-6.8.8.5.ebuild:	sed -i -e '/LIBS/s:-lmupdf::' configure || die #503690
imagemagick-6.8.8.7.ebuild:	sed -i -e '/LIBS/s:-lmupdf::' configure || die #503690

Followed by succesful compile of the PDF plug-in:

media-gfx/imagemagick (/usr/lib64/ImageMagick-6.8.8/modules-Q16/coders/pdf.so)
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-07 17:11:28 UTC
(In reply to Samuli Suominen from comment #5)
> Yeah. It's insane. This works:
> 
> $ grep sed.*pdf imagemagick-6.8.8.*
> imagemagick-6.8.8.5.ebuild:	sed -i -e '/LIBS/s:-lmupdf::' configure || die
> #503690
> imagemagick-6.8.8.7.ebuild:	sed -i -e '/LIBS/s:-lmupdf::' configure || die
> #503690

You're mighty far away from configure.ac by now.

> Followed by succesful compile of the PDF plug-in:
> 
> media-gfx/imagemagick
> (/usr/lib64/ImageMagick-6.8.8/modules-Q16/coders/pdf.so)

We're talking about the xps plugin, not pdf:

Makefile.in:coders_xps_la_LIBADD = $(MAGICKCORE_LIBS) $(MUPDF_LIBS) $(FREETYPE_LIBS) $(MATH_LIBS)
coders/Makefile.am:coders_xps_la_LIBADD       = $(MAGICKCORE_LIBS) $(MUPDF_LIBS) $(FREETYPE_LIBS) $(MATH_LIBS)

configure.ac second-guesses it should look for fz_new_context in libmupdf, when it should be looking in libfitz instead.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2014-03-07 17:19:40 UTC
(In reply to Jeroen Roovers from comment #6)
> (In reply to Samuli Suominen from comment #5)
> > Yeah. It's insane. This works:
> > 
> > $ grep sed.*pdf imagemagick-6.8.8.*
> > imagemagick-6.8.8.5.ebuild:	sed -i -e '/LIBS/s:-lmupdf::' configure || die
> > #503690
> > imagemagick-6.8.8.7.ebuild:	sed -i -e '/LIBS/s:-lmupdf::' configure || die
> > #503690
> 
> You're mighty far away from configure.ac by now.

No I'm not, configure is generated from configure.ac, and the .ebuild doesn't use eautoreconf.

> 
> > Followed by succesful compile of the PDF plug-in:
> > 
> > media-gfx/imagemagick
> > (/usr/lib64/ImageMagick-6.8.8/modules-Q16/coders/pdf.so)
> 
> We're talking about the xps plugin, not pdf:

That's fine, neither needs mupdf or fitz. No linking of anykind or dlopen that I can see. Both pdf and xps build OK, as in, --with-mupdf works without mupdf installed.

> Makefile.in:coders_xps_la_LIBADD = $(MAGICKCORE_LIBS) $(MUPDF_LIBS)
> $(FREETYPE_LIBS) $(MATH_LIBS)
> coders/Makefile.am:coders_xps_la_LIBADD       = $(MAGICKCORE_LIBS)
> $(MUPDF_LIBS) $(FREETYPE_LIBS) $(MATH_LIBS)
> 
> configure.ac second-guesses it should look for fz_new_context in libmupdf,
> when it should be looking in libfitz instead.

Where does it use libfitz? Haven't seen any file yet. configure* and Makefile* doesn't count.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-07 17:32:36 UTC
Shame about bug #491876 then.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2014-03-07 17:37:05 UTC
(In reply to Jeroen Roovers from comment #8)
> Shame about bug #491876 then.

Yeah, no kidding.  I didn't expect this level of retardness from ImageMagick build system, and missed it.
I'm reporting this to the upstream forums, and we'll see, maybe there is something we don't know... If it says it needs mupdf, I'd expect it uses it, just don't understand how yet
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2014-03-07 17:37:38 UTC
So please don't drop keywords yet, give me a day or two :)
Comment 11 Alexander Miller 2014-03-07 22:48:52 UTC
I think USE="pdf" can be removed from 6.8.8.5, too.
And I'm not sure why you try to force mupdf detection, I don't see what difference it makes whether mupdf is enabled or disabled. Well, it tries to link an unneeded library, but you have disabled that. I think messing with the build system is not needed at all, --without-mupdf does the trick.
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2014-03-08 05:35:52 UTC
I'll leave 6.8.8.5 as-is, and stabilize newer imagemagick once I get the openjpeg-2 bug sorted out (bug 503692)
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2014-04-06 12:13:15 UTC
reported here:

http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=25363
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2014-04-07 19:24:25 UTC
(In reply to Samuli Suominen from comment #13)
> reported here:
> 
> http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=25363

and upstream committed a fix (no more mupdf check in configure.ac) to subversion :)