[GRASS-dev] iconv a required dependency for using Freetype?

William Kyngesburye woklist at kyngchaos.com
Fri May 11 15:17:23 EDT 2007


On May 10, 2007, at 11:03 AM, Paul Kelly wrote:

>> One suggestion - make it useable outside of GRASS, or during the  
>> startup process. (I tried it and got a segfault)
>
> It calls G_no_gisinit(), i.e. it doesn't require a valid location  
> or mapset to be present, just GISBASE and GISRC to be set, so  
> should be fine for most purposes I think.

Doesn't help if I want to generate the *cap file before init.sh is  
run, since the user hasn't selected a map yet.  I thought about  
trying a dummy location like the demolocation, but that would have to  
be installed with the binary.

I came up with this possibility - in init.sh, after it gets a valid  
mapset from the user (and all the needed vars are set):

--- init.sh-orig        2007-05-11 13:58:54.000000000 -0500
+++ init.sh     2007-05-11 13:56:38.000000000 -0500
@@ -676,6 +676,15 @@
         exit 1 ;;
  esac

+if [ "$GRASS_FONT_CAP" ] && [ ! -f "$GRASS_FONT_CAP" ] ; then
+       echo "Building user fontcap ..."
+       g.mkfontcap -o
+fi
+if [ "$GRASS_FT_CAP" ] && [ ! -f "$GRASS_FT_CAP" ] ; then
+       echo "Building user freetypecap ..."
+       g.mkfontcap -o -f
+fi
+
  trap "" 2 3 15

  # cygwin has many problems with the shell setup


This should be safe - it should not get run on the *caps installed  
with the GRASS binary (though if a user sets either to be the binary  
copy, it will try to), but only when either or both env vars are set  
and the file doesn't exist.  It will give the user a start for adding  
other fonts manually, or cleaning up possible mistakes.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian]  What are you supposed to do WITH a maniacally depressed  
robot?

[Marvin]  You think you have problems?  What are you supposed to do  
if you ARE a maniacally depressed robot?  No, don't try and answer,  
I'm 50,000 times more intelligent than you and even I don't know the  
answer...

- HitchHiker's Guide to the Galaxy





More information about the grass-dev mailing list