summaryrefslogtreecommitdiff
blob: 005a2ec004fd3fb9df97be32a77568d9cc5727db (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
64
65
66
67
68
69
70
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{8..11} )
inherit meson python-any-r1

COMMIT_HASH="${PV}"
MESON_DOCS_TAR=meson-docs-0.63.0-239-g41a05ff93.tar.gz

DESCRIPTION="A meson-compatible build system"
HOMEPAGE="https://muon.build/"
SRC_URI="
	https://git.sr.ht/~lattis/muon/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz
	man? (
		https://mochiro.moe/wrap/${MESON_DOCS_TAR}
	)
"

# Apache-2.0 for meson-docs
LICENSE="GPL-3 man? ( Apache-2.0 )"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+archive +curl +libpkgconf +man"

S="${WORKDIR}/${PN}-${COMMIT_HASH}"

DEPEND="
	curl? ( net-misc/curl )
	archive? ( app-arch/libarchive:= )
	libpkgconf? ( dev-util/pkgconf:= )
	man? ( app-text/scdoc )
"
RDEPEND="${DEPEND}"
BDEPEND="
	man? (
		$(python_gen_any_dep '
			dev-python/pyyaml[${PYTHON_USEDEP}]
		')
	)
"

PATCHES=(
	"${FILESDIR}/muon-0.1.0-fix-potential-overflow.patch"
)

python_check_deps() {
	python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
}

src_prepare() {
	default

	if use man; then
		mv "${WORKDIR}/meson-docs" "${S}/subprojects" || die
	fi
}

src_configure() {
	local emesonargs=(
		$(meson_feature curl libcurl)
		$(meson_feature archive libarchive)
		$(meson_feature libpkgconf)
		$(meson_feature man docs)
		-Dsamurai=disabled  # patched version of samurai downloaded via wraps
		-Dbestline=enabled  # vendored bestline, an insignificant addition
	)
	meson_src_configure
}