AUR installs: install LICENSE and zsh+bash shell completions for gerbil CLI

This commit is contained in:
Egor 2025-09-23 22:45:00 -07:00
parent 18c94fd7dd
commit 49a453ff19

View file

@ -126,6 +126,22 @@ jobs:
fi
done
# Download license file with retry
for attempt in $(seq 1 $max_attempts); do
echo "Attempt $attempt: Downloading license file..."
if curl -L -o "LICENSE" "https://raw.githubusercontent.com/lone-cloud/gerbil/${{ inputs.tag }}/LICENSE"; then
echo "✅ License file downloaded successfully"
break
else
echo "❌ License file download failed, waiting 10 seconds..."
sleep 10
if [ $attempt -eq $max_attempts ]; then
echo "❌ Failed to download license file after $max_attempts attempts"
exit 1
fi
fi
done
# Verify file sizes
appimage_size=$(stat -c%s "gerbil-${{ steps.release_info.outputs.version }}.AppImage")
echo "AppImage size: $appimage_size bytes"
@ -136,12 +152,15 @@ jobs:
SHA256_APPIMAGE=$(sha256sum "gerbil-${{ steps.release_info.outputs.version }}.AppImage" | cut -d' ' -f1)
SHA256_DESKTOP=$(sha256sum "gerbil.desktop" | cut -d' ' -f1)
SHA256_LICENSE=$(sha256sum "LICENSE" | cut -d' ' -f1)
echo "sha256_appimage=$SHA256_APPIMAGE" >> $GITHUB_OUTPUT
echo "sha256_desktop=$SHA256_DESKTOP" >> $GITHUB_OUTPUT
echo "sha256_license=$SHA256_LICENSE" >> $GITHUB_OUTPUT
echo "AppImage SHA256: $SHA256_APPIMAGE"
echo "Desktop SHA256: $SHA256_DESKTOP"
echo "License SHA256: $SHA256_LICENSE"
- name: Generate PKGBUILD
run: |
@ -160,9 +179,11 @@ jobs:
provides=('gerbil')
conflicts=('gerbil-git')
source=("gerbil-${pkgver}.AppImage::${{ steps.release_info.outputs.appimage_url }}"
"gerbil.desktop::https://raw.githubusercontent.com/lone-cloud/gerbil/${{ steps.release_info.outputs.tag }}/assets/gerbil.desktop")
"gerbil.desktop::https://raw.githubusercontent.com/lone-cloud/gerbil/${{ steps.release_info.outputs.tag }}/assets/gerbil.desktop"
"LICENSE::https://raw.githubusercontent.com/lone-cloud/gerbil/${{ steps.release_info.outputs.tag }}/LICENSE")
sha256sums=('${{ steps.sha_calc.outputs.sha256_appimage }}'
'${{ steps.sha_calc.outputs.sha256_desktop }}')
'${{ steps.sha_calc.outputs.sha256_desktop }}'
'${{ steps.sha_calc.outputs.sha256_license }}')
prepare() {
chmod +x "gerbil-${pkgver}.AppImage"
@ -185,9 +206,11 @@ jobs:
WRAPPER
chmod +x "${pkgdir}/usr/bin/gerbil"
# Install desktop file from assets
# Install desktop file and license
install -dm755 "${pkgdir}/usr/share/applications"
install -dm755 "${pkgdir}/usr/share/licenses/gerbil"
cp "${srcdir}/gerbil.desktop" "${pkgdir}/usr/share/applications/"
cp "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/gerbil/"
# Install icon to hicolor theme directory and pixmaps as fallback
install -dm755 "${pkgdir}/usr/share/icons/hicolor/512x512/apps"
@ -206,6 +229,65 @@ jobs:
fi
done
fi
# Install shell completions
install -dm755 "${pkgdir}/usr/share/bash-completion/completions"
install -dm755 "${pkgdir}/usr/share/zsh/site-functions"
# Bash completion
cat > "${pkgdir}/usr/share/bash-completion/completions/gerbil" << 'BASH_COMP'
_gerbil() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--version --cli"
case "${prev}" in
--cli)
# Don't complete after --cli, let user type kobold args
return 0
;;
*)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
esac
}
complete -F _gerbil gerbil
BASH_COMP
# Zsh completion
cat > "${pkgdir}/usr/share/zsh/site-functions/_gerbil" << 'ZSH_COMP'
#compdef gerbil
_gerbil() {
local context state line
_arguments -C \
'1: :->command' \
'*: :->args' && return 0
case $state in
command)
local commands=(
'--version:Show version information'
'--cli:Run in CLI mode (pass remaining args to kobold binary)'
)
_describe 'commands' commands
;;
args)
case ${words[2]} in
--cli)
# Don't complete after --cli, let user type kobold args
;;
esac
;;
esac
}
_gerbil "$@"
ZSH_COMP
}
EOF
@ -228,8 +310,10 @@ jobs:
conflicts = gerbil-git
source = gerbil-${{ steps.release_info.outputs.version }}.AppImage::${{ steps.release_info.outputs.appimage_url }}
source = gerbil.desktop::https://raw.githubusercontent.com/lone-cloud/gerbil/${{ steps.release_info.outputs.tag }}/assets/gerbil.desktop
source = LICENSE::https://raw.githubusercontent.com/lone-cloud/gerbil/${{ steps.release_info.outputs.tag }}/LICENSE
sha256sums = ${{ steps.sha_calc.outputs.sha256_appimage }}
sha256sums = ${{ steps.sha_calc.outputs.sha256_desktop }}
sha256sums = ${{ steps.sha_calc.outputs.sha256_license }}
pkgname = gerbil
EOF