From f839dbde90cb4c7efaed2b599613fb830ba1b53b Mon Sep 17 00:00:00 2001 From: Maciej Barć Date: Mon, 6 Jun 2022 22:20:53 +0200 Subject: dev-ml/merlin: use --- dev-ml/merlin/merlin-3.4.2-r2.ebuild | 70 --------------------------- dev-ml/merlin/merlin-3.4.2-r3.ebuild | 70 +++++++++++++++++++++++++++ dev-ml/merlin/merlin-4.2-r1.ebuild | 83 ------------------------------- dev-ml/merlin/merlin-4.2-r2.ebuild | 83 +++++++++++++++++++++++++++++++ dev-ml/merlin/merlin-4.3.1-r1.ebuild | 84 -------------------------------- dev-ml/merlin/merlin-4.3.1-r2.ebuild | 84 ++++++++++++++++++++++++++++++++ dev-ml/merlin/merlin-4.4-r1.ebuild | 93 ----------------------------------- dev-ml/merlin/merlin-4.4-r2.ebuild | 93 +++++++++++++++++++++++++++++++++++ dev-ml/merlin/merlin-4.5-r1.ebuild | 94 ------------------------------------ dev-ml/merlin/merlin-4.5-r2.ebuild | 94 ++++++++++++++++++++++++++++++++++++ 10 files changed, 424 insertions(+), 424 deletions(-) delete mode 100644 dev-ml/merlin/merlin-3.4.2-r2.ebuild create mode 100644 dev-ml/merlin/merlin-3.4.2-r3.ebuild delete mode 100644 dev-ml/merlin/merlin-4.2-r1.ebuild create mode 100644 dev-ml/merlin/merlin-4.2-r2.ebuild delete mode 100644 dev-ml/merlin/merlin-4.3.1-r1.ebuild create mode 100644 dev-ml/merlin/merlin-4.3.1-r2.ebuild delete mode 100644 dev-ml/merlin/merlin-4.4-r1.ebuild create mode 100644 dev-ml/merlin/merlin-4.4-r2.ebuild delete mode 100644 dev-ml/merlin/merlin-4.5-r1.ebuild create mode 100644 dev-ml/merlin/merlin-4.5-r2.ebuild (limited to 'dev-ml/merlin') diff --git a/dev-ml/merlin/merlin-3.4.2-r2.ebuild b/dev-ml/merlin/merlin-3.4.2-r2.ebuild deleted file mode 100644 index bf15b8d8aaef..000000000000 --- a/dev-ml/merlin/merlin-3.4.2-r2.ebuild +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# TODO: vim-plugin, although it's not clear how to make it work here -inherit elisp-common dune - -DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" -HOMEPAGE="https://github.com/ocaml/merlin" -SRC_URI="https://github.com/ocaml/merlin/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="MIT" -SLOT="0/${PV}" -KEYWORDS="~amd64" -IUSE="emacs +ocamlopt" - -RDEPEND=" - dev-ml/csexp:= - dev-ml/yojson:= - >=dev-lang/ocaml-4.09:= - =app-editors/emacs-23.1:* - app-emacs/auto-complete - app-emacs/company-mode - ) -" -DEPEND="${RDEPEND}" - -SITEFILE="50${PN}-gentoo.el" - -src_prepare() { - default - - # Handle installation via the eclass - rm emacs/dune || die -} - -src_compile() { - dune_src_compile - - if use emacs ; then - # Build the emacs integration - cd emacs || die - - # iedit isn't packaged yet - rm merlin-iedit.el || die - - elisp-compile *.el - fi -} - -src_install() { - dune_src_install - - if use emacs ; then - cd "${S}/emacs" || die - elisp-install ${PN} *.el *.elc - elisp-site-file-install "${FILESDIR}/${SITEFILE}" - fi -} - -pkg_postinst() { - use emacs && elisp-site-regen -} - -pkg_postrm() { - use emacs && elisp-site-regen -} diff --git a/dev-ml/merlin/merlin-3.4.2-r3.ebuild b/dev-ml/merlin/merlin-3.4.2-r3.ebuild new file mode 100644 index 000000000000..c4d43185b391 --- /dev/null +++ b/dev-ml/merlin/merlin-3.4.2-r3.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# TODO: vim-plugin, although it's not clear how to make it work here +inherit elisp-common dune + +DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" +HOMEPAGE="https://github.com/ocaml/merlin" +SRC_URI="https://github.com/ocaml/merlin/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="emacs +ocamlopt" + +RDEPEND=" + dev-ml/csexp:= + =dev-lang/ocaml-4.09:= + =app-editors/emacs-23.1:* + app-emacs/auto-complete + app-emacs/company-mode + ) +" +DEPEND="${RDEPEND}" + +SITEFILE="50${PN}-gentoo.el" + +src_prepare() { + default + + # Handle installation via the eclass + rm emacs/dune || die +} + +src_compile() { + dune_src_compile + + if use emacs ; then + # Build the emacs integration + cd emacs || die + + # iedit isn't packaged yet + rm merlin-iedit.el || die + + elisp-compile *.el + fi +} + +src_install() { + dune_src_install + + if use emacs ; then + cd "${S}/emacs" || die + elisp-install ${PN} *.el *.elc + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/dev-ml/merlin/merlin-4.2-r1.ebuild b/dev-ml/merlin/merlin-4.2-r1.ebuild deleted file mode 100644 index d6a09238ac2f..000000000000 --- a/dev-ml/merlin/merlin-4.2-r1.ebuild +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# TODO: vim-plugin, although it's not clear how to make it work here -inherit elisp-common dune - -DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" -HOMEPAGE="https://github.com/ocaml/merlin" -SRC_URI="https://github.com/ocaml/merlin/archive/v${PV}-411.tar.gz -> ${P}-411.tar.gz - https://dev.gentoo.org/~tupone/distfiles/${P}-ocaml-4.12.patch.gz" - -LICENSE="MIT" -SLOT="0/${PV}" -KEYWORDS="~amd64" -IUSE="emacs +ocamlopt test" -RESTRICT="!test? ( test )" - -RDEPEND=" - dev-ml/csexp:= - dev-ml/yojson:= - dev-ml/menhir:= - || ( - dev-lang/ocaml:0/4.11 - dev-lang/ocaml:0/4.12 - ) - emacs? ( - >=app-editors/emacs-23.1:* - app-emacs/auto-complete - app-emacs/company-mode - ) -" -DEPEND="${RDEPEND} - test? ( app-misc/jq )" - -SITEFILE="50${PN}-gentoo.el" - -S="${WORKDIR}"/${P}-411 - -src_prepare() { - has_version "dev-lang/ocaml:0/4.12" && \ - eapply "${WORKDIR}"/${P}-ocaml-4.12.patch - default - - # Handle installation via the eclass - rm emacs/dune || die - - # rm failing test - rm -r tests/test-dirs/locate/context-detection/cd-mod_constr.t || die -} - -src_compile() { - dune build @install - - if use emacs ; then - # Build the emacs integration - cd emacs || die - - # iedit isn't packaged yet - rm merlin-iedit.el || die - - elisp-compile *.el - fi -} - -src_install() { - dune_src_install - - if use emacs ; then - cd "${S}/emacs" || die - elisp-install ${PN} *.el *.elc - elisp-site-file-install "${FILESDIR}/${SITEFILE}" - fi -} - -pkg_postinst() { - use emacs && elisp-site-regen -} - -pkg_postrm() { - use emacs && elisp-site-regen -} diff --git a/dev-ml/merlin/merlin-4.2-r2.ebuild b/dev-ml/merlin/merlin-4.2-r2.ebuild new file mode 100644 index 000000000000..ec4d4384818f --- /dev/null +++ b/dev-ml/merlin/merlin-4.2-r2.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# TODO: vim-plugin, although it's not clear how to make it work here +inherit elisp-common dune + +DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" +HOMEPAGE="https://github.com/ocaml/merlin" +SRC_URI="https://github.com/ocaml/merlin/archive/v${PV}-411.tar.gz -> ${P}-411.tar.gz + https://dev.gentoo.org/~tupone/distfiles/${P}-ocaml-4.12.patch.gz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="emacs +ocamlopt test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-ml/csexp:= + =app-editors/emacs-23.1:* + app-emacs/auto-complete + app-emacs/company-mode + ) +" +DEPEND="${RDEPEND} + test? ( app-misc/jq )" + +SITEFILE="50${PN}-gentoo.el" + +S="${WORKDIR}"/${P}-411 + +src_prepare() { + has_version "dev-lang/ocaml:0/4.12" && \ + eapply "${WORKDIR}"/${P}-ocaml-4.12.patch + default + + # Handle installation via the eclass + rm emacs/dune || die + + # rm failing test + rm -r tests/test-dirs/locate/context-detection/cd-mod_constr.t || die +} + +src_compile() { + dune build @install + + if use emacs ; then + # Build the emacs integration + cd emacs || die + + # iedit isn't packaged yet + rm merlin-iedit.el || die + + elisp-compile *.el + fi +} + +src_install() { + dune_src_install + + if use emacs ; then + cd "${S}/emacs" || die + elisp-install ${PN} *.el *.elc + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/dev-ml/merlin/merlin-4.3.1-r1.ebuild b/dev-ml/merlin/merlin-4.3.1-r1.ebuild deleted file mode 100644 index 0ddc350e9d9b..000000000000 --- a/dev-ml/merlin/merlin-4.3.1-r1.ebuild +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# TODO: vim-plugin, although it's not clear how to make it work here -inherit elisp-common dune - -DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" -HOMEPAGE="https://github.com/ocaml/merlin" -SRC_URI="https://github.com/ocaml/merlin/archive/v${PV}-411.tar.gz -> ${P}-411.tar.gz - https://dev.gentoo.org/~tupone/distfiles/${P}-ocaml-4.12.patch.gz" - -LICENSE="MIT" -SLOT="0/${PV}" -KEYWORDS="~amd64" -IUSE="emacs +ocamlopt test" -RESTRICT="!test? ( test )" - -RDEPEND=" - dev-ml/csexp:= - dev-ml/yojson:= - dev-ml/menhir:= - >=dev-ml/dune-2.9 - || ( - dev-lang/ocaml:0/4.11 - dev-lang/ocaml:0/4.12 - ) - emacs? ( - >=app-editors/emacs-23.1:* - app-emacs/auto-complete - app-emacs/company-mode - ) -" -DEPEND="${RDEPEND} - test? ( app-misc/jq )" - -SITEFILE="50${PN}-gentoo.el" - -S="${WORKDIR}"/${P}-411 - -src_prepare() { - has_version "dev-lang/ocaml:0/4.12" && \ - eapply "${WORKDIR}"/${P}-ocaml-4.12.patch - default - - # Handle installation via the eclass - rm emacs/dune || die - - # rm failing test - rm -r tests/test-dirs/locate/context-detection/cd-mod_constr.t || die -} - -src_compile() { - dune build @install - - if use emacs ; then - # Build the emacs integration - cd emacs || die - - # iedit isn't packaged yet - rm merlin-iedit.el || die - - elisp-compile *.el - fi -} - -src_install() { - dune_src_install - - if use emacs ; then - cd "${S}/emacs" || die - elisp-install ${PN} *.el *.elc - elisp-site-file-install "${FILESDIR}/${SITEFILE}" - fi -} - -pkg_postinst() { - use emacs && elisp-site-regen -} - -pkg_postrm() { - use emacs && elisp-site-regen -} diff --git a/dev-ml/merlin/merlin-4.3.1-r2.ebuild b/dev-ml/merlin/merlin-4.3.1-r2.ebuild new file mode 100644 index 000000000000..3ba67542cafd --- /dev/null +++ b/dev-ml/merlin/merlin-4.3.1-r2.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# TODO: vim-plugin, although it's not clear how to make it work here +inherit elisp-common dune + +DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" +HOMEPAGE="https://github.com/ocaml/merlin" +SRC_URI="https://github.com/ocaml/merlin/archive/v${PV}-411.tar.gz -> ${P}-411.tar.gz + https://dev.gentoo.org/~tupone/distfiles/${P}-ocaml-4.12.patch.gz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="emacs +ocamlopt test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-ml/csexp:= + =dev-ml/dune-2.9 + || ( + dev-lang/ocaml:0/4.11 + dev-lang/ocaml:0/4.12 + ) + emacs? ( + >=app-editors/emacs-23.1:* + app-emacs/auto-complete + app-emacs/company-mode + ) +" +DEPEND="${RDEPEND} + test? ( app-misc/jq )" + +SITEFILE="50${PN}-gentoo.el" + +S="${WORKDIR}"/${P}-411 + +src_prepare() { + has_version "dev-lang/ocaml:0/4.12" && \ + eapply "${WORKDIR}"/${P}-ocaml-4.12.patch + default + + # Handle installation via the eclass + rm emacs/dune || die + + # rm failing test + rm -r tests/test-dirs/locate/context-detection/cd-mod_constr.t || die +} + +src_compile() { + dune build @install + + if use emacs ; then + # Build the emacs integration + cd emacs || die + + # iedit isn't packaged yet + rm merlin-iedit.el || die + + elisp-compile *.el + fi +} + +src_install() { + dune_src_install + + if use emacs ; then + cd "${S}/emacs" || die + elisp-install ${PN} *.el *.elc + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/dev-ml/merlin/merlin-4.4-r1.ebuild b/dev-ml/merlin/merlin-4.4-r1.ebuild deleted file mode 100644 index 2975d266d475..000000000000 --- a/dev-ml/merlin/merlin-4.4-r1.ebuild +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# TODO: vim-plugin, although it's not clear how to make it work here -inherit elisp-common dune - -DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" -HOMEPAGE="https://github.com/ocaml/merlin" -SRC_URI="https://github.com/ocaml/merlin/releases/download/v${PV}-411/${P}-411.tbz - https://github.com/ocaml/merlin/releases/download/v${PV}-412/${P}-412.tbz - https://github.com/ocaml/merlin/releases/download/v${PV}-413/${P}-413.tbz" - -LICENSE="MIT" -SLOT="0/${PV}" -KEYWORDS="~amd64" -IUSE="emacs +ocamlopt test" -RESTRICT="!test? ( test )" - -RDEPEND=" - dev-ml/csexp:= - dev-ml/yojson:= - dev-ml/menhir:= - >=dev-ml/dune-2.9 - || ( - dev-lang/ocaml:0/4.11 - dev-lang/ocaml:0/4.12 - dev-lang/ocaml:0/4.13 - ) - emacs? ( - >=app-editors/emacs-23.1:* - app-emacs/auto-complete - app-emacs/company-mode - ) -" -DEPEND="${RDEPEND} - test? ( app-misc/jq )" - -SITEFILE="50${PN}-gentoo.el" - -src_unpack() { - default - if has_version "dev-lang/ocaml:0/4.11" ; then - mv merlin-4.4-411 "${S}" || die - elif has_version "dev-lang/ocaml:0/4.12" ; then - mv merlin-4.4-412 "${S}" || die - elif has_version "dev-lang/ocaml:0/4.13" ; then - mv merlin-4.4-413 "${S}" || die - fi -} - -src_prepare() { - default - - # Handle installation via the eclass - rm emacs/dune || die - - # rm failing test - rm -r tests/test-dirs/locate/context-detection/cd-mod_constr.t || die -} - -src_compile() { - dune build @install - - if use emacs ; then - # Build the emacs integration - cd emacs || die - - # iedit isn't packaged yet - rm merlin-iedit.el || die - - elisp-compile *.el - fi -} - -src_install() { - dune_src_install - - if use emacs ; then - cd "${S}/emacs" || die - elisp-install ${PN} *.el *.elc - elisp-site-file-install "${FILESDIR}/${SITEFILE}" - fi -} - -pkg_postinst() { - use emacs && elisp-site-regen -} - -pkg_postrm() { - use emacs && elisp-site-regen -} diff --git a/dev-ml/merlin/merlin-4.4-r2.ebuild b/dev-ml/merlin/merlin-4.4-r2.ebuild new file mode 100644 index 000000000000..33b8e14ab23b --- /dev/null +++ b/dev-ml/merlin/merlin-4.4-r2.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# TODO: vim-plugin, although it's not clear how to make it work here +inherit elisp-common dune + +DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" +HOMEPAGE="https://github.com/ocaml/merlin" +SRC_URI="https://github.com/ocaml/merlin/releases/download/v${PV}-411/${P}-411.tbz + https://github.com/ocaml/merlin/releases/download/v${PV}-412/${P}-412.tbz + https://github.com/ocaml/merlin/releases/download/v${PV}-413/${P}-413.tbz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="emacs +ocamlopt test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-ml/csexp:= + =dev-ml/dune-2.9 + || ( + dev-lang/ocaml:0/4.11 + dev-lang/ocaml:0/4.12 + dev-lang/ocaml:0/4.13 + ) + emacs? ( + >=app-editors/emacs-23.1:* + app-emacs/auto-complete + app-emacs/company-mode + ) +" +DEPEND="${RDEPEND} + test? ( app-misc/jq )" + +SITEFILE="50${PN}-gentoo.el" + +src_unpack() { + default + if has_version "dev-lang/ocaml:0/4.11" ; then + mv merlin-4.4-411 "${S}" || die + elif has_version "dev-lang/ocaml:0/4.12" ; then + mv merlin-4.4-412 "${S}" || die + elif has_version "dev-lang/ocaml:0/4.13" ; then + mv merlin-4.4-413 "${S}" || die + fi +} + +src_prepare() { + default + + # Handle installation via the eclass + rm emacs/dune || die + + # rm failing test + rm -r tests/test-dirs/locate/context-detection/cd-mod_constr.t || die +} + +src_compile() { + dune build @install + + if use emacs ; then + # Build the emacs integration + cd emacs || die + + # iedit isn't packaged yet + rm merlin-iedit.el || die + + elisp-compile *.el + fi +} + +src_install() { + dune_src_install + + if use emacs ; then + cd "${S}/emacs" || die + elisp-install ${PN} *.el *.elc + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/dev-ml/merlin/merlin-4.5-r1.ebuild b/dev-ml/merlin/merlin-4.5-r1.ebuild deleted file mode 100644 index 52caa02ed44d..000000000000 --- a/dev-ml/merlin/merlin-4.5-r1.ebuild +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# TODO: vim-plugin, although it's not clear how to make it work here -inherit elisp-common dune - -DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" -HOMEPAGE="https://github.com/ocaml/merlin" -SRC_URI="https://github.com/ocaml/merlin/releases/download/v${PV}-411/${P}-411.tbz - https://github.com/ocaml/merlin/releases/download/v${PV}-412/${P}-412.tbz - https://github.com/ocaml/merlin/releases/download/v${PV}-413/${P}-413.tbz - https://github.com/ocaml/merlin/releases/download/v${PV}-414/${P}-414.tbz" - -LICENSE="MIT" -SLOT="0/${PV}" -KEYWORDS="~amd64" -IUSE="emacs +ocamlopt test" -RESTRICT="!test? ( test )" - -RDEPEND=" - dev-ml/csexp:= - dev-ml/yojson:= - dev-ml/menhir:= - >=dev-ml/dune-2.9 - || ( - dev-lang/ocaml:0/4.11 - dev-lang/ocaml:0/4.12 - dev-lang/ocaml:0/4.13 - dev-lang/ocaml:0/4.14 - ) - emacs? ( - >=app-editors/emacs-23.1:* - app-emacs/auto-complete - app-emacs/company-mode - ) -" -DEPEND="${RDEPEND} - test? ( app-misc/jq )" - -SITEFILE="50${PN}-gentoo.el" - -src_unpack() { - default - - if has_version "dev-lang/ocaml:0/4.11" ; then - mv ${P}-411 "${S}" || die - elif has_version "dev-lang/ocaml:0/4.12" ; then - mv ${P}-412 "${S}" || die - elif has_version "dev-lang/ocaml:0/4.13" ; then - mv ${P}-413 "${S}" || die - elif has_version "dev-lang/ocaml:0/4.14" ; then - mv ${P}-414 "${S}" || die - fi -} - -src_prepare() { - default - - # Handle installation via the eclass - rm emacs/dune || die - - # This test runs only inside a git repo - rm -r tests/test-dirs/occurrences/issue1404.t || die -} - -src_compile() { - dune build @install - - if use emacs ; then - # iedit isn't packaged yet - rm emacs/merlin-iedit.el || die - - BYTECOMPFLAGS="-L emacs" elisp-compile emacs/*.el - fi -} - -src_install() { - dune_src_install - - if use emacs ; then - elisp-install ${PN} emacs/*.el{,c} - elisp-site-file-install "${FILESDIR}/${SITEFILE}" - fi -} - -pkg_postinst() { - use emacs && elisp-site-regen -} - -pkg_postrm() { - use emacs && elisp-site-regen -} diff --git a/dev-ml/merlin/merlin-4.5-r2.ebuild b/dev-ml/merlin/merlin-4.5-r2.ebuild new file mode 100644 index 000000000000..fe9006bed302 --- /dev/null +++ b/dev-ml/merlin/merlin-4.5-r2.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# TODO: vim-plugin, although it's not clear how to make it work here +inherit elisp-common dune + +DESCRIPTION="Context sensitive completion for OCaml in Vim and Emacs" +HOMEPAGE="https://github.com/ocaml/merlin" +SRC_URI="https://github.com/ocaml/merlin/releases/download/v${PV}-411/${P}-411.tbz + https://github.com/ocaml/merlin/releases/download/v${PV}-412/${P}-412.tbz + https://github.com/ocaml/merlin/releases/download/v${PV}-413/${P}-413.tbz + https://github.com/ocaml/merlin/releases/download/v${PV}-414/${P}-414.tbz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="emacs +ocamlopt test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-ml/csexp:= + =dev-ml/dune-2.9 + || ( + dev-lang/ocaml:0/4.11 + dev-lang/ocaml:0/4.12 + dev-lang/ocaml:0/4.13 + dev-lang/ocaml:0/4.14 + ) + emacs? ( + >=app-editors/emacs-23.1:* + app-emacs/auto-complete + app-emacs/company-mode + ) +" +DEPEND="${RDEPEND} + test? ( app-misc/jq )" + +SITEFILE="50${PN}-gentoo.el" + +src_unpack() { + default + + if has_version "dev-lang/ocaml:0/4.11" ; then + mv ${P}-411 "${S}" || die + elif has_version "dev-lang/ocaml:0/4.12" ; then + mv ${P}-412 "${S}" || die + elif has_version "dev-lang/ocaml:0/4.13" ; then + mv ${P}-413 "${S}" || die + elif has_version "dev-lang/ocaml:0/4.14" ; then + mv ${P}-414 "${S}" || die + fi +} + +src_prepare() { + default + + # Handle installation via the eclass + rm emacs/dune || die + + # This test runs only inside a git repo + rm -r tests/test-dirs/occurrences/issue1404.t || die +} + +src_compile() { + dune build @install + + if use emacs ; then + # iedit isn't packaged yet + rm emacs/merlin-iedit.el || die + + BYTECOMPFLAGS="-L emacs" elisp-compile emacs/*.el + fi +} + +src_install() { + dune_src_install + + if use emacs ; then + elisp-install ${PN} emacs/*.el{,c} + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} -- cgit v1.2.3-65-gdbad