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

John Ralls jralls at ceridwen.us
Thu May 2 13:03:20 EDT 2019


AT&T Unix and the real BSD did have /usr/local as the place for installing stuff not part of the system. Sun Microsystems started using that for their Solaris extensions to BSD and invented /opt as the place for locally-installed packages. Both typically require root to install into and some distros have put stuff in one or the other, so care is advised when using either.

There's another problem: CMake treats both specially and munges the subdirectory locations; this is worst with /opt as it insists on stuffing etc/gnucash into a weird path under /etc so root is required for the install step and gnucash can't find the environment file.

I lean towards guiding inexperienced users toward keeping everything in their home directories and away from using su or sudo for anything. 

Regards,
John Ralls

> On May 2, 2019, at 9:40 AM, Colin Law <clanlaw at gmail.com> wrote:
> 
> On many varieties of Linux /usr/local is the conventional location to
> add locally built packages.  In this case probably /usr/local/gnucash.
> I think the build instructions used to suggest that but I may be
> mistaken.
> 
> Colin
> 
> On Thu, 2 May 2019 at 17:27, Geert Janssens <geert.gnucash at kobaltwit.be> wrote:
>> 
>> Op donderdag 2 mei 2019 18:03:22 CEST schreef Tommy Trussell:
>>> On Thu, May 2, 2019 at 6:02 AM Geert Janssens <geert.gnucash at kobaltwit.be>
>>> 
>>> wrote:
>>>> Our current wiki on building gnucash for Ubuntu 16.04 (https://
>>>> wiki.gnucash.org/wiki/BuildUbuntu16.04) suggests $HOME/.local as a valid
>>>> installation prefix.
>>> 
>>> ...
>>> 
>>>> So personally I would recommend against using $HOME/.local as installation
>>>> prefix. I am however curious where this suggestion originally came from.
>>> 
>>> This is entirely speculation... I'm looking at this system where I've been
>>> testing the GnuCash versions available as Snap and Flatpak... and I see
>>> that the Flatpak installation apparently added
>>> ~/.local/share/flatpak/exports/share to the $XDG_DATA_DIRS environment
>>> variable.
>>> 
>>> Maybe whoever wrote the wiki entry was also working with Flatpak and
>>> thought .local would be a good place to stash things to make them more
>>> accessible to Flatpak.
>>> 
>> Possibly.
>> 
>>> I would think ~/bin would be a more ideal suggestion because I see it is
>>> already defined in my bash $PATH on this Ubuntu machine. (And I'm pretty
>>> sure I didn't add it, though I may have.)
>> 
>> That would be another alternative location. To have gnucash benefit from ~/bin
>> being on the path though the gnucash binary itself should be ~/bin/gnucash.
>> 
>> Translating this back to the required installation prefix would mean the
>> installation prefix should be $HOME.
>> 
>> This is certainly possible but has the drawback the installation would add
>> extra directories in your home directory, like
>> ~/share
>> ~/etc
>> ~/lib(64)
>> ...
>> 
>> That may be cluttering the home directory more than the average user may like.
>> And in addition if someone is adding other binaries to ~/bin it again becomes
>> more difficult to keep the gnucash build separate from everything else.
>> 
>> To me something like Adrien suggested makes most sense.
>> One could add two extra steps to simplify launching gnucash afterwards:
>> - make a softlink from <installation_prefix>/bin/gnucash to /home/bin/gnucash.
>> This would allow console users to simply type "gnucash" to run their own
>> gnucash build.
>> - copy <installation/prefix>/share/applications/gnucash.desktop to
>> ~/.local/share/applications
>> That should make you graphical environment aware of your self-built gnucash
>> and have it pop up in the usual places to launch applications (the Kicker menu
>> on KDE, or the gnome-shell application launcher).
>> 
>> Regards,
>> 
>> Geert
>> 
>> 
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel



More information about the gnucash-devel mailing list