Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828108 - games-emulation/higan does not place needed templates and system files in the correct locations
Summary: games-emulation/higan does not place needed templates and system files in the...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-03 20:53 UTC by Nathan Zachary
Modified: 2022-01-03 19:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch Higan to look in a system-wide location for templates (higan-116_pre20210404-template_directory.patch,343 bytes, patch)
2021-12-07 05:19 UTC, Nathan Zachary
Details | Diff
Modified ebuild that includes that patch and changes the insinto targets (higan-116_pre20210404.ebuild,2.37 KB, text/plain)
2021-12-07 05:21 UTC, Nathan Zachary
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Zachary 2021-12-03 20:53:12 UTC
Installing Higan places the needed system files and templates under /usr/share/{P}, whereas the binary by default looks in ~/.local/share/higan/.  This results in a lot of user interaction to even get Higan to function at all.

Our options would be:
 * Patch the source to look in a system-wide directory (e.g. /usr/share/higan)
 * Copy the needed files from /usr/share/higan/ into ~/.local/share/higan/

Doing a quick grep in the source, I only see the home directory mentioned in two files:


*****
$ grep -Ri '.local/share' higan-9a625c545ca89b094d5c1da40bbfa5d07156a4aa/{higan-ui,nall}/
higan-9a625c545ca89b094d5c1da40bbfa5d07156a4aa/higan-ui/higan-ui.hpp:  extern string settings;   // ~/.local/share/higan/
higan-9a625c545ca89b094d5c1da40bbfa5d07156a4aa/higan-ui/higan-ui.hpp:  extern string templates;  // ~/.local/share/higan/Systems/
higan-9a625c545ca89b094d5c1da40bbfa5d07156a4aa/nall/path.hpp:// /home/username/.local/share/
higan-9a625c545ca89b094d5c1da40bbfa5d07156a4aa/nall/path.hpp:    result = {Path::user(), ".local/share/"};
*****

So, I think it may be favourable to patch the source to look in /usr/share/higan as a system-wide default rather than in a home directory.  Further, for "systems", "controllers", and other templates, I think it makes more sense to have one copy shared amongst all users instead of duplicating those files into home directories.
Comment 1 Nathan Zachary 2021-12-07 05:17:08 UTC
Here is the corresponding bug in higan's tracker:
https://github.com/higan-emu/higan/issues/181
Comment 2 Nathan Zachary 2021-12-07 05:19:39 UTC
Created attachment 757587 [details, diff]
Patch Higan to look in a system-wide location for templates

My modified ebuild places the template files in /usr/share/higan.
The "temporary_directory.patch" modifies the creation of paths.bml to search for templates in that system-wide location instead of a user's home directory.
Comment 3 Nathan Zachary 2021-12-07 05:21:33 UTC
Created attachment 757588 [details]
Modified ebuild that includes that patch and changes the insinto targets

My modified ebuild includes the "template_directory.patch" and also changes the "insinto" targets from /usr/share/{P} locations to /usr/share/{PN} locations.
Comment 4 Nathan Zachary 2021-12-07 05:22:38 UTC
I have tested this new ebuild and the patch, and they work in my setup.  However, there may be a better approach, and I'm certainly open to feedback.
Comment 5 Larry the Git Cow gentoo-dev 2022-01-03 12:13:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3cb59332d973d7cabe4c3eb10da86cfedc49044

commit f3cb59332d973d7cabe4c3eb10da86cfedc49044
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2022-01-03 11:35:52 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-01-03 12:12:54 +0000

    games-emulation/higan: add 116_pre20210818, use system paths
    
    Closes: https://bugs.gentoo.org/828108
    Thanks-to: Nathan Zachary
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 games-emulation/higan/Manifest                     |   1 +
 .../higan/files/higan-116_pre20210818-paths.patch  |  44 ++++++++
 games-emulation/higan/higan-116_pre20210818.ebuild | 122 +++++++++++++++++++++
 3 files changed, 167 insertions(+)
Comment 6 Ionen Wolkens gentoo-dev 2022-01-03 12:14:36 UTC
Sorry for the wait, this been on my TODO for a while.

Doesn't feel perfect but went with similar approach as Arch and Void
which passively change defaults rather than force, and added an elog
to explain the changes (see patch+elog for details).

An alternative some other distros have used is a wrapper that
copy/update everything in ~/.local on startup but I'd rather
not duplicate nor overwrite files in users' $HOME.

That aside, I don't use/know current higan well (only used several
years ago and don't recognize it), so better suggestions are welcome
if something's off.

Also bumped to latest snapshot and modernized ebuild a bit
while at it, not that there's been many changes since the last
snapshot.
Comment 7 Nathan Zachary 2022-01-03 19:00:47 UTC
No need to apologise at all, Ionen; thank you very much for your help with the commit!

Cheers,
Nathan Zachary