[GRASS-dev] [GRASS GIS] #854: g.extension does not work on a Mac (probably not on Windows either

#854: g.extension does not work on a Mac (probably not on Windows either
--------------------------------+-------------------------------------------
Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Installation | Version: svn-trunk
Keywords: extensions, addons | Platform: All
      Cpu: OSX/Intel |
--------------------------------+-------------------------------------------
g.extension does not work on a Mac. It seems to assume that GRASS is being
run from a source directory and tries to drop the files into the grass.app
rather than the source. So it gets a no make target error.

It needs to ask where the source directory is located, put the source
files there, and run make, followed by make install.

The manual should also clearly indicate that a successfully compiled GRASS
source distribution is required in order for this to work.

The error is below using v.strahler as an example:

{{{
g.extension extension=v.strahler svnurl=https://svn.osgeo.org/grass/grass-
addons/ prefix=/Library/Application\ Support/GRASS/7.0
menuitem=Vector;Stream order
'/Library/Application\ Support/GRASS/7.0' created
Fetching 'v.strahler' from GRASS-Addons SVN (be patient)...
A v.strahler/v.mainchannel
A v.strahler/v.mainchannel.html
A v.strahler/forest2tree.c
A v.strahler/description.html
A v.strahler/r.strahler.sh
A v.strahler/helper.c
A v.strahler/r.strahler.sh.html
A v.strahler/images
A v.strahler/images/at_rbroscoe.jpg
A v.strahler/images/Qgisout_vstrahler.jpg
A v.strahler/images/thrVScell.jpg
A v.strahler/images/wt_rbroscoe.jpg
A v.strahler/images/input_vstrahler.jpg
A v.strahler/images/menotre.jpg
A v.strahler/images/output_vstrahler.jpg
A v.strahler/images/lr_rbroscoe.jpg
A v.strahler/main.c
A v.strahler/r.broscoe.sh
A v.strahler/strahler.c
A v.strahler/r.broscoe.sh.html
A v.strahler/documentation
A v.strahler/documentation/r.broscoe_flowchart.dia
A v.strahler/documentation/v.strahler_flowchart.jpeg
A v.strahler/documentation/r.broscoe_flowchart.jpeg
A v.strahler/documentation/v.strahler_flowchart.dia
A v.strahler/strahler.h
A v.strahler/write.c
A v.strahler/Makefile
Checked out revision 40210.
Compiling 'v.strahler'...
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/bin.i386-apple-
darwin10.2.0'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/bin.i386-apple-
darwin10.2.0'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/include/grass'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/include/grass'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/lib'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/lib'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/bin'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/bin'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/etc'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/etc'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/driver'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/driver'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/driver/db'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/driver/db'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/fonts'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/fonts'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/docs'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/docs'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/docs/html'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/docs/html'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/man'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/man'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/man/man1'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/man/man1'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: overriding commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/tools'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:16: warning: ignoring old commands for target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/tools'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:19: warning: overriding commands for target
`OBJ.i386-apple-darwin10.2.0'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:19: warning: ignoring old commands for target
`OBJ.i386-apple-darwin10.2.0'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:41: warning: overriding commands for target
`clean'
/Applications/Grass/GRASS-7.0.app/Contents/MacOS/include/Mak
e/Rules.make:41: warning: ignoring old commands for target
`clean'
make: *** No rule to make target
`/Users/cmbarton/grass_dev/grass70_dev/dist.i386-apple-
darwin10.2.0/docs/html/.html', needed by `html'. Stop.
ERROR: Compilation failed, sorry. Please check above error messages.
(Sun Jan 3 14:46:24 2010) Command finished (20 sec)

}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------+------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Installation | Version: svn-trunk
Resolution: | Keywords: extensions, addons
  Platform: All | Cpu: OSX/Intel
---------------------------+------------------------------------------------
Comment (by kyngchaos):

Replying to [ticket:854 cmbarton]:
> It needs to ask where the source directory is located, put the source
files there, and run make, followed by make install.
>
> The manual should also clearly indicate that a successfully compiled
GRASS source distribution is required in order for this to work.

I believe the intent is to NOT require a built source dir, or source at
all. It's likely that work is needed so that the installed platform.make
has the install paths instead of the original build paths, OR that it
overrides GRASS_HOME and RUN_GISBASE when running make (better, since the
install path could change).

> g.extension extension=v.strahler svnurl=https://svn.osgeo.org/grass/
grass-addons/ prefix=/Library/Application\ Support/GRASS/7.0
menuitem=Vector;Stream order

Note: the correct OSX addons dir is /Library/Application
Support/GRASS/7.0/Modules.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------+------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Installation | Version: svn-trunk
Resolution: | Keywords: extensions, addons
  Platform: All | Cpu: OSX/Intel
---------------------------+------------------------------------------------
Comment (by hamish):

Replying to [comment:1 kyngchaos]:
> Replying to [ticket:854 cmbarton]:
> > g.extension extension=v.strahler svnurl=https://svn.osgeo.org/grass/
grass-addons/ prefix=/Library/Application\ Support/GRASS/7.0
menuitem=Vector;Stream order
>
> Note: the correct OSX addons dir is /Library/Application
Support/GRASS/7.0/Modules.

Hi,

In 6.5svn I've just checked in an update which quotes all variables and it
should work better when there are spaces in pathnames now.

specifically, ${} is not enough to protect against spaces when used as a
command line argument.

this makes two directories, a/ and path/
{{{
foo="a path"
mkdir ${foo}

ls
rmdir $foo
}}}

(I'll merge it to the other branches this evening once I get the chance)

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/854#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------+------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Installation | Version: svn-trunk
Resolution: | Keywords: extensions, addons
  Platform: All | Cpu: OSX/Intel
---------------------------+------------------------------------------------
Comment (by cmbarton):

Replying to [comment:1 kyngchaos]:
> Replying to [ticket:854 cmbarton]:
> > It needs to ask where the source directory is located, put the source
files there, and run make, followed by make install.
> >
> > The manual should also clearly indicate that a successfully compiled
GRASS source distribution is required in order for this to work.
>
> I believe the intent is to NOT require a built source dir, or source at
all. It's likely that work is needed so that the installed platform.make
has the install paths instead of the original build paths, OR that it
overrides GRASS_HOME and RUN_GISBASE when running make (better, since the
install path could change).

How can this work without the GRASS libraries, platform.make, etc?

>
> > g.extension extension=v.strahler svnurl=https://svn.osgeo.org/grass/
grass-addons/ prefix=/Library/Application\ Support/GRASS/7.0
menuitem=Vector;Stream order
>
> Note: the correct OSX addons dir is /Library/Application
Support/GRASS/7.0/Modules.

Hmm. I thought I put this in the field. I'll have to check again.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Installation | Version: svn-trunk
Keywords: g.extension, addons | Platform: All
      Cpu: OSX/Intel |
---------------------------------+------------------------------------------
Changes (by hamish):

  * keywords: extensions, addons => g.extension, addons

Comment:

see also #620, #1178, and #1180

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/854#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Installation | Version: svn-trunk
Keywords: g.extension, addons | Platform: All
      Cpu: OSX/Intel |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

I got a chance to poke around.

Problems I identified:

  * as mentioned on the mailing list, $GRASS_ADDON_PATH can't be used
because g.extension needs a single path, while GRASS_ADDON_PATH can have
multiple paths, and does in my Mac distribution (a global and user addon
path). The workaround is to specify the user path when running
g.extension. That's:
    * `/Library/GRASS/6.4/Modules` for the global path for GRASS 6.4 (and
6.5, just change the version in the path)
    * `~/Library/GRASS/6.4/Modules` for the user path (and similar for 6.5)
    *`/Library/Application Support/GRASS/7.0/Modules` for the global path
for GRASS 7.0 (and similar for future versions)
    *`~/Library/Application Support/GRASS/7.0/Modules` for the user path
for GRASS 7.0 (and similar for future versions)
  * the makefile parts are hardwired to the source. This can be overridden
when running make, it's just a matter of figuring out which to do.
  * the compile stage compiles to ARCH_DISTDIR, which is constructed from
GISBASE, which is the installed app. Even if the user uses a prefix that
they have permissions to, they will still need admin privileges to compile
  * mkhtml.sh and g.html2man are not installed, so installation only
partially succeeds - binaries are installed but not help files, and
g.extension reports it as a failed install.

I was able to get partial compilation and installation (without the help
files) by overriding a few more make variables (patch attached):

  * ARCH_DISTDIR = TMPDIR/dist
  * ARCH_LIBDIR = GISBASE/lib
  * ARCH_INC = GISBASE/include, MYINST_DIR/include and TMPDIR/dist/include
  * ARCH_LIBPATH = GISBASE/lib, MYINST_DIR/lib and TMPDIR/dist/lib

This will also find addon includes and libs that might be needed from
another addon (ie for a group of addons).

Fixing help compilation needs some more changes:

  * install tools/mkhtml.sh and tools/g.html2man
  * mkhtml.sh is found from MODULE_TOPDIR (in html.make), so that should
work, but g.html2man is found from GRASS_HOME (in man.make). Either
change man.make to use MODULE_TOPDIR for consistency, or add another make
override for GRASS_HOME.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/854#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------
Changes (by neteler):

  * version: svn-trunk => 6.4.1 RCs
  * cpu: OSX/Intel => All
  * milestone: 7.0.0 => 6.4.2

Comment:

Great, this patch solved also a problem on Linux, turning g.extension to
functional under conditions where the current 6.4.svn version fails.
Please submit.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/854#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

r46220 (rel64) and r46221 (dev6) for my patch as far as it goes. I
haven't looked at GRASS 7 yet.

I'll work on the help file compilation next. Can you think of any reason
not to install mkhtml.sh and g.html2man? ie dangerous actions in the
scripts, ...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

OK, the help files issue is partly my fault for OS X - the OS X install
was missing the tools dir, and the main GRASS makefile does install
mkhtml.sh. Fixed for OS X.

g.html2man still needs to be installed. It looks like mkhtml.sh was
hacked to install into the dist dir during compilation from the main
makefile, instead of from the tools/ makefile, so I'd say just do the same
for g.html2man.

Otherwise, I tested with those installed, plus the man.make change, and
g.extension worked without a failure.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

In adding the install for g.html2man (r46240 in rel64, r46241 in dev6), I
found an update (r45933) by martinl that did that, though it was broken
(didn't make sure g.html2man subfolder existed). But also he had an old
copy of the Makefile and I had to fix a reversion.

And instead of my changes to g.extension to change ARCH_* vars, martin
hacked platform.make, grass.make and man.make on install to change the
make vars.

Though it probably needs a few more vars updated to match what I did,
which is the better method? Seems to me to change 1 file, g.extension, is
better than to change 3. But maybe there are other uses for the makefiles
outside g.extension?

I guess both methods won't hurt...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

Copied the wrong var name in man.make. fixed in r46245/r46246.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by neteler):

Looks much better than ever now. A remaining flaw is there:

- Linux binary snapshot taken from web site (I forced created some minutes
ago)
    http://grass.osgeo.org/grass64/binary/linux/snapshot/

- installed into user's home into the $HOME/grass64/ directory

- g.extension failed upon wrong parameters in Platform.make

I updated manually Platform.make (differences attached): all fine,
g.extension works.
The missing issue is to update the script "binaryInstall.src" which
generates

   grass-6.4.2svn-x86_64-unknown-linux-gnu-12_05_2011-install.sh

in order to have a correct include/Make/Platform.make after installed.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by martinl):

Replying to [comment:9 kyngchaos]:
> In adding the install for g.html2man (r46240 in rel64, r46241 in dev6),
I found an update (r45933) by martinl that did that, though it was broken
(didn't make sure g.html2man subfolder existed). But also he had an old
copy of the Makefile and I had to fix a reversion.

I don't understand fully "he had an old copy", I modified fresh Makefile
from SVN.

> And instead of my changes to g.extension to change ARCH_* vars, martin
hacked platform.make, grass.make and man.make on install to change the
make vars.

Well, I though I have fixed wrongly set variables, probably I was wrong.

> Though it probably needs a few more vars updated to match what I did,
which is the better method? Seems to me to change 1 file, g.extension, is
better than to change 3. But maybe there are other uses for the makefiles
outside g.extension?

I think that makefiles should provide up-to-date variables.

BTW, your commit introduced again 'macosx' directory. What is the reason
for this directory on GNU/Linux or MS Windows? Thanks. Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

Replying to [comment:12 martinl]:
> BTW, your commit introduced again 'macosx' directory. What is the reason
for this directory on GNU/Linux or MS Windows? Thanks. Martin

That's what made me think you had an old copy. The test on whether to
build the MACOSX_APP stuff is in the macosx/Makefile, so nothing will
happen on other systems. Either way is fine.

I'm not trying to blame anyone, but I think I had originally done it your
way in the top level makefile, but glynn changed it. Or he changed
something similar elsewhere, and I changed this case to match.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by martinl):

Replying to [comment:13 kyngchaos]:
> Replying to [comment:12 martinl]:
> > BTW, your commit introduced again 'macosx' directory. What is the
reason for this directory on GNU/Linux or MS Windows? Thanks. Martin
>
> That's what made me think you had an old copy. The test on whether to
build the MACOSX_APP stuff is in the macosx/Makefile, so nothing will
happen on other systems. Either way is fine.

OK, thanks for clarification.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by glynn):

Replying to [comment:13 kyngchaos]:
> I think I had originally done it your way in the top level makefile, but
glynn changed it. Or he changed something similar elsewhere, and I
changed this case to match.

Note that I hardly ever touch 6.x. Most of the problems stem from trying
to back-port isolated parts of 7.x to 6.x, when the changes to the build
system are highly inter-dependent. But back-porting the entire build
system would run into problems with "unusual" modules (most of which have
been eliminated from 7.x).

BTW: one of the original reasons for not keeping the 6.x build system in
sync was that the 7.x build system absolutely requires GNU make 3.81,
which wasn't universally available at the time (e.g. MacOSX was still on
3.79). I don't think that's an issue any more.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by kyngchaos):

