use `$PREFIX` as installation path
Is your feature request related to a problem? Please describe. When using NixOS i would have to patch the installation targets
Describe the solution you'd like it would be better to use a prefix and if it is not set, then have a fallback. Proposed solution: https://stackoverflow.com/a/7106823
Describe alternatives you've considered
I could stick to patching it manually, but i think this is not only a NixOS problem, maybe some people want to install it to /opt/.
i could provide an PR myself, but first i want to check if this would be accepted.
also the default should be /usr/local/bin which is the location for locally compiled packages (executing qmake, ...)
/usr/bin should only be used by distro-package maintainers.
Hi,
a PR would be very welcome. I don't update our qmake config too often as I want to switch to CMake sometime in the future.
Just FYI: We already support installing MediaElch into another dir with QMake. See e.g.
https://github.com/Komet/MediaElch/blob/2ca63413bf934daa7c36b21f1bd520a6e15166e9/.ci/package.sh#L98
I use that for packaging MediaElch in an AppImage.
Also, CMake has this built in:
https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
See also the second answer in your StackOverflow post: https://stackoverflow.com/a/55781661/1603627 :-)
INSTALL_ROOT is nice, but it is different to PREFIX.
INSTALL_ROOT will create a folder usr/ in its root, which PREFIX will not.
i am a bit scared breaking things, when changing the .pro-file. I never worked with qmake before.
I recently added the install instruction to nixpkgs. my solution is not the best, but i will replace /usr/ with the corresponding new path.
I would like to keep this issue open until there is a better fix, then replacing hard coded paths.
Ah, ok. PRs are welcome. We can keep this issue open. :-)
I recently switch to cmake because of qt6. And with cmake this this is not relevant any more... So if you want, close it.
:+1:
Thanks.