aur/PKGBUILD

42 lines
2.1 KiB
Bash
Raw Normal View History

2022-04-04 17:34:13 +02:00
# Maintainer: Kamack38 <kamack38.biznes@gmail.com>
_pkgname='oh-my-posh'
pkgname="${_pkgname}-bin"
pkgver=7.82.1
2022-04-04 17:34:13 +02:00
pkgrel=1
pkgdesc="A prompt theme engine for any shell."
arch=('x86_64' 'armv7h' 'aarch64')
2022-04-04 17:34:13 +02:00
url="https://github.com/JanDeDobbeleer/oh-my-posh"
license=('MIT')
makedepends=('curl' 'grep' 'sed' 'unzip')
2022-04-04 17:34:13 +02:00
provides=("${_pkgname}")
conflicts=("${_pkgname}")
sha256sums=('3f6f5132bf08d4b39a5519ad90eed7fd93642a757624de5a52c200da7be8ccab')
sha256sums_x86_64=('7d97181b61b5cf22eeb8ddc72f11eb6e4a8c88dd90e25c5112835bfd562bdaec')
sha256sums_armv7h=('607ef516605fa5b60c089459e73f6634fbad53f47fb73c7343928e2d3496e2da')
sha256sums_aarch64=('b64b187d902cf9d93820da3abe583ef58c459284cae6b6bd7b17e8b8227c361f')
source=("themes-${sha256sums}.zip::https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$pkgver/themes.zip")
source_x86_64=("posh-linux-amd64-${sha256sums_x86_64}::https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$pkgver/posh-linux-amd64")
source_armv7h=("posh-linux-arm-${sha256sums_armv7h}::https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$pkgver/posh-linux-arm")
source_aarch64=("posh-linux-arm64-${sha256sums_aarch64}::https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$pkgver/posh-linux-arm64")
noextract=('themes.zip')
2022-04-04 17:34:13 +02:00
pkgver() {
2022-04-05 15:52:39 +02:00
curl --silent -L "https://api.github.com/repos/JanDeDobbeleer/oh-my-posh/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
2022-04-04 17:34:13 +02:00
sed -E 's/.*"([^"]+)".*/\1/' |
sed 's/v//'
}
package() {
if [[ "$CARCH" = 'x86_64' ]]; then
install -Dm 755 "posh-linux-amd64-${sha256sums_x86_64}" "${pkgdir}/usr/bin/oh-my-posh"
elif [[ "$CARCH" = 'armv7h' ]]; then
install -Dm 755 "posh-linux-arm-${sha256sums_armv7h}" "${pkgdir}/usr/bin/oh-my-posh"
elif [[ "$CARCH" = 'aarch64' ]]; then
install -Dm 755 "posh-linux-arm64-${sha256sums_aarch64}" "${pkgdir}/usr/bin/oh-my-posh"
fi
mkdir -p "${pkgdir}/usr/share/oh-my-posh/themes"
unzip "${srcdir}/themes-${sha256sums}.zip" -d "${pkgdir}/usr/share/oh-my-posh/themes"
2022-04-04 17:34:13 +02:00
}