summaryrefslogtreecommitdiff
blob: 7a5d85d89fa0cfb0f0bed96186ffb4b00b33b515 (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
53
54
55
56
57
58
59
60
61
62
63
# Copyright 2018-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{9..11} )
PYTHON_REQ_USE="sqlite"
inherit edo multiprocessing python-single-r1

DESCRIPTION="Smaller, easier, more powerful, and more reliable than make"
HOMEPAGE="https://github.com/apenwarr/redo"
SRC_URI="https://github.com/apenwarr/redo/archive/${P}.tar.gz"
S="${WORKDIR}"/${PN}-${P}

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

BDEPEND="
	$(python_gen_cond_dep '
		dev-python/beautifulsoup4[${PYTHON_USEDEP}]
		dev-python/markdown[${PYTHON_USEDEP}]
	')
	${PYTHON_DEPS}
"
RDEPEND="${BDEPEND}"

src_prepare() {
	default

	sed -i -e "s:which:command -v:" redo/sh.do || die
	sed -i "1s;^;#!${PYTHON}\n;" docs/md2man.py || die
}

src_configure() {
	echo ${PYTHON} > redo/whichpython || die
}

src_compile() {
	edo ./do -j$(makeopts_jobs) build
}

src_test() {
	local ARCH= CFLAGS= CXXFLAGS= LDFLAGS=
	edo ./do -j$(makeopts_jobs) test
}

src_install() {
	DESTDIR="${D}" \
	DOCDIR="${D}/usr/share/doc/${PF}" \
	LIBDIR="${D}/$(python_get_sitedir)/${PN}" \
	edo ./do -j$(makeopts_jobs) \
		install

	python_fix_shebang "${D}"

	sed -i \
		-e 's|/lib/|/'"$(get_libdir)"'/|g' \
		"${D}"/usr/bin/* || die

	python_optimize
}