Patchwork [2/5] vim: implement gvim, vim-tiny as PACKAGECONFIG

login
register
mail settings
Submitter Martin Jansa
Date Jan. 29, 2013, 12:29 p.m.
Message ID <8a28d343965dd467ccf72709642e2fc065d9b992.1359462547.git.Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/43629/
State Accepted, archived
Commit 72a1427f116cbb516aeced7931aedc891865bac7
Headers show

Comments

Martin Jansa - Jan. 29, 2013, 12:29 p.m.
* only one of those should be built in sysroot, otherwise they were
  overwritting files provided by other alternatives
* define PACKAGECONFIG options
* there are no RCONFLICTS/RREPLACES/RPROVIDES, because it depends on
  selected PACKAGECONFIGs
* add PN to VIMDIR and use VIMDIR where undefined VIMVER was
  (e.g. "${PN}${VIMVER}")
* move checksums from .inc to recipe
* vim/gvim/vim-tiny conflict is now fatal, with
  http://patches.openembedded.org/patch/43105/

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/recipes-support/vim/gvim_7.2.446.bb     | 14 --------
 meta-oe/recipes-support/vim/vim-tiny_7.2.446.bb | 11 ------
 meta-oe/recipes-support/vim/vim.inc             | 47 +++++++++++--------------
 meta-oe/recipes-support/vim/vim_7.2.446.bb      | 31 +++++-----------
 4 files changed, 30 insertions(+), 73 deletions(-)
 delete mode 100644 meta-oe/recipes-support/vim/gvim_7.2.446.bb
 delete mode 100644 meta-oe/recipes-support/vim/vim-tiny_7.2.446.bb

Patch

diff --git a/meta-oe/recipes-support/vim/gvim_7.2.446.bb b/meta-oe/recipes-support/vim/gvim_7.2.446.bb
deleted file mode 100644
index fbc763a..0000000
--- a/meta-oe/recipes-support/vim/gvim_7.2.446.bb
+++ /dev/null
@@ -1,14 +0,0 @@ 
-VIMGUI = "gtk2"
-VIMX = "--with-x"
-
-require vim_${PV}.bb
-
-PR = "${INC_PR}.4"
-
-DEPENDS += "gtk+ xt"
-
-FILES_${PN} += "${datadir}/vim"
-
-EXTRA_OECONF += "--enable-gtk2-test"
-
-RREPLACES_${PN} = "vim vim-tiny"
diff --git a/meta-oe/recipes-support/vim/vim-tiny_7.2.446.bb b/meta-oe/recipes-support/vim/vim-tiny_7.2.446.bb
deleted file mode 100644
index d29b801..0000000
--- a/meta-oe/recipes-support/vim/vim-tiny_7.2.446.bb
+++ /dev/null
@@ -1,11 +0,0 @@ 
-VIMFEATURES = "tiny"
-
-require vim_${PV}.bb
-
-PR = "${INC_PR}.4"
-
-RCONFLICTS_${PN} = "gvim vim"
-
-PACKAGES =+ "${PN}-data"
-
-FILES_${PN}-data = "${datadir}/vim"
diff --git a/meta-oe/recipes-support/vim/vim.inc b/meta-oe/recipes-support/vim/vim.inc
index 16ca58d..ca36bf1 100644
--- a/meta-oe/recipes-support/vim/vim.inc
+++ b/meta-oe/recipes-support/vim/vim.inc
@@ -7,17 +7,18 @@  LICENSE = "vim"
 LIC_FILES_CHKSUM = "file://README.txt;md5=72c4840d07b65659b60b3fa405c7da36"
 
 PV_MAJOR = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
-VIMDIR = "${@d.getVar('PV',1).split('.')[0]}${@d.getVar('PV',1).split('.')[1]}"
+VIMDIR = "${PN}${@d.getVar('PV',1).split('.')[0]}${@d.getVar('PV',1).split('.')[1]}"
 
