aboutsummaryrefslogtreecommitdiff
blob: 2772d20a0d5751c66e7afb6809ae87e9de77dca2 (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
# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools flag-o-matic

DESCRIPTION="A fork of DOSBox, with patches and more features"
HOMEPAGE="https://dosbox-x.com/"
SRC_URI="https://github.com/joncampbell123/${PN}/archive/${PN}-v${PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
IUSE="alsa debug hardened ffmpeg opengl +sdl2"

DEPEND="alsa? ( media-libs/alsa-lib )
	ffmpeg? ( media-video/ffmpeg )
	opengl? ( virtual/glu virtual/opengl )
	debug? ( sys-libs/ncurses:0 )
	sdl2? (
		media-libs/libsdl2[X,joystick,video,sound]
		media-libs/sdl2-net
	)
	!sdl2? (
		media-libs/libsdl[X,joystick,video,sound]
		media-libs/sdl-net
	)
	media-libs/libpng"
RDEPEND=${DEPEND}

S="${WORKDIR}/${PN}-${PN}-v${PV}"

PATCHES=(
	"${FILESDIR}/sys-perm.patch"
	"${FILESDIR}/cmath.patch"
	"${FILESDIR}/z_of_fix.patch"
)

src_prepare() {
	default
	eautoreconf
	chmod +x vs/sdl/build-scripts/strip_fPIC.sh
	chmod +x configure
	if use !sdl2; then
		# Prefer to compile against the internal copy of SDL 1.x
		(cd vs/sdl && ./build-dosbox.sh) || die
	fi
}

src_configure() {
	econf \
		$(use_enable alsa alsa-midi) \
		$(use_enable ffmpeg avcodec) \
		$(use_enable !hardened dynamic-core) \
		$(use_enable !hardened core-inline) \
		$(use_enable !sdl2 sdl) \
		$(use_enable sdl2) \
		$(use_enable debug) \
		$(use_enable opengl)
}