[GRASS-dev] wingrass: etc/fontcap contains fonts from dist. directory not installed directory

Hi,

The grass-6.3.cvs/etc/fontcap file in wingrass contains a series of entries of the sorts:

cyrilc|Cyrillic|0|c:\grasssrc\grass6\dist.i686-pc-mingw32\fonts\cyrilc.hmp|0|utf-8|

This should be

cyrilc|Cyrillic|0|c:\grass\grass-6.3.cvs\fonts\cyrilc.hmp|0|utf-8|

IIUC, the line that deals with this in the Makefile is (277):

-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${INST_DIR}/etc/fontcap

Do we need an equivalent line for wingrass with WINGISBASE ?

Moritz

Moritz Lennert wrote:

The grass-6.3.cvs/etc/fontcap file in wingrass contains a series of
entries of the sorts:

cyrilc|Cyrillic|0|c:\grasssrc\grass6\dist.i686-pc-mingw32\fonts\cyrilc.hmp|0|utf-8|

This should be

cyrilc|Cyrillic|0|c:\grass\grass-6.3.cvs\fonts\cyrilc.hmp|0|utf-8|

IIUC, the line that deals with this in the Makefile is (277):

-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
${INST_DIR}/etc/fontcap

Do we need an equivalent line for wingrass with WINGISBASE ?

WINGISBASE doesn't exist during compilation. AFAICT, it's only used
within grass63.bat and init.bat.

But, yes, we should probably allow for that.

Or, you can always regenerate the fontcap file after installation.

--
Glynn Clements <glynn@gclements.plus.com>

On Wed, October 24, 2007 21:39, Glynn Clements wrote:

Moritz Lennert wrote:

The grass-6.3.cvs/etc/fontcap file in wingrass contains a series of
entries of the sorts:

cyrilc|Cyrillic|0|c:\grasssrc\grass6\dist.i686-pc-mingw32\fonts\cyrilc.hmp|0|utf-8|

This should be

cyrilc|Cyrillic|0|c:\grass\grass-6.3.cvs\fonts\cyrilc.hmp|0|utf-8|

IIUC, the line that deals with this in the Makefile is (277):

-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
${INST_DIR}/etc/fontcap

Do we need an equivalent line for wingrass with WINGISBASE ?

WINGISBASE doesn't exist during compilation. AFAICT, it's only used
within grass63.bat and init.bat.

Duh, obviously it has nothing to do with WINGISBASE. The problem is path
syntax:

content of dist.i686-pc-mingw32/etc/fontcap:
cyrilc|Cyrillic|0|c:\grasssrc\grass-6.3.0RC1\dist.i686-pc-mingw32\fonts\cyrilc.h
mp|0|utf-8|

sed command in the Makefile:

        -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
${INST_DIR}/etc/fontcap

which during install translates to

sed
's#'/c/grasssrc/grass-6.3.0RC1/dist.i686-pc-mingw32'#'c:/grass63RC1/grass-6.3.0RC1'#g'
/c/grasssrc/grass-6.3.0RC1/dist.i686-pc-mingw32/etc/fontcap >
c:/grass63RC1/grass-6.3.0RC1/etc/fontcap

fontcap entries need to use windows syntax under windows for gis.m to see
the font.

So, we need a specific sed command for windows, but do we have a variable
for GISBASE in windows path syntax ? If not how to create it ?

Or, you can always regenerate the fontcap file after installation.

That's what I'm doing manually now for the binaries, but it would be great
to have this to happen automatically. Is this possible in the Makefile ?

Moritz

Moritz Lennert wrote:

>> The grass-6.3.cvs/etc/fontcap file in wingrass contains a series of
>> entries of the sorts:
>>
>> cyrilc|Cyrillic|0|c:\grasssrc\grass6\dist.i686-pc-mingw32\fonts\cyrilc.hmp|0|utf-8|
>>
>> This should be
>>
>> cyrilc|Cyrillic|0|c:\grass\grass-6.3.cvs\fonts\cyrilc.hmp|0|utf-8|
>>
>> IIUC, the line that deals with this in the Makefile is (277):
>>
>> -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
>> ${INST_DIR}/etc/fontcap
>>
>>
>> Do we need an equivalent line for wingrass with WINGISBASE ?
>
> WINGISBASE doesn't exist during compilation. AFAICT, it's only used
> within grass63.bat and init.bat.

Duh, obviously it has nothing to do with WINGISBASE. The problem is path
syntax:

content of dist.i686-pc-mingw32/etc/fontcap:
cyrilc|Cyrillic|0|c:\grasssrc\grass-6.3.0RC1\dist.i686-pc-mingw32\fonts\cyrilc.h
mp|0|utf-8|

It's sort of related to WINGISBASE; if you run the installation
in-place, WINGISBASE would be set to:

  c:\grasssrc\grass-6.3.0RC1\dist.i686-pc-mingw32

which would work. But WINGISBASE isn't set while building, only when
actually running GRASS.

sed command in the Makefile:

        -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
${INST_DIR}/etc/fontcap

which during install translates to

sed
's#'/c/grasssrc/grass-6.3.0RC1/dist.i686-pc-mingw32'#'c:/grass63RC1/grass-6.3.0RC1'#g'
/c/grasssrc/grass-6.3.0RC1/dist.i686-pc-mingw32/etc/fontcap >
c:/grass63RC1/grass-6.3.0RC1/etc/fontcap

