Page 1 of 1

Missing fonts/FreeSansBold.otf

Posted: 24 Oct 2011, 15:07
by SpliFF
When trying to build and run spring on Gentoo I get the error

Code: Select all

[f=0000000] [Font] Error: Failed creating font: Couldn't find font 'fonts/FreeSansBold.otf'.
Error: Spring: Incorrect/Missing content:  Failed to load font: fonts/FreeSansBold.otf
I've installed the freefonts-ttf package but no dice. I think this font is supposed to be part of spring content so maybe that didn't install. Any clues what might be going on?

One thing that might be relevant is I'm using "make spring-default" && "make install-spring-default" rather than the more typical "make spring && make install" as I'm testing a new gentoo ebuild which allows you to choose whether you want headless, dedicated, multithreaded, etc.

The weird part is this:

Code: Select all

# locate fonts/*.otf
/usr/share/games/spring/fonts/FreeSansBold.otf
So I seem to have the font, just in the wrong place? Wrong install prefix?

The relevant ebuild line is:

Code: Select all

cmake-utils_src_make install-spring-${build_type} DESTDIR="${D}"

Re: Missing fonts/FreeSansBold.otf

Posted: 24 Oct 2011, 15:21
by jK
check the stdout/infolog, it names the dirs it searches in.

Re: Missing fonts/FreeSansBold.otf

Posted: 24 Oct 2011, 21:09
by hoijui
also check the output of the "make install*" line, to see if it installs the font.
cant check anything right now, sorry.

Re: Missing fonts/FreeSansBold.otf

Posted: 27 Oct 2011, 02:03
by SpliFF
It's ONLY using my home directory as a data dir.

Code: Select all

Using read-write data directory: /home/spliff/.spring/

Code: Select all

access("/home/spliff/.spring/fonts/FreeSansBold.otf", R_OK) = -1 ENOENT (No such file or directory)
open("fonts/FreeSansBold.otf", O_RDONLY) = -1 ENOENT (No such file or directory)
My .springrc is empty. I deleted it deliberately to make sure it wasn't masking any issues for new users of the ebuild.

So the question is, other than editing .springrc (which isn't a solution for other users of the ebuild) how do I tell spring to also use /usr/share/games/spring/ as a read-only directory at install/configure time?

Re: Missing fonts/FreeSansBold.otf

Posted: 27 Oct 2011, 02:07
by jK
check the original ebuild?

Re: Missing fonts/FreeSansBold.otf

Posted: 27 Oct 2011, 04:28
by SpliFF
Sorry, I wasn't clear enough. My ebuild extends the original and the parts that seem applicable haven't changed.

Code: Select all

VERSION_DATADIR="${GAMES_DATADIR}/${PN}"
src_configure() {
   ...
   mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=/usr -DBINDIR=${GAMES_BINDIR#/usr/} -DLIBDIR=${LIBDIR#/usr/} -DDATADIR=${VERSION_DATADIR#/usr/}"
  
   cmake-utils_src_configure
}
The only relevant change I can think of is the original uses:

Code: Select all

src_install () {
    cmake-utils_src_install
    ...

... and the new version uses:

Code: Select all

src_install () {

    for build_type in default multithreaded headless dedicated
    do
        if use $build_type ; then
            cmake-utils_src_make install-spring-${build_type} DESTDIR="${D}"
        fi
    done
    ...
... because cmake-utils_src_install doesn't accept a target argument.

The only other MAJOR difference is spring itself.

Here's the new ebuild for reference: http://pastebin.com/bi8eyrJs
And the old: http://pastebin.com/d6pp8tib

I'm guessing the issue is soomething to do with this cmake arg: -DDATADIR=${VERSION_DATADIR#/usr/}"

I don't have a build log yet, but I can post one later if required.

Re: Missing fonts/FreeSansBold.otf

Posted: 27 Oct 2011, 04:34
by jK
It's late so I won't investigate myself, but you might want to check the ebuild helper file that implements `cmake-utils_src_install` and see how `mycmakeargs` is handled.

Re: Missing fonts/FreeSansBold.otf

Posted: 27 Oct 2011, 15:27
by SpliFF
I finally discovered what was wrong. I found I could run spring as root so it suddenly clicked it was a permissions issue. Turns out I forgot to add the user account to the 'games' group so the whole /usr/share/games path wasn't accessible.

I'd suggest in future spring provide some minimal log feedback when a datadir can't be read or doesn't exist. As things are there's no feedback to say why a datadir was ignored.