diff options
author | Thomas Bracht Laumann Jespersen <t@laumann.xyz> | 2022-07-24 16:54:56 +0200 |
---|---|---|
committer | Thomas Bracht Laumann Jespersen <t@laumann.xyz> | 2022-07-24 16:54:56 +0200 |
commit | 18ff99bfe1785f729c858951dfc3a00bfc0d18fd (patch) | |
tree | e056db5759ae6ae9538472b38648625305aed4bf | |
parent | 6144c72ba5973d0774cc3f05b1822dfd716088b5 (diff) |
vim.eclass: impl VIM_{VERSION,PATCH_TAG} variables
The VIM_VERSION tag might not be strictly necessary, but it could make
sense to have a variable exposed by the ebuild based on the VIM_VERSION.
The VIM_PATCH_TAG should refer to a git tag on the proj/vim-patches.git
repo on gitweb.gentoo.org. If the tag isn't set, no patches are applied.
Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
-rw-r--r-- | eclass/vim.eclass | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/eclass/vim.eclass b/eclass/vim.eclass index b7c1691..182cf74 100644 --- a/eclass/vim.eclass +++ b/eclass/vim.eclass @@ -10,9 +10,9 @@ # @SUPPORTED_EAPIS: 8 # @BLURB: Provides common set of functionality for vim-core, vim and gvim # @DESCRIPTION: -# -# TODO: Have a user-provided VIM_VERSION variable -# TODO: Have a user-provided VIM_PATCH_VERSION variable +# Provides common functionality for app-editors/{vim,gvim,vim-core} packages. +# They all share the same setup, patching and post install/remove phases (more +# or less), the major differences are the configuration and installation phases. case ${PN} in vim-core|vim|gvim) ;; @@ -25,18 +25,35 @@ case ${EAPI} in esac # Common inherits +# FIXME(laumann): Do the inherits go inside the inherit guard? inherit vim-doc flag-o-matic bash-completion-r1 xdg-utils if [[ ! ${_VIM_ECLASS} ]]; then _VIM_ECLASS=1 +# @ECLASS_VARIABLE: VIM_VERSION +# @PRE_INHERIT +# @DEFAULT_UNSET +# @DESCRIPTION: +# The "MAJOR.MINOR" version of vim, like "9.0" (not actually used by the eclass, +# but is used in the install phase). + +# @ECLASS_VARIABLE: VIM_PATCH_TAG +# @PRE_INHERIT +# @DEFAULT_UNSET +# @DESCRIPTION: +# The tag name of the patchset to fetch in a snapshot from +# https://gitweb.gentoo.org/proj/vim-patches + if [[ ${PV} == 9999* ]] ; then inherit git-r3 EGIT_REPO_URI="https://github.com/vim/vim.git" EGIT_CHECKOUT_DIR=${WORKDIR}/vim-${PV} else - SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> ${P}.tar.gz - https://gitweb.gentoo.org/proj/vim-patches.git/snapshot/vim-patches-vim-9.0.0049-patches.tar.gz" + SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> ${P}.tar.gz" + if [[ ${VIM_PATCH_TAG} ]]; then + SRC_URI+=" https://gitweb.gentoo.org/proj/vim-patches.git/snapshot/vim-patches-${VIM_PATCH_TAG}.tar.gz" + fi fi S="${WORKDIR}/vim-${PV}" @@ -53,9 +70,9 @@ vim_pkg_setup() { # @DESCRIPTION: # Applies patches and performs other minor adjustments to the source code vim_src_prepare() { - if [[ ${PV} != 9999* ]] ; then + if [[ ${PV} != 9999* ]] && [[ ${VIM_PATCH_TAG} ]] ; then # Gentoo patches to fix runtime issues, cross-compile errors, etc - eapply "${WORKDIR}"/vim-patches-vim-${PV}-patches + eapply "${WORKDIR}"/vim-patches-${VIM_PATCH_TAG} fi # Fixup a script to use awk instead of nawk |