Skip to content

Commit

Permalink
preliminary work for building webfonts as well
Browse files Browse the repository at this point in the history
  • Loading branch information
AndydeCleyre committed Dec 9, 2020
1 parent 4192741 commit 5aa45b4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
21 changes: 16 additions & 5 deletions mk/pkgbuilds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,30 @@ cd "$(dirname "$0")"
gitroot="$(git rev-parse --show-toplevel)"

"${gitroot}"/mk/private-build-plans.toml.sh

pbp_sha256="$(sha256sum "${gitroot}"/private-build-plans.toml | cut -d' ' -f 1)"

yaml-get -p 'spacings.*' "${gitroot}"/vars.yml | while read spacing; do
if [ "$(yaml-get -p build_webfonts "${gitroot}"/vars.yml)" = yes ]; then
build_webfonts=true
else
build_webfonts=false
fi

folder="${gitroot}/pkgs/ttf-iosevka-${spacing}${spacing:+-}custom-git"
yaml-get -p 'spacings.*' "${gitroot}"/vars.yml | while read -r spacing; do

folder="${gitroot}/pkgs/ttf-iosevka-${spacing}${spacing:+-}custom-git"
mkdir -p "$folder"

cp "${gitroot}"/private-build-plans.toml "${folder}"/private-build-plans.toml.example
wheezy.template "${gitroot}"/templates/PKGBUILD.wz \
'{"spacing": "'$spacing'", "pbp_sha256": "'$pbp_sha256'"}' \
>"${folder}"/PKGBUILD

wheezy.template "${gitroot}"/templates/PKGBUILD.wz '{
"spacing": "'"$spacing"'",
"pbp_sha256": "'"$pbp_sha256"'",
"build_webfonts": '"$build_webfonts"'
}' >"${folder}"/PKGBUILD

printf '%s\n' \
'/*.pkg.*' '/src' '/pkg' '/Iosevka' \
>"${folder}/.gitignore"

done
17 changes: 15 additions & 2 deletions templates/PKGBUILD.wz
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@require(spacing, pbp_sha256)
@require(spacing, pbp_sha256, build_webfonts)
# Maintainer: Andy Kluger <https://t.me/andykluger>
# Contributor: Markus Weimar <mail@@markusweimar.de>
_pkgname=ttf-iosevka-@{spacing and spacing + '-' or ''}custom
Expand Down Expand Up @@ -44,12 +44,25 @@ build() {
cd Iosevka
npm install
npm update
npm run build -- ttf::${_pkgname#*-}
npm run build -- @{build_webfonts and 'contents' or 'ttf'}::${_pkgname#*-}
}

package() {
install -d "${pkgdir}/usr/share/fonts/TTF"
install -m644 Iosevka/dist/*/ttf/*.ttf "${pkgdir}/usr/share/fonts/TTF/"
@if build_webfonts:
install -d "${pkgdir}/usr/share/fonts/WOFF2"
install -m644 Iosevka/dist/*/woff2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/"
# where's the css stuff?
printf '%s\n' "IN THE DIST FOLDER, TOP LEVEL:"
ls Iosevka/dist/
printf '%s\n' "IN THE DIST FOLDER, SECOND LEVEL:"
ls Iosevka/dist/*/
printf '%s\n' "IN THE DIST FOLDER, THIRD LEVEL:"
ls Iosevka/dist/*/*/
# install -d "${pkgdir}/usr/share/fonts/WOFF2"
# install -m644 Iosevka/dist/*/woff2/*.woff2 "${pkgdir}/usr/share/fonts/WOFF2/"
@end
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 Iosevka/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/"
}
1 change: 1 addition & 0 deletions vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spacings:
- term # fewer wide glyphs
- fontconfig-mono # no wide glyphs
- fixed # neither wide glyphs nor ligatures
build_webfonts: yes
charvars:
digit-form: lining
turn-v: curly
Expand Down

0 comments on commit 5aa45b4

Please sign in to comment.