games-emulation/mupen64plus-video-rice: rename USE=gles2 to USE=gles2-only
[gentoo.git] / games-emulation / mupen64plus-video-rice / mupen64plus-video-rice-2.5.9-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 MY_P=${PN}-src-${PV}
7 inherit toolchain-funcs
8
9 DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, rice video plugin"
10 HOMEPAGE="https://www.mupen64plus.org/"
11 SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
12
13 LICENSE="GPL-2+"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="gles2-only cpu_flags_x86_sse"
17
18 RDEPEND=">=games-emulation/mupen64plus-core-2.5:0=[gles2-only=]
19         media-libs/libpng:0=
20         media-libs/libsdl2:0=[video]
21         virtual/opengl:0=
22         gles2-only? ( media-libs/libsdl2:0[gles] )"
23 DEPEND="${RDEPEND}
24         virtual/pkgconfig"
25
26 S=${WORKDIR}/${MY_P}
27
28 src_prepare() {
29         default
30
31         # avoid implicitly appending CPU flags
32         sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
33 }
34
35 src_compile() {
36         MAKEARGS=(
37                 # Note: please keep this in sync in all of mupen64plus-* packages
38
39                 -C projects/unix
40
41                 # this basically means: GNU userspace
42                 UNAME=Linux
43
44                 # verbose output
45                 V=1
46
47                 CROSS_COMPILE="${CHOST}-"
48                 CC="$(tc-getCC)"
49                 CXX="$(tc-getCXX)"
50                 PKG_CONFIG="$(tc-getPKG_CONFIG)"
51                 # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
52                 # so we can leave OPTFLAGS empty
53                 OPTFLAGS=
54
55                 # paths, some of them are used at compile time
56                 PREFIX=/usr
57                 LIBDIR=/usr/$(get_libdir)
58
59                 # disable unwanted magic
60                 LDCONFIG=:
61                 INSTALL_STRIP_FLAG=
62
63                 # Package-specific stuff
64
65                 # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
66                 SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
67                 SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
68
69                 NO_ASM=$(usex cpu_flags_x86_sse 0 1)
70                 USE_GLES=$(usex gles2-only 1 0)
71         )
72
73         use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
74         use x86 && MAKEARGS+=( HOST_CPU=i386 )
75
76         emake "${MAKEARGS[@]}" all
77 }
78
79 src_install() {
80         emake "${MAKEARGS[@]}" DESTDIR="${D}" install
81         dodoc README RELEASE
82 }