Subject: [PATCH] community/font-noto-cjk: split into subpackages

From: Drew DeVault <[email-masked]>
Date: Wed, 10 Jul 2019 13:50:19 -0400

The lists of fonts matches those found in the Debian packages of the
same names.
---
 community/font-noto-cjk/APKBUILD | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/community/font-noto-cjk/APKBUILD b/community/font-noto-cjk/APKBUILD
index 5cb7723a16..818b584bf5 100644
--- a/community/font-noto-cjk/APKBUILD
+++ b/community/font-noto-cjk/APKBUILD
@@ -3,20 +3,45 @@
 pkgname=font-noto-cjk
 pkgver=0_git20181130
 _sha=9326451d9b4f32ec7f8640581c5053cc192039f2
-pkgrel=0
+pkgrel=1
 pkgdesc="Google's font family that aims to support all the world's languages (cjk)"
 url="https://github.com/googlei18n/noto-fonts/"
 arch="noarch"
 license="OFL-1.1"
 depends="fontconfig"
 options="!check"
+subpackages="$pkgname-extra:_extra"
 source="$pkgname-$pkgver.tar.gz::https://github.com/googlei18n/noto-cjk/archive/$_sha.tar.gz"
 builddir="$srcdir/noto-cjk-$_sha"
 
 package() {
 	mkdir -p "$pkgdir"/usr/share/fonts/noto
-	install -m644 "$builddir"/*.otf \
-		"$pkgdir"/usr/share/fonts/noto/
+	for font in NotoSansCJK-Bold.ttc \
+		NotoSansCJK-Regular.ttc \
+		NotoSerifCJK-Bold.ttc \
+		NotoSerifCJK-Regular.ttc
+	do
+		install -m644 "$builddir"/"$font" \
+			"$pkgdir"/usr/share/fonts/noto/"$font"
+	done
+}
+
+_extra() {
+	mkdir -p "$subpkgdir"/usr/share/fonts/noto
+	for font in NotoSansCJK-Black.ttc \
+		NotoSansCJK-DemiLight.ttc \
+		NotoSansCJK-Light.ttc \
+		NotoSansCJK-Medium.ttc \
+		NotoSansCJK-Thin.ttc \
+		NotoSerifCJK-Black.ttc \
+		NotoSerifCJK-ExtraLight.ttc \
+		NotoSerifCJK-Light.ttc \
+		NotoSerifCJK-Medium.ttc \
+		NotoSerifCJK-SemiBold.ttc
+	do
+		install -m644 "$builddir"/"$font" \
+			"$subpkgdir"/usr/share/fonts/noto/"$font"
+	done
 }
 
 sha512sums="d4578421919d03ecf82627375cfc4b227825af485140b35e2315d17f8ef38d034e0ffdd21fb3aa226c82e9cf587123867d565f93d32f8bf7d754571f0ebf825e  font-noto-cjk-0_git20181130.tar.gz"
-- 
2.22.0