-INC_PR = "r11"
+INC_PR = "r12"
 
 SRC_URI = " \
-  ftp://ftp.vim.org/pub/vim/unix/vim-${PV_MAJOR}.tar.bz2;name=vim${PV_MAJOR}tarbz2 \
-  ftp://ftp.vim.org/pub/vim/extra/vim-${PV_MAJOR}-extra.tar.gz;name=vim${PV_MAJOR}extratargz \
-  ftp://ftp.vim.org/pub/vim/extra/vim-${PV_MAJOR}-lang.tar.gz;name=vim${PV_MAJOR}langtargz \
+  ftp://ftp.${PN}.org/pub/${PN}/unix/${PN}-${PV_MAJOR}.tar.bz2;name=${VIMDIR} \
+  ftp://ftp.${PN}.org/pub/${PN}/extra/${PN}-${PV_MAJOR}-extra.tar.gz;name=${VIMDIR}-extra \
+  ftp://ftp.${PN}.org/pub/${PN}/extra/${PN}-${PV_MAJOR}-lang.tar.gz;name=${VIMDIR}-lang \
+  file://vimrc \
 "
 
-S = "${WORKDIR}/vim${VIMDIR}/src"
+S = "${WORKDIR}/${VIMDIR}/src"
 
 inherit autotools update-alternatives
 
@@ -32,16 +33,14 @@  do_configure () {
   touch auto/config.mk auto/config.h
 }
 
+#Available PACKAGECONFIG options are gtkgui, x11, tiny
+PACKAGECONFIG ??= ""
 
-
-VIMFEATURES ?= "big"
-VIMX ?= "--without-x"
-VIMGUI ?= "no"
+PACKAGECONFIG[gtkgui] = "--enable-gtk2-test --enable-gui=gtk2,--enable-gui=no,gtk+,"
+PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
+PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
 
 EXTRA_OECONF = " \
-  --enable-gui=${VIMGUI} \
-  --with-features=${VIMFEATURES} \
-  ${VIMX} \
   --disable-gpm \
   --disable-gtktest \
   --disable-xim \
@@ -59,24 +58,20 @@  EXTRA_OECONF = " \
 
 # Work around rpm picking up csh as a dep
 do_install_append() {
-	chmod -x ${D}${datadir}/vim/vim72/tools/vim132
+	chmod -x ${D}${datadir}/${PN}/${VIMDIR}/tools/vim132
+	install -m 0644 ${WORKDIR}/vimrc ${D}/${datadir}/${PN}
 }
 
-PACKAGES =+ "vim-common vim-syntax vim-help vim-tutor"
-FILES_vim-syntax = "${datadir}/vim/vim${VIMVER}/syntax"
-FILES_vim-help = "${datadir}/vim/vim${VIMVER}/doc"
-FILES_vim-tutor = "${datadir}/vim/vim${VIMVER}/tutor ${bindir}/vimtutor"
+PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-data"
+FILES_${PN}-syntax = "${datadir}/${PN}/${VIMDIR}/syntax"
+FILES_${PN}-help = "${datadir}/${PN}/${VIMDIR}/doc"
+FILES_${PN}-tutor = "${datadir}/${PN}/${VIMDIR}/tutor ${bindir}/${PN}tutor"
+FILES_${PN}-vimrc = "${datadir}/${PN}/vimrc"
+FILES_${PN}-data = "${datadir}/${PN}"
 
 ALTERNATIVE_NAME = "vi"
-ALTERNATIVE_PATH = "${bindir}/vim"
+ALTERNATIVE_PATH = "${bindir}/${PN}"
 ALTERNATIVE_LINK = "${base_bindir}/vi"
 ALTERNATIVE_PRIORITY = "100"
 
