summaryrefslogtreecommitdiff
blob: cf48d28e86239485dde0671c7e565dce73b45297 (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
71
72
73
74
75
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
PYTHON_COMPAT=( python2_7 )

inherit python-single-r1

if [[ ${PV} == 9999* ]] ; then
	EGIT_REPO_URI="https://github.com/yasm/yasm.git"
	inherit autotools git-r3
else
	SRC_URI="http://www.tortall.net/projects/yasm/releases/${P}.tar.gz"
	KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x86-solaris"
fi

DESCRIPTION="An assembler for x86 and x86_64 instruction sets"
HOMEPAGE="http://yasm.tortall.net/"

LICENSE="BSD-2 BSD || ( Artistic GPL-2 LGPL-2 )"
SLOT="0"
IUSE="nls python"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

BDEPEND="
	nls? ( sys-devel/gettext )
	python? (
		${PYTHON_DEPS}
		$(python_gen_cond_dep '>=dev-python/cython-0.14[${PYTHON_USEDEP}]')
	)
"
DEPEND="
	nls? ( virtual/libintl )
"
RDEPEND="${DEPEND}
	python? ( ${PYTHON_DEPS} )
"

if [[ ${PV} == 9999* ]]; then
	BDEPEND+="
		app-text/xmlto
		app-text/docbook-xml-dtd:4.1.2
	"
fi

pkg_setup() {
	: # Avoid python-single-r1_pkg_setup
}

src_prepare() {
	default

	if [[ ${PV} == 9999* ]]; then
		eautoreconf
		./modules/arch/x86/gen_x86_insn.py || die
	fi
}

src_configure() {
	use python && python_setup

	local myconf=(
		--disable-warnerror
		$(use_enable python)
		$(use_enable python python-bindings)
		$(use_enable nls)
	)

	econf "${myconf[@]}"
}

src_test() {
	# https://bugs.gentoo.org/718870
	emake -j1 check
}