Skip to content

Navigation Menu

Sign in
Sign up

How can this method be better ? building AppImage with Dynamic Hard-Linked files - symlink hard-linked. #1388

Unanswered
offternet asked this question in Q&A
Discussion options

I owe everyone a big apology as AppImage does work as designed. @probonopd @TheAssassin

I originally used Sparkylinux 7 (trixie) to build my AppImage which was part of the problem but, after several days of testing on a new Distro, I came up with the following that works for me.

Used the below "cp" command to copy all dynamic linked library files to AppDir/usr/lib... for yad gui
(yad binary & 3 other executables

cp --parents -H $(ldd /usr/local/bin/yad | grep -o '\W/[^ ]*') AppDir/usr/ # produced directories lib 246 files / lib64 1 file.

yad also uses 3 helper executables under /usr/lib/x86_64-linux/webkit2gtk-4.0

  • /usr/lib/webkit2gtk-4.0/MiniBrowser.source
  • /usr/lib/webkit2gtk-4.0/WebKitNetworkProcess.source
  • /usr/lib/webkit2gtk-4.0/WebKitWebProcess.source

yad library files /usr/lib | /usr/share → 465 library files = 465 / 232MB

yad binary → compiled on pure Debian bookworm 12 x86_64
./configure --enable-html –enable-sourceview --standalone

yad etc config files = 7 | 232KB

16 hard-linked library files copied to target partition

  • File List at bottom of this post - subject to change – more testing needed
  • Example code to create symlink to /tmp/yad/lib/x86_64-linux-gnu/library-fileame

This is what I am now doing that is working for me:

/AppDir/ Structure:
/AppDir/AppImageBuilder.yml
/AppDir/AppRun
/yad14-portable.desktop
yad-app.png
/Appdir/usr/bin/yad
/AppDir/etc/openal/alsoft.conf
/AppDir/etc/openni2/OpenNI.ini
/AppDir/etc/timidity/timgm6mb.cfg

/AppDir/usr/lib/gstreamer-1.0/ # 264 Library Files
/AppDir/usr/lib/OpenNI2/Drivers/ # 3 driver files
/AppDir/usr/lib/udev/rules.d/60-libopenni2-0.rules
/AppDir/usr/lib/x86_64-linux-gnu/ # 154 Library files
AppDir/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/ # 4 executable helper files
/AppDir/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/injected-bundle/
/AppDir/usr/share/gstreamer-1.0/encoding-profiles/device/dvd.gep
/AppDir/usr/share/gstreamer-1.0/encoding-profiles/file-extension/ # 9 encoding files
/AppDir/usr/share/gstreamer-1.0/encoding-profiles/online-services/youtube.gep
/AppDir/usr/share/gstreamer-1.0/presets/ # 8 multimedia preset files

#----------------------------

/AppDir/AppRun

#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
export PATH="${HERE}/usr/bin:/usr/lib:/etc:/etc/openal:/etc/openni2:/etc/timidity:usr/share/gstreamer-1.0/encoding-profiles/device:/usr/share/gstreamer-1.0/encoding-profiles/file-extension:/usr/share/gstreamer-1.0/encoding-profiles/online-services:/usr/share/gstreamer-1.0/presets:/usr/lib/gstreamer-1.0:/usr/lib/OpenNI2/Drivers:/usr/lib/udev/rules.[d:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/injected-bundle:/usr/lib/x86_64-linux-gnu](https://github.com/d:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/injected-bundle:/usr/lib/x86_64-linux-gnu)"
exec "${HERE}/usr/bin/yad" "$@"

#----------------------------

/AppDir/yad14-portable.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Name[en_GB]=Yad-Porable-14.1-AppImage
Name=Yad-Porable-14.1-AppImage
Name[en_US]=Yad-Porable-14.1-AppImage
GenericName[en_GB]=Yad-Porable-14.1-AppImage
GenericName=Yad-Porable-14.1-AppImage
GenericName[en_US]=Yad-Porable-14.1-AppImage
Exec=/usr/bin/yad
Icon=yad-app
Path=/usr/bin
Terminal=false
Type=Application
Categories=Utility;
Comment="yad 14 Portable"
StartupNotify=false

----------------------------------

AppImageBuilder.yml (Not Used – Untested)

app: yad
binpatch: true
ingredients:
 dist: bookworm
 sources:
 	- deb http://deb.debian.org/debian bookworm main non-free-firmware
- deb-src http://deb.debian.org/debian bookworm main non-free-firmware

----------------------------------

Additional Added Library Files – Hard Linked by yad GUI binary

These files can be copied to /tmp/yad/usr/lib/x86_64-linux/ directory and symlined to system directory. I will make a script that does this and post it here.

Debian pure
yad dependencies: Hard Linked Files not normally on Debian minimum builds:

libenchant-2.so.2
libgstgl-1.0.so.0
libgsttranscoder-1.0.so.0
libgtksourceview-3.0.so.1
libharfbuzz-icu.so.0
libicuio.so.72
libmanette-0.2.so.0
libsoup-2.4.so.1

Ubuntu / Linux Mint
yad dependencies: Hard Linked Library Files not normally on Ubuntu builds:

libavif.so.15
libdav1d.so.6
libicudata.so.72
libicui18n.so.72
libicuuc.so.72
libjpeg.so.62
libwoff2common.so.1.0.2
libwoff2dec.so.1.0.2


Example of symlinking to temp hard-linked yad library files:

#!/bin/bash
 export libDir="/usr/lib/x86_64-linux-gnu"
 export libTmpDir="/tmp/yad/usr/lib/x86_64-linux-gnu"
 libFile="libenchant-2.so.2"
# do if file exists 
 if [ -f "$libDir/$libFile" ]; then
	ls -l $libDir/$libFile
	sleep .25
 else 
# do if file is missing: ln -s (file) (symlink)
	ln -s $libTmpDir/$libFile $libDir/$libFile
# export log of all symlinks for easy 1 click removal when done using yad portable setup.
	echo "unlink /usr/lib/x86_64-linux-gnu/$libFile" >> /tmp/yad/remove_yad-libfile-symlinks.sh 
# display symlinke > file (/tmp/yad/usr/lib/x86_64-linux-gnu/libenchant-2.so.2
	ls -l $yadDir/$yadFile
	sleep .25
 fi
You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Hi, you can use sharun if you need to bundle webkit2gtk: https://github.com/VHSgunzo/sharun

I has a hook that automatically handles webkit2gtk

See this example: https://github.com/olekolek1000/wayvr-dashboard/blob/master/appimage/deb_to_appimage.sh

Probono also used sharun for the PrusaSlicer AppImage that also bundles webkit2gtk, but this was done before the lib4bin hooks feature, so a lot of steps were done manually back then.

You must be logged in to vote
2 replies
Comment options

Thank You for providing program info and examples too, that will help a lot !

Comment options

@Samueru-sama I have spent some time looking at sharun / lib4bin and it will help me to build minimal AppImages for apps that have hard linked shared library files.
Again, Thank you for the information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /