Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emacs/emacs-common-gentoo/
Date: Sat, 29 Aug 2020 11:44:57
Message-Id: 1598701422.dc22ab6d98381884fb09fb13280b47a040a0b90b.ulm@gentoo
1 commit: dc22ab6d98381884fb09fb13280b47a040a0b90b
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 12 16:47:26 2020 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 29 11:43:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc22ab6d
7
8 app-emacs/emacs-common-gentoo: Migrate from X to gui USE flag.
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
12
13 .../emacs-common-gentoo-1.6-r4.ebuild | 102 +++++++++++++++++++++
14 1 file changed, 102 insertions(+)
15
16 diff --git a/app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.6-r4.ebuild b/app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.6-r4.ebuild
17 new file mode 100644
18 index 00000000000..5e3c5961742
19 --- /dev/null
20 +++ b/app-emacs/emacs-common-gentoo/emacs-common-gentoo-1.6-r4.ebuild
21 @@ -0,0 +1,102 @@
22 +# Copyright 1999-2020 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +inherit elisp-common desktop xdg-utils readme.gentoo-r1
28 +
29 +DESCRIPTION="Common files needed by all GNU Emacs versions"
30 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Emacs"
31 +SRC_URI="https://dev.gentoo.org/~ulm/emacs/${P}.tar.xz"
32 +
33 +LICENSE="GPL-3+"
34 +SLOT="0"
35 +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
36 +IUSE="games gui"
37 +
38 +RDEPEND="games? ( acct-group/gamestat )"
39 +DEPEND="${RDEPEND}"
40 +PDEPEND=">=app-editors/emacs-23.1:*"
41 +
42 +src_install() {
43 + insinto "${SITELISP}"
44 + doins subdirs.el
45 + newins site-gentoo.el{,.orig}
46 +
47 + keepdir /etc/emacs
48 + insinto /etc/emacs
49 + doins site-start.el
50 +
51 + if use games; then
52 + keepdir /var/games/emacs
53 + fowners 0:gamestat /var/games/emacs
54 + fperms g+w /var/games/emacs
55 + fi
56 +
57 + if use gui; then
58 + local i
59 + domenu emacs.desktop emacsclient.desktop
60 +
61 + pushd icons || die
62 + newicon sink.png emacs-sink.png
63 + newicon emacs25_48.png emacs.png
64 + for i in 16 24 32 48 128; do
65 + [[ ${i} -le 48 ]] && newicon -s ${i} emacs22_${i}.png emacs22.png
66 + newicon -s ${i} emacs23_${i}.png emacs23.png
67 + newicon -s ${i} emacs25_${i}.png emacs.png
68 + done
69 + doicon -s scalable emacs23.svg
70 + newicon -s scalable emacs25.svg emacs.svg
71 + popd
72 + fi
73 +
74 + DOC_CONTENTS="All site initialisation for Gentoo-installed packages is
75 + added to ${SITELISP}/site-gentoo.el. In order for this site
76 + initialisation to be loaded for all users automatically, a default
77 + site startup file /etc/emacs/site-start.el is installed. You are
78 + responsible for maintenance of this file.
79 + \n\nAlternatively, individual users can add the following command:
80 + \n\n(require 'site-gentoo)
81 + \n\nto their ~/.emacs initialisation files, or, for greater
82 + flexibility, users may load single package-specific initialisation
83 + files from the ${SITELISP}/site-gentoo.d/ directory."
84 + readme.gentoo_create_doc
85 +}
86 +
87 +pkg_preinst() {
88 + # make sure that site-gentoo.el exists since site-start.el requires it
89 + if [[ ! -f ${ED}${SITELISP}/site-gentoo.el ]]; then #554518
90 + mv "${ED}${SITELISP}"/site-gentoo.el{.orig,} || die
91 + fi
92 + if [[ -d ${EROOT}${SITELISP} ]]; then
93 + elisp-site-regen
94 + cp "${EROOT}${SITELISP}/site-gentoo.el" "${ED}${SITELISP}/" || die
95 + fi
96 +
97 + if use games; then
98 + local f
99 + for f in /var/games/emacs/{snake,tetris}-scores; do
100 + if [[ -e ${EROOT}${f} ]]; then
101 + cp "${EROOT}${f}" "${ED}${f}" || die
102 + fi
103 + touch "${ED}${f}" || die
104 + chgrp gamestat "${ED}${f}" || die
105 + chmod g+w "${ED}${f}" || die
106 + done
107 + fi
108 +}
109 +
110 +pkg_postinst() {
111 + if use gui; then
112 + xdg_desktop_database_update
113 + xdg_icon_cache_update
114 + fi
115 + readme.gentoo_print_elog
116 +}
117 +
118 +pkg_postrm() {
119 + if use gui; then
120 + xdg_desktop_database_update
121 + xdg_icon_cache_update
122 + fi
123 +}