Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » How to create AppImage (Short tutorial showing how to build portable linux binaries)
How to create AppImage [message #60323] Wed, 22 November 2023 21:27
Zbych is currently offline  Zbych
Messages: 326
Registered: July 2009
Senior Member
Hi everyone,

As you probably know, creating universal binary packages for Linux can be a pain in the butt.
To make this pain a little less, I decided to play around with AppImage - a minimalist container.
AppImage allows you to pack your application, necessary libraries and assets into a single executable (and hopefully portable) file.
Unfortunately, AppImage doesn't solve the problem of missing or incompatible libraries on its own, you have to tell it which libraries should be part of your application.
It also means you have to build your application on the oldest system you want to support.
Before you start, I recommend reading this: https://docs.appimage.org/reference/best-practices.html#


To build AppImage:

1. Create directory structure like this:
MyAppName.AppDir
MyAppName.AppDir/usr/bin/
MyAppName.AppDir/usr/lib/

More information is here: https://docs.appimage.org/reference/appdir.html

2. Copy your binary to MyAppName.AppDir/usr/bin/
3. Copy the necessary libraries to MyAppName.AppDir/usr/lib/
4. Copy the application icon to MyAppName.AppDir/MyAppName.png
5. Create a desktop file for your application in MyAppName.AppDir/MyAppName.desktop:
[Desktop Entry]
Type=Application
Name=MyAppName
Exec=MyAppName
Icon=MyAppName
StartupNotify=true
Categories=Utility;

6. Remove hardcoded paths from your binaries and libraries:
sed -i -e 's#/usr#././#g' MyAppName.AppDir/usr/bin/MyAppName

7. Download bootstrap application AppRun and place it in MyAppName.AppDir/AppRun

When the directory structure is ready run the appimage toool to build AppImage. VoilĂ .

To automate these steps I created a simple bash script and added it to TheIde to automatically build AppImage.
1. Copy the script into your project directory
2. Open the project properties in theIDE and select "Custom build steps"
3. Press "insert" to add a new line and type post-link as the extension,
3. select the added line and paste into commands:
bash $(DIR)/make_app_image.sh $(EXEDIR)/$(EXEFILE)

[Updated on: Wed, 22 November 2023 21:44]

Report message to a moderator

Previous Topic: Clean UPPOUT data recovery
Next Topic: Cross compile on ubuntu for windows
Goto Forum:
  


Current Time: Wed May 08 18:09:22 CEST 2024

Total time taken to generate the page: 0.01751 seconds