-SRC_URI[vim7.2tarbz2.md5sum] = "f0901284b338e448bfd79ccca0041254"
-SRC_URI[vim7.2tarbz2.sha256sum] = "914db0f2205ebd6f02878295ec2506036ea7500399db112c61a01491cd9a1d86"
-SRC_URI[vim7.2langtargz.md5sum] = "d8884786979e0e520c112faf2e176f05"
-SRC_URI[vim7.2langtargz.sha256sum] = "11607f539a4518b550bf1606b7d3a6f36c1ffdf566c058e7d94bced78034cd5b"
-SRC_URI[vim7.2extratargz.md5sum] = "35e04482f07c57221c9a751aaa3b8dac"
-SRC_URI[vim7.2extratargz.sha256sum] = "20894ac79672160bfc4f1d2f9f9775b34d944762d655307a91ca96d358faa04d"
-
 PARALLEL_MAKE = ""
diff --git a/meta-oe/recipes-support/vim/vim_7.2.446.bb b/meta-oe/recipes-support/vim/vim_7.2.446.bb
index 62d76d7..ef9f3c9 100644
--- a/meta-oe/recipes-support/vim/vim_7.2.446.bb
+++ b/meta-oe/recipes-support/vim/vim_7.2.446.bb
@@ -1,15 +1,6 @@ 
-# vim-tiny sets that too
-VIMFEATURES ?= "big"
+require ${PN}.inc
 
-# GUI type - gvim recipe sets "gtk2"
-VIMGUI ?= "no"
-
-# gvim recipes uses "--with-x"
-VIMX ?= "--without-x"
-
-require vim.inc
-
-PR = "${INC_PR}.3"
+PR = "${INC_PR}.0"
 
 # 001-446; 401-446 are not yet available online
 SRC_URI += "http://ftp.vim.org/pub/vim/patches/7.2/7.2.001-100.gz;name=p001-100;apply=yes;patchdir=..;pnum=0"
@@ -18,6 +9,13 @@  SRC_URI += "http://ftp.vim.org/pub/vim/patches/7.2/7.2.201-300.gz;name=p201-300;
 SRC_URI += "http://ftp.vim.org/pub/vim/patches/7.2/7.2.301-400.gz;name=p301-400;apply=yes;patchdir=..;pnum=0"
 SRC_URI += "file://401-446.diff;patchdir=..;pnum=0"
 
+SRC_URI[vim72.md5sum] = "f0901284b338e448bfd79ccca0041254"
+SRC_URI[vim72.sha256sum] = "914db0f2205ebd6f02878295ec2506036ea7500399db112c61a01491cd9a1d86"
+SRC_URI[vim72-lang.md5sum] = "d8884786979e0e520c112faf2e176f05"
+SRC_URI[vim72-lang.sha256sum] = "11607f539a4518b550bf1606b7d3a6f36c1ffdf566c058e7d94bced78034cd5b"
+SRC_URI[vim72-extra.md5sum] = "35e04482f07c57221c9a751aaa3b8dac"
+SRC_URI[vim72-extra.sha256sum] = "20894ac79672160bfc4f1d2f9f9775b34d944762d655307a91ca96d358faa04d"
+
 SRC_URI[p001-100.md5sum] = "ba91b19374cee90f71b8f4ab1d92dc0f"
 SRC_URI[p001-100.sha256sum] = "519f4fea460e4f7a737ea8006c0dc1684982f8372d1581fb963a5d58f8007f67"
 SRC_URI[p101-200.md5sum] = "b485233d360041d043c56cd99057dbff"
@@ -28,14 +26,3 @@  SRC_URI[p301-400.md5sum] = "137b5821ff4a2266796d14d867be5f9f"
 SRC_URI[p301-400.sha256sum] = "41f022ec829786a008685c0b00acf8be09525755a94a06236a4b879b1f84b5f4"
 
 SRC_URI += "file://configure.in_remove_CC_quotes.patch;patchdir=.."
-SRC_URI += "file://vimrc"
-
-do_install_append() {
-    install -m 0644 ${WORKDIR}/vimrc ${D}/${datadir}/vim
-}
-
-RCONFLICTS_${PN} = "gvim"
-RREPLACES_${PN} = "vim-tiny"
-PACKAGES =+ "${PN}-vimrc"
-
-FILES_${PN}-vimrc = "${datadir}/vim/vimrc"