1 |
commit: 316d2cee8734dbc22f0a1a1e5d4debac89c8cbce |
2 |
Author: Arjan Adriaanse <arjan <AT> adriaan <DOT> se> |
3 |
AuthorDate: Tue May 5 09:05:49 2020 +0000 |
4 |
Commit: Arjan Adriaanse <arjan <AT> adriaan <DOT> se> |
5 |
CommitDate: Tue May 5 09:05:49 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=316d2cee |
7 |
|
8 |
app-emacs/vterm: add new package |
9 |
|
10 |
Package-Manager: Portage-2.3.89, Repoman-2.3.20 |
11 |
Signed-off-by: Arjan Adriaanse <arjan <AT> adriaan.se> |
12 |
|
13 |
app-emacs/vterm/Manifest | 1 + |
14 |
app-emacs/vterm/files/50vterm-gentoo.el | 2 + |
15 |
app-emacs/vterm/files/bashrc | 26 +++++++++++++ |
16 |
app-emacs/vterm/files/config.fish | 30 +++++++++++++++ |
17 |
app-emacs/vterm/files/zshrc | 25 +++++++++++++ |
18 |
app-emacs/vterm/metadata.xml | 26 +++++++++++++ |
19 |
app-emacs/vterm/vterm-20200504.544.ebuild | 61 +++++++++++++++++++++++++++++++ |
20 |
7 files changed, 171 insertions(+) |
21 |
|
22 |
diff --git a/app-emacs/vterm/Manifest b/app-emacs/vterm/Manifest |
23 |
new file mode 100644 |
24 |
index 0000000..0fa0a8c |
25 |
--- /dev/null |
26 |
+++ b/app-emacs/vterm/Manifest |
27 |
@@ -0,0 +1 @@ |
28 |
+DIST vterm-20200504.544.tar 184320 BLAKE2B 9a705ef3e36b8b1991e9b152b59a40f5d784631ee613056ccedffc85c690c83b0860f900d1494388047b2fec8ef7803adc7c5550b2d210e3cda95ebd8894be5c SHA512 c2971628778e9128efae5c567bd0e9453a8260032d0c220e4348e135e2d2c1af56429eebe613641bd13a148dec53e10c4604dd93a0261f2db74a1bcb8a240ff8 |
29 |
|
30 |
diff --git a/app-emacs/vterm/files/50vterm-gentoo.el b/app-emacs/vterm/files/50vterm-gentoo.el |
31 |
new file mode 100644 |
32 |
index 0000000..a050b7a |
33 |
--- /dev/null |
34 |
+++ b/app-emacs/vterm/files/50vterm-gentoo.el |
35 |
@@ -0,0 +1,2 @@ |
36 |
+(add-to-list 'load-path "@SITELISP@") |
37 |
+(load "vterm-autoloads" nil t) |
38 |
|
39 |
diff --git a/app-emacs/vterm/files/bashrc b/app-emacs/vterm/files/bashrc |
40 |
new file mode 100755 |
41 |
index 0000000..bafa9f1 |
42 |
--- /dev/null |
43 |
+++ b/app-emacs/vterm/files/bashrc |
44 |
@@ -0,0 +1,26 @@ |
45 |
+function vterm_printf(){ |
46 |
+ if [ -n "$TMUX" ]; then |
47 |
+ # Tell tmux to pass the escape sequences through |
48 |
+ # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) |
49 |
+ printf "\ePtmux;\e\e]%s\007\e\\" "$1" |
50 |
+ elif [ "${TERM%%-*}" = "screen" ]; then |
51 |
+ # GNU screen (screen, screen-256color, screen-256color-bce) |
52 |
+ printf "\eP\e]%s\007\e\\" "$1" |
53 |
+ else |
54 |
+ printf "\e]%s\e\\" "$1" |
55 |
+ fi |
56 |
+} |
57 |
+ |
58 |
+if [[ "$INSIDE_EMACS" = 'vterm' ]]; then |
59 |
+ function clear(){ |
60 |
+ vterm_printf "51;Evterm-clear-scrollback"; |
61 |
+ tput clear; |
62 |
+ } |
63 |
+fi |
64 |
+ |
65 |
+PROMPT_COMMAND='echo -ne "\033]0;\h:\w\007"' |
66 |
+ |
67 |
+vterm_prompt_end(){ |
68 |
+ vterm_printf "51;A$(whoami)@$(hostname):$(pwd)" |
69 |
+} |
70 |
+PS1=$PS1'\[$(vterm_prompt_end)\]' |
71 |
|
72 |
diff --git a/app-emacs/vterm/files/config.fish b/app-emacs/vterm/files/config.fish |
73 |
new file mode 100644 |
74 |
index 0000000..ce47d71 |
75 |
--- /dev/null |
76 |
+++ b/app-emacs/vterm/files/config.fish |
77 |
@@ -0,0 +1,30 @@ |
78 |
+function vterm_printf; |
79 |
+ if [ -n "$TMUX" ] |
80 |
+ # tell tmux to pass the escape sequences through |
81 |
+ # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) |
82 |
+ printf "\ePtmux;\e\e]%s\007\e\\" "$argv" |
83 |
+ else if string match -q -- "screen*" "$TERM" |
84 |
+ # GNU screen (screen, screen-256color, screen-256color-bce) |
85 |
+ printf "\eP\e]%s\007\e\\" "$argv" |
86 |
+ else |
87 |
+ printf "\e]%s\e\\" "$argv" |
88 |
+ end |
89 |
+end |
90 |
+ |
91 |
+function fish_title |
92 |
+ hostname |
93 |
+ echo ":" |
94 |
+ pwd |
95 |
+end |
96 |
+ |
97 |
+function vterm_prompt_end; |
98 |
+ vterm_printf '51;A'(whoami)'@'(hostname)':'(pwd) |
99 |
+end |
100 |
+functions -c fish_prompt vterm_old_fish_prompt |
101 |
+function fish_prompt --description 'Write out the prompt; do not replace this. Instead, put this at end of your file.' |
102 |
+ # Remove the trailing newline from the original prompt. This is done |
103 |
+ # using the string builtin from fish, but to make sure any escape codes |
104 |
+ # are correctly interpreted, use %b for printf. |
105 |
+ printf "%b" (string join "\n" (vterm_old_fish_prompt)) |
106 |
+ vterm_prompt_end |
107 |
+end |
108 |
|
109 |
diff --git a/app-emacs/vterm/files/zshrc b/app-emacs/vterm/files/zshrc |
110 |
new file mode 100644 |
111 |
index 0000000..eb9255a |
112 |
--- /dev/null |
113 |
+++ b/app-emacs/vterm/files/zshrc |
114 |
@@ -0,0 +1,25 @@ |
115 |
+function vterm_printf(){ |
116 |
+ if [ -n "$TMUX" ]; then |
117 |
+ # Tell tmux to pass the escape sequences through |
118 |
+ # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) |
119 |
+ printf "\ePtmux;\e\e]%s\007\e\\" "$1" |
120 |
+ elif [ "${TERM%%-*}" = "screen" ]; then |
121 |
+ # GNU screen (screen, screen-256color, screen-256color-bce) |
122 |
+ printf "\eP\e]%s\007\e\\" "$1" |
123 |
+ else |
124 |
+ printf "\e]%s\e\\" "$1" |
125 |
+ fi |
126 |
+} |
127 |
+ |
128 |
+if [[ "$INSIDE_EMACS" = 'vterm' ]]; then |
129 |
+ alias clear='vterm_printf "51;Evterm-clear-scrollback";tput clear' |
130 |
+fi |
131 |
+ |
132 |
+autoload -U add-zsh-hook |
133 |
+add-zsh-hook -Uz chpwd (){ print -Pn "\e]2;%m:%2~\a" } |
134 |
+ |
135 |
+vterm_prompt_end() { |
136 |
+ vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"; |
137 |
+} |
138 |
+setopt PROMPT_SUBST |
139 |
+PROMPT=$PROMPT'%{$(vterm_prompt_end)%}' |
140 |
|
141 |
diff --git a/app-emacs/vterm/metadata.xml b/app-emacs/vterm/metadata.xml |
142 |
new file mode 100644 |
143 |
index 0000000..a9708bd |
144 |
--- /dev/null |
145 |
+++ b/app-emacs/vterm/metadata.xml |
146 |
@@ -0,0 +1,26 @@ |
147 |
+<?xml version="1.0" encoding="UTF-8"?> |
148 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
149 |
+<pkgmetadata> |
150 |
+<maintainer type="person"> |
151 |
+ <email>arjan@×××××××.se</email> |
152 |
+ <name>Arjan Adriaanse</name> |
153 |
+</maintainer> |
154 |
+<longdescription> |
155 |
+ Emacs-libvterm (vterm) is fully-fledged terminal emulator inside GNU |
156 |
+ Emacs based on libvterm, a C library. As a result of using compiled |
157 |
+ code (instead of elisp), emacs-libvterm is fully capable, fast, and |
158 |
+ it can seamlessly handle large outputs. |
159 |
+ |
160 |
+ This package automatically compiles the needed module and provides |
161 |
+ configurations for better integration with some shells. |
162 |
+</longdescription> |
163 |
+<upstream> |
164 |
+ <maintainer status="active"> |
165 |
+ <email>fuermetz@×××××××.org</email> |
166 |
+ <name>Lukas Fürmetz</name> |
167 |
+ </maintainer> |
168 |
+ <doc>https://github.com/akermu/emacs-libvterm/blob/master/README.md</doc> |
169 |
+ <bugs-to>https://github.com/akermu/emacs-libvterm/issues</bugs-to> |
170 |
+ <remote-id type="github">akermu/emacs-libvterm</remote-id> |
171 |
+</upstream> |
172 |
+</pkgmetadata> |
173 |
|
174 |
diff --git a/app-emacs/vterm/vterm-20200504.544.ebuild b/app-emacs/vterm/vterm-20200504.544.ebuild |
175 |
new file mode 100644 |
176 |
index 0000000..6de8fb8 |
177 |
--- /dev/null |
178 |
+++ b/app-emacs/vterm/vterm-20200504.544.ebuild |
179 |
@@ -0,0 +1,61 @@ |
180 |
+# Copyright 2020 Gentoo Authors |
181 |
+# Distributed under the terms of the GNU General Public License v2 |
182 |
+ |
183 |
+EAPI=7 |
184 |
+ |
185 |
+inherit elisp cmake |
186 |
+ |
187 |
+DESCRIPTION="Emacs libvterm integration" |
188 |
+HOMEPAGE="https://github.com/akermu/emacs-libvterm" |
189 |
+SRC_URI="https://melpa.org/packages/${PN}-${PV}.tar -> ${P}.tar" |
190 |
+ |
191 |
+LICENSE="GPL-2+" |
192 |
+SLOT="0" |
193 |
+KEYWORDS="~amd64 ~x86" |
194 |
+ |
195 |
+RDEPEND=" |
196 |
+ app-editors/emacs[dynamic-loading] |
197 |
+ dev-libs/libvterm |
198 |
+" |
199 |
+ |
200 |
+ELISP_REMOVE="${PN}-pkg.el" |
201 |
+SITEFILE="50${PN}-gentoo.el" |
202 |
+ |
203 |
+src_configure() { |
204 |
+ elisp-make-autoload-file |
205 |
+ |
206 |
+ local mycmakeargs=( "USE_SYSTEM_LIBVTERM=yes" ) |
207 |
+ cmake_src_configure |
208 |
+} |
209 |
+ |
210 |
+src_compile() { |
211 |
+ elisp_src_compile |
212 |
+ |
213 |
+ cmake_src_compile |
214 |
+} |
215 |
+ |
216 |
+src_install() { |
217 |
+ elisp_src_install |
218 |
+ |
219 |
+ dodoc README.md |
220 |
+ |
221 |
+ # install vterm module |
222 |
+ elisp-install ${PN} *.so |
223 |
+ |
224 |
+ # add shell config files |
225 |
+ if has_version app-shells/bash; then |
226 |
+ elog "Adding configuration for bash." |
227 |
+ exeinto /etc/bash/bashrc.d/ |
228 |
+ newexe "${FILESDIR}/bashrc" bash-emacs-vterm.sh |
229 |
+ fi |
230 |
+ if has_version app-shells/zsh; then |
231 |
+ elog "Adding configuration for zsh." |
232 |
+ exeinto /etc/profile.d/ |
233 |
+ newexe "${FILESDIR}/zshrc" zsh-emacs-vterm.sh |
234 |
+ fi |
235 |
+ if has_version app-shells/fish; then |
236 |
+ elog "Adding configuration for fish." |
237 |
+ exeinto /etc/fish/conf.d/ |
238 |
+ newexe "${FILESDIR}/config.fish" emacs-vterm.fish |
239 |
+ fi |
240 |
+} |