commit:     1509acbb6d4e7f4c9f1a622ac380a14b4afa7317
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 18 22:03:37 2022 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Mon Apr 18 22:03:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1509acbb

dev-ml/dune: 2.9.3 - enable Emacs support & bump to EAPI 8

Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 dev-ml/dune/{dune-2.9.3.ebuild => dune-2.9.3-r1.ebuild} | 15 ++++++++++++---
 dev-ml/dune/files/50dune-gentoo.el                      |  4 ++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/dev-ml/dune/dune-2.9.3.ebuild b/dev-ml/dune/dune-2.9.3-r1.ebuild
similarity index 73%
rename from dev-ml/dune/dune-2.9.3.ebuild
rename to dev-ml/dune/dune-2.9.3-r1.ebuild
index 9bf93b2276e8..8830c7c629e2 100644
--- a/dev-ml/dune/dune-2.9.3.ebuild
+++ b/dev-ml/dune/dune-2.9.3-r1.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit multiprocessing
+inherit multiprocessing elisp-common
 
 DESCRIPTION="A composable build system for OCaml"
 HOMEPAGE="https://github.com/ocaml/dune";
@@ -12,11 +12,12 @@ SRC_URI="https://github.com/ocaml/dune/archive/${PV}.tar.gz 
-> ${P}.tar.gz"
 LICENSE="MIT"
 SLOT="0/${PV}"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
-IUSE="test"
+IUSE="emacs test"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
        >=dev-lang/ocaml-4.08:=
+       emacs? ( >=app-editors/emacs-23.1:* )
 "
 DEPEND="
        ${RDEPEND}
@@ -29,6 +30,7 @@ DEPEND="
 "
 
 QA_FLAGS_IGNORED="usr/bin/dune"
+SITEFILE="50${PN}-gentoo.el"
 
 src_configure() {
        :
@@ -38,10 +40,17 @@ src_compile() {
        ocaml bootstrap.ml -j $(makeopts_jobs) || die
        ./dune.exe build -p "${PN}" --profile dune-bootstrap -j 
$(makeopts_jobs) \
                --display short || die
+
+       use emacs && elisp-compile editor-integration/emacs/*.el
 }
 
 src_install() {
        default
        mv "${ED}"/usr/doc "${ED}"/usr/share/doc/${PF} || die
        mv "${ED}"/usr/man "${ED}"/usr/share/man || die
+
+       if use emacs ; then
+               elisp-install ${PN} editor-integration/emacs/*.el{,c}
+               elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+       fi
 }

diff --git a/dev-ml/dune/files/50dune-gentoo.el 
b/dev-ml/dune/files/50dune-gentoo.el
new file mode 100644
index 000000000000..87fd7c6b28a9
--- /dev/null
+++ b/dev-ml/dune/files/50dune-gentoo.el
@@ -0,0 +1,4 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'dune-mode "dune"
+  "Major mode to edit dune files." t)
+(add-to-list 'auto-mode-alist 
'("\\(?:\\`\\|/\\)dune\\(?:\\.inc\\|\\-project\\)?\\'" . dune-mode))

Reply via email to