/[gentoo-x86]/eclass/elisp-common.eclass
Gentoo

Diff of /eclass/elisp-common.eclass

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

Revision 1.33 Revision 1.34
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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/elisp-common.eclass,v 1.33 2007/12/12 21:58:57 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.34 2007/12/28 17:48:34 ulm Exp $
4# 4#
5# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
6# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
5# Copyright 2007 Christian Faulhammer <opfer@gentoo.org> 8# Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
6# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
8# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
9# Copyright 2007 Ulrich Mueller <ulm@gentoo.org> 9# Copyright 2007 Ulrich Mueller <ulm@gentoo.org>
10# 10#
11# @ECLASS: elisp-common.eclass 11# @ECLASS: elisp-common.eclass
12# @MAINTAINER: 12# @MAINTAINER:
13# Feel free to contact the Emacs team through <emacs@gentoo.org> if you have 13# Feel free to contact the Emacs team through <emacs@gentoo.org> if you have
198# @FUNCTION: elisp-emacs-version 198# @FUNCTION: elisp-emacs-version
199# @DESCRIPTION: 199# @DESCRIPTION:
200# Output version of currently active Emacs. 200# Output version of currently active Emacs.
201 201
202elisp-emacs-version() { 202elisp-emacs-version() {
203 # The following will work for at least versions 18-23. 203 # The following will work for at least versions 18--23.
204 echo "(princ emacs-version)" >"${T}"/emacs-version.el 204 echo "(princ emacs-version)" >"${T}"/emacs-version.el
205 ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el 205 ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el
206} 206}
207 207
208# @FUNCTION: elisp-make-autoload-file 208# @FUNCTION: elisp-make-autoload-file
260# @USAGE: <site-init file> [subdirectory] 260# @USAGE: <site-init file> [subdirectory]
261# @DESCRIPTION: 261# @DESCRIPTION:
262# Install Emacs site-init file in SITELISP directory. 262# Install Emacs site-init file in SITELISP directory.
263 263
264elisp-site-file-install() { 264elisp-site-file-install() {
265 local sf="$1" my_pn="${2:-${PN}}" 265 local sf="${1##*/}" my_pn="${2:-${PN}}"
266 ebegin "Installing site initialisation file for GNU Emacs" 266 ebegin "Installing site initialisation file for GNU Emacs"
267 cp "${sf}" "${T}" 267 cp "$1" "${T}/${sf}"
268 sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \ 268 sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \
269 -e "s:@SITEETC@:${SITEETC}/${my_pn}:g" "${T}/${sf##*/}" 269 -e "s:@SITEETC@:${SITEETC}/${my_pn}:g" "${T}/${sf}"
270 ( # subshell to avoid pollution of calling environment 270 ( # subshell to avoid pollution of calling environment
271 insinto "${SITELISP}" 271 insinto "${SITELISP}/site-gentoo.d"
272 doins "${T}/${sf##*/}" 272 doins "${T}/${sf}"
273 ) 273 )
274 eend $? "doins failed" 274 eend $? "doins failed"
275} 275}
276 276
277# @FUNCTION: elisp-site-regen 277# @FUNCTION: elisp-site-regen
278# @DESCRIPTION: 278# @DESCRIPTION:
279# Regenerate site-gentoo.el file. 279# Regenerate site-gentoo.el file. The old location for site initialisation
280 280# files of packages was /usr/share/emacs/site-lisp/. In December 2007 this
281# Old location for site initialisation files of packages was 281# has been changed to /usr/share/emacs/site-lisp/site-gentoo.d/. Remerge of
282# /usr/share/emacs/site-lisp/. It is planned to change this to 282# packages with Emacs support is enough, the old location is still supported
283# /usr/share/emacs/site-lisp/site-gentoo.d/. 283# when generating the start-up file.
284 284
285elisp-site-regen() { 285elisp-site-regen() {
286 local i sf line 286 local i sf line obsolete
287 local -a sflist 287 local -a sflist
288 288
289 if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \ 289 if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \
290 && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then 290 && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then
291 einfo "Creating default ${SITELISP}/site-start.el ..." 291 einfo "Creating default ${SITELISP}/site-start.el ..."
322 for ((i=${#sflist[@]}; i>0; i--)); do 322 for ((i=${#sflist[@]}; i>0; i--)); do
323 [[ ${sf##*/} < ${sflist[i-1]##*/} ]] || break 323 [[ ${sf##*/} < ${sflist[i-1]##*/} ]] || break
324 sflist[i]=${sflist[i-1]} 324 sflist[i]=${sflist[i-1]}
325 done 325 done
326 sflist[i]=${sf} 326 sflist[i]=${sf}
327 # set a flag if there are obsolete files
328 [ "${sf%/*}" = "${ROOT}${SITELISP}" ] && obsolete=t
327 done 329 done
328 330
329 eval "${old_shopts}" 331 eval "${old_shopts}"
330 332
331 cat <<-EOF >"${T}"/site-gentoo.el 333 cat <<-EOF >"${T}"/site-gentoo.el
377 (require 'site-gentoo) 379 (require 'site-gentoo)
378 380
379to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line 381to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line
380can be added by individual users to their initialisation files, or, 382can be added by individual users to their initialisation files, or,
381for greater flexibility, users can load individual package-specific 383for greater flexibility, users can load individual package-specific
382initialisation files from /usr/share/emacs/site-lisp/. 384initialisation files from /usr/share/emacs/site-lisp/site-gentoo.d/.
383EOF 385EOF
384 echo 386 echo
385 fi 387 fi
386 388
387 # Kludge for backwards compatibility: During pkg_postrm, old versions 389 # Kludge for backwards compatibility: During pkg_postrm, old versions
388 # of this eclass (saved in the PDB) won't find packages' site-init files 390 # of this eclass (saved in the VDB) won't find packages' site-init files
389 # in the new location. So we copy them to an auxiliary file that is 391 # in the new location. So we copy them to an auxiliary file that is
390 # visible to old eclass versions. 392 # visible to old eclass versions.
391 for sf in "${sflist[@]}"; do 393 for sf in "${sflist[@]}"; do
392 [ "${sf%/*}" = "${ROOT}${SITELISP}/site-gentoo.d" ] \ 394 [ "${sf%/*}" = "${ROOT}${SITELISP}/site-gentoo.d" ] \
393 && cat "${sf}" >>"${ROOT}${SITELISP}"/00site-gentoo.el 395 && cat "${sf}" >>"${ROOT}${SITELISP}"/00site-gentoo.el
394 done 396 done
397
398# if [ "${obsolete}" ]; then
399# while read line; do ewarn "${line}"; done <<-EOF
400# Site-initialisation files of Emacs packages are now installed in
401# /usr/share/emacs/site-lisp/site-gentoo.d/. You may consider using
402# /usr/sbin/emacs-updater to rebuild the installed Emacs packages.
403# However, the old location is still supported.
404# EOF
405# echo
406# fi
395} 407}

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.20