# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 inherit elisp-common multilib DESCRIPTION="Interactive Javascript Console for Mozilla Applications Developers" HOMEPAGE="https://github.com/bard/mozrepl/wiki http://addons.mozilla.org/firefox/addon/mozrepl" SRC_URI="https://github.com/bard/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" LICENSE="MPL-2.0" SLOT="0" KEYWORDS="~x86" IUSE="emacs" DEPEND="|| ( www-client/firefox www-client/firefox-bin www-client/conkeror ) emacs? ( virtual/emacs )" SITEFILE="50${PN}-gentoo.el" src_compile() { if use emacs; then cd chrome/content || die elisp-make-autoload-file elisp-compile *.el fi } src_install() { local emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' ./install.rdf)" \ || die "failed to determine extension id" insinto "${EPREFIX}/usr/share/${P}" doins -r ./* local MOZ_DIRS=() local v=$(best_version www-client/firefox) if [ -n "${v}" ]; then MOZ_DIRS+=("${EPREFIX}/usr/$(get_libdir)/firefox") fi v=$(best_version www-client/firefox-bin) if [ -n "${v}" ]; then MOZ_DIRS+=("${EPREFIX}/opt/firefox") fi v=$(best_version www-client/conkeror) if [ -n "${v}" ]; then MOZ_DIRS+=("${EPREFIX}/usr/share/conkeror") fi for i in ${MOZ_DIRS[@]} do dosym "${EPREFIX}/usr/share/${P}" "${i}/extensions/${emid}" done if use emacs; then cd chrome/content || die elisp-install ${PN} *.el *.elc elisp-site-file-install "${FILESDIR}/${SITEFILE}" fi }