My *nix world

Fix the dvisvgm-1.0.8.ebuild

Today I had to install some a Gentoo package that depends on the app-text/dvisvgm package. No problem, this happens all the time, right?

Well, sometimes (especially when you are not in the mood for such things) it happens that to compile/build a package it's not that easy. Just a small typo in a Makefile and everything turns against you:

x86_64-pc-linux-gnu-g++ -Wall -Wnon-virtual-dtor -O2 -pipe -march=native -mtune=native -fomit-frame-pointer -fno-var-tracking -m64 -fpic -I/usr/include/freetype2   -Wl,-O1 -Wl,--as-needed -lfreetype     -o dvisvgm dvisvgm.o gzstream.o libdvisvgm.a   ../potracelib/libpotrace.a   -lz -lgs -lkpathsea 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../x86_64-pc-linux-gnu/bin/ld: libdvisvgm.a(FontEngine.o): undefined reference to symbol 'FT_Init_FreeType'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../x86_64-pc-linux-gnu/bin/ld: note: 'FT_Init_FreeType' is defined in DSO /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/ so try adding it to the linker command line
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/ could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [dvisvgm] Error 1

That's not a real problem if this is not the first time when you fix such things.

First of all, the source of the problem, like the command line error says, is regarding the libfreetype library that, if even it's installed and working well on your system, it cannot be found by the GNU linker (ld) because that command line that invoked the linker it's not properly set.

If something like this happened to you then go to your /var/tmp/portage/app-text/dvisvgm-1.0.8/work/dvisvgm-1.0.8/src and edit the Makefile file such as replace the reference to -lfreetype with FREETYPE_{CFLAGS,LIBS} :

FREETYPE_CFLAGS = -I/usr/include/freetype2
LDFLAGS = -Wl,-O1 -Wl,--as-needed -FREETYPE_{CFLAGS,LIBS}

Now that you found the source of your problem you know what have to be patched. But how? I must repeat myself that this is not a real problem if this is not the first time when you fix such things.

  1. fetch and unpack the ebuild
ebuild /usr/portage/app-text/dvisvgm/dvisvgm-1.0.8.ebuild clean fetch unpack
  1. edit your Makefile as described above
  2. compile and if everything is fine then install and qmerge them with ebuild
ebuild /usr/portage/app-text/dvisvgm/dvisvgm-1.0.8.ebuild compile install qmerge

and you are done.


now you know to fix Gentoo dvisvgm-1.0.8.ebuild dependency.

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

The following two tabs change content below.
Fix the dvisvgm-1.0.8.ebuild

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
Fix the dvisvgm-1.0.8.ebuild

Latest posts by Eugen Mihailescu (see all)

Tagged on: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *