Where to put .desktop file and icon

I am in the process of creating a flatpak package for my application and publishing it to flathub, but I am unsure where to put the .desktop file and the icon.

My github repository, that I am cloning to build the program, contains the .desktop file and the application’s icon is located in my github’s src/ directory. Will flatpak be able to find these itself, or do I need to upload these in the flathub PR, so that they are located in the root directory of my PR (next to the manifest)?

I use this commands in manifest:

  - name: tabela
    buildsystem: simple
      - python -m pip install --no-deps --no-build-isolation --prefix=/app .
      - install -Dm644 data/eu.cichy1173.tabela.desktop -t /app/share/applications
      - install -Dm644 data/eu.cichy1173.tabela.metainfo.xml -t /app/share/metainfo
      - install -Dm644 data/icons/hicolor/apps/48x48/eu.cichy1173.tabela.png -t /app/share/icons/hicolor/48x48/apps
      - install -Dm644 data/icons/hicolor/apps/128x128/eu.cichy1173.tabela.png -t /app/share/icons/hicolor/128x128/apps

Command - python -m pip install --no-deps --no-build-isolation --prefix=/app . installs the app. Next four commands are for icons, .desktop and metainfo

Ok so I understand it correct that I need to manually copy the .desktop, .metainfo and the icon to the proper locations, right?

I am not a pro in Flatpak (I published only one app tabela | Flathub) but this commands work, so I think this files can be copied manually. Is it the only way? I think not, but you have to ask more experienced developers about that

Ok thank you, I will go with your approach

What exactly is python -m pip install --no-deps --no-build-isolation --prefix=/app . doing in your example?

Installs the app using setup.py and setuptools

I understand, so it moves your actual binary to the destination location, right?

Btw, you shared install -Dm644 data/eu.cichy1173.tabela.desktop -t /app/share/applications above. Where exactly is my current position at this step? Is it in the cloned git repository, or is it one directory up?

root directory of the git repo. data is a subdirectory in this repo. You can check this here: cichy1173/tabela-flatpak: Repository for Flatpak version of tabela app - tabela-flatpak - Codeberg.org

1 Like