You are not logged in.

#1 2010-07-05 06:02:19

scottfial
Member
Registered: 2010-03-20
Posts: 17

[SOLVED] PKGBUILD for a font - xset fails when X not running

I am working on my second PKGBUILD -- this time for a simple raster font I use.  The PKGBUILD uses a post_install() which does an "xset -fp rehash" after installing the font files, because it seemed like otherwise the font wouldn't show up in X.  Then in tests I found that the install died with errors when I installed my package without X running.  How is this situation normally handled?

Last edited by scottfial (2010-07-09 08:04:21)


Time flies like a banana.

Offline

#2 2010-07-05 19:28:14

azleifel
Member
Registered: 2007-10-28
Posts: 486

Re: [SOLVED] PKGBUILD for a font - xset fails when X not running

xset will fail if X isn't running.  Font packages generally have an install file like this:

# arg 1: the new package version
post_install() {
  echo -n "Updating font cache... "
  fc-cache -f > /dev/null
  mkfontscale /usr/share/fonts/local
  mkfontdir /usr/share/fonts/local
  echo "done."
}

# # arg 1: the new package version
# # arg 2: the old package version
post_upgrade() {
  post_install $1
}
#
# # arg 1: the old package version
post_remove() {
  post_install $1
}

The user can then either run xset manually or logout/login after installation.

Offline

#3 2010-07-05 21:28:02

scottfial
Member
Registered: 2010-03-20
Posts: 17

Re: [SOLVED] PKGBUILD for a font - xset fails when X not running

Thanks for your suggestion.  I updated my .install file to reflect what you posted.  Before that, I was installing the .pcf files to /usr/share/fonts/misc, but I noticed that your example assumes /usr/share/fonts/local.  Is that the proper place to install a bitmap font like this?


Time flies like a banana.

Offline

#4 2010-07-07 20:16:35

azleifel
Member
Registered: 2007-10-28
Posts: 486

Re: [SOLVED] PKGBUILD for a font - xset fails when X not running

I just picked a random example from the repositories (http://repos.archlinux.org/wsvn/communi … nt.install) and deleted the comment before posting ;-)

Offline

#5 2010-07-07 23:01:26

scottfial
Member
Registered: 2010-03-20
Posts: 17

Re: [SOLVED] PKGBUILD for a font - xset fails when X not running

I see.  Well, on my system it looks like Dina and Terminus both put their .pcf files in /usr/share/fonts/local.  If the big-boys are doing it, I guess it must be the thing to do.  Thanks for your help.


Time flies like a banana.

Offline

Board footer

Powered by FluxBB