1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit latex-package elisp-common toolchain-funcs flag-o-matic
10 DESCRIPTION="LaTeX package to use CJK (Chinese/Japanese/Korean) scripts in various encodings"
11 HOMEPAGE="https://cjk.ffii.org/"
12 # fonts are taken from ftp://ftp.ctan.org/tex-archive/fonts/CJK.zip
13 SRC_URI="ftp://ftp.ffii.org/pub/cjk/${MY_P}.tar.gz
14 mirror://gentoo/${MY_P}-fonts.zip
15 doc? ( ftp://ftp.ffii.org/pub/cjk/${MY_P}-doc.tar.gz )"
19 KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
22 RDEPEND="virtual/latex-base
24 emacs? ( >=app-editors/emacs-23.1:* )"
28 BDEPEND="app-arch/unzip
31 S="${WORKDIR}/${MY_P}"
35 for i in "${WORKDIR}"/CJK/*.tar.gz; do
36 tar -xzf ${i} || die "failed to unpack $i"
38 find texmf/fonts/hbf -type f -exec cp {} "${T}" \; || die
39 sed -i -e "/^pk_files/s/no/yes/" \
40 -e "/^dpi_x/s/300/500/" \
41 texmf/hbf2gf/*.cfg || die
45 has_version '>=dev-libs/kpathsea-6.2.1' && append-cppflags "$($(tc-getPKG_CONFIG) --cflags kpathsea)"
49 local f=`echo ${d} | tr '[:upper:]' '[:lower:]'`
50 echo "all: $f" >> Makefile
51 if [ ${d} = CEFconv ] ; then
52 echo "all: cef5conv cefsconv" >> Makefile
57 econf --with-kpathsea-lib="${EPREFIX}"/usr/$(get_libdir) \
58 --with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea
84 for f in "${S}"/texmf/hbf2gf/*.cfg ; do
85 env TEXMFCNF="${EPREFIX}/etc/texmf/web2c" HBF_TARGET="${S}/texmf/fonts" "${S}/utils/hbf2gf/hbf2gf" $f || die
88 einfo "Generating pk fonts"
99 local f=`echo $d | tr '[:upper:]' '[:lower:]'`
107 dodir "${TEXMF}/fonts/hbf"
112 pushd texmf &>/dev/null || die
113 for d in fonts/pk/modeless/*/* ; do
114 insinto ${TEXMF}/${d}
115 for f in "${T}"/${d##*/}*.pk ; do
116 newins ${f} `basename ${f/.pk/.500pk}`
119 popd &>/dev/null || die
121 insinto "${TEXMF}/tex/latex/${PN}"
123 doins -r contrib/wadalab
127 elisp-install ${PN} *.el{,c} emacs/*.el{,c} mule-2.3/*.el{,c}
133 insinto ${TEXMF}/scripts/uwpatch
134 doins uwpatch/uwpatchold.sh
135 insinto ${TEXMF}/fonts/afm/uwpatch
140 doins -r jisksp40/texmf
144 doins -r kanji48/texmf
146 use doc || rm -rf texmf/doc
150 # Move fonts because hbf2gf expects them in MISCFONTS
151 mv "${ED}/${TEXMF}/fonts/hbf" "${ED}/${TEXMF}/fonts/misc" || die "mv font failed"
153 insinto ${TEXMF}/hbf2gf
154 doins -r utils/hbf2gf/cfg/
156 insinto ${TEXMF}/scripts/subfonts
157 doins -r utils/subfonts/
159 rm -f doc/COPYING doc/INSTALL || die
160 dodoc ChangeLog README
162 insinto /usr/share/doc/${PF}