In talking with Michael off-list, I came up with the following summary of
issues with the current state of g.extension:

'''Clearly define what GRASS_ADDON_PATH is.''' It should be one thing
only. Currently in GRASS 7 it can be a mix of bin (full) paths and prefix
paths, and is just messy and confusing. I'd recommend (I'm sure I
mentioned something like this before) that to keep backwards
compatibility, GRASS_ADDON_PATH should be left as it's always been
defined: full paths to executable folders (ie .../bin). Add a new
variable for "extensions" that includes prefix paths where bin and scripts
(possibly etc and lib) subfolders are found. Use this new variable for
g.extension, as well as adding the /bin and /scripts subfolders to the
PATH in grass.py.

'''grass.py needs to handle multiple paths in GRASS_ADDON_PATH.'''
Really, with the above recommendation, GRASS_ADDON_PATH can be simply
added to PATH as it always has been, and the new var would get the /bin &
/scripts treatment.

Currently, it adds GRASS_ADDON_PATH to the PATH (the old definition of
full paths to ../bin) ''and'' adds subfolders to GRASS_ADDON_PATH as a
whole to /bin and /scripts to the PATH. ie, the OSX startup sets
GRASS_ADDON_PATH as:

{{{
$HOME/Library/Application
Support/GRASS/7.0/Modules/bin:/Library/Application
Support/GRASS/7.0/Modules/bin
}}}

What gets added to the PATH is:

{{{
/Users/kyngchaos/Library/Application Support/GRASS/7.0/Modules/bin:
/Library/Application Support/GRASS/7.0/Modules/bin/bin:
/Users/kyngchaos/Library/Application Support/GRASS/7.0/Modules/bin:
/Library/Application Support/GRASS/7.0/Modules/bin/scripts
}}}

'''change the OSX startup use the new var.''' The OSX default paths were
designed as prefix paths, though only the bin subfolders were added to
GRASS_ADDON_PATH.

'''change g.extension to use the new var.''' then it should start working
properly.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by neteler):

Duplicate of g.extension bug #1406 ?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by neteler):

Is this problem solved as is bug #1406 ?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#854: g.extension does not work on a Mac (probably not on Windows either
---------------------------------+------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.2
Component: Installation | Version: 6.4.1 RCs
Keywords: g.extension, addons | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------

Comment(by cmbarton):

I don't know where this is at currently. Has a new 'extension' variable
been defined? I followed the discussion and see a good suggestion to
resolving this, but don't know if anyone has actually done it.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/854#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>