archrelease: copy trunk to community-any
[ArchLinux/community.git] / adobe-source-han-sans-fonts / trunk / PKGBUILD
blob71c28f169a4bbb68abf7c204678ae1d1aeca4054
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Sascha Weaver <wzyboy@wzyboy.org>
4 # This font has four versions:
6 # * Multilingual versions with a default language: (OTF)
7 #   (We do not package them)
8 #   * Multilingual version with Japanese glyphs as default priority
9 #   * Multilingual version with Korean glyphs as default priority
10 #   * Multilingual version with Simplified Chinese glyphs as default priority
11 #   * Multilingual version with Traditional Chinese glyphs as default priority
12 # * Multilingual version combined the four versions above. (OTC) (Not included in the tarball anymore)
13 #   (This version is "the best of the worlds", but it cannot be used in Windows)
14 #   -> adobe-source-han-sans-otc-fonts
15 # * Multilingual version compressed the 7 files into a single ttc file. (SuperOTC)
16 #   (We package them now, as there's no difference from the OTC version above)
17 # * Regional subsets with only characters used in CN, JP, KR or TW: (SubsetOTF)
18 #   (This version is smaller and has better compatibility)
19 #   * Regional subset with only Japanese glyphs + Latin
20 #   -> adobe-source-han-sans-jp-fonts
21 #   * Regional subset with only Korean glyphs + Latin
22 #   -> adobe-source-han-sans-kr-fonts
23 #   * Regional subset with only Simplified Chinese glyphs + Latin
24 #   -> adobe-source-han-sans-cn-fonts
25 #   * Regional subset with only Traditional Chinese glyphs + Latin
26 #   -> adobe-source-han-sans-tw-fonts
28 _pkgbase=adobe-source-han-sans
29 pkgbase=$_pkgbase-fonts
30 pkgname=($_pkgbase-jp-fonts $_pkgbase-kr-fonts $_pkgbase-cn-fonts $_pkgbase-tw-fonts $_pkgbase-hk-fonts $_pkgbase-otc-fonts)
31 pkgver=2.004
32 pkgrel=1
33 pkgdesc='Adobe Source Han Sans - A set of Pan-CJK fonts designed to complement Source Sans Pro'
34 arch=('any')
35 license=('custom:SIL')
36 url='https://github.com/adobe-fonts/source-han-sans'
37 source=("$pkgbase-$pkgver.tar.gz::https://github.com/adobe-fonts/source-han-sans/archive/${pkgver}R.tar.gz"
38         44-source-han-sans-jp.conf
39         44-source-han-sans-kr.conf
40         44-source-han-sans-cn.conf
41         44-source-han-sans-tw.conf
42         44-source-han-sans-hk.conf
43         44-source-han-sans-otc.conf)
44 sha512sums=('f8fe85b5e62445ff6d2e07daff414b0fec1334840fb308fb06407838badb95df7bbdcae24a7e4b6df9a5c2473f72633cbef235a1bfac22f0cdb65217d47e10c1'
45             '2582097792c2938cf8a04a21795acf6d6640531a8509865111bfbaeb41ce96a632d8f694aae93aa68f375a9f496a3eb8ecd6f6909f81045e2a0a42b432898588'
46             '53aba437f7eddb89826ec1050840081f8f509f860b9bc43c71a7b1a5d294fbc6256a7b8690f9a28b505bc2be63bf77bcf6bf8ae93d7a4783d7f91d0305d84147'
47             'fd1fd6a5cf68a879bd5286642427ba6a01944568106ef186a18942bd0db658e61da8656a23a83468f266e4ec332baa71485a3d91f01333d48cc840909ac3fd5d'
48             '430d0a5e86fdf5c89ca2d12886901dc3dde3bb6f5d7be494e6b404bb0040dc11e591fd642f23e0d92784e8f01d7e27cd90aa2805f4ca6ea2be401405a36a1b20'
49             '40bbac5de07abece7aae291c368325a421a187bf2742f0dc0028ff5722ac2c655a8c854a4371746d76917652921ee7e8e0c96f6635fd48c5238b521b42dcb961'
50             '14342eb8d9eab434b325100707376c28c584a6b7ff3a7b7b67fbc1bf5dbd1918b50000fe47101ee9ca42f60d9272c16fbc1abed5090dbab7b704c10d48a3920b')
52 _jp=(
53 SourceHanSansJP-Bold.otf
54 SourceHanSansJP-ExtraLight.otf
55 SourceHanSansJP-Heavy.otf
56 SourceHanSansJP-Light.otf
57 SourceHanSansJP-Medium.otf
58 SourceHanSansJP-Normal.otf
59 SourceHanSansJP-Regular.otf
61 _kr=(
62 SourceHanSansKR-Bold.otf
63 SourceHanSansKR-ExtraLight.otf
64 SourceHanSansKR-Heavy.otf
65 SourceHanSansKR-Light.otf
66 SourceHanSansKR-Medium.otf
67 SourceHanSansKR-Normal.otf
68 SourceHanSansKR-Regular.otf
70 _cn=(
71 SourceHanSansCN-Bold.otf
72 SourceHanSansCN-ExtraLight.otf
73 SourceHanSansCN-Heavy.otf
74 SourceHanSansCN-Light.otf
75 SourceHanSansCN-Medium.otf
76 SourceHanSansCN-Normal.otf
77 SourceHanSansCN-Regular.otf
79 _tw=(
80 SourceHanSansTW-Bold.otf
81 SourceHanSansTW-ExtraLight.otf
82 SourceHanSansTW-Heavy.otf
83 SourceHanSansTW-Light.otf
84 SourceHanSansTW-Medium.otf
85 SourceHanSansTW-Normal.otf
86 SourceHanSansTW-Regular.otf
88 _hk=(
89 SourceHanSansHK-Bold.otf
90 SourceHanSansHK-ExtraLight.otf
91 SourceHanSansHK-Heavy.otf
92 SourceHanSansHK-Light.otf
93 SourceHanSansHK-Medium.otf
94 SourceHanSansHK-Normal.otf
95 SourceHanSansHK-Regular.otf
97 _otc=(
98 SourceHanSans.ttc
101 function _package {
102     cd "$srcdir/source-han-sans-${pkgver}R"
104     case "$1" in
105         $_pkgbase-jp-fonts)
106             fonts=(${_jp[@]})
107             cd SubsetOTF/JP
108             _fontconfig_filename=44-source-han-sans-jp.conf
109             pkgdesc="Adobe Source Han Sans Subset OTF - Japanese OpenType/CFF fonts";;
110         $_pkgbase-kr-fonts)
111             fonts=(${_kr[@]})
112             cd SubsetOTF/KR
113             _fontconfig_filename=44-source-han-sans-kr.conf
114             pkgdesc="Adobe Source Han Sans Subset OTF - Korean OpenType/CFF fonts";;
115         $_pkgbase-cn-fonts)
116             fonts=(${_cn[@]})
117             cd SubsetOTF/CN
118             _fontconfig_filename=44-source-han-sans-cn.conf
119             pkgdesc="Adobe Source Han Sans Subset OTF - Simplified Chinese OpenType/CFF fonts";;
120         $_pkgbase-tw-fonts)
121             fonts=(${_tw[@]})
122             cd SubsetOTF/TW
123             _fontconfig_filename=44-source-han-sans-tw.conf
124             pkgdesc="Adobe Source Han Sans Subset OTF - Traditional Chinese (Taiwan) OpenType/CFF fonts";;
125         $_pkgbase-hk-fonts)
126             fonts=(${_hk[@]})
127             cd SubsetOTF/HK
128             _fontconfig_filename=44-source-han-sans-hk.conf
129             pkgdesc="Adobe Source Han Sans Subset OTF - Traditional Chinese (Hong Kong) OpenType/CFF fonts";;
130         $_pkgbase-otc-fonts)
131             fonts=(${_otc[@]})
132             cd SuperOTC
133             bsdtar xf SourceHanSans.ttc.zip
134             _fontconfig_filename=44-source-han-sans-otc.conf
135             pkgdesc="Adobe Source Han Sans - Pan-CJK OpenType/CFF Collection fonts";;
136     esac
138     # Prepare destination directory
139     install -dm755 "$pkgdir/usr/share/fonts/adobe-source-han-sans"
141     # Install fonts
142     for font in "${fonts[@]}"; do
143         install -m644 "$font" "$pkgdir/usr/share/fonts/adobe-source-han-sans"
144     done
146     # Install fontconfig fix
147     install -d "$pkgdir/usr/share/fontconfig/conf.default"
148     install -Dm644 "$srcdir/$_fontconfig_filename" "$pkgdir/usr/share/fontconfig/conf.avail/$_fontconfig_filename"
149     ln -s ../conf.avail/$_fontconfig_filename "$pkgdir/usr/share/fontconfig/conf.default/$_fontconfig_filename"
151     install -Dm644 "$srcdir"/source-han-sans-${pkgver}R/LICENSE.txt -t "$pkgdir"/usr/share/licenses/$1/
154 for _pkgname in ${pkgname[@]}; do
155     eval "function package_$_pkgname() { _package $_pkgname; }"
156 done