fontcap entries need to use windows syntax under windows for gis.m to see
the font.

It's more than just gis.m; C functions (e.g. fopen()) only understand
Windows syntax, not MinGW/MSys syntax. Forward slashes work in most
places (but not in the command interpreter), so either c:/grass63RC1
or c:\grass63RC1 will work, but /c/grass63RC1 won't.

So, we need a specific sed command for windows, but do we have a variable
for GISBASE in windows path syntax ? If not how to create it ?

> Or, you can always regenerate the fontcap file after installation.

That's what I'm doing manually now for the binaries, but it would be great
to have this to happen automatically. Is this possible in the Makefile ?

g.dirseps will convert the separators, but not the /c/ -> c:/ for the
drive letter.

Does $(RUN_GISBASE) have the correct syntax?

--
Glynn Clements <glynn@gclements.plus.com>

On 25/10/07 23:28, Glynn Clements wrote:

Moritz Lennert wrote:

The grass-6.3.cvs/etc/fontcap file in wingrass contains a series of
entries of the sorts:

cyrilc|Cyrillic|0|c:\grasssrc\grass6\dist.i686-pc-mingw32\fonts\cyrilc.hmp|0|utf-8|

This should be

cyrilc|Cyrillic|0|c:\grass\grass-6.3.cvs\fonts\cyrilc.hmp|0|utf-8|

IIUC, the line that deals with this in the Makefile is (277):

-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
${INST_DIR}/etc/fontcap

Do we need an equivalent line for wingrass with WINGISBASE ?

WINGISBASE doesn't exist during compilation. AFAICT, it's only used
within grass63.bat and init.bat.

Duh, obviously it has nothing to do with WINGISBASE. The problem is path
syntax:

content of dist.i686-pc-mingw32/etc/fontcap:
cyrilc|Cyrillic|0|c:\grasssrc\grass-6.3.0RC1\dist.i686-pc-mingw32\fonts\cyrilc.h
mp|0|utf-8|

It's sort of related to WINGISBASE; if you run the installation
in-place, WINGISBASE would be set to:

  c:\grasssrc\grass-6.3.0RC1\dist.i686-pc-mingw32

which would work. But WINGISBASE isn't set while building, only when
actually running GRASS.

sed command in the Makefile:

        -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap >
${INST_DIR}/etc/fontcap

which during install translates to

sed
's#'/c/grasssrc/grass-6.3.0RC1/dist.i686-pc-mingw32'#'c:/grass63RC1/grass-6.3.0RC1'#g'
/c/grasssrc/grass-6.3.0RC1/dist.i686-pc-mingw32/etc/fontcap >
c:/grass63RC1/grass-6.3.0RC1/etc/fontcap

fontcap entries need to use windows syntax under windows for gis.m to see
the font.

It's more than just gis.m; C functions (e.g. fopen()) only understand
Windows syntax, not MinGW/MSys syntax. Forward slashes work in most
places (but not in the command interpreter), so either c:/grass63RC1
or c:\grass63RC1 will work, but /c/grass63RC1 won't.

So, we need a specific sed command for windows, but do we have a variable
for GISBASE in windows path syntax ? If not how to create it ?

Or, you can always regenerate the fontcap file after installation.

That's what I'm doing manually now for the binaries, but it would be great
to have this to happen automatically. Is this possible in the Makefile ?

g.dirseps will convert the separators, but not the /c/ -> c:/ for the
drive letter.

Does $(RUN_GISBASE) have the correct syntax?

It has c:/ (forward-slash) style syntax. So, windows usable, but not for the above sed command.

Moritz

Moritz Lennert-2 wrote:

On 25/10/07 23:28, Glynn Clements wrote:

Moritz Lennert wrote:

...
...
It has c:/ (forward-slash) style syntax. So, windows usable, but not for
the above sed command.

In (Linux?) sed, you can substitute / separator for example with + or
another character:

echo "ciao mama/sorella" | sed 's+mama+papa+g'
ciao papa/sorella

Maybe helpful?

Markus

--
View this message in context: http://www.nabble.com/wingrass%3A-etc-fontcap-contains-fonts-from-dist.-directory-not-installed-directory-tf4683362.html#a13434503
Sent from the Grass - Dev mailing list archive at Nabble.com.

Moritz Lennert wrote:

>> So, we need a specific sed command for windows, but do we have a variable
>> for GISBASE in windows path syntax ? If not how to create it ?
>>
>>> Or, you can always regenerate the fontcap file after installation.
>> That's what I'm doing manually now for the binaries, but it would be great
>> to have this to happen automatically. Is this possible in the Makefile ?
>
> g.dirseps will convert the separators, but not the /c/ -> c:/ for the
> drive letter.
>
> Does $(RUN_GISBASE) have the correct syntax?

It has c:/ (forward-slash) style syntax. So, windows usable, but not for
the above sed command.

We could fix it with g.dirseps, but that's a bit ugly (it requires
setting GISBASE/GISRC); it's easier to use sed, e.g.:

ifneq ($(strip $(MINGW)),)
  -WINGISBASE=`echo $(RUN_GISBASE) | sed 's#/#\\#g'` ; \
  sed 's#'$$WINGISBASE'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${INST_DIR}/etc/fontcap
fi

--
Glynn Clements <glynn@gclements.plus.com>