<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 25 Feb 2022 at 09:07, Sebastiaan Couwenberg <<a href="mailto:sebastic@xs4all.nl" target="_blank">sebastic@xs4all.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
If we want to stop using --prefix=/usr/lib and have FHS complianance <br>
while also having the shared libraries in the default library search <br>
path several changes in GRASS will be required.<br>
<br>
The resulting structure should result in something like:<br>
<br>
  /etc/grass                            configuration files<br>
  /usr/bin                              executables<br>
  /usr/lib                              shared libraries<br>
  /usr/lib/python3/dist-packages/grass  python package<br>
  /usr/libexec/grass                    executable helpers<br>
  /usr/share/grass                      architecture independent files<br>
  /usr/share/man                        manual pages<br></blockquote><div><br></div><div>Makes sense. Any good examples of how to do this with Autotools, esp. given that macOS and Windows still need a single directory? <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

This assumes that the grass shared libraries should not be considered <br>
private which does seem to be the case with their use by libgdal-grass <br>
being the exception.<br></blockquote><div><br></div><div>We keep a stable API anyway for custom user executables such as addons, so not private in that sense. Libraries can also be accessed from Python through an API which wraps ctypes calls.<br></div><div><br></div><div>I'm not sure what is the current situation in QGIS, but at least historically, that would be another exception, so perhaps not an exception at all, but a rule.<br></div><div><br></div><div>The executables like g.region are somewhat internal, so that's perhaps the /usr/libexec/grass group.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

Alternatively the GRASS executables need to have RPATH set, e.g. with:<br>
<br>
  -Wl,-rpath,/usr/lib/grass80/lib<br></blockquote><div><br></div><div>I'm not sure what are the risks involved here. I have seen -<span class="gmail-il">rpath</span>-link used in the code, so that's not good enough.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

To remove the need for changing the library search path. This is the <br>
road of least resistance.<br>
</blockquote></div></div>