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/libfreetype.so so try adding it to the linker command line
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libfreetype.so: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [dvisvgm] Error 1That'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
FREETYPE_LIBS = -<strong>FREETYPE_{CFLAGS,LIBS}</strong>
...
LDFLAGS = -Wl,-O1 -Wl,--as-needed -<strong>FREETYPE_{CFLAGS,LIBS}</strong>
...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.
fetch and unpack the ebuild
ebuild /usr/portage/app-text/dvisvgm/dvisvgm-1.0.8.ebuild clean fetch unpackedit your Makefile as described above
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 qmergeand you are done.
Conclusion
now you know to fix Gentoo dvisvgm-1.0.8.ebuild dependency.
Comments
No comments yet
Be the first to leave a comment.
Leave a comment