-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve 'make install' for distros. #131
base: master
Are you sure you want to change the base?
Conversation
That would also benefit the Flatpak packaging. |
I added one more commit to take care of out of tree builds. Example:
This adds dependencies for the It may need to abstract |
Sorry it's taken such a long time to get back to you! Most of these changes look pretty straightforward, and in my limited experience trying to write RPM spec files at a former job, I understand why they're useful. However, I'm less sure about supporting out-of-tree builds — that's the biggest change of all (67 insertions, 55 deletions) and I don't think it's strictly needed - I can imagine it being useful in occasional, niche situations, but I don't think it's going to be used regularly enough to make the change worthwhile. I'm happy to merge the other changes as-is right now, but if you have a common use-case for out-of-tree builds I'm willing to hear it before I decide. |
I believe out-of-tree builds are an orthogonal concern to the original topic of this PR, i.e. proper support for a Perhaps it is best to merge the changes until the last commit, submit the latter as a separate PR and continue the discussion there? |
I removed the out of tree commit from this PR and pushed it to this branch for now https://github.com/orbea/bsnes/tree/out_of_tree
This is a very understandable concern and when I made similar changes for other projects (i.e. mupen64plus) it was not nearly as big of a diff. This is because each file has its own make rule which is a strange design. It would be much better if they are listed in variables with a few make rules to control them all. Perhaps if this was done first it would be a far more straight forward and less intrusive commit.
Its very useful for source based distros like what is used in gentoo as it keeps a clean distinction from the build files and the actual source tree. It is also helpful in cases where the source directory may not have write permissions or if the user wishes to keep the source on their filesystem while only building in tmpfs. I also have a personal simple build repo which depends on out of tree builds working so I have a strong desire for it. |
I think the freebsd build issue was introduced after I rebased to master... |
Thank you very much for making that change. I've reviewed this PR, I like everything in it, and I'd be happy to merge it except that I've just noticed it wouldn't work. When bsnes looks for a resource — the game database, shaders, firmware files, etc. — it calls a function called bsnes/bsnes/target-bsnes/bsnes.cpp Lines 8 to 17 in be0ee76
It checks beside the executable, it checks the "user data" path ( Probably the simplest thing to do now would be to add a fallback to |
Somehow I overlooked that such an issue already exists: #111. |
@Screwtapello Thanks for pointing that out, I failed to notice that |
@Screwtapello indeed, that's what we observed back then with my FHS compliance PR on Higan which then triggered issue #111 for further discussion. I did a (hopefully) comprehensive review of path queries throughout the code base and the results are available here. The last commit from @orbea is similar to the patch applied to the Debian packaging to support FHS shared data directory. |
From my perspective, this PR looks good to be merged. |
Fixes #70.
The main goal of this is a more standard
make install
andmake uninstall
which will work much better with distros. I only touched the linux/bsd path and left both windows and osx alone since I am not knowledgeable of what those platforms expect.More specifically this does:
install
anduninstall
checks when run as root. Some distros like Slackware build and create packages as root and there are tools like sandbox (https://wiki.gentoo.org/wiki/Project:Sandbox) designed to catch programs that install out of the expected paths.DESTDIR
which by default is unset. When set it allows for staged installs. For example everything gets installed into a fake root directory which is then used to create a distro package./usr/share/
whenDATADIR
is defined during the build so that it correctly respects the installed path.For
3
the default paths are:These can be overridden with setting these variables as make arguments.
For example on Slackware I would use:
It is important to have both
datarootdir
anddatadir
as the former is for files like icons and desktop files while the latter is data files specific for bsnes. On Slackware I would install the former to/usr/share/
and the latter gets installed to/usr/share/games/bsnes
.Please review to make sure there are not any hardcoded paths I missed.
Some things I did not include.
Out of tree builds, it is helpful to be able to compile bsnes without touching the actual source tree. I will look into this later depending on the outcome of this PR.prefix
orbindir
may be more standard if written asPREFIX
orBINDIR
, but its not really important.