1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 inherit toolchain-funcs
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"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="gles2-only cpu_flags_x86_sse"
18 RDEPEND=">=games-emulation/mupen64plus-core-2.5:0=[gles2-only=]
20 media-libs/libsdl2:0=[video]
22 gles2-only? ( media-libs/libsdl2:0[gles] )"
31 # avoid implicitly appending CPU flags
32 sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
37 # Note: please keep this in sync in all of mupen64plus-* packages
41 # this basically means: GNU userspace
47 CROSS_COMPILE="${CHOST}-"
50 PKG_CONFIG="$(tc-getPKG_CONFIG)"
51 # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
52 # so we can leave OPTFLAGS empty
55 # paths, some of them are used at compile time
57 LIBDIR=/usr/$(get_libdir)
59 # disable unwanted magic
63 # Package-specific stuff
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)"
69 NO_ASM=$(usex cpu_flags_x86_sse 0 1)
70 USE_GLES=$(usex gles2-only 1 0)
73 use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
74 use x86 && MAKEARGS+=( HOST_CPU=i386 )
76 emake "${MAKEARGS[@]}" all
80 emake "${MAKEARGS[@]}" DESTDIR="${D}" install