summaryrefslogtreecommitdiff
blob: b53f28c71ccf41fe5ec91703c8e7594f2e5b0991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python{3_7,3_8} )

inherit python-single-r1 vim-plugin vcs-snapshot

# Commit Date: 1 Mar 2018
COMMIT="4f12628247940d98eedd594961695dc504261058"

DESCRIPTION="Vim plugin for easy and fast outlining"
HOMEPAGE="https://github.com/vimoutliner/vimoutliner"
SRC_URI="https://github.com/vimoutliner/vimoutliner/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3"
KEYWORDS="amd64 ~ia64 ppc sparc x86"

REQUIRED_USE="${PYTHON_REQUIRED_USE}"

VIM_PLUGIN_HELPFILES="vimoutliner"
VIM_PLUGIN_MESSAGES="filetype"

RDEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep 'dev-python/autopep8[${PYTHON_MULTI_USEDEP}]')
"

DEPEND="
	${RDEPEND}"

DOCS=( README CHANGELOG TODO.otl )

src_prepare() {
	default

	sed -e '1s:^:#!/usr/bin/python\n:' \
		-i "${S}"/vimoutliner/scripts/otl2latex/otl2latex.py || die
	find "${S}" -type f -exec chmod a+r {} \; || die
}

src_compile() {
	local pyscript _pyscript
	for pyscript in $(find "${S}" -type f -name \*.py); do
		_pyscript=$(basename "${pyscript}")
		[[ ${_pyscript} == "otl.py" ]] && continue
		2to3 -w -n --no-diffs "${pyscript}" >& /dev/null || die
		python_fix_shebang -f -q "${pyscript}"
	done
	rm -v README.detailed || die
}