PREFIX not respected in subdirs projects
XFLR5 is an analysis tool for airfoils, wings and planes
Brought to you by:
techwinder
When passing PREFIX to qmake the variable is not respected in xflr5-engine.pro
or XFoil-lib.pro where 'target.path' is hardcoded to "/usr/local/lib".
This results in the binary 'xflr5' being installed in the correct PREFIX while the libraries end up in /usr/local/lib.
Well, /usr/local/lib is where the shared libraries belong if they are to be re-used by other applications.
But OK, I'll see if this can be overriden if PREFIX is specified.
Most linux distributions, whether they follow the FHS or just out of convention, reserve /usr/local for locally installed software that bypasses the package-manager. Official distro packages will not be installed there
So instead of letting every downstream packager hack around this individually it would be better to fix it upstream before they start packaging 6.42.
Debian follows the FHS:
https://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html#USRLOCALLOCALHIERARCHY
as well as Fedora:
https://fedoraproject.org/wiki/Packaging:Guidelines#No_Files_or_Directories_under_.2Fsrv.2C_.2Fusr.2Flocal.2C_or_.2Fhome.2F.24USER
Gentoo's layout is only based on the FHS but retains the same rule for /usr/local:
https://devmanual.gentoo.org/general-concepts/filesystem/index.html
same as Arch:
https://wiki.archlinux.org/index.php/Arch_packaging_standards#Package_etiquette
I'm not very good at packaging for linux. Care to commit the change if I give you dev rights to the project?
Commit access is probably a bit too much responsibility but i can try to whip up a patch this weekend.
I think this is as idiomatic as it gets in qmake. I tested it for a couple of scenarios and it seems to work as expected. It still defaults to /usr/local but will let you override the prefix with a simple "qmake PREFIX=/usr".
Thanks. I'm still uncertain though.
I understand that it's important to facilitate the job of packagers. However the goal is for the XFoil-lib and xflr5-engine libs to be re-used by other apps, say sail7 for instance. If they are installed in any directory, then this directory will need to be included in the user's PATH, and as far as I understand the make install process doesn't do this - by default at least.
On the other hand, again as far as I understand, this is the intent of the /usr/local/lib directory. from The Linux Documentation Project
The main advantage is that /usr/local/lib is in the PATH by default.
The other recommended way seems to be to use the opt directory
But then the install process will need to add the directory to the PATH.
I'll give it some thought.
Last edit: André 2018-06-10
The goals of reusable xflr libraries and happy downstream packagers are not at odds.
Any software worth its money will default to the /usr/local PREFIX. Admins expect this when they install software with the typical "make && make install" combo.
Distribution packagers must follow the guidelines of their distro, which in most cases forbids installation to /usr/local.
You, as the upstream maintainer, don't have to worry about /usr/local/lib being in the search path of the dynamic linker or /usr/local/bin being in $PATH. Leave that up to the distribution and the admin, they know better about the quirks of their system.
The best thing you can do is to keep the build system adaptable enough to help them achieve their respective goals.
You can't rely on this being true. But you don't have to worry about it either. It's not your problem, leave it up to the distro/admin.
Since this project nicely fits into the file structure of modern distros you don't want to install to /opt.
Last edit: Alexander Schnaidt 2018-06-10
OK, thanks for the exaplanation. Things are a little more clear now.
Fix committed.