# Copyright 2014-2016 Alexander Scheuermann # Distributed under the terms of the GNU General Public License v2 MY_PNV="${PN}_v${PV}-source" SUMMARY="higan is a Nintendo multi-system emulator." DESCRIPTION="Emulator aiming for perfect accuracy on the systems Famicom, Super Famicom, Game Boy, Game Boy Color, Game Boy Advance and the subsystems Super Game Boy, BS-X Satellaview and Sufami Turbo. OpenGL 3.2 is required." HOMEPAGE="http://byuu.org/emulation/${PN}/" DOWNLOADS="http://download.byuu.org/${MY_PNV}.7z" LICENCES="GPL-3" SLOT="0" PLATFORMS="~amd64" MYOPTIONS=" opengl openmp sdl xv ( alsa ao openal oss pulseaudio ) [[ number-selected = at-least-one ]] ( gtk2 qt4 ) [[ number-selected = exactly-one ]] ( providers: eudev systemd ) [[ number-selected = exactly-one ]] " DEPENDENCIES=" build: app-arch/7zip virtual/pkg-config build+run: x11-libs/libX11 x11-libs/libXext alsa? ( sys-sound/alsa-lib ) ao? ( media-libs/libao ) gtk2? ( dev-libs/at-spi2-core[>=2.52.0] dev-libs/glib gnome-desktop/gtksourceview:2 media-libs/fontconfig media-libs/freetype:2 x11-libs/cairo x11-libs/gdk-pixbuf:2.0 x11-libs/gtk+:2 x11-libs/pango ) openal? ( media-libs/openal ) opengl? ( x11-dri/mesa[X] ) openmp? ( sys-libs/libgomp:= ) oss? ( sys-sound/oss ) pulseaudio? ( media-sound/pulseaudio ) sdl? ( media-libs/SDL ) qt4? ( x11-libs/qt:4 ) xv? ( x11-libs/libXv ) providers:eudev? ( sys-apps/eudev ) providers:systemd? ( sys-apps/systemd ) " WORK="${WORKBASE}/${MY_PNV}" DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}/hiro_GNUmakefile.patch" ) RESTRICT=test higan_disable() { edo sed -i \ -e "s/${1}//" \ "${WORK}/higan/target-tomoko/GNUmakefile" } src_prepare() { # use system flags edo sed -i \ -e "/flags += -I. -I.. -O3/ s/-O3/${CXXFLAGS}/" \ -e "/ flags += -march=native/ s/-march=native //" \ -e "/ link += -fopenmp/ s/$/ ${LDFLAGS}/" \ higan/GNUmakefile edo sed -i \ -e "/flags += -I.. -O3/ s/-O3/${CXXFLAGS}/" \ icarus/GNUmakefile # set pkg-config edo sed -i \ -e "s/pkg-config/${PKG_CONFIG}/" \ hiro/GNUmakefile # optionally disable openmp optionq openmp || { edo sed -i \ -e "s/-fopenmp//" \ higan/GNUmakefile } # apply options # audio optionq alsa || higan_disable audio.alsa optionq ao || higan_disable audio.ao optionq openal || higan_disable audio.openal optionq oss || higan_disable audio.oss optionq pulseaudio || { higan_disable audio.pulseaudio higan_disable audio.pulseaudiosimple } # video optionq opengl || higan_disable video.glx optionq sdl || higan_disable video.sdl optionq xv || higan_disable video.xv # input optionq sdl || higan_disable input.sdl } src_compile() { # main program edo pushd higan emake \ platform="linux" \ compiler="${CXX}" \ hiro="$(option qt4 qt gtk)" edo popd # library management edo pushd icarus emake \ platform="linux" \ compiler="${CXX}" \ hiro="$(option qt4 qt gtk)" edo popd } src_install() { dobin higan/out/higan dobin icarus/out/icarus insinto /usr/share/pixmaps doins higan/data/higan.png insinto /usr/share/applications doins higan/data/higan.desktop insinto /usr/share/higan doins -r higan/systems/* } pkg_postinst() { default # system data library needs manual user copy ewarn "${PN} does not know its system wide resources and requires a manual copy per user." ewarn "Please run: cp -r /usr/share/${PN} ~/.local/share/" }