[GNC-dev] About the "$HOME/.local" installation prefix

David Cousens davidcousens at bigpond.com
Thu May 2 21:09:43 EDT 2019


Hi John,

It was because of a number of posts in the forum, not sure whether DEV or
USER around the time I reworked the pages which suggested $HOME/.local  for
single user local installations of GnuCash . I think it may also have been
specified the previous Wiki page I started from as well. At the time I could
not find any better suggestions so I left it in place. My own preference has
been to install in /usr/local or /opt system wide for production. If you use
make uninstall from the build directory it seems to uninstall correctly from
$HOME/.local as long as the manifest still exists as the paths to each file
installed are specified

If I do a local temporary install, I personally install in a subdirectory of
my home directory and add the relevant search paths to the front of the PATH
environment variable . You of course have the problem with the order in PATH
as to whether you search $HOME directories before or after system installed
paths if you have multiple copies of different versions. Ideally in that
case you could invoke a startup script which setup the PATH variable
depending on which version you are starting up and where its resouces are
located. I have used /opt and /usr/local for different versions but the same
problem with ordering the search order in PATH arises.

Python installs what it calls site-packages under $HOME/.local which seem to
be user specific but most of the other data I find in the directory is in
$HOME/.local/share which seems to be mainly user specific data for various
packages.

The Linux File Heirarchy gives no real guidance for the structure of a users
home directory apart from a reference to XDG and GLib conventions ( can't
find any reference):

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

One stackexchange article suggested duplicating sections of the FHS under
$HOME which seems a bit extreme. If I did that I would be inclined to have a
specific directory under $HOME with the /bin, /etc, /lib /share directories
under it. I have an Applications directory for that purpose usually with a
package sub directory under that which contains the above directories.

For the little development work on GnuCash I do I have a separate structure
again under my home directory which has an install subdirectory which I
install to. I have often wondered whether I am actually getting to the
correct libraries by setting up the PATH variable (particularly if I forget
to set it up). Then there is unsetting PATH when you want to go back to
production work. 

Perhaps it is worth investigating the update-alternatives command  used when
several python versions are installed, e.g.
https://askubuntu.com/questions/315646/update-java-alternatives-vs-update-alternatives-config-java.
perhaps using this in startup scripts. Here the installed files are labelled
with the version number and selected by setting a master and slave symbolic
link groups which are setup with the "update-alternatives --set  name path"
command.

Not sure what is the best location and structure for general users for a
local installation though. I would be inclined to go for a directory
labelled with a package name and version number with its own /bin, /etc,
/lib and /share directories and then prepend these to the PATH.

David Cousens



-----
David Cousens
--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html


More information about the gnucash-devel mailing list