Implemented 64bit AppImage support

master
Ismael Barros² 2021-01-10 22:44:59 +00:00
parent 440dcd8b55
commit 12d6388e93
47 changed files with 54 additions and 25 deletions

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,32 +2,46 @@
# Author : Ismael Barros² <ismael@barros2.org>
# License : BSD http://en.wikipedia.org/wiki/BSD_license
arch="$(uname -m)"
case "$arch" in
i386|i586|i686) arch="x86" ;;
esac
OutputDir=..
InputDir="${1:-$PWD}"
OutputDir="$InputDir/.."
arch="$(uname -m)"
for i in "$@"; do
case "$i" in
-o=*)
OutputDir=${i#*=}
shift
;;
-m=*)
arch=${i#*=}
shift
;;
esac
done
AppImageAssistant="$(dirname $(readlink -f "$0"))/AppImageAssistant.AppImage"
[ -f "$AppImageAssistant" ] || { echo "Could not find $AppImageAssistant"; exit 1; }
[ -d "$InputDir" ] || { echo "Directory $InputDir doesn't exist"; exit 1; }
DesktopFile=$(ls -1 *.desktop | head -n1)
[ -n "$DesktopFile" ] || { echo "No package found"; exit 1; }
case "$arch" in
i386|i586|i686) arch="i686" ;;
x86_64|amd64) arch="x86_64" ;;
esac
PackageName="$(egrep Name "$DesktopFile" | head -n1 | cut -d= -f2)-${arch}.run"
AppImageTool="$(dirname $(readlink -f "$0"))/AppImage/appimagetool-${arch}.AppImage"
[ -f "$AppImageTool" ] || { echo "Could not find $AppImageTool"; exit 1; }
export ARCH="$arch"
rm -if "$OutputDir/$PackageName"
echo "Building package in $OutputDir/${PackageName}..."
DesktopFile=$(ls -1 "$InputDir"/*.desktop | head -n1)
[ -n "$DesktopFile" ] || { echo "No *.desktop file found in $InputDir"; exit 1; }
export LD_LIBRARY_PATH="$AppImageAssistantDir/usr/lib"
echo "$AppImageAssistant" --package . "$OutputDir/$PackageName"
"$AppImageAssistant" --package . "$OutputDir/$PackageName"
case "$arch" in
i386|i586|i686) arch="x86" ;;
esac
PackageName="$(egrep Name "$DesktopFile" | head -n1 | cut -d= -f2)"
PackagePath="$(readlink -f "$OutputDir/${PackageName}-${arch}.run")"
rm -if "$PackagePath"
echo "Building $PackagePath..."
"$AppImageTool" --no-appstream "$InputDir" "$PackagePath"

View File

@ -1,7 +1,9 @@
[Desktop Entry]
Name=
Exec=AppRun
Icon=AppRun.png
Icon=AppRun
Type=Application
Categories=Game
StartupNotify=true
X-AppImage-Title=
X-AppImage-Version=

View File

@ -24,7 +24,18 @@ setup_keepResolution
ret=0
cd "$APPDIR/usr/"
{
export RUNELF_HELPERS="$APPDIR/usr/lib/ld-linux.so.2"
if [[ "$(file "$BINARY")" =~ ELF.*executable.*\ interpreter\ ([^,]+) ]]; then
linker="$APPDIR/usr/lib/$(basename "${BASH_REMATCH[1]}")"
if [ -f "$linker" ]; then
export RUNELF_HELPERS="$linker"
else
echo "!! Linker not found in $linker" >&2
fi
else
linker=""
echo "!! Could not find architecture: $(file "$BINARY")" >&2
fi
run_withLocalLibs $APPRUN_HELPERS $RUNELF_HELPERS "$BINARY" $BINARY_ARGS "$@"
ret=$?
} 2>&1 | tee "$LOGFILE"

View File

@ -23,12 +23,12 @@ if [ -z "$*" ]; then
fi
Distro="$(egrep "ID_LIKE=(.*)" /etc/os-release | cut -d= -f2)"
[ -n "$Distro" ] || Distro="$(egrep "ID=(.*)" /etc/os-release | cut -d= -f2)"
Distro="$(egrep "^ID_LIKE=(.*)" /etc/os-release | cut -d= -f2)"
[ -n "$Distro" ] || Distro="$(egrep "^ID=(.*)" /etc/os-release | cut -d= -f2)"
[ -n "$Distro" ] || die "Could not find distro"
case "$Distro" in
Arch|archlinux)
Arch|arch|archlinux)
Tag="archlinux"
;;
Ubuntu*)
@ -40,12 +40,12 @@ case "$Distro" in
esac
case "$Distro" in
Arch|archlinux)
Arch|arch|archlinux)
getPackageInfo() {
if [ -f "$1" ]; then
pacman -Qip "$1"
else
yaourt -Si "$1"
yay -Si "$1"
fi
}
@ -70,7 +70,7 @@ case "$Distro" in
find_file_for_package() { ls -1t /var/cache/pacman/pkg/$1-?(+([^-])-)+([0-9\.])-+([^.-]).pkg.tar* 2>/dev/null| head -n1; }
uncompress_package_file() { tar -xf $1; }
package_files() { pacman -Ql "$1"; }
install_package() { yaourt -S "$1"; }
install_package() { yay -S "$1"; }
download_package() {
case "$1" in
aur/*)
@ -80,7 +80,7 @@ case "$Distro" in
echo "Building $pkg ..."
mkdir -p /tmp/pacman2AppDir_build/
pushd /tmp/pacman2AppDir_build/ || exit 1
yaourt -G "$pkg" || die "Could not download package from AUR"
yay -G "$pkg" || die "Could not download package from AUR"
pushd "$pkg" || exit 1
makepkg -d || exit 1
f=$(echo ${pkg}*.pkg.tar*)
@ -264,7 +264,7 @@ fi
if [ "$pkgs" ]; then
case "$Distro" in
Arch|archlinux)
Arch|arch|archlinux)
pkgs+=("xdg-utils")
ignore+=("libgl" "hicolor-icon-theme" "gtk-update-icon-cache")
;;
@ -383,6 +383,7 @@ fi
PackageName=$(desktopFile_getParameter "$i" "Name")
PackageExec=$(desktopFile_getParameter "$i" "Exec")
PackageIcon=$(desktopFile_getParameter "$i" "Icon")
PackageCategories=$(desktopFile_getParameter "$i" "Categories")
echo "Found .desktop file '$PackageName' ($PackageExec)"
@ -428,6 +429,7 @@ fi
cp "$pg4l_dir/data/AppRun.desktop" .
desktopFile_setParameter "AppRun.desktop" "Name" "$MainPackageName $MainPackageVersion-r1$Suffix"
desktopFile_setParameter "AppRun.desktop" "Categories" "$PackageCategories"
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Title" "$MainPackageName"
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Version" "$MainPackageVersion"
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Release" "1"