*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / games-emulation / dosbox / dosbox-0.75_pre4302.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools desktop flag-o-matic
7
8 case "${PV}" in
9 9999)
10         MY_P=${PN}
11         ESVN_REPO_URI="https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk"
12         inherit subversion
13         ;;
14 *_pre*)
15         MY_PV=0-r${PV#*_pre}
16         MY_P=${PN}-code-${MY_PV}-${PN}-trunk
17         SRC_URI="https://sourceforge.net/code-snapshots/svn/d/do/dosbox/code-0/${MY_P}.zip"
18         BDEPEND="app-arch/unzip"
19         ;;
20 *)
21         MY_PV=$(ver_rs 2 -)
22         MY_P=${PN}-${MY_PV}
23         SRC_URI="mirror://sourceforge/dosbox/${MY_P}.tar.gz"
24         ;;
25 esac
26
27 GLIDE_PATCH=841e1071597b64ead14dd08c25a03206b2d1d1b6
28 SRC_URI+=" glide? ( https://raw.githubusercontent.com/voyageur/openglide/${GLIDE_PATCH}/platform/dosbox/dosbox_glide.diff -> dosbox_glide-${GLIDE_PATCH}.diff )"
29
30 DESCRIPTION="DOS emulator"
31 HOMEPAGE="https://www.dosbox.com/"
32 LICENSE="GPL-2"
33 SLOT="0"
34 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
35 IUSE="alsa +core-inline debug glide hardened opengl X"
36
37 RDEPEND="alsa? ( media-libs/alsa-lib )
38         glide? ( media-libs/openglide )
39         opengl? ( virtual/glu virtual/opengl )
40         debug? ( sys-libs/ncurses:0= )
41         X? ( x11-libs/libX11 )
42         media-libs/libpng:0=
43         media-libs/libsdl[joystick,opengl?,video,X?]
44         media-libs/sdl-net
45         media-libs/sdl-sound
46         sys-libs/zlib"
47
48 DEPEND="${RDEPEND}"
49
50 S="${WORKDIR}/${MY_P}"
51
52 PATCHES=(
53         "${FILESDIR}"/${PN}-0.74-ncurses.patch
54 )
55
56 src_prepare() {
57         use glide && eapply "${DISTDIR}"/dosbox_glide-${GLIDE_PATCH}.diff
58         default
59         eautoreconf
60 }
61
62 src_configure() {
63         use glide && append-cppflags -I"${EPREFIX}"/usr/include/openglide
64
65         ac_cv_lib_X11_main=$(usex X yes no) \
66         econf \
67                 $(use_enable alsa alsa-midi) \
68                 $(use_enable core-inline) \
69                 $(use_enable !hardened dynamic-core) \
70                 $(use_enable !hardened dynamic-x86) \
71                 $(use_enable debug) \
72                 $(use_enable opengl)
73 }
74
75 src_install() {
76         default
77         make_desktop_entry dosbox DOSBox /usr/share/pixmaps/dosbox.ico
78         doicon src/dosbox.ico
79 }
80
81 pkg_postinst() {
82         if use glide; then
83                 elog "You have enabled unofficial Glide emulation. To use this, symlink"
84                 elog "or copy ${EPREFIX}/usr/share/openglide/glide2x-dosbox.ovl to your game's"
85                 elog "directory and add the following to your DOSBox configuration."
86                 elog ""
87                 elog "[glide]"
88                 elog "glide=true"
89         fi
90 }