How to bundle program libraries to AppImage lib directory

Hi everyone,

I have successfully created my AppImage for my program that uses GTK2 using this command:

./appimagetool-x86_64.AppImage squashfs-root/ my_program_x84_64.AppImage generate

Now I want to bundle its libraries or dependencies (like gtk2, etc) to use it in other linux distros.
And when I run this command :
objdump -p /usr/bin/myprogram | grep NEEDED

I get this :

  NEEDED               libpthread.so.0
  NEEDED               libdl.so.2
  NEEDED               libgdk-x11-2.0.so.0
  NEEDED               libX11.so.6
  NEEDED               libgdk_pixbuf-2.0.so.0
  NEEDED               libgtk-x11-2.0.so.0
  NEEDED               libgobject-2.0.so.0
  NEEDED               libglib-2.0.so.0
  NEEDED               libgthread-2.0.so.0
  NEEDED               libgmodule-2.0.so.0
  NEEDED               libpango-1.0.so.0
  NEEDED               libcairo.so.2
  NEEDED               libatk-1.0.so.0
  NEEDED               libXtst.so.6
  NEEDED               libc.so.6
  NEEDED               libpangocairo-1.0.so.0

I found linuxdeploy with its gtk plugin

./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage --icon-file myprogram.png

after it includes all the libraries of the program, the AppRun not created, instead it create a directory names apprun-hooks with this script:

#! /usr/bin/env bash

gsettings get org.gnome.desktop.interface gtk-theme 2> /dev/null | grep -qi "dark" && GTK_THEME_VARIANT="dark" || GTK_THEME_VARIANT="light"
APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:-"Adwaita:$GTK_THEME_VARIANT"}" # Allow user to override theme (discouraged)

export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}" # Workaround to run extracted AppImage
export GTK_DATA_PREFIX="$APPDIR"
export GTK_THEME="$APPIMAGE_GTK_THEME" # Custom themes are broken
export GDK_BACKEND=x11 # Crash with Wayland backend on Wayland
export XDG_DATA_DIRS="$APPDIR/usr/share:/usr/share:$XDG_DATA_DIRS" # g_get_system_data_dirs() from GLib
export GSETTINGS_SCHEMA_DIR="$APPDIR//usr/share/glib-2.0/schemas"
export GI_TYPELIB_PATH="$APPDIR//usr/lib/x86_64-linux-gnu/girepository-1.0"
export GDK_PIXBUF_MODULE_FILE="$APPDIR//usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache"

And not works when i create again using:
./appimagetool-x86_64.AppImage squashfs-root/ my_program_x84_64.AppImage generate

Please ask over at Issues · linuxdeploy/linuxdeploy · GitHub since its author probably isn’t reading here. Thanks!