Implemented 64bit AppImage support
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
@ -2,32 +2,46 @@
|
||||||
# Author : Ismael Barros² <ismael@barros2.org>
|
# Author : Ismael Barros² <ismael@barros2.org>
|
||||||
# License : BSD http://en.wikipedia.org/wiki/BSD_license
|
# 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
|
for i in "$@"; do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
-o=*)
|
-o=*)
|
||||||
OutputDir=${i#*=}
|
OutputDir=${i#*=}
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-m=*)
|
||||||
|
arch=${i#*=}
|
||||||
|
shift
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
AppImageAssistant="$(dirname $(readlink -f "$0"))/AppImageAssistant.AppImage"
|
[ -d "$InputDir" ] || { echo "Directory $InputDir doesn't exist"; exit 1; }
|
||||||
[ -f "$AppImageAssistant" ] || { echo "Could not find $AppImageAssistant"; exit 1; }
|
|
||||||
|
|
||||||
DesktopFile=$(ls -1 *.desktop | head -n1)
|
case "$arch" in
|
||||||
[ -n "$DesktopFile" ] || { echo "No package found"; exit 1; }
|
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"
|
DesktopFile=$(ls -1 "$InputDir"/*.desktop | head -n1)
|
||||||
echo "Building package in $OutputDir/${PackageName}..."
|
[ -n "$DesktopFile" ] || { echo "No *.desktop file found in $InputDir"; exit 1; }
|
||||||
|
|
||||||
export LD_LIBRARY_PATH="$AppImageAssistantDir/usr/lib"
|
case "$arch" in
|
||||||
echo "$AppImageAssistant" --package . "$OutputDir/$PackageName"
|
i386|i586|i686) arch="x86" ;;
|
||||||
"$AppImageAssistant" --package . "$OutputDir/$PackageName"
|
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"
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=
|
Name=
|
||||||
Exec=AppRun
|
Exec=AppRun
|
||||||
Icon=AppRun.png
|
Icon=AppRun
|
||||||
|
Type=Application
|
||||||
|
Categories=Game
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
X-AppImage-Title=
|
X-AppImage-Title=
|
||||||
X-AppImage-Version=
|
X-AppImage-Version=
|
||||||
|
|
|
@ -24,7 +24,18 @@ setup_keepResolution
|
||||||
ret=0
|
ret=0
|
||||||
cd "$APPDIR/usr/"
|
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 "$@"
|
run_withLocalLibs $APPRUN_HELPERS $RUNELF_HELPERS "$BINARY" $BINARY_ARGS "$@"
|
||||||
ret=$?
|
ret=$?
|
||||||
} 2>&1 | tee "$LOGFILE"
|
} 2>&1 | tee "$LOGFILE"
|
||||||
|
|
|
@ -23,12 +23,12 @@ if [ -z "$*" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
Distro="$(egrep "ID_LIKE=(.*)" /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" ] || Distro="$(egrep "^ID=(.*)" /etc/os-release | cut -d= -f2)"
|
||||||
[ -n "$Distro" ] || die "Could not find distro"
|
[ -n "$Distro" ] || die "Could not find distro"
|
||||||
|
|
||||||
case "$Distro" in
|
case "$Distro" in
|
||||||
Arch|archlinux)
|
Arch|arch|archlinux)
|
||||||
Tag="archlinux"
|
Tag="archlinux"
|
||||||
;;
|
;;
|
||||||
Ubuntu*)
|
Ubuntu*)
|
||||||
|
@ -40,12 +40,12 @@ case "$Distro" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$Distro" in
|
case "$Distro" in
|
||||||
Arch|archlinux)
|
Arch|arch|archlinux)
|
||||||
getPackageInfo() {
|
getPackageInfo() {
|
||||||
if [ -f "$1" ]; then
|
if [ -f "$1" ]; then
|
||||||
pacman -Qip "$1"
|
pacman -Qip "$1"
|
||||||
else
|
else
|
||||||
yaourt -Si "$1"
|
yay -Si "$1"
|
||||||
fi
|
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; }
|
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; }
|
uncompress_package_file() { tar -xf $1; }
|
||||||
package_files() { pacman -Ql "$1"; }
|
package_files() { pacman -Ql "$1"; }
|
||||||
install_package() { yaourt -S "$1"; }
|
install_package() { yay -S "$1"; }
|
||||||
download_package() {
|
download_package() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
aur/*)
|
aur/*)
|
||||||
|
@ -80,7 +80,7 @@ case "$Distro" in
|
||||||
echo "Building $pkg ..."
|
echo "Building $pkg ..."
|
||||||
mkdir -p /tmp/pacman2AppDir_build/
|
mkdir -p /tmp/pacman2AppDir_build/
|
||||||
pushd /tmp/pacman2AppDir_build/ || exit 1
|
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
|
pushd "$pkg" || exit 1
|
||||||
makepkg -d || exit 1
|
makepkg -d || exit 1
|
||||||
f=$(echo ${pkg}*.pkg.tar*)
|
f=$(echo ${pkg}*.pkg.tar*)
|
||||||
|
@ -264,7 +264,7 @@ fi
|
||||||
|
|
||||||
if [ "$pkgs" ]; then
|
if [ "$pkgs" ]; then
|
||||||
case "$Distro" in
|
case "$Distro" in
|
||||||
Arch|archlinux)
|
Arch|arch|archlinux)
|
||||||
pkgs+=("xdg-utils")
|
pkgs+=("xdg-utils")
|
||||||
ignore+=("libgl" "hicolor-icon-theme" "gtk-update-icon-cache")
|
ignore+=("libgl" "hicolor-icon-theme" "gtk-update-icon-cache")
|
||||||
;;
|
;;
|
||||||
|
@ -383,6 +383,7 @@ fi
|
||||||
PackageName=$(desktopFile_getParameter "$i" "Name")
|
PackageName=$(desktopFile_getParameter "$i" "Name")
|
||||||
PackageExec=$(desktopFile_getParameter "$i" "Exec")
|
PackageExec=$(desktopFile_getParameter "$i" "Exec")
|
||||||
PackageIcon=$(desktopFile_getParameter "$i" "Icon")
|
PackageIcon=$(desktopFile_getParameter "$i" "Icon")
|
||||||
|
PackageCategories=$(desktopFile_getParameter "$i" "Categories")
|
||||||
|
|
||||||
echo "Found .desktop file '$PackageName' ($PackageExec)"
|
echo "Found .desktop file '$PackageName' ($PackageExec)"
|
||||||
|
|
||||||
|
@ -428,6 +429,7 @@ fi
|
||||||
cp "$pg4l_dir/data/AppRun.desktop" .
|
cp "$pg4l_dir/data/AppRun.desktop" .
|
||||||
|
|
||||||
desktopFile_setParameter "AppRun.desktop" "Name" "$MainPackageName $MainPackageVersion-r1$Suffix"
|
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-Title" "$MainPackageName"
|
||||||
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Version" "$MainPackageVersion"
|
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Version" "$MainPackageVersion"
|
||||||
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Release" "1"
|
desktopFile_setParameter "AppRun.desktop" "X-AppImage-Release" "1"
|
||||||
|
|