-
Notifications
You must be signed in to change notification settings - Fork 224
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
optional INSTALL_PATH qmake flag (on unix) #247
optional INSTALL_PATH qmake flag (on unix) #247
Conversation
I packaged Jamulus for nix/nixos and it would be neat if there was an option to specify a path at which to install the binary. I'm not really familiar with qmake -- is this a good way to achieve this? (nixpkgs pull request: NixOS/nixpkgs#87914)
Maybe something like this might be better: isEmpty(PREFIX) {
PREFIX = /usr/local
}
isEmpty(BINDIR) {
BINDIR = bin
}
BINDIR = $$absolute_path($$BINDIR, $$PREFIX)
target.path = $$BINDIR Nixpkgs qmake setup hook already passes |
Thanks for your contributions. What shall I add now? The proposal from jtojnar seems to be more suited, right? So if you agree, I would just add these code lines to the pro-file. |
That would be great! |
Lets clarify that first. @jtojnar Can you please comment? |
I am not familiar with qmake at all but I would expect it to be required. |
INSTALLS += target | ||
target.path = $$BINDIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely need to be swapped:
INSTALLS += target | |
target.path = $$BINDIR | |
target.path = $$BINDIR | |
INSTALLS += target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is valid syntax but it might also be nicer to use more descriptive target name:
INSTALLS += target | |
target.path = $$BINDIR | |
jamulus_bin_target.path = $$BINDIR | |
INSTALLS += jamulus_bin_target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both works (on my laptop)
EDIT what I checked here is swapping the lines, not renaming the target. Not sure if renaming the target breaks other stuff in the .pro file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading https://doc.qt.io/qt-5/qmake-advanced-usage.html#installing-files, target
seems to be a magic name that will choose something in unspecified manner. For the other installed files, you will need to specify .files
.
isEmpty(PREFIX) { | ||
PREFIX = /usr/local | ||
} | ||
isEmpty(BINDIR) { | ||
BINDIR = bin | ||
} | ||
BINDIR = $$absolute_path($$BINDIR, $$PREFIX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this to the top of unix conditional. It will be useful when we decide to install other files like .desktop
entry or icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, these are actually available in the repo and AUR package installs them:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=jamulus#n26
isEmpty(DATADIR) {
DATADIR = share
}
DATADIR = $$absolute_path($$DATADIR, $$PREFIX)
ICONDIR = $$DATADIR/icons/hicolor/48x48/apps # https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#install_icons
DESKTOPDIR = $$DATADIR/applications
...
icon_target.files = src/res/fronticon.png
icon_target.path = $$ICONDIR
INSTALLS += icon_target
desktop_file_target.files = distributions/jamulus.desktop
desktop_file_target.path = $$DESKTOPDIR
INSTALLS += desktop_file_target
We should probably do that too.
Isn't this what DESTDIR is for? https://cmake.org/cmake/help/latest/envvar/DESTDIR.html I believe this is how the Debian package build installs to a temporary directory before copying everything into package files. [EDIT] Or I get your motivation wrong. You really want to install the binary somewhere else than $PREFIX/bin ? BTW, the AUR script could possibly also use "make DESTDIR=$pkgdir" and "make install". |
@tormodvolden No, Also this project does not use CMake but qmake, and, on UNIX, does not install any files at all (there is no |
Ok, so I take it that the change in that current pull request is the final code to be added? So I will merge it now. If anything is open or shall be changed, just create a new pull request. |
We would still want to add installation of icon and desktop files as described above: #247 (comment) |
I tried those extra changes (here) but (at least when building with nix) there are some issues that make it not straighforward:
Anyway, the install target for the binary works fine with changes that are already merged |
Looking at https://github.com/seb314/jamulus/blob/submit/install_add_icon_and_desktop/distributions/debian/rules, we might want to install the icon from distributions instead. And also the service file, thought it would require more changes. But changing to something like
might be more useful anyway. See https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=, https://www.freedesktop.org/software/systemd/man/systemd.service.html#Command%20lines and https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers for some info. Ideally the desktop and service file would contain Maybe it would be fine to port the project to a different build system as qmake will apparently not be supported by Qt 6. |
Just found |
To my knowledge qmake will still be supported by Qt6 but cmake is the preferred tool to use. But I may be wrong. I also read that Qt will create a script to convert qmake files to cmake files. Let's wait until this script is ready and tested. Then we can try out to convert the Jamulus qmake file. |
I packaged Jamulus for nix/nixos and it would
be neat if there was an option to specify a
path at which to install the binary. I'm not
really familiar with qmake -- is this a good
way to achieve this?
(nixpkgs pull request: NixOS/nixpkgs#87914)