aur/PKGBUILD

47 lines
2.4 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.91.3
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=('e172e91d824ff14fe7cf0b9ecb97ef96f5cf89405ce77cfaefb91524e297d1bd'
'a5308c4e51268229a039ec4ec9a251a4cdb89d9380383e6e13aeba64a74f19ad')
sha256sums_x86_64=('534af05b6d5a1107e29526810f6dcf766135fc9b1465da6fe2ff7ddfe93bd720')
sha256sums_armv7h=('dc7572d79a8b7b5f4066fafde4cb772df75b73e6d843b92dbf1b5e63a8203067')
sha256sums_aarch64=('143f6f770d2bcbc681b5c141cf53476e53d3c472fb3c1c5e3aecc2baa6827af9')
source=(
"themes-${sha256sums[0]}.zip::https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$pkgver/themes.zip"
"LICENSE-${sha256sums[1]}::https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v${pkgver}/COPYING"
)
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() {
install -Dm 644 "LICENSE-${sha256sums[1]}" -t "${pkgdir}/usr/share/licenses/${pkgname}/"
if [[ "$CARCH" = 'x86_64' ]]; then
install -Dm 755 "${srcdir}/posh-linux-amd64-${sha256sums_x86_64}" "${pkgdir}/usr/bin/oh-my-posh"
elif [[ "$CARCH" = 'armv7h' ]]; then
install -Dm 755 "${srcdir}/posh-linux-arm-${sha256sums_armv7h}" "${pkgdir}/usr/bin/oh-my-posh"
elif [[ "$CARCH" = 'aarch64' ]]; then
install -Dm 755 "${srcdir}/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
}