# Contributor: Carlo Landmeter # Contributor: Jakub Jirutka # Maintainer: Carlo Landmeter pkgname=font-noto pkgver=23.7.1 pkgrel=0 pkgdesc="Noto font families for Latin, Cyrillic and Greek scripts" url="https://github.com/notofonts/notofonts.github.io" arch="noarch" license="OFL-1.1" depends="fontconfig $pkgname-common=$pkgver-r$pkgrel" makedepends="ruby" checkdepends="cmd:xmllint" source="$pkgname-$pkgver.tar.gz::https://github.com/notofonts/notofonts.github.io/archive/refs/tags/noto-monthly-release-$pkgver.tar.gz 45-noto-math.conf 45-noto.xml.erb 58-noto-math.conf 58-noto.xml.erb noto-meta.json noto-meta " builddir="$srcdir/notofonts.github.io-noto-monthly-release-$pkgver" # List of subpackages generated by './noto-meta list-subpkgs'. # NOTE: List is sorted by string length to prevent find doing partial matching. _subpkgs=" nyiakeng-puachue-hmong canadian-aboriginal indic-siyaq-numbers khitan-small-script hanifi-rohingya mayan-numerals gunjala-gondi masaram-gondi mende-kikakui nastaliq-urdu ottoman-siyaq cypro-minoan meetei-mayek naskh-arabic pahawh-hmong rashi-hebrew sora-sompeng syloti-nagri dives-akuru medefaidrin nag-mundari nandinagari new-tai-lue pau-cin-hau signwriting warang-citi chorasmian devanagari historical old-uyghur saurashtra bassa-vah malayalam mongolian samaritan sundanese armenian balinese buginese cherokee duployan ethiopic fangsong georgian gujarati gurmukhi javanese kayah-li ol-chiki tagbanwa tifinagh vithkuqi bengali elbasan grantha hanunoo kannada makasar myanmar sharada sinhala soyombo symbols tibetan tirhuta arabic chakma coptic hebrew kaithi khojki lepcha rejang syriac tangsa telugu thaana wancho yezidi adlam bamum batak buhid khmer limbu music nushu oriya osage tamil ahom cham kawi lisu math miao modi newa test thai toto lao mro nko tai vai yi " for _sub in $_subpkgs; do subpackages="$subpackages $pkgname-$_sub:_split" done subpackages="$subpackages $pkgname-extra $pkgname-common $pkgname-all:_all " _fontsdir='usr/share/fonts/noto' build() { noto_meta gen-font-confs conf.d/ } check() { xmllint --quiet --loaddtd --valid --nonet \ --path /usr/share/xml/fontconfig/ conf.d/*.conf >/dev/null } package() { depends="$depends $pkgname-math=$pkgver-r$pkgrel $pkgname-symbols=$pkgver-r$pkgrel " install -D -m644 fonts/*/hinted/ttf/*.ttf -t "$pkgdir/$_fontsdir"/ install -D -m644 conf.d/*.conf -t "$pkgdir"/etc/fonts/conf.avail/ cd "$pkgdir" mkdir -p etc/fonts/conf.d local f; for f in etc/fonts/conf.avail/*.conf; do ln -s ../conf.avail/${f##*/} "$pkgdir"/etc/fonts/conf.d/${f##*/} done } _split() { pkgdesc=$(noto_meta pkgdesc $subpkgname) provides="" replaces="" # For backward compatibility (Alpine <3.16). case "${subpkgname#font-noto-}" in kayah-li) replaces="$pkgname-kayahli";; ol-chiki) replaces="$pkgname-olchiki";; historical) replaces="$pkgname-egyptianhieroglyphs $pkgname-oldturkic";; esac local name [ "$replaces" ] && for name in $replaces; do provides="$provides $name=$pkgver-r$pkgrel" done replaces="$replaces $pkgname<0_git20211101-r1 $pkgname-extra<0_git20211101-r1" local font; for font in $(noto_meta font-basenames $subpkgname); do amove "$_fontsdir"/$font-*.ttf done local fontconf="${subpkgname#font-}.conf" amove etc/fonts/conf.avail/[0-9]*-$fontconf amove etc/fonts/conf.d/[0-9]*-$fontconf } extra() { pkgdesc="$pkgdesc (extra weights and variants)" depends="$pkgname=$pkgver-r$pkgrel" cd "$pkgdir" mkdir -p "$builddir"/.tmp local font weight for font in $(noto_meta font-basenames '@'); do for weight in Regular Italic Bold BoldItalic; do mv "$_fontsdir"/$font-$weight.ttf "$builddir"/.tmp/ 2>/dev/null || true done amove "$_fontsdir"/$font-*.ttf done # Take advantage of the fact that this split function runs as the last # one (we don't count -all) and check if there are any files not listed # in fonts-meta.json if [ "$(ls -A "$_fontsdir")" ]; then error "Unknown files found in /$_fontsdir (update fonts-meta.json):" ls -1 "$_fontsdir" >&2 return 1 fi mkdir -p "$_fontsdir" mv "$builddir"/.tmp/*.ttf "$_fontsdir"/ } common() { pkgdesc="Common files for Noto font families" depends="" amove etc/fonts/conf.avail/58-noto.conf amove etc/fonts/conf.d/58-noto.conf } _all() { pkgdesc="Google Noto font families that aim to support all the world's languages (meta package)" depends="$pkgname=$pkgver-r$pkgrel $pkgname-extra=$pkgver-r$pkgrel " local subname; for subname in $_subpkgs; do depends="$depends $pkgname-$subname" done mkdir -p "$subpkgdir" } noto_meta() { "$srcdir"/noto-meta "$@" } sha512sums=" 19b9e5349ed876a3588219ea161904435543831da6efce6609ff3b963eb59ff17384fb7cc860cdd4070b6cb68397510f5e67b7d5deb92d767b6b779f8073d1cb font-noto-23.7.1.tar.gz bbe805d212b0d46d4ce2d0fbc5a91d1f276a34f920b56ff6cb9474fdb3e1497bf9615cacfb9b69c04280ac4087c6f02a4fcb015b03c1ec0dd2d8180870811692 45-noto-math.conf 94c902aba178df855e388b1b2186866a0a28e6420f3f4ddbb798dfc7f551c13f93aa99c3ee7b112de218b817954b5f23c2cafdbd6a1828f2fec60ee61656e02a 45-noto.xml.erb 117830984239d10ce09bb79b7140b23810404ac13d44d1b3456587e34441273d9d4f4860fcabc19e8aec3ba3b60582c6b5411b28910e618fa2434968f83bd154 58-noto-math.conf 7024227b5b88f37bfff83792b36dbda66b27fdf472a0211c1b189a067d7cf7d406ad415e5a04ff1d7f067b9a4c9a97b275149062cb0ad65e7b0eed2835fa1c42 58-noto.xml.erb 1af80364b8a19ceeef5115ccc8e7938ef6d39e339dced86e04be0eb07f52f02083fb4b10ceaa830eda01082fc8436398016e307e0b07759857885ad4f75c5ba2 noto-meta.json 0e48ee2f69c4f2e4e5a5bb118d628a00c8a6479800e664c703a72b3e7a7c49c49f868a160a70faf242693e5daf797e97a2635b79be8470130ff3c2ed0a1a1b00 noto-meta "