/[gentoo-x86]/eclass/texlive-module.eclass
Gentoo

Diff of /eclass/texlive-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.37 Revision 1.38
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.37 2010/10/23 16:38:26 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.38 2010/10/23 21:47:07 aballier Exp $
4 4
5# @ECLASS: texlive-module.eclass 5# @ECLASS: texlive-module.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# tex@gentoo.org 7# tex@gentoo.org
8# 8#
154# @DESCRIPTION: 154# @DESCRIPTION:
155# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d 155# Creates a language.${PN}.def entry to put in /etc/texmf/language.def.d
156# It parses the AddHyphen directive of tlpobj files to create it. 156# It parses the AddHyphen directive of tlpobj files to create it.
157 157
158texlive-module_make_language_def_lines() { 158texlive-module_make_language_def_lines() {
159 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions 159 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions luaspecial
160 eval $@ 160 eval $@
161 einfo "Generating language.def entry for $@" 161 einfo "Generating language.def entry for $@"
162 [ -z "$lefthyphenmin" ] && lefthyphenmin="2" 162 [ -z "$lefthyphenmin" ] && lefthyphenmin="2"
163 [ -z "$righthyphenmin" ] && righthyphenmin="3" 163 [ -z "$righthyphenmin" ] && righthyphenmin="3"
164 echo "\\addlanguage{$name}{$file}{}{$lefthyphenmin}{$righthyphenmin}" >> "${S}/language.${PN}.def" 164 echo "\\addlanguage{$name}{$file}{}{$lefthyphenmin}{$righthyphenmin}" >> "${S}/language.${PN}.def"
175# Only valid for TeXLive 2008. 175# Only valid for TeXLive 2008.
176# Creates a language.${PN}.dat entry to put in /etc/texmf/language.dat.d 176# Creates a language.${PN}.dat entry to put in /etc/texmf/language.dat.d
177# It parses the AddHyphen directive of tlpobj files to create it. 177# It parses the AddHyphen directive of tlpobj files to create it.
178 178
179texlive-module_make_language_dat_lines() { 179texlive-module_make_language_dat_lines() {
180 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions 180 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions luaspecial
181 eval $@ 181 eval $@
182 einfo "Generating language.dat entry for $@" 182 einfo "Generating language.dat entry for $@"
183 echo "$name $file" >> "${S}/language.${PN}.dat" 183 echo "$name $file" >> "${S}/language.${PN}.dat"
184 if [ -n "$synonyms" ] ; then 184 if [ -n "$synonyms" ] ; then
185 for i in $(echo $synonyms | tr ',' ' ') ; do 185 for i in $(echo $synonyms | tr ',' ' ') ; do
186 einfo "Generating language.dat synonym $i for $@" 186 einfo "Generating language.dat synonym $i for $@"
187 echo "=$i" >> "${S}/language.${PN}.dat" 187 echo "=$i" >> "${S}/language.${PN}.dat"
188 done 188 done
189 fi 189 fi
190}
191
192# @FUNCTION: texlive-module_synonyms_to_language_lua_line
193# @DESCRIPTION:
194# Helper function for texlive-module_make_language_lua_lines to generate a
195# correctly formatted synonyms entry for language.lua.dat
196
197texlive-module_synonyms_to_language_lua_line() {
198 local prev=""
199 for i in $(echo $@ | tr ',' ' ') ; do
200 printf "${prev} '%s'" $i
201 prev=","
202 done
203}
204
205# @FUNCTION: texlive-module_make_language_lua_lines
206# @DESCRIPTION:
207# Only valid for TeXLive 2010.
208# Creates a language.${PN}.dat entry to put in /etc/texmf/language.lua.d
209# It parses the AddHyphen directive of tlpobj files to create it.
210
211texlive-module_make_language_lua_lines() {
212 local lefthyphenmin righthyphenmin synonyms name file file_patterns file_exceptions luaspecial
213 local dest="${S}/language.${PN}.dat.lua"
214 eval $@
215 einfo "Generating language.lua.dat entry for $@"
216 printf "\t['%s'] = {\n" "$name" >> "$dest"
217 printf "\t\tloader = '%s',\n" "$file" >> "$dest"
218 printf "\t\tlefthyphenmin = %s,\n\t\trighthyphenmin = %s,\n" "$lefthyphenmin" "$righthyphenmin" >> "$dest"
219 printf "\t\tsynonyms = {%s },\n" "$(texlive-module_synonyms_to_language_lua_line "$synonyms")" >> "$dest"
220 [ -n "$file_patterns" ] && printf "\t\tpatterns = '%s',\n" "$file_patterns" >> "$dest"
221 [ -n "$file_exceptions" ] && printf "\t\thyphenation = '%s',\n" "$file_exceptions" >> "$dest"
222 [ -n "$luaspecial" ] && printf "\t\tspecial = '%s',\n" "$luaspecial" >> "$dest"
223 printf "\t},\n" >> "$dest"
190} 224}
191 225
192# @FUNCTION: texlive-module_src_compile 226# @FUNCTION: texlive-module_src_compile
193# @DESCRIPTION: 227# @DESCRIPTION:
194# exported function: 228# exported function:
222 echo "p +${parameter}" >> "${S}/${PN}-config.ps";; 256 echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
223 addDvipdfmMap) 257 addDvipdfmMap)
224 echo "f ${parameter}" >> "${S}/${PN}-config";; 258 echo "f ${parameter}" >> "${S}/${PN}-config";;
225 AddHyphen) 259 AddHyphen)
226 texlive-module_make_language_def_lines "$parameter" 260 texlive-module_make_language_def_lines "$parameter"
227 texlive-module_make_language_dat_lines "$parameter";; 261 texlive-module_make_language_dat_lines "$parameter"
262 [ "${PV#2008}" = "${PV}" -a "${PV#2009}" = "${PV}" ] && texlive-module_make_language_lua_lines "$parameter"
263 ;;
228 AddFormat) 264 AddFormat)
229 texlive-module_add_format "$parameter";; 265 texlive-module_add_format "$parameter";;
230 BuildFormat) 266 BuildFormat)
231 einfo "Format $parameter already built.";; 267 einfo "Format $parameter already built.";;
232 BuildLanguageDat) 268 BuildLanguageDat)
290 326
291 if [ -f "${S}/language.${PN}.dat" ] ; then 327 if [ -f "${S}/language.${PN}.dat" ] ; then
292 insinto /etc/texmf/language.dat.d 328 insinto /etc/texmf/language.dat.d
293 doins "${S}/language.${PN}.dat" 329 doins "${S}/language.${PN}.dat"
294 fi 330 fi
331
332 if [ -f "${S}/language.${PN}.dat.lua" ] ; then
333 insinto /etc/texmf/language.dat.lua.d
334 doins "${S}/language.${PN}.dat.lua"
335 fi
336
295 [ -n "${TEXLIVE_MODULE_BINSCRIPTS}" ] && dobin_texmf_scripts ${TEXLIVE_MODULE_BINSCRIPTS} 337 [ -n "${TEXLIVE_MODULE_BINSCRIPTS}" ] && dobin_texmf_scripts ${TEXLIVE_MODULE_BINSCRIPTS}
296 338
297 texlive-common_handle_config_files 339 texlive-common_handle_config_files
298} 340}
299 341

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.20