Skip to content

Commit

Permalink
app-emacs/vterm: Initial import.
Browse files Browse the repository at this point in the history
Ebuild contributed by me, based on earlier work by Hans de Graaff
<[email protected]> and Arjan Adriaanse <[email protected]>.

Closes: https://bugs.gentoo.org/721256
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Ulrich Müller <[email protected]>
  • Loading branch information
ulm committed Aug 4, 2020
1 parent e0ffc60 commit 8d01f01
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-emacs/vterm/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST vterm-0.0.1_pre20200713.tar.gz 48160 BLAKE2B 96c45ddb139d19f3020d7a8eebc1ee31a7dc098f47c16cfffc7bf3327261a4366763744a8158d3c8a066ec94be4966a5ef78804db95c9025eee06fb8c9e4aa76 SHA512 17726ad0957daeab2a87b398bfa24dbe3c4c48dfba932138a71cd8c992bf20bd2925a7118a89247bbd674dbecd7fda8663c564a278168bb207034efb03e50cd0
5 changes: 5 additions & 0 deletions app-emacs/vterm/files/50vterm-gentoo.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(add-to-list 'load-path "@SITELISP@")
(add-to-list 'load-path "@EMACSMODULES@")
(autoload 'vterm "vterm" "Create a new vterm." t)
(autoload 'vterm-other-window "vterm"
"Create a new vterm in another window." t)
22 changes: 22 additions & 0 deletions app-emacs/vterm/files/vterm-dont-compile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Simply error out if the module is not found. Don't confuse the user
with messages about compiling the module, which won't work outside of
the package's source tree.

--- a/vterm.el
+++ b/vterm.el
@@ -121,14 +121,7 @@
(message "Compilation of `emacs-libvterm' module succeeded")
(error "Compilation of `emacs-libvterm' module failed!")))))

-;; If the vterm-module is not compiled yet, compile it
-(unless (require 'vterm-module nil t)
- (if (or vterm-always-compile-module
- (y-or-n-p "Vterm needs `vterm-module' to work. Compile it now? "))
- (progn
- (vterm-module-compile)
- (require 'vterm-module))
- (error "Vterm will not work until `vterm-module' is compiled!")))
+(require 'vterm-module)

;; Silence compiler warnings by informing it of what functions are defined
(declare-function display-line-numbers-update-width "display-line-numbers")
17 changes: 17 additions & 0 deletions app-emacs/vterm/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>[email protected]</email>
<name>Gentoo GNU Emacs project</name>
</maintainer>
<longdescription>
Emacs-libvterm (vterm) is fully-fledged terminal emulator inside
GNU Emacs based on libvterm, a C library. As a result of using
compiled code (instead of elisp), emacs-libvterm is fully capable,
fast, and it can seamlessly handle large outputs.
</longdescription>
<upstream>
<remote-id type="github">akermu/emacs-libvterm</remote-id>
</upstream>
</pkgmetadata>
45 changes: 45 additions & 0 deletions app-emacs/vterm/vterm-0.0.1_pre20200713.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
NEED_EMACS=26
COMMIT="f41849c2c9c1899f22d1c3d4f871ec47c82627ce"

inherit cmake elisp

MY_PN="emacs-libvterm"
DESCRIPTION="Fully-featured terminal emulator based on libvterm"
HOMEPAGE="https://github.com/akermu/emacs-libvterm"
SRC_URI="https://github.com/akermu/${MY_PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="dev-libs/libvterm"
RDEPEND="${DEPEND}
app-editors/emacs[dynamic-loading]"

S="${WORKDIR}/${MY_PN}-${COMMIT}"
PATCHES=( "${FILESDIR}"/${PN}-dont-compile.patch )
SITEFILE="50${PN}-gentoo.el"
DOCS="README.md"

src_prepare() {
cmake_src_prepare
}

src_configure() {
local mycmakeargs=( "-DUSE_SYSTEM_LIBVTERM=ON" )
cmake_src_configure
}

src_compile() {
cmake_src_compile
elisp_src_compile
}

src_install() {
elisp_src_install
elisp-modules-install ${PN} vterm-module.so
}

0 comments on commit 8d01f01

Please sign in to comment.