mailnag icon indicating copy to clipboard operation
mailnag copied to clipboard

.desktop points to wrong path when installed from source

Open hyOzd opened this issue 10 years ago • 5 comments

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.

hyOzd avatar Jan 02 '16 19:01 hyOzd

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.

hyOzd avatar Jan 02 '16 20:01 hyOzd

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

hyOzd avatar Jan 03 '16 11:01 hyOzd

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.

pulb avatar Jan 03 '16 14:01 pulb

For the record; my distro is Linux Mint 17 (ubuntu based version).

Thanks for the tip.

hyOzd avatar Jan 03 '16 21:01 hyOzd

More info on this topic: https://mail.python.org/pipermail/distutils-sig/2009-September/013284.html https://docs.python.org/2/install/

pulb avatar Jan 12 '16 17:01 pulb