probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.22k stars 414 forks source link

Cannot build appimage -- Desktop file not found, aborting #482

Closed James-Hudson3010 closed 3 years ago

James-Hudson3010 commented 3 years ago

I have a sample project at https://github.com/jh3010-qt-questions/large_qrc which I am working with.

I have setup my directory structure according to the instructions:

$ tree usr/
usr/
├── bin
│   └── large_qrc
├── lib
└── share
    ├── applications
    │   └── large_qrc.desktop
    └── icons
        └── hicolor
            └── 256z256
                └── apps
                    └── large_qrc.png

My desktop files looks like:

$ cat usr/share/applications/large_qrc.desktop
[Desktop Entry]
Type=Application
Name=Large QRC
Comment=The best Qt Application Ever
Exec=large_qrc
Icon=large_qrc
Categories=Office;⏎

I then call linuxdeployqt:

$ linuxdeployqt usr/bin/large_qrc -appimage -qmake=/home/jamesh/Qt5.12.10/5.12.10/gcc_64/bin/qmake -qmldir=/home/jamesh/depot_qt/questions/large_qrc

linuxdeployqt 4 (commit 8b3ded6), build 571 built on 2018-10-07 20:58:12 UTC
FHS-like mode with PREFIX, fhsPrefix: "/home/jamesh/depot_qt/questions/appimage/usr"
app-binary: "/home/jamesh/depot_qt/questions/appimage/usr/bin/large_qrc"
appDirPath: "/home/jamesh/depot_qt/questions/appimage"
relativeBinPath: "usr/bin/large_qrc"
appimagetool, continuous build (commit d185526), build 1855 built on 2018-10-07 20:18:45 UTC
Desktop file not found, aborting

What am I doing wrong?

If it matters, I am using Ubuntu 20.04.

probonopd commented 3 years ago

Try

cd .. # You need to be outside of the AppDIr
linuxdeployqt appdir/usr/share/applications/large_qrc.desktop -appimage -qmake=/home/jamesh/Qt5.12.10/5.12.10/gcc_64/bin/qmake -qmldir=/home/jamesh/depot_qt/questions/large_qrc`
James-Hudson3010 commented 3 years ago

that works. I did not realize that the tool, in this case, needed to point to the .desktop

keshavbhatt commented 3 years ago

I have similar problem creating appimage of one of my app,

 ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/bin/wonderwall -appimage -qmake="/usr/lib/x86_64-linux-gnu/qt5/bin/qmake"
linuxdeployqt 7 (commit 7d0bab4), build 730 built on 2021-04-27 18:47:56 UTC
FHS-like mode with PREFIX, fhsPrefix: "/tmp/appimage/appdir/usr"
app-binary: "/tmp/appimage/appdir/usr/bin/wonderwall"
appDirPath: "/tmp/appimage/appdir"
relativeBinPath: "usr/bin/wonderwall"
Keeping existing AppRun
WARNING: Plugin "/usr/lib/x86_64-linux-gnu/qt5/plugins/styles/libqgtk2style.so" not found, skipping
WARNING: "/tmp/appimage/appdir/usr/bin/qt.conf" already exists, will not overwrite.
appimagetool, continuous build (commit 8bbf694), build <local dev build> built on 2020-12-31 11:48:33 UTC
fatal: not a git repository (or any of the parent directories): .git
Failed to run 'git rev-parse --short HEAD: Child process exited with code 128 (code 128)
Desktop file not found, aborting

My desktop file is located in usr/share/applications/, output of tree :

$ tree appdir/usr/share/applications/
appdir/usr/share/applications/
└── wonderwall.desktop

0 directories, 1 file

Content of desktop file, output of cat :

$ cat appdir/usr/share/applications/wonderwall.desktop 
[Desktop Entry]
Version=1.0
GenericName=Wonderwall
Name=Wonderwall
Type=Application
Icon=wonderwall
Keywords=Wallpaper;Variety;wallch;desktop;background
Exec=wonderwall %F
Comment=Wallpaper manager for Linux
Categories=Utility;Settings;
Terminal=false
Name[en_IN]=Wonderwall
keshavbhatt commented 3 years ago

This is strange behaviour but I was able to build appimage with the following command using the .desktop file as argument instead of app binary:

$ ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/wonderwall.desktop -appimage -qmake="/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" -no-copy-copyright-files

probonopd commented 3 years ago

Looks correct. But why -no-copy-copyright-files?

keshavbhatt commented 3 years ago

I don't know, since the option was there. Thought it will reduce size of AppImage.

probonopd commented 3 years ago

They are tiny text files and depending on what you are packaging they may be necessary for legal reasons.

keshavbhatt commented 3 years ago

Who unpacks an AppImage to see if one has shipped copyright files unless they are trying to sue someone. Kidding, I will remove that argument.