summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Barć <xgqt@gentoo.org>2022-04-08 18:09:23 +0200
committerMaciej Barć <xgqt@gentoo.org>2022-04-08 18:10:12 +0200
commitdd486c071062789d2c715380150b04591912c085 (patch)
tree86377afa9e117c183f74c5638ca8e5e10c9f9b60 /app-emacs/yasnippet-snippets
parentnet-mail/automx2: drop 2021.5 (diff)
downloadgentoo-dd486c071062789d2c715380150b04591912c085.tar.gz
gentoo-dd486c071062789d2c715380150b04591912c085.tar.bz2
gentoo-dd486c071062789d2c715380150b04591912c085.zip
app-emacs/yasnippet-snippets: install el library files
some libraries want to acess "yasnippet-snippets--fixed-indent" or "yasnippet-snippets-initialize", so let's install the missing "yasnippet-snippets.el" files providing those functions, also change how site-gentoo autoloads are handled - call "yasnippet-snippets-initialize" Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'app-emacs/yasnippet-snippets')
-rw-r--r--app-emacs/yasnippet-snippets/files/50yasnippet-snippets-gentoo.el9
-rw-r--r--app-emacs/yasnippet-snippets/files/yasnippet-snippets-dir.patch18
-rw-r--r--app-emacs/yasnippet-snippets/yasnippet-snippets-0.3-r1.ebuild (renamed from app-emacs/yasnippet-snippets/yasnippet-snippets-1.0-r1.ebuild)16
-rw-r--r--app-emacs/yasnippet-snippets/yasnippet-snippets-1.0-r2.ebuild (renamed from app-emacs/yasnippet-snippets/yasnippet-snippets-0.3.ebuild)26
4 files changed, 56 insertions, 13 deletions
diff --git a/app-emacs/yasnippet-snippets/files/50yasnippet-snippets-gentoo.el b/app-emacs/yasnippet-snippets/files/50yasnippet-snippets-gentoo.el
index 2db51796990b..4c85ffac5510 100644
--- a/app-emacs/yasnippet-snippets/files/50yasnippet-snippets-gentoo.el
+++ b/app-emacs/yasnippet-snippets/files/50yasnippet-snippets-gentoo.el
@@ -1,4 +1,5 @@
-(eval-after-load "yasnippet"
- '(let ((snippets-dir "@SITEETC@"))
- (add-to-list 'yas-snippet-dirs snippets-dir t)
- (yas-load-directory snippets-dir t)))
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'yasnippet-snippets-initialize "yasnippet-snippets"
+ "Load the `yasnippet-snippets' snippets directory." t)
+(eval-after-load 'yasnippet
+ '(yasnippet-snippets-initialize))
diff --git a/app-emacs/yasnippet-snippets/files/yasnippet-snippets-dir.patch b/app-emacs/yasnippet-snippets/files/yasnippet-snippets-dir.patch
new file mode 100644
index 000000000000..2d5c8f2e483b
--- /dev/null
+++ b/app-emacs/yasnippet-snippets/files/yasnippet-snippets-dir.patch
@@ -0,0 +1,18 @@
+index 078ac04..1c84318 100644
+--- a/yasnippet-snippets.el
++++ b/yasnippet-snippets.el
+@@ -35,13 +35,7 @@
+ (defconst yasnippet-snippets-dir
+ (expand-file-name
+ "snippets"
+- (file-name-directory
+- ;; Copied from ‘f-this-file’ from f.el.
+- (cond
+- (load-in-progress load-file-name)
+- ((and (boundp 'byte-compile-current-file) byte-compile-current-file)
+- byte-compile-current-file)
+- (:else (buffer-file-name))))))
++ "@SITEETC@"))
+
+ ;;;###autoload
+ (defun yasnippet-snippets-initialize ()
diff --git a/app-emacs/yasnippet-snippets/yasnippet-snippets-1.0-r1.ebuild b/app-emacs/yasnippet-snippets/yasnippet-snippets-0.3-r1.ebuild
index 3b465cd3954b..e1d0818702d5 100644
--- a/app-emacs/yasnippet-snippets/yasnippet-snippets-1.0-r1.ebuild
+++ b/app-emacs/yasnippet-snippets/yasnippet-snippets-0.3-r1.ebuild
@@ -16,16 +16,26 @@ KEYWORDS="~amd64 ~x86"
RDEPEND="app-emacs/yasnippet"
BDEPEND="${RDEPEND}"
+DOCS=( README.md )
+PATCHES=( "${FILESDIR}"/${PN}-dir.patch )
SITEFILE="50${PN}-gentoo.el"
+src_prepare() {
+ elisp_src_prepare
+
+ sed "s|@SITEETC@|${EPREFIX}${SITEETC}/${PN}|" -i ${PN}.el || die
+}
+
src_compile() {
+ elisp_src_compile
+
${EMACS} ${EMACSFLAGS} --eval "(require 'yasnippet)" \
--eval "(yas-compile-directory \"${S}/snippets\")" || die
}
src_install() {
- elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ elisp_src_install
+
insinto "${SITEETC}/${PN}"
- doins -r snippets/.
- dodoc README.md
+ doins -r snippets
}
diff --git a/app-emacs/yasnippet-snippets/yasnippet-snippets-0.3.ebuild b/app-emacs/yasnippet-snippets/yasnippet-snippets-1.0-r2.ebuild
index 693935e3fecf..e1d0818702d5 100644
--- a/app-emacs/yasnippet-snippets/yasnippet-snippets-0.3.ebuild
+++ b/app-emacs/yasnippet-snippets/yasnippet-snippets-1.0-r2.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit elisp
@@ -14,14 +14,28 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="app-emacs/yasnippet"
+BDEPEND="${RDEPEND}"
+DOCS=( README.md )
+PATCHES=( "${FILESDIR}"/${PN}-dir.patch )
SITEFILE="50${PN}-gentoo.el"
-src_compile() { :; }
+src_prepare() {
+ elisp_src_prepare
+
+ sed "s|@SITEETC@|${EPREFIX}${SITEETC}/${PN}|" -i ${PN}.el || die
+}
+
+src_compile() {
+ elisp_src_compile
+
+ ${EMACS} ${EMACSFLAGS} --eval "(require 'yasnippet)" \
+ --eval "(yas-compile-directory \"${S}/snippets\")" || die
+}
src_install() {
- elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ elisp_src_install
+
insinto "${SITEETC}/${PN}"
- doins -r snippets/.
- dodoc README.md
+ doins -r snippets
}