AppImageCrafters / appimage-builder

GNU/Linux packaging solution using the AppImage format
MIT License
304 stars 58 forks source link

Cannot generate recipe from provided .desktop file #49

Closed hcsubser closed 3 years ago

hcsubser commented 3 years ago

When I run appimage-builder --generate I get the following error:

INFO:Generator:Searching AppDir
INFO:Generator:Searching desktop entries
INFO:Generator:Reading desktop entry: rakarrack.desktop
Traceback (most recent call last):
  File "/usr/local/bin/appimage-builder", line 18, in <module>
    __main__();
  File "/usr/local/lib/python3.6/dist-packages/AppImageBuilder/__main__.py", line 51, in __main__
    generator = RecipeGenerator()
  File "/usr/local/lib/python3.6/dist-packages/AppImageBuilder/generator/generator.py", line 48, in __init__
    self._setup_app_info()
  File "/usr/local/lib/python3.6/dist-packages/AppImageBuilder/generator/generator.py", line 147, in _setup_app_info
    parser = DesktopFileParser(desktop_file)
  File "/usr/local/lib/python3.6/dist-packages/AppImageBuilder/generator/desktop_entry_parser.py", line 23, in __init__
    exec = self.parser['Desktop Entry']['Exec'].strip()
  File "/usr/lib/python3.6/configparser.py", line 959, in __getitem__
    raise KeyError(key)
KeyError: 'Desktop Entry'

It seems to me that this is a problem with .desktop file so here is my desktop file:

[Desktop Entry]
Type=Application
Categories=AudioVideo;Audio;
Exec=rakarrack
Name=Rakarrack
Comment=Guitar Effects Processor
Terminal=false
Icon=rakarrack

Weirdest thing with this is that it seems to only happen with desktop files that I manually write, because when I, for example, download audacious.deb package with apt download audacious and extract it and use desktop file that was inside of it, this error does not happen.

azubieta commented 3 years ago

It's provably something related to the .desktop file format. Could you please quick check if your desktop files is valid using desktop-file-validate?

hcsubser commented 3 years ago

I tried it but desktop-file-validate rakarrack.desktop gave no output.

azubieta commented 3 years ago

@milanlinux I'm currently working on improving this section. Could you please share your desktop file (the whole file), for me to used while testing.

In the meantime you can use one of the existent recipes as template and manually add the required packages.

hcsubser commented 3 years ago

Alright, I created a repo where I uploaded .desktop file (since that was the easiest way for me to share it and because I will eventually release it here), so here it is: (https://github.com/milanlinux/rakarrack-appimage)

azubieta commented 3 years ago

Hello @milanlinux, I downloaded your .desktop file, copied it into an AppDir/usr/share/applications and also copied ls in AppDir/usr/bin/rakarrack and the appimage-builder --generate command ran well.

Maybe we could do a shared terminal session in order to diagnose your issue, if that is ok to you please find me at irc://irc.freenode.net/appimage as azubieta

azubieta commented 3 years ago

This should be fixed in the latest release (v0.8.2). Please feel free to reopen the issue if required.