I use the deb2appimage program from
https://github.com/simoniz0r/deb2appimage

I use the deb2appimage program from
https://github.com/simoniz0r/deb2appimage

////////////// MANY THANKS TO THE AUTHOR /////////////////////
////////////// MANY THANKS TO THE AUTHOR /////////////////////
////////////// MANY THANKS TO THE AUTHOR /////////////////////

The shell script is located at
~/devel/appimage/deb2appimage/deb2appimage.sh

This shell script is modified to suit my working method.
Check the options with --help.

Network-independent preparation of the local packages
=====================================================

The working directory for deb2appimage to make the preparation of the
AppImage image is located at
~/.local/deb2appimage

In that directory, all the Debian packages that will be needed to extract
useful libraries or binaries to put in the AppImage image are located in
~/.local/deb2appimage/debs.

I have created a static replicate in
~/.local/deb2appimage/stable-debs
because the deb packages in ~/.local/deb2appimage/debs are automatically removed
by the deb2appimage.sh script (could not manage to understand where).

So the first set of commands to run with newly built packages in the local
development hierarchy:

debs_directory=$HOME/.local/deb2appimage/debs
cp -uv $HOME/devel/odsstream/build-area/debbench/stable/libodsstream0_0.9.18-1_amd64.deb ${debs_directory}
cp -uv $HOME/devel/pappsomspp/build-area/debbench/stable/libpappsomspp-{core,gui}0*.deb ${debs_directory}
cp -uv $HOME/devel/xpertmass/build-area/debbench/stable/libxpertmass{core,gui}1*_*.deb ${debs_directory}

Beware, the two programs need not be in the same debs directory because they will be
copied to the AppImage. But the AppImage will be able to run only one executable !

MassXpert
=========
cp -uv $HOME/devel/massxpert/build-area/debbench/stable/massxpert3{,-doc,-data}*.deb ${debs_directory}

MineXpert
=========
cp -uv $HOME/devel/minexpert/build-area/debbench/stable/minexpert3{,-doc}*.deb ${debs_directory}

After that, we can start downloading the packages in ~/.local/deb2appimage/debs.

The script needs to be run from the appimage directory in the program's corresponding
source directory:

cd $HOME/devel/massxpert/development/appimage

Then make sure to copy the already downloaded deb package from the static
~/.local/deb2appimage/stable-debs directory to the dynamic ~/.local/deb2appimage/debs
directory. There are flags to the deb2appimage.sh script that allows to only
download debian packages (and that does not load the packages already found in
~/.local/deb2appimage/debs).

This is the command to only download the debian packages from the Debian repositories
without going on to the AppImage building (which may delete all the debian packages
depending on the presence/absence of the --keepdownloadeddebs flag):

pushd ~/.local/deb2appimage && ./update-debs-from-store && \
popd && clear && reset && \
~/devel/appimage/deb2appimage/deb2appimage.sh --debug -j ./deb2appimage-stable.json -o . --onlydownloaddebs

With this --onlydownloaddebs flag, the packages are downloaded from the debian repositories
and then the program stops.

At this point make a backup of all the download debian packages from debs to stable-debs,
for when the deb2appimage.sh erases them all from debs (if --removedownloaddebs is provided).

Good. Now run a Fedora39 virtualbox image and execute the massxpert-linux-x86_64.AppImage file.
You'll see that some library is missing. Copy the library file name and go to
https://www.debian.org/distrib/packages to search what package contains that file.
Copy the found package for stable and for amd64. Put that name in the "deps"
list in the deb2appimage-stable.json configuration file at

$HOME/devel/massxpert/development/appimage/deb2appimage-stable.json

Currently, a full list that actually creates a usable AppImage image is the following:

"deps": "libboost-system1.88.0, libboost-chrono1.88.0t64, libboost-container1.88.0, libboost-filesystem1.88.0, libboost-thread1.88.0, libboost-iostreams1.88.0, libboost-random1.88.0, libboost-atomic1.88.0, libboost-date-time1.88.0, libboost-regex1.88.0, libqt6core6t64, libqt6gui6, libqt6svg6, libqt6svgwidgets6, libqt6widgets6, libqt6printsupport6, libqt6sql6, libqt6core5compat6, libqt6network6, libqt6xml6, libqt6concurrent6, libqt6dbus6, libopengl0, libqscintilla2-qt6-15, libquazip1-qt6-1t64, libicu76, libbz2-1.0, zlib1g, liblzf1, libzstd1, libsqlite3-0, libpwizlite3t64,  libmd4c0, libdouble-conversion3, libb2-1, libhdf5-cpp-310, libhdf5-31, libssl3t64, libsz2, libaec0, libstdc++6,libcurl4t64, libnghttp3-9, librtmp1, libldap2, libsasl2-2, libssh2-1t64"

Note that this is a comma-separated value list in a single double quote pair.

At this point, run the following command with the following flag:

pushd ~/.local/deb2appimage && ./update-debs-from-store && \
popd && clear && reset && \
~/devel/appimage/deb2appimage/deb2appimage.sh --debug -j ./deb2appimage-stable.json -o . --downloaddeb libssh2-1t64

The '--downloaddeb libssh2-1t64' flag tells to download the libssh2-1t64 debian package from
the debian repositories and to copy immediately it from deps to stable-debs, so that we have it
available. No other downloads are performed and the AppImage image is built right away.
At this point run that image again in Fedora39 and redo the loop with any new missing library.

At the end of doing all that work, I found that the program was not complaining about any missing
libraries, but that the libqxcb was missing with the message about the platform. I knew that was this
file not reachable but actually in there the AppImage image:

lib/x86_64-linux-gnu/qt6/plugins/platforms

So I had to provide the qt.conf file in the $HOME/.local/deb2appimage/AppDir/usr/bin
directory that reads like this:

% cat qt.conf
[Paths]
Prefix = ../
Plugins = lib/x86_64-linux-gnu/qt6/plugins

When the MassXpert program is run, it's looking into this qt.conf file to be
able to locate the plugins/platforms/libqxcb.so library.

So the template qt.conf file is located at $HOME/devel/massxpert/development/appimage/qt.conf
and that file is copied to $HOME/.local/deb2appimage/AppDir/usr/bin/

right next to the MassXpert3 program by my modified version of the deb2appimage.sh
script.

Once all the material needed to be included in the AppImage image bundle, run
the canonical command but first make sure to remove the AppDir directory in the
working directory:

rm -rf $HOME/.local/deb2appimage/AppDir

That ensure that any cruft stored there while elaborating the contents of the AppImage
image are remove and that a new pristine AppImage image is built.

