Emerging from scratch several times, I get that the search path in Ghostscript has the original Gentoo build directory embedded within it, concequently it cannot find some of it's files when I try to run it: ------------------------------------------------------- Search path: . : /var/tmp/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/lib : /usr/share/fonts/default/ghostscript/ : /usr/share/fonts : /usr/share/fonts/ttf/zh_TW : /usr/share/fonts/ttf/zh_CN : /usr/share/fonts/arphicfonts : /usr/share/fonts/ttf/korean/baekmuk : /usr/share/fonts/baekmuk-fonts : /usr/X11R6/lib/X11/fonts/truetype : /usr/share/fonts/kochi-substitute For more information, see /var/tmp/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/doc/Use.htm. ------------------------------------------------------- Everything works fine when I "cd /usr/share/ghostscript/7.07" since it can then find the files. Reproducible: Always Steps to Reproduce: 1. 2. 3.
I can confirm this also gs --help gives Search path: . : /tmp/portage/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/lib : /usr/share/fonts/default/ghostscript/ : /usr/share/fonts : /usr/share/fonts/ttf/zh_TW : /usr/share/fonts/ttf/zh_CN : /usr/share/fonts/arphicfonts : /usr/share/fonts/ttf/korean/baekmuk : /usr/share/fonts/baekmuk-fonts : /usr/X11R6/lib/X11/fonts/truetype : /usr/share/fonts/kochi-substitute For more information, see /tmp/portage/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/doc/Use.htm.
remerging ghostscript will help
Even after re-merging, I have this same problem. gs -help: --------------------------------------------- Search path: . : /var/tmp/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/lib : /usr/share/fonts/default/ghostscript/ : /usr/share/fonts : /usr/share/fonts/ttf/zh_TW : /usr/share/fonts/ttf/zh_CN : /usr/share/fonts/arphicfonts : /usr/share/fonts/ttf/korean/baekmuk : /usr/share/fonts/baekmuk-fonts : /usr/X11R6/lib/X11/fonts/truetype : /usr/share/fonts/kochi-substitute For more information, see /var/tmp/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/doc/Use.htm. ---------------------------------------------
Please paste the output of `emerge info`.
Output of `emerge info`: Portage 2.0.51-r2 (default-x86-1.4, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.8.1-ck4 i686) ================================================================= System uname: 2.6.8.1-ck4 i686 Intel(R) Pentium(R) 4 Mobile CPU 1.70GHz Gentoo Base System version 1.5.3 Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux-headers-2.4.19-r1,sys-kernel/linux-headers-2.4.21-r1 Libtools: sys-devel/libtool-1.4.3-r4 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium4 -funroll-loops -pipe -fprefetch-loop-arrays" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium4 -funroll-loops -pipe -fprefetch-loop-arrays" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache distlocks sandbox" GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/[myuser]/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X aalib acpi alsa apm arts avi berkdb bitmap-fonts cdr crypt cups dvd dvdr encode esd f77 foomaticdb gdbm gif gnupg gphoto2 gpm gtk gtk2 imap imlib java jpeg libg++ libwww mad mikmod mmx motif mpeg msn ncurses nls oggvorbis opengl oss pam pdflib perl png ppds python qt quicktime readline sdl slang spell sse ssl svga tcltk tcpd tetex truetype usb usb2 x86 xinerama xml2 xmms xv zlib"
I couldn't reproduce the bug with almost the same environemnt :( Please define PORT_LOGDIR and attach the log of `emerge ghostscript` created in that directory.
Created attachment 42911 [details] emerge log Here is the log of an emerge
Thanks, the log helped me finding the bug. I reproduced it with MAKEOPTS="-j2". I think I fixed the bug with the latest -r7, so please test it and report back whether it works.
Same problem here, with the latest -r7 ebuild. I put MAKEOPTS="j1" into my make.conf and it didn't make any difference. Still getting "/var/tmp/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/lib" as output of "gs -?" I could generate some logs if that would be helpful.
All right Mike, I modified -r7 a little more. If that doesn't solve the issue, please attach an emerge log.
Created attachment 43070 [details] gzipped emerge log Didn't work. Did 'emerge sync' and checked that ebuild file was updated then 'PORT_LOGDIR="/root" emerge ghostscript', and 'gs -?' still gives me '/var/tmp/portage/ghostscript-7.07.1-r7/image//usr/share/ghostscript/7.07/lib'. Attaching gzipped emerge log.
Okay, thanks for testing. I added DESTDIR patch and this should solve the issue. Please run emerge sync and try again.
Actually I think I've found a typo in the ebuild file. Line number 66 needs to be: sed -i -e 's:$(gsdatadir)/lib:/usr/share/ghostscript/7.07/$(get_libdir):'\ rather than the original: sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/7.07/$(get_libdir):"\ After this change I reemerged ghostscript and the problem was gone.
Mike, it should not be so. $(get_libdir) is Portage function, not a Makefile variable. If you change that to single quote, it will be expanded to null string.
I was a bit too quick with my previous post. I'll try to explain. I still believe that the line sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/7.07/$(get_libdir):"\ does not do what it is supposed to do. I am not familiar with script programming and the syntax of sed, so I experimented a little. I extracted Makefile.in from espgs-7.07.1-source.tar.bz2 and ran the command sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/7.07/$(get_libdir):" Makefile.in in shell. After that I compared the resulting Makefile.in with the original. The files were identical. Apparently the match-and-raplace command didn't match anything. Then I ran the command sed -i -e 's:$(gsdatadir)/lib:/usr/share/ghostscript/7.07/$(get_libdir):' Makefile.in in the shell. This time it did modify the file. So I concluded that the double quotes and backslashes were the problem and modified the ebuild. After reemerging ghostscript the 'gs -?' gave me /usr/share/ghostscript/7.07/ which is not quite what we want. So I modified the above mentioned line again: sed -i -e 's:$(gsdatadir)/lib:/usr/share/ghostscript/7.07/lib:' \ and reemerged ghostscript again. This time 'gs -?' gave the expected result: /usr/share/ghostscript/7.07/lib I don't know what the significance of $(get_libdir) is. Anyway, I found a fix that works for me. Hope this helps.
Thanks for all your help. That solves the problem for me, hopefully everyone else gets their problem solved too.
Mike: right, sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/7.07/$(get_libdir):" Makefile.in should be sed -i -e "s:\$(gsdatadir)/lib:/usr/share/ghostscript/7.07/$(get_libdir):" Makefile.in $(get_libdir) is a function for 64bit environment. kugelfang: will you have a look at it, as you seem to change the sed line? It was actually - sed -i -e 's:$(gsdatadir)/lib:/usr/share/ghostscript/7.07/lib:' Makefile.in + sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/7.07/$(get_libdir):" \ + Makefile.in || die "sed failed" before.