commit:     d48eb5d10b1d301240521d5369b9ddcf8c93cb52
Author:     Keri Harris <keri <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 27 14:50:06 2021 +0000
Commit:     Keri Harris <keri <AT> gentoo <DOT> org>
CommitDate: Sun Jun 27 14:50:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d48eb5d1

dev-lang/mozart: include site-lisp file to get Oz major modes.

Closes: https://bugs.gentoo.org/194604
Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Keri Harris <keri <AT> gentoo.org>

 dev-lang/mozart/files/50mozart-gentoo.el | 13 +++++++++++++
 dev-lang/mozart/mozart-2.0.1.ebuild      | 12 +++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/dev-lang/mozart/files/50mozart-gentoo.el 
b/dev-lang/mozart/files/50mozart-gentoo.el
new file mode 100644
index 00000000000..3533d49d693
--- /dev/null
+++ b/dev-lang/mozart/files/50mozart-gentoo.el
@@ -0,0 +1,13 @@
+;;; mozart site-lisp configuration
+
+(or (getenv "OZHOME")
+    (setenv "OZHOME" "/usr"))
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'run-oz' "oz" "Start Mozart as a sub-process" t)
+(autoload 'oz-mode "oz" "Major mode for editing Oz code." t)
+(autoload 'oz-gump-mode "oz"
+  "Major mode for editing Oz code with embedded Gump specifications." t)
+(autoload 'ozm-mode "mozart" "Major mode for displaying Oz machine code." t)
+(add-to-list 'auto-mode-alist '("\\.oz$" . oz-mode))
+(add-to-list 'auto-mode-alist '("\\.ozg$" . oz-gump-mode))
+(add-to-list 'auto-mode-alist '("\\.ozm$" . ozm-mode))

diff --git a/dev-lang/mozart/mozart-2.0.1.ebuild 
b/dev-lang/mozart/mozart-2.0.1.ebuild
index d469901f25b..510d6729b40 100644
--- a/dev-lang/mozart/mozart-2.0.1.ebuild
+++ b/dev-lang/mozart/mozart-2.0.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit cmake java-pkg-2 java-ant-2
+inherit cmake elisp-common java-pkg-2 java-ant-2
 
 PATCHSET_VER="1"
 
@@ -30,6 +30,8 @@ DEPEND="${RDEPEND}
        dev-lang/scala:2.12
        test? ( dev-cpp/gtest:= )"
 
+SITEFILE="50${PN}-gentoo.el"
+
 S="${WORKDIR}/${PN}2-${PV}"
 
 src_prepare() {
@@ -71,12 +73,19 @@ src_install() {
 
        dolib.so "${BUILD_DIR}"/vm/vm/main/libmozartvm.so
        dolib.so "${BUILD_DIR}"/vm/boostenv/main/libmozartvmboost.so
+
+       if use emacs; then
+               elisp-install ${PN} "${S}"/opi/emacs/*.el
+               elisp-site-file-install "${FILESDIR}"/"${SITEFILE}" \
+                       || die "elsip-site-file-install failed"
+       fi
 }
 
 pkg_postinst() {
        if use emacs; then
                xdg_icon_cache_update
                xdg_desktop_database_update
+               elisp-site-regen
        fi
 }
 
@@ -84,5 +93,6 @@ pkg_postrm() {
        if use emacs; then
                xdg_icon_cache_update
                xdg_desktop_database_update
+               elisp-site-regen
        fi
 }

Reply via email to