app-metrics/prometheus: add 3.1.0
[gentoo/gentoo.git] / app-accessibility / emacspeak / emacspeak-56.0-r1.ebuild
blob2fb27f565d08e92a207fac3861cfb96dfe02a48c
1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 NEED_EMACS=26.1
7 FORCE_PRINT_ELOG=1
8 DISABLE_AUTOFORMATTING=1
9 inherit elisp toolchain-funcs readme.gentoo-r1
11 DESCRIPTION="The emacspeak audio desktop"
12 HOMEPAGE="http://emacspeak.sourceforge.net/"
14 if [[ ${PV} == 9999 ]] ; then
15         EGIT_REPO_URI="https://github.com/tvraman/emacspeak.git"
16         inherit git-r3
17 else
18         SRC_URI="https://github.com/tvraman/emacspeak/releases/download/${PV}/${P}.tar.bz2"
19         KEYWORDS="amd64 ppc x86"
22 LICENSE="GPL-2+ GPL-3+"
23 SLOT="0"
24 IUSE="+espeak"
26 # Usually need := dep with tcl anyway but in particular, it's needed
27 # here as we do a version check in src_compile and bake in the results.
28 DEPEND="
29         dev-lang/tcl:=
30         espeak? ( app-accessibility/espeak-ng )
32 RDEPEND="
33         ${DEPEND}
34         >=dev-tcltk/tclx-8.4
37 DOC_CONTENTS='
38 As of version 39.0 and later, the /usr/bin/emacspeak
39 shell script has been removed downstream in Gentoo.
40 You should launch emacspeak by another method, for instance
41 by adding the following to your ~/.emacs file:
42 (load "/usr/share/emacs/site-lisp/emacspeak/lisp/emacspeak-setup.el")
45 HTML_DOCS=( etc/ info/ )
47 src_configure() {
48         MAKEOPTS+=" -j1"
50         tc-export CXX
52         emake config
55 src_compile() {
56         emake emacspeak
57         if use espeak; then
58                 local tcl_version="$(echo 'puts $tcl_version;exit 0' |tclsh)"
59                 if [[ -z ${tcl_version} ]]; then
60                         die 'Unable to detect the installed version of dev-lang/tcl.'
61                 fi
63                 cd servers/native-espeak || die
64                 emake TCL_VERSION="${tcl_version}"
65         fi
68 src_install() {
69         emake DESTDIR="${D}" install
71         if use espeak; then
72                 pushd servers/native-espeak > /dev/null || die
74                 emake DESTDIR="${D}" install
75                 local orig_serverdir="/usr/share/emacs/site-lisp/emacspeak/servers/native-espeak"
76                 local serverfile="${ED}${orig_serverdir}/tclespeak.so"
78                 install -Dm755 "${serverfile}" \
79                         "${ED}/usr/$(get_libdir)/emacspeak/tclespeak.so" || die
80                 rm -f "${serverfile}" || die
82                 dosym -r "/usr/$(get_libdir)/emacspeak/tclespeak.so" \
83                         "${orig_serverdir}/tclespeak.so"
84                 popd > /dev/null || die
85         fi
87         dodoc README etc/NEWS* etc/COPYRIGHT
88         einstalldocs
90         cd "${ED}"/usr/share/emacs/site-lisp/${PN} || die
91         rm -rf README etc/NEWS* etc/COPYRIGHT install-guide \
92                 user-guide || die
93         readme.gentoo_create_doc