archrelease: copy trunk to community-any
[ArchLinux/community.git] / cascadia-code / trunk / PKGBUILD
blob6324bf4a0e8812b04446a641bb653028058648fe
1 # Maintainer: Konstantin Gizdov <arch at kge dot pw>
2 # Contributor: Jerome Leclanche <jerome@leclan.ch>
4 pkgbase=cascadia-code
5 pkgname=("ttf-${pkgbase}" "otf-${pkgbase}" "woff2-${pkgbase}")
6 pkgver=2111.01
7 pkgrel=1
8 pkgdesc="A monospaced font by Microsoft that includes programming ligatures"
9 arch=("any")
10 url="https://github.com/microsoft/cascadia-code"
11 license=("custom:OFL")
12 source=(
13     "${pkgname}-${pkgver}-release.zip::https://github.com/microsoft/${pkgbase}/releases/download/v${pkgver}/CascadiaCode-${pkgver}.zip"
14     "${pkgname}-${pkgver}.tar.gz::https://github.com/microsoft/${pkgbase}/archive/v${pkgver}.tar.gz"
16 sha256sums=('51fd68176dffb87e2fbc79381aef7f5c9488b58918dee223cd7439b5aa14e712'
17             'fb1859ca3f475e5c5510a69824eeb4622a04d8733b3a26d9de58ae26162ad5b9')
19 function prepare() {
20     cd "${srcdir}/otf/static"
21     cp ./*.otf ../
24 function _package() {
25     cd "${srcdir}/"
27     local ext="${1%%-*}"
28     local installdir="${ext^^}"
29     local fonts=("${srcdir}/${ext}"/*."${ext}")
31     # Install fonts
32     install -d "${pkgdir}/usr/share/fonts/${installdir}"
33     local font
34     for font in "${fonts[@]}"; do
35         install -m644 "${font}" "${pkgdir}/usr/share/fonts/${installdir}"
36     done
38     # Install license
39     install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
42 for _pkgname in ${pkgname[@]}; do
43     eval "function package_$_pkgname() { _package $_pkgname; }"
44 done