A tool for creating standalone Linux applications
linuxdeploy inspects the executable file and deploys it alongside with all the dependencies to a specified location. Afterwards RPATH is fixed correctly so deployed executable only uses deployed libraries. Main use-case for this tool is deploying Qt applications on Linux without pain in the format of AppImage, however your mileage may vary.
As easy as:
cd src
go build -o linuxdeploy
You have to have in your PATH
:
ldd
(checking dso dependencies)- patchelf (patching
RPATH
in binaries) strip
(optionally to remove debug symbols from binaries)
Most simple usage of this tool can be expressed with a following commands:
linuxdeploy -exe /path/to/myexe -appdir myexe.AppDir -icon /path/to/icon
-gen-desktop -default-blacklist -out appimage
appimagetool --verbose -n myexe.AppDir "myexe.AppImage"
These commands will deploy application myexe
and it's dependencies to the directory ./myexe.AppDir/
packing in the AppImage-compatible structure. Afterwards AppImage is generated with a proper tool.
linuxdeploy is capable of correctly deploying all Qt's dependencies alongside: libraries, private widgets, QML imports and translations. Optionally you can specify path to the qmake
executable and linuxdeploy will parse Qt Environment from it. You can specify additional directories to search for qml impors using -qmldir
switch.
Usually when creating AppImage you don't need to deploy all libraries (like libstdc++ or libdbus). linuxdeploy supports ignore list (called "blacklist") as a command-line parameter -blacklist
as path to a file with a prefix per line to ignore (e.g. if you need to ignore libstdc++.so.6 you can have a line libstdc++ in the blacklist file). Also you have a default blacklist which can be checked out in the src/blacklist.go
file.
linuxdeploy can generate a desktop file in the deployment directory. Also it will fill-in information about icon and AppRun link in case you're deploying AppImage.
Every binary deployed (original exe and dependent libs) can be stripped if you specify cmdline swith -strip
.
-exe string
Path to the executable to deploy
-appdir string
Path to the destination deployment directory or AppDir (if 'type' is appimage)
-libs value
Additional libraries search paths (repeatable)
-qmake string
Path to qmake
-qmldir value
Additional QML imports dir (repeatable)
-blacklist string
Path to the additional libraries blacklist file (default "libs.blacklist")
-default-blacklist
Add default blacklist
-gen-desktop
Generate desktop file
-icon string
Path the exe's icon (used for desktop file)
-log string
Path to the logfile (default "linuxdeploy.log")
-out string
Type of the generated output (default "appimage")
-overwrite
Overwrite output if preset
-stdout
Log to stdout and to logfile
-strip
Run strip on binaries
I wrote this tool because linuxdeployqt was too buggy for me. Now this tool successfully deploys more or less complex desktop Qt/Qml app and works a lot faster then the former. There could be some issues with libQt5Core.so
patching in TravisCI environment, but everything seems to work just fine in a field.
Pull Requests and feedback are more than welcome. Check out CONTRIBUTING.md for more details and documentation on the internals.