Skip to content
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

ReText has wrong Exec and Icon lines in /usr/local/share/applications/me.mitya57.ReText.desktop file when installed with pip3 #452

Closed
N0rbert opened this issue Mar 23, 2019 · 2 comments

Comments

@N0rbert
Copy link

N0rbert commented Mar 23, 2019

Steps to reproduce:

  1. Have Ubuntu 16.04.6 LTS or Ubuntu 18.04.2 LTS installed with all updates
  2. Install pip3 with sudo apt install python3-pip
  3. Install ReText from pypi with sudo -H pip3 install retext

Expected results:

  • pip3 installed ReText with correct paths in desktop-file - user can launch application from Dash and can identify ReText by its icon

Actual results:

  • pip3 installed ReText with broken paths in /usr/local/share/applications/me.mitya57.ReText.desktop file:

    $ cat /usr/local/share/applications/me.mitya57.ReText.desktop | grep -E "Exec|Icon"
    Exec=ReText-7.0.4.data/scripts/retext %F
    Icon=ReText-7.0.4.data/data/share/retext/icons/retext.svg
    

    Screenshot from mozo Main Menu editor
    retext

  • ReText starts normally only from terminal as

    $ which retext 
    /usr/local/bin/retext
    

    is correct.

Temporary workaround:

  • Change paths in /usr/local/share/applications/me.mitya57.ReText.desktop manually to

    Exec=/usr/local/bin/retext
    Icon=/usr/local/share/retext/icons/retext.svg
    
@N0rbert N0rbert changed the title ReText has wrong Exec line in /usr/local/share/applications/me.mitya57.ReText.desktop file when installed with pip3 ReText has wrong Exec and Icon lines in /usr/local/share/applications/me.mitya57.ReText.desktop file when installed with pip3 Mar 23, 2019
@mitya57
Copy link
Member

mitya57 commented Mar 26, 2019

Thanks for reporting this! I will fix it ASAP. In the meantime, passing --no-cache-dir to pip should work around the issue.

Upd: the option name is --no-cache-dir, not --no-use-wheel like this comment previously stated.

@mitya57
Copy link
Member

mitya57 commented Mar 31, 2019

So it looks like by default pip first builds a wheel and then installs it. When installing into a wheel, our setup.py thinks that the wheel directory is the final destination and writes that path to the .desktop file. There is no way to know what the actual destination will be.

I have just pushed a commit that disables any path substitution at all when building wheels, so the desktop file will have generic Exec=retext %F and Icon=retext lines. This is not ideal, but better than the current situation.

I recommend either using the distro packages, or running pip with --no-cache-dir like my previous comment says.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants