.desktop points to wrong path when installed from source
This is the contents of the mailnag.desktop file when installed from source:
[Desktop Entry]
Name=Mailnag
Comment=An extensible mail notification daemon
Comment[de]=Ein erweiterbarer Mail-Benachrichtigungs-Dämon
Exec=/usr/bin/mailnag --quiet
Icon=mailnag
Type=Application
NoDisplay=true
X-GNOME-Autostart-enabled=true
X-GNOME-UsesNotifications=true
But mailnag executables are in /usr/local/bin
>>> which mailnag; which mailnag-config
/usr/local/bin/mailnag
/usr/local/bin/mailnag-config
Due to this problem, when installed from source, shortcuts doesn't appear in menus.
By the way I've spent some time on this issue; trying to find out the "final and true installation path of the executables from a setup.py script".
I think I found something;
install_script_cmd = self.distribution.get_command_obj('install_scripts')
print(install_script_cmd.install_dir)
When called from inside InstallData.run() function this will print the installation directory of the executables.
I hope it's useful to you.
I've noticed this problem isn't limited to .desktop files. Plugins were not loaded because paths in the dist_cfg.py were wrong. For ex;
LIB_DIR = '/usr/lib/python2.7/dist-packages/Mailnag'
should have been;
LIB_DIR = '/usr/local/lib/python2.7/dist-packages/Mailnag'
Manually specifying --prefix during install solved these issues;
sudo python ./setup.py install --prefix=/usr/local
When running setup.py install the prefix defaults to /usr on my system and PREFIX = '/usr' at line 23 in setup.py does match in that case. It seems that for some reason the prefix defaults to /usr/local on your distro so PREFIX = '/usr' doesn't match here. The current prefix code is implemented hacky anyway (as the comment in line 22 says ;), I'll try to reimplement it based on your install_script findings.
You don't need to install mailnag from source btw, you can just run it from an arbitrary directory in your home dir, in parallel to your package installation.
For the record; my distro is Linux Mint 17 (ubuntu based version).
Thanks for the tip.
More info on this topic: https://mail.python.org/pipermail/distutils-sig/2009-September/013284.html https://docs.python.org/2/install/