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"
2022-07-10 20:45:10 +02:00
pkgver=8.15.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}")
2022-07-08 16:18:31 +02:00
sha256sums=('41fd29514b4f7f13062e57c229a62d163470d4519aefb8ac05a6b4153b8d807a'
'a5308c4e51268229a039ec4ec9a251a4cdb89d9380383e6e13aeba64a74f19ad')
2022-07-08 16:18:31 +02:00
sha256sums_x86_64=('1673f78916bb93a0a16cf5025bdc60a69aa4590c4f33d2cffefc8eac87fceec5')
2022-07-10 20:45:10 +02:00
sha256sums_armv7h=('013dfa1ac50dc0d3cf726a0dca9ff4c0c9c465df0bb3779fd4fd62780941597c')
sha256sums_aarch64=('ab2a0fcce531708ec84f46532afed61947d1f26352f05505925decfddd1013bd')
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
}