[tex-live] dvisvgm with libgs on mac os x

jfbu jfbu at free.fr
Mon Mar 12 16:38:06 CET 2018


Le 12 mars 2018 à 12:50, jfbu <jfbu at free.fr> a écrit :

> 
> Le 12 mars 2018 à 00:26, Mojca Miklavec <mojca.miklavec.lists at gmail.com> a écrit :
> 
>> On 12 March 2018 at 00:02, jfbu wrote:
>>> hi,
>>> 
>>> asking for help on how to compile dvisvgm from TeXLive sources
>>> so that it can locate the libgs library on my mac which is at
>>> /opt/local/lib
>>> 
>>> (/opt/local/lib/libgs.dylib is a symlink to libgs.9.22.dylib)
>>> 
>>> With the vanilla ./Build produced dvisvgm, I need to pass --libgs option
>>> to dvisvgm binary when using it like this
>>> 
>>> $ dvisvgm --libgs="/opt/local/lib/libgs.dylib" temp.dvi
>>> 
>>> and it does work fine (temp.dvi contains 18 postscript specials)
>> 
>> I would try with
>>   export LDFLAGS="-L/opt/local/lib"
>>   export CXXFLAGS="-I/opt/local/include"
> 
> 
> I have tried but this does not suffice (details below)

Turns out I needed also to set CPPFLAGS in order for AC_CHECK_HEADERS
in the /texk/dvisvgm/configure.ac to work as expected

Perhaps ok the latest patch to the TeXLive sources discussed at
http://tug.org/pipermail/tlbuild/2018q1/004094.html
was needed, I don't know.

Anyway I now get into the desired 

checking ghostscript/iapi.h usability... yes
checking ghostscript/iapi.h presence... yes
checking for ghostscript/iapi.h... yes
checking for gsapi_revision in -lgs... yes
checking Ghostscript version... "922"


But the process then ends with a report of 8 errors of similar nature

../../../../../texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp:78:48: error: unknown
      type name 'CommandLine'
static string get_transformation_string (const CommandLine &args) {
                                               ^

and 

../../../../../texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp:307:9: error: use of
      undeclared identifier 'CL'
                throw CL::CommandLineException(msg);


I assume I have messed up things with my 

$ export CPPFLAGS='-I/opt/local/include'

I must have overwritten some other config.

I don't want to occupy to much this mailing list though,
so I will only report later on in case I solve this
and do get my dvisvgm 2.3.3 with Postscript support

Best

Jean-François

>> 
>> But keep in mind that when ghostscript gets updated, you might need to
>> recompile the binary. Why don't you use
>>   sudo port install dvisvgm
>> instead?
> 
> Indeed the dvisvgm  from MacPorts does find /opt/local/lib/libgs.dylib
> I did port upgrade outdated the other day and ghostscript was
> moved to 9.22, and the texlive binaries were updated including dvisvgm
> (to binaries from October 2017)
> 
>> 
>> I tried to update it just now (the latest version is not in the repo
>> yet). Two tests fail:
>> FAIL: DVIReaderTest
>> FAIL: FontManagerTest
>> but I'm not sure about how the situation was before.
>> 
>>> I tried to play with the configure options listed at
>>> 
>>> http://tug.org/texlive/doc/tlbuild.html#Configure-options-for-texk_002fdvisvgm
>>> 
>>> my last attempt did
>>> 
>>> Work$ ../configure --disable-all-pkgs --disable-native-texlive-build --enable-multiplatform --prefix="/opt/local" --disable-cxx-runtime-hack --enable-dvisvgm --with-system-libgs --with-libgs-includes="/opt/local/include/ghostscript" --with-libgs-libdir="/opt/local/lib/"
>>> 
>>> but it did not seem to succeed.
>>> 
>>> Is there something wrong in my environment variables
>> 
>> No. But when neither pkg-config nor cmake know where to find the
>> binaries, you need to provide explicit hints.
>> 
>>> (I noticed /opt/local/lib is not in my PATH, I have no idea if that matters)
>> 
>> It should not be.
>> 
>>> I googled a bit for location of dylib's on the mac, and found no
>>> immediately usable answer
>> 
>> They are spread all over the place. The dylibs in /opt/local/lib
>> (usually) come from MacPorts, but that's by far not the only place
>> where you can find them. Usually each .app bundle ships its own copy
>> of libraries.
> 
> 
> Thanks for the info. My situation is seen is the following
> 
> Work$ echo $CXXFLAGS
> -I/opt/local/include
> 
> Work$ echo $LDFLAGS
> -L/opt/local/lib
> 
> Work$ ../configure --disable-all-pkgs --disable-native-texlive-build --enable-multiplatform --prefix="/opt/local" --enable-dvisvgm --with-system-libgs
> 
> (or various variants)
> 
> Then I do the "make" and from its voluminous output I extract the following
> 
> === configuring in dvisvgm (/opt/src/tldevsrc/source/Work/texk/dvisvgm)
> [lines snipped]
> checking ghostscript/iapi.h usability... no
> checking ghostscript/iapi.h presence... no
> checking for ghostscript/iapi.h... no
> checking for dlopen in -ldl... yes
> configure: not linking to libgs, trying to arrange for dynamic loading
> 
> But I have :
> 
> Work$ pushd /opt && find . -name 'iapi.h' && popd
> /opt /opt/src/tldevsrc/source/Work /opt
> ./local/include/ghostscript/iapi.h
> ./src/tldevsrc/source/texk/dvisvgm/dvisvgm-src/src/iapi.h
> /opt/src/tldevsrc/source/Work /opt
> 
> 
> Then I tried manually editing the Makefile in Work/texk/dvisvgm
> 
> LDFLAGS = -L/opt/local/lib
> LIBGS_INCLUDES = -I/opt/local/include/ghostscript
> LIBGS_LIBS = /opt/local/lib/libgs.dylib
> 
> where the LDFLAGS was already as above
> 
> but I am not sure which target to use for make there, and anyway
> it doesn't work
> 
> I am just completely unknowledgeable about the autoconf machinery
> etc, hence I have some difficulties understanding these Makefiles
> 
> Best
> 
> Jean-François




More information about the tex-live mailing list