# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 PYTHON_COMPAT=( python{2_7,3_3} ) PYTHON_REQ_USE="threads" inherit eutils fdo-mime flag-o-matic python-single-r1 if [[ ${PV} == *9999* ]]; then inherit git-r3 EGIT_REPO_URI=( "https://bitbucket.org/equalsraf/${PN}.git" "https://github.com/equalsraf/${PN}.git" "git://gitorious.org/${PN}/${PN}.git" ) KEYWORDS="" else SRC_URI="https://github.com/equalsraf/${PN}/archive/package-${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~x86" S="${WORKDIR}/${PN}-package-${PV}" fi DESCRIPTION="Qt GUI version of the Vim text editor" HOMEPAGE="https://bitbucket.org/equalsraf/vim-qt/wiki/Home" SLOT="0" LICENSE="vim" IUSE="acl cscope debug gpm lua luajit nls perl python racket ruby selinux" REQUIRED_USE=" python? ( ${PYTHON_REQUIRED_USE} ) luajit? ( lua ) " RDEPEND=" >=app-editors/vim-core-7.4.417 >=app-admin/eselect-vi-1.1 >=sys-libs/ncurses-5.2-r2 >=dev-qt/qtcore-4.7.0:4 >=dev-qt/qtgui-4.7.0:4 acl? ( kernel_linux? ( sys-apps/acl ) ) cscope? ( dev-util/cscope ) gpm? ( sys-libs/gpm ) lua? ( luajit? ( dev-lang/luajit ) !luajit? ( dev-lang/lua[deprecated] ) ) nls? ( virtual/libintl ) perl? ( >=dev-lang/perl-5.16.0 ) python? ( ${PYTHON_DEPS} ) racket? ( dev-scheme/racket ) ruby? ( || ( dev-lang/ruby:2.0 dev-lang/ruby:1.9 ) ) selinux? ( sys-libs/libselinux ) " DEPEND="${RDEPEND} >=app-admin/eselect-vi-1.1 dev-util/ctags sys-devel/autoconf virtual/pkgconfig nls? ( sys-devel/gettext ) " pkg_setup() { # people with broken alphabets run into trouble. bug 82186. unset LANG LC_ALL export LC_COLLATE="C" use python && python-single-r1_pkg_setup } src_prepare() { # Read vimrc and gvimrc from /etc/vim echo '#define SYS_VIMRC_FILE "/etc/vim/vimrc"' >> "${S}"/src/feature.h echo '#define SYS_GVIMRC_FILE "/etc/vim/gvimrc"' >> "${S}"/src/feature.h } src_configure() { local myconf use debug && append-flags "-DDEBUG" myconf="--with-features=huge --enable-multibyte" myconf+=" $(use_enable acl)" myconf+=" $(use_enable cscope)" myconf+=" $(use_enable gpm)" myconf+=" $(use_enable lua luainterp)" myconf+=" $(use_with luajit)" myconf+=" $(use_enable nls)" myconf+=" $(use_enable perl perlinterp)" myconf+=" $(use_enable racket mzschemeinterp)" myconf+=" $(use_enable ruby rubyinterp)" myconf+=" $(use_enable selinux)" if use python ; then if [[ ${EPYTHON} == python3* ]] ; then myconf+=" --enable-python3interp" export vi_cv_path_python3="${PYTHON}" else myconf+=" --enable-pythoninterp" export vi_cv_path_python="${PYTHON}" fi else myconf+=" --disable-pythoninterp --disable-python3interp" fi # --with-features=huge forces on cscope even if we --disable it. We need # to sed this out to avoid screwiness. (1 Sep 2004 ciaranm) if ! use cscope ; then sed -i '/# define FEAT_CSCOPE/d' src/feature.h || \ die "couldn't disable cscope" fi econf \ --with-modified-by=Gentoo-${PVR} \ --enable-gui=qt --with-vim-name=qvim --with-x \ ${myconf} } src_install() { dobin src/qvim dosym qvim /usr/bin/qvimdiff dodir /usr/share/man/man1 echo ".so vim.1" > "${ED}"/usr/share/man/man1/qvim.1 echo ".so vimdiff.1" > "${ED}"/usr/share/man/man1/qvimdiff.1 newmenu "${FILESDIR}"/vim-qt.desktop vim-qt.desktop doicon -s 64 src/qt/icons/vim-qt.png } pkg_postinst() { fdo-mime_mime_database_update } pkg_postrm() { fdo-mime_mime_database_update }