summaryrefslogtreecommitdiff
path: root/games-emulation
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /games-emulation
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'games-emulation')
-rw-r--r--games-emulation/Manifest.gzbin12286 -> 9474 bytes
-rw-r--r--games-emulation/advancemame-3.713
-rw-r--r--games-emulation/advancemame/Manifest8
-rw-r--r--games-emulation/advancemame/advancemame-3.7.ebuild101
-rw-r--r--games-emulation/advancemame/files/advancemame-1.2-pic.patch13
-rw-r--r--games-emulation/advancemame/files/advancemame-1.2-verboselog.patch42
-rw-r--r--games-emulation/advancemame/files/advancemame-3.7-move_aclocal_to_acinclude.patch78
-rw-r--r--games-emulation/advancemame/files/advancemame-3.7-remove_static_configure_option.patch41
-rw-r--r--games-emulation/advancemame/metadata.xml24
-rw-r--r--games-emulation/advancemenu-2.713
-rw-r--r--games-emulation/advancemenu-2.913
-rw-r--r--games-emulation/advancemenu/Manifest9
-rw-r--r--games-emulation/advancemenu/advancemenu-2.7.ebuild85
-rw-r--r--games-emulation/advancemenu/advancemenu-2.9.ebuild89
-rw-r--r--games-emulation/advancemenu/files/advancemenu-2.7-alsa-pkg-config.patch20
-rw-r--r--games-emulation/advancemenu/files/advancemenu-2.7-pic.patch13
-rw-r--r--games-emulation/advancemenu/files/advancemenu-2.9-destdir.patch112
-rw-r--r--games-emulation/advancemenu/metadata.xml11
-rw-r--r--games-emulation/advancescan-1.16-r112
-rw-r--r--games-emulation/advancescan/Manifest5
-rw-r--r--games-emulation/advancescan/advancescan-1.16-r1.ebuild36
-rw-r--r--games-emulation/advancescan/files/advancescan-1.16-gcc6.patch520
-rw-r--r--games-emulation/advancescan/files/advancescan-1.16-sys-expat.patch77
-rw-r--r--games-emulation/advancescan/metadata.xml11
-rw-r--r--games-emulation/atari800-3.1.0-r113
-rw-r--r--games-emulation/atari800/Manifest6
-rw-r--r--games-emulation/atari800/atari800-3.1.0-r1.ebuild92
-rw-r--r--games-emulation/atari800/files/atari800-3.1.0-tgetent-detection.patch12
-rw-r--r--games-emulation/atari800/files/atari800.cfg24
-rw-r--r--games-emulation/atari800/metadata.xml29
-rw-r--r--games-emulation/caps-2007111513
-rw-r--r--games-emulation/caps/Manifest6
-rw-r--r--games-emulation/caps/caps-20071115.ebuild67
-rw-r--r--games-emulation/caps/metadata.xml15
-rw-r--r--games-emulation/daphne-1.012
-rw-r--r--games-emulation/daphne/Manifest10
-rw-r--r--games-emulation/daphne/daphne-1.0.ebuild89
-rw-r--r--games-emulation/daphne/files/daphne-1.0-gcc43.patch12
-rw-r--r--games-emulation/daphne/files/daphne-1.0-ldflags.patch22
-rw-r--r--games-emulation/daphne/files/daphne-1.0-system-lmpeg2.patch41
-rw-r--r--games-emulation/daphne/files/daphne-1.0-typefix.patch47
-rw-r--r--games-emulation/daphne/files/daphne-1.0-underlink.patch8
-rw-r--r--games-emulation/daphne/files/daphne-1.0-vorbisfilefix.patch14
-rw-r--r--games-emulation/daphne/files/daphne-1.0-zlib.patch13
-rw-r--r--games-emulation/daphne/metadata.xml8
-rw-r--r--games-emulation/desmume-0.9.11-r112
-rw-r--r--games-emulation/desmume/Manifest6
-rw-r--r--games-emulation/desmume/desmume-0.9.11-r1.ebuild38
-rw-r--r--games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff11
-rw-r--r--games-emulation/desmume/files/desmume-0.9.11-gcc6.patch47
-rw-r--r--games-emulation/desmume/files/desmume-0.9.11-gcc7.patch21
-rw-r--r--games-emulation/desmume/metadata.xml14
-rw-r--r--games-emulation/dgen-sdl-1.33-r112
-rw-r--r--games-emulation/dgen-sdl/Manifest4
-rw-r--r--games-emulation/dgen-sdl/dgen-sdl-1.33-r1.ebuild40
-rw-r--r--games-emulation/dgen-sdl/files/dgen-sdl-1.33-joystick.patch18
-rw-r--r--games-emulation/dgen-sdl/metadata.xml11
-rw-r--r--games-emulation/dolphin-5.013
-rw-r--r--games-emulation/dolphin-999911
-rw-r--r--games-emulation/dolphin/Manifest5
-rw-r--r--games-emulation/dolphin/dolphin-5.0.ebuild179
-rw-r--r--games-emulation/dolphin/dolphin-9999.ebuild183
-rw-r--r--games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch49
-rw-r--r--games-emulation/dolphin/metadata.xml22
-rw-r--r--games-emulation/dosbox-0.74_p2016062913
-rw-r--r--games-emulation/dosbox-0.74_p20160629-r113
-rw-r--r--games-emulation/dosbox-999912
-rw-r--r--games-emulation/dosbox/Manifest8
-rw-r--r--games-emulation/dosbox/dosbox-0.74_p20160629-r1.ebuild69
-rw-r--r--games-emulation/dosbox/dosbox-0.74_p20160629.ebuild51
-rw-r--r--games-emulation/dosbox/dosbox-9999.ebuild74
-rw-r--r--games-emulation/dosbox/files/dosbox-0.74-gcc46.patch10
-rw-r--r--games-emulation/dosbox/metadata.xml19
-rw-r--r--games-emulation/emutos-0.9.4-r110
-rw-r--r--games-emulation/emutos-0.9.9.110
-rw-r--r--games-emulation/emutos/Manifest8
-rw-r--r--games-emulation/emutos/emutos-0.9.4-r1.ebuild25
-rw-r--r--games-emulation/emutos/emutos-0.9.9.1.ebuild23
-rw-r--r--games-emulation/emutos/metadata.xml11
-rw-r--r--games-emulation/fakenes-0.5.8-r313
-rw-r--r--games-emulation/fakenes/Manifest5
-rw-r--r--games-emulation/fakenes/fakenes-0.5.8-r3.ebuild77
-rw-r--r--games-emulation/fakenes/files/fakenes-0.5.8-underlink.patch8
-rw-r--r--games-emulation/fakenes/files/fakenes-0.5.8-zlib.patch170
-rw-r--r--games-emulation/fakenes/metadata.xml11
-rw-r--r--games-emulation/fbzx-3.0.0-r112
-rw-r--r--games-emulation/fbzx/Manifest4
-rw-r--r--games-emulation/fbzx/fbzx-3.0.0-r1.ebuild38
-rw-r--r--games-emulation/fbzx/files/fbzx-3.0.0-gentoo.patch118
-rw-r--r--games-emulation/fbzx/metadata.xml15
-rw-r--r--games-emulation/fceux-2.2.313
-rw-r--r--games-emulation/fceux/Manifest4
-rw-r--r--games-emulation/fceux/fceux-2.2.3.ebuild51
-rw-r--r--games-emulation/fceux/files/fceux-2.2.2-warnings.patch33
-rw-r--r--games-emulation/fceux/metadata.xml14
-rw-r--r--games-emulation/gambatte-0.5.0_p20131102-r212
-rw-r--r--games-emulation/gambatte/Manifest3
-rw-r--r--games-emulation/gambatte/gambatte-0.5.0_p20131102-r2.ebuild74
-rw-r--r--games-emulation/gambatte/metadata.xml11
-rw-r--r--games-emulation/gcube-0.4-r212
-rw-r--r--games-emulation/gcube/Manifest6
-rw-r--r--games-emulation/gcube/files/gcube-0.4-gcc47.patch10
-rw-r--r--games-emulation/gcube/files/gcube-0.4-ldflags.patch30
-rw-r--r--games-emulation/gcube/files/gcube-0.4-underlink.patch10
-rw-r--r--games-emulation/gcube/gcube-0.4-r2.ebuild50
-rw-r--r--games-emulation/gcube/metadata.xml8
-rw-r--r--games-emulation/generator-0.35_p4-r112
-rw-r--r--games-emulation/generator/Manifest6
-rw-r--r--games-emulation/generator/files/generator-0.35_p4-configure.patch94
-rw-r--r--games-emulation/generator/files/generator-0.35_p4-inline.patch12
-rw-r--r--games-emulation/generator/files/generator-0.35_p4-underlink.patch11
-rw-r--r--games-emulation/generator/generator-0.35_p4-r1.ebuild54
-rw-r--r--games-emulation/generator/metadata.xml11
-rw-r--r--games-emulation/gens-2.15.5-r112
-rw-r--r--games-emulation/gens/Manifest7
-rw-r--r--games-emulation/gens/files/gens-2.15.5-as-needed.patch11
-rw-r--r--games-emulation/gens/files/gens-2.15.5-gcc34.patch46
-rw-r--r--games-emulation/gens/files/gens-2.15.5-ovflfix.patch13
-rw-r--r--games-emulation/gens/files/gens-2.15.5-romsdir.patch13
-rw-r--r--games-emulation/gens/gens-2.15.5-r1.ebuild48
-rw-r--r--games-emulation/gens/metadata.xml11
-rw-r--r--games-emulation/gfceux-2.1.1-r114
-rw-r--r--games-emulation/gfceux/Manifest3
-rw-r--r--games-emulation/gfceux/gfceux-2.1.1-r1.ebuild70
-rw-r--r--games-emulation/gfceux/metadata.xml11
-rw-r--r--games-emulation/gngb-20060309-r113
-rw-r--r--games-emulation/gngb/Manifest10
-rw-r--r--games-emulation/gngb/files/gngb-20060309-amd64.patch30
-rw-r--r--games-emulation/gngb/files/gngb-20060309-gcc34.patch22
-rw-r--r--games-emulation/gngb/files/gngb-20060309-gcc5.patch35
-rw-r--r--games-emulation/gngb/files/gngb-20060309-gcc7.patch73
-rw-r--r--games-emulation/gngb/files/gngb-20060309-inline.patch24
-rw-r--r--games-emulation/gngb/files/gngb-20060309-joystick.patch56
-rw-r--r--games-emulation/gngb/files/gngb-20060309-qwerty.patch24
-rw-r--r--games-emulation/gngb/gngb-20060309-r1.ebuild44
-rw-r--r--games-emulation/gngb/metadata.xml8
-rw-r--r--games-emulation/gngeo-0.8-r112
-rw-r--r--games-emulation/gngeo/Manifest8
-rw-r--r--games-emulation/gngeo/files/gngeo-0.8-cflags.patch41
-rw-r--r--games-emulation/gngeo/files/gngeo-0.8-concurrentMake.patch16
-rw-r--r--games-emulation/gngeo/files/gngeo-0.8-execstacks.patch105
-rw-r--r--games-emulation/gngeo/files/gngeo-0.8-zlib.patch9
-rw-r--r--games-emulation/gngeo/gngeo-0.8-r1.ebuild43
-rw-r--r--games-emulation/gngeo/metadata.xml8
-rw-r--r--games-emulation/gnuboy-1.0.3-r213
-rw-r--r--games-emulation/gnuboy/Manifest6
-rw-r--r--games-emulation/gnuboy/files/gnuboy-1.0.3-exec-stack.patch27
-rw-r--r--games-emulation/gnuboy/files/gnuboy-1.0.3-include.patch14
-rw-r--r--games-emulation/gnuboy/files/gnuboy-1.0.3-linux-headers.patch93
-rw-r--r--games-emulation/gnuboy/gnuboy-1.0.3-r2.ebuild60
-rw-r--r--games-emulation/gnuboy/metadata.xml11
-rw-r--r--games-emulation/hatari-2.1.015
-rw-r--r--games-emulation/hatari/Manifest3
-rw-r--r--games-emulation/hatari/hatari-2.1.0.ebuild76
-rw-r--r--games-emulation/hatari/metadata.xml11
-rw-r--r--games-emulation/higan-106_p1-r114
-rw-r--r--games-emulation/higan/Manifest6
-rw-r--r--games-emulation/higan/files/higan-106_p1-QA.patch117
-rw-r--r--games-emulation/higan/files/higan-106_p1-header-locations.patch24
-rw-r--r--games-emulation/higan/files/higan-106_p1-wrapper5
-rw-r--r--games-emulation/higan/higan-106_p1-r1.ebuild138
-rw-r--r--games-emulation/higan/metadata.xml12
-rw-r--r--games-emulation/hugo-2.1212
-rw-r--r--games-emulation/hugo/Manifest4
-rw-r--r--games-emulation/hugo/files/hugo-2.12-gcc41.patch11
-rw-r--r--games-emulation/hugo/hugo-2.12.ebuild35
-rw-r--r--games-emulation/hugo/metadata.xml8
-rw-r--r--games-emulation/kigb-2.0212
-rw-r--r--games-emulation/kigb/Manifest4
-rw-r--r--games-emulation/kigb/files/kigb15
-rw-r--r--games-emulation/kigb/kigb-2.02.ebuild40
-rw-r--r--games-emulation/kigb/metadata.xml8
-rw-r--r--games-emulation/lxdream-0.9.1-r313
-rw-r--r--games-emulation/lxdream/Manifest4
-rw-r--r--games-emulation/lxdream/files/lxdream-0.9.1-glib-single-include.patch395
-rw-r--r--games-emulation/lxdream/lxdream-0.9.1-r3.ebuild64
-rw-r--r--games-emulation/lxdream/metadata.xml12
-rw-r--r--games-emulation/m64py-0.2.414
-rw-r--r--games-emulation/m64py/Manifest3
-rw-r--r--games-emulation/m64py/m64py-0.2.4.ebuild53
-rw-r--r--games-emulation/m64py/metadata.xml15
-rw-r--r--games-emulation/mamory-0.2.25-r112
-rw-r--r--games-emulation/mamory/Manifest3
-rw-r--r--games-emulation/mamory/mamory-0.2.25-r1.ebuild50
-rw-r--r--games-emulation/mamory/metadata.xml11
-rw-r--r--games-emulation/mastergear-bin-4.311
-rw-r--r--games-emulation/mastergear-bin/Manifest3
-rw-r--r--games-emulation/mastergear-bin/mastergear-bin-4.3.ebuild27
-rw-r--r--games-emulation/mastergear-bin/metadata.xml8
-rw-r--r--games-emulation/mednafen-0.9.4613
-rw-r--r--games-emulation/mednafen/Manifest3
-rw-r--r--games-emulation/mednafen/mednafen-0.9.46.ebuild115
-rw-r--r--games-emulation/mednafen/metadata.xml15
-rw-r--r--games-emulation/mednaffe-0.8.712
-rw-r--r--games-emulation/mednaffe/Manifest3
-rw-r--r--games-emulation/mednaffe/mednaffe-0.8.7.ebuild47
-rw-r--r--games-emulation/mednaffe/metadata.xml11
-rw-r--r--games-emulation/mekanix-070-r112
-rw-r--r--games-emulation/mekanix/Manifest3
-rw-r--r--games-emulation/mekanix/mekanix-070-r1.ebuild33
-rw-r--r--games-emulation/mekanix/metadata.xml8
-rw-r--r--games-emulation/metadata.xml31
-rw-r--r--games-emulation/mgba-0.6.114
-rw-r--r--games-emulation/mgba-0.6.214
-rw-r--r--games-emulation/mgba-0.6.314
-rw-r--r--games-emulation/mgba/Manifest8
-rw-r--r--games-emulation/mgba/files/mgba-0.6.3-qt511.patch34
-rw-r--r--games-emulation/mgba/metadata.xml11
-rw-r--r--games-emulation/mgba/mgba-0.6.1.ebuild115
-rw-r--r--games-emulation/mgba/mgba-0.6.2.ebuild115
-rw-r--r--games-emulation/mgba/mgba-0.6.3.ebuild122
-rw-r--r--games-emulation/mupen64plus-2.510
-rw-r--r--games-emulation/mupen64plus-audio-sdl-2.513
-rw-r--r--games-emulation/mupen64plus-audio-sdl/Manifest3
-rw-r--r--games-emulation/mupen64plus-audio-sdl/metadata.xml11
-rw-r--r--games-emulation/mupen64plus-audio-sdl/mupen64plus-audio-sdl-2.5.ebuild84
-rw-r--r--games-emulation/mupen64plus-core-2.5-r114
-rw-r--r--games-emulation/mupen64plus-core/Manifest3
-rw-r--r--games-emulation/mupen64plus-core/metadata.xml20
-rw-r--r--games-emulation/mupen64plus-core/mupen64plus-core-2.5-r1.ebuild111
-rw-r--r--games-emulation/mupen64plus-input-sdl-2.512
-rw-r--r--games-emulation/mupen64plus-input-sdl/Manifest3
-rw-r--r--games-emulation/mupen64plus-input-sdl/metadata.xml11
-rw-r--r--games-emulation/mupen64plus-input-sdl/mupen64plus-input-sdl-2.5.ebuild76
-rw-r--r--games-emulation/mupen64plus-rsp-hle-2.512
-rw-r--r--games-emulation/mupen64plus-rsp-hle/Manifest3
-rw-r--r--games-emulation/mupen64plus-rsp-hle/metadata.xml11
-rw-r--r--games-emulation/mupen64plus-rsp-hle/mupen64plus-rsp-hle-2.5.ebuild68
-rw-r--r--games-emulation/mupen64plus-ui-console-2.5-r112
-rw-r--r--games-emulation/mupen64plus-ui-console/Manifest3
-rw-r--r--games-emulation/mupen64plus-ui-console/metadata.xml11
-rw-r--r--games-emulation/mupen64plus-ui-console/mupen64plus-ui-console-2.5-r1.ebuild90
-rw-r--r--games-emulation/mupen64plus-video-glide64mk2-2.513
-rw-r--r--games-emulation/mupen64plus-video-glide64mk2/Manifest3
-rw-r--r--games-emulation/mupen64plus-video-glide64mk2/metadata.xml15
-rw-r--r--games-emulation/mupen64plus-video-glide64mk2/mupen64plus-video-glide64mk2-2.5.ebuild88
-rw-r--r--games-emulation/mupen64plus-video-rice-2.513
-rw-r--r--games-emulation/mupen64plus-video-rice/Manifest3
-rw-r--r--games-emulation/mupen64plus-video-rice/metadata.xml14
-rw-r--r--games-emulation/mupen64plus-video-rice/mupen64plus-video-rice-2.5.ebuild81
-rw-r--r--games-emulation/mupen64plus/Manifest2
-rw-r--r--games-emulation/mupen64plus/metadata.xml24
-rw-r--r--games-emulation/mupen64plus/mupen64plus-2.5.ebuild22
-rw-r--r--games-emulation/nestopia-1.47_p2017010513
-rw-r--r--games-emulation/nestopia-999911
-rw-r--r--games-emulation/nestopia/Manifest4
-rw-r--r--games-emulation/nestopia/metadata.xml15
-rw-r--r--games-emulation/nestopia/nestopia-1.47_p20170105.ebuild53
-rw-r--r--games-emulation/nestopia/nestopia-9999.ebuild53
-rw-r--r--games-emulation/nestra-0.66-r312
-rw-r--r--games-emulation/nestra/Manifest6
-rw-r--r--games-emulation/nestra/files/nestra-0.66-exec-stack.patch10
-rw-r--r--games-emulation/nestra/files/nestra-0.66-include.patch73
-rw-r--r--games-emulation/nestra/metadata.xml8
-rw-r--r--games-emulation/nestra/nestra-0.66-r3.ebuild49
-rw-r--r--games-emulation/openmsx-0.14.012
-rw-r--r--games-emulation/openmsx/Manifest3
-rw-r--r--games-emulation/openmsx/metadata.xml11
-rw-r--r--games-emulation/openmsx/openmsx-0.14.0.ebuild74
-rw-r--r--games-emulation/pcsx2-1.4.012
-rw-r--r--games-emulation/pcsx2-999910
-rw-r--r--games-emulation/pcsx2/Manifest5
-rw-r--r--games-emulation/pcsx2/files/pcsx2-1.4.0-gcc5.patch26
-rw-r--r--games-emulation/pcsx2/metadata.xml16
-rw-r--r--games-emulation/pcsx2/pcsx2-1.4.0.ebuild107
-rw-r--r--games-emulation/pcsx2/pcsx2-9999.ebuild102
-rw-r--r--games-emulation/pcsxr-1.9.94-r215
-rw-r--r--games-emulation/pcsxr/Manifest6
-rw-r--r--games-emulation/pcsxr/files/pcsxr-1.9.94-disable-sdl2.patch28
-rw-r--r--games-emulation/pcsxr/files/pcsxr-1.9.94-ffmpeg3.patch62
-rw-r--r--games-emulation/pcsxr/files/pcsxr-1.9.94-zlib-uncompress2.patch47
-rw-r--r--games-emulation/pcsxr/metadata.xml12
-rw-r--r--games-emulation/pcsxr/pcsxr-1.9.94-r2.ebuild115
-rw-r--r--games-emulation/ppsspp-1.4.214
-rw-r--r--games-emulation/ppsspp-1.4.2-r114
-rw-r--r--games-emulation/ppsspp-1.5.414
-rw-r--r--games-emulation/ppsspp-1.5.4-r114
-rw-r--r--games-emulation/ppsspp-999912
-rw-r--r--games-emulation/ppsspp/Manifest26
-rw-r--r--games-emulation/ppsspp/files/ppsspp-1.4-O2.patch32
-rw-r--r--games-emulation/ppsspp/files/ppsspp-1.4.2-assets-lookup.patch13
-rw-r--r--games-emulation/ppsspp/metadata.xml20
-rw-r--r--games-emulation/ppsspp/ppsspp-1.4.2-r1.ebuild98
-rw-r--r--games-emulation/ppsspp/ppsspp-1.4.2.ebuild107
-rw-r--r--games-emulation/ppsspp/ppsspp-1.5.4-r1.ebuild98
-rw-r--r--games-emulation/ppsspp/ppsspp-1.5.4.ebuild107
-rw-r--r--games-emulation/ppsspp/ppsspp-9999.ebuild81
-rw-r--r--games-emulation/raine-0.51.912
-rw-r--r--games-emulation/raine/Manifest6
-rw-r--r--games-emulation/raine/files/raine-0.51.9-ldflags.patch11
-rw-r--r--games-emulation/raine/files/raine-0.51.9-libpng15.patch13
-rw-r--r--games-emulation/raine/files/raine-0.51.9-underlink.patch11
-rw-r--r--games-emulation/raine/metadata.xml8
-rw-r--r--games-emulation/raine/raine-0.51.9.ebuild57
-rw-r--r--games-emulation/snes9x-1.5514
-rw-r--r--games-emulation/snes9x-1.5614
-rw-r--r--games-emulation/snes9x/Manifest8
-rw-r--r--games-emulation/snes9x/files/snes9x-1.53-cross-compile.patch38
-rw-r--r--games-emulation/snes9x/files/snes9x-1.55-build-system.patch63
-rw-r--r--games-emulation/snes9x/files/snes9x-1.56-build-system.patch53
-rw-r--r--games-emulation/snes9x/metadata.xml16
-rw-r--r--games-emulation/snes9x/snes9x-1.55.ebuild125
-rw-r--r--games-emulation/snes9x/snes9x-1.56.ebuild137
-rw-r--r--games-emulation/stella-4.7.2-r113
-rw-r--r--games-emulation/stella/Manifest3
-rw-r--r--games-emulation/stella/metadata.xml11
-rw-r--r--games-emulation/stella/stella-4.7.2-r1.ebuild69
-rw-r--r--games-emulation/vbam-2.0.1-r114
-rw-r--r--games-emulation/vbam-2.0.214
-rw-r--r--games-emulation/vbam-999912
-rw-r--r--games-emulation/vbam/Manifest8
-rw-r--r--games-emulation/vbam/files/vbam-2.0.1-changelog-update.patch98
-rw-r--r--games-emulation/vbam/files/vbam-2.0.1-read-version-from-changelog.patch76
-rw-r--r--games-emulation/vbam/metadata.xml15
-rw-r--r--games-emulation/vbam/vbam-2.0.1-r1.ebuild97
-rw-r--r--games-emulation/vbam/vbam-2.0.2.ebuild92
-rw-r--r--games-emulation/vbam/vbam-9999.ebuild92
-rw-r--r--games-emulation/vgba-4.8-r111
-rw-r--r--games-emulation/vgba/Manifest3
-rw-r--r--games-emulation/vgba/metadata.xml8
-rw-r--r--games-emulation/vgba/vgba-4.8-r1.ebuild29
-rw-r--r--games-emulation/yabause-0.9.1413
-rw-r--r--games-emulation/yabause/Manifest5
-rw-r--r--games-emulation/yabause/files/yabause-0.9.14-RWX.patch24
-rw-r--r--games-emulation/yabause/files/yabause-0.9.14-cmake.patch51
-rw-r--r--games-emulation/yabause/metadata.xml14
-rw-r--r--games-emulation/yabause/yabause-0.9.14.ebuild73
-rw-r--r--games-emulation/zinc-1.1-r111
-rw-r--r--games-emulation/zinc/Manifest3
-rw-r--r--games-emulation/zinc/metadata.xml8
-rw-r--r--games-emulation/zinc/zinc-1.1-r1.ebuild29
-rw-r--r--games-emulation/zsnes-1.51-r613
-rw-r--r--games-emulation/zsnes-1.51-r713
-rw-r--r--games-emulation/zsnes/Manifest17
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch20
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-arch.patch77
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch502
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-buffer.patch85
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch34
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-depbuild.patch24
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-gcc43.patch48
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-gcc47.patch15
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch25
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-libpng.patch33
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-libpng15.patch12
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch56
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-stack-align.patch15
-rw-r--r--games-emulation/zsnes/metadata.xml15
-rw-r--r--games-emulation/zsnes/zsnes-1.51-r6.ebuild117
-rw-r--r--games-emulation/zsnes/zsnes-1.51-r7.ebuild122
350 files changed, 11331 insertions, 921 deletions
diff --git a/games-emulation/Manifest.gz b/games-emulation/Manifest.gz
index 22d6f22672fd..e802685c2e05 100644
--- a/games-emulation/Manifest.gz
+++ b/games-emulation/Manifest.gz
Binary files differ
diff --git a/games-emulation/advancemame-3.7 b/games-emulation/advancemame-3.7
deleted file mode 100644
index 3e030f9ea0e2..000000000000
--- a/games-emulation/advancemame-3.7
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare
-DEPEND=app-arch/unzip app-arch/zip dev-libs/expat media-libs/libsdl2 sys-libs/zlib alsa? ( media-libs/alsa-lib ) truetype? ( media-libs/freetype:2 ) virtual/os-headers virtual/pkgconfig x86? ( >=dev-lang/nasm-0.98 ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=GNU/Linux port of the MAME emulator with GUI menu
-EAPI=6
-HOMEPAGE=http://www.advancemame.it/
-IUSE=alsa fbcon oss truetype
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 XMAME
-RDEPEND=app-arch/unzip app-arch/zip dev-libs/expat media-libs/libsdl2 sys-libs/zlib alsa? ( media-libs/alsa-lib ) truetype? ( media-libs/freetype:2 )
-SLOT=0
-SRC_URI=https://github.com/amadvance/advancemame/releases/download/v3.7/advancemame-3.7.tar.gz https://github.com/amadvance/advancemame/commit/70f099ac49786a287ebd3949ce8f8670a5731abd.patch -> advancemame-3.7-use_pkgconfig_for_freetype_and_sdl.patch
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=21f8a0a36ec5c2a9e6ed1cab916ce5b4
diff --git a/games-emulation/advancemame/Manifest b/games-emulation/advancemame/Manifest
new file mode 100644
index 000000000000..600b261cab4d
--- /dev/null
+++ b/games-emulation/advancemame/Manifest
@@ -0,0 +1,8 @@
+AUX advancemame-1.2-pic.patch 344 BLAKE2B 61e312fe33565171824e2e875a22187134bfc8905dfa2f6bc50b43427acd0f25502d1da1f7f591c1882e82f37d591c737af0aaaa98705c345637d786886e6c20 SHA512 5ae1a76a5e08e65efece7b295af7e177e8da7d65c7de9a03529d8a6909d38c6510d8c3e122bc4bc542760bc2cdf2e26a1edf56d27bcfa6b1fe25ea9c0f467360
+AUX advancemame-1.2-verboselog.patch 838 BLAKE2B 157d3797c5b92148d35f502fbc76aac9742c21b277d897308e4a074e1cba95b6fe1ea3e6b758be0a8d8b7e10fba5d33f5ac318d7c332f6bf622215627168646e SHA512 d34ff98ff2971a01dd46a66b322507afec4930f89afd2141e753233efeccdc582644dbf576eae08300c8e3be0336e09e56609983bcd602a69a47985ecd954e6e
+AUX advancemame-3.7-move_aclocal_to_acinclude.patch 2277 BLAKE2B f66691900297b845d9b20f93c989d4f31c7e9cd87be5168fc9e716080f6d23bcf590b372df3275149ad28927581d4e406a4bcd3bb6ba1af3b732f97c7f5483f6 SHA512 1ece971e4d51d4ac6e8bcc9b72413b6cb9d19206797131c1ed6af33da3eec18797be128776061a7478dac807dc4e83a75a9495dd0a6c788090f55eb13aeaa89b
+AUX advancemame-3.7-remove_static_configure_option.patch 1076 BLAKE2B 17014295ddf61b910376338998791b645157175b640839ba076c72861cc643c2c5d969139230e7c49ee5e60ce790a100fc3f1612d2370e6bcb3a7a9f37ae4f14 SHA512 b7c1c961c123d8a175325626005c8d2081ba98f0f392dabde795732340f323caf513c6b691790afe254860044fca97cf497209d94dc0ff6e1d98fc8df4bda563
+DIST advancemame-3.7-use_pkgconfig_for_freetype_and_sdl.patch 21144 BLAKE2B ba374d664db45f938d3b054820868b5aaa63a7461938f5e8a320dc607ef3444c8fc5f87cdd3ef9db130c1048ef9e75afed4f856997f048bcb44eb99d3bcbaefc SHA512 80136d71117329997846fe0f03a3cf3439ee8ff3db649f50a3008595ed2d82cd0e3dcd9c6908edf30e19d516943eeed129eb994a6326effaf94a7eaa5d1b8fa2
+DIST advancemame-3.7.tar.gz 25616260 BLAKE2B 455004ff7ce3f7517c6b06767e9d1656bff6b93f822d363cbd42738e0f9ba988c243f600db5f20e24897c27faaf5c458072e2bc9c97cf92803f76299cf3010b8 SHA512 b5af59cdd3cf70dfae0769ed35eb6ce00a6f01d05eefcb687f322420faa2ee5aabf83394249c2ab7f7f1241d3fd09c2f0412666b2dbd27b91e7bc3622f925f74
+EBUILD advancemame-3.7.ebuild 2156 BLAKE2B 269e0044b610bf6c51d2de3cc689c3b4cf6a8529d66b94d08344404ae21eb64c5e225a7651e4639fff08373936a029d3815b32bc461c3706168d18bca7066546 SHA512 0cbe417469a221e735bdfc71b02f1b69e487e9fa903a7ff94a967ef7cc2364966ebf7107985d2cdbfdd760ee5b9492c60e2623782422f20c1e2c7aca1b86ba0d
+MISC metadata.xml 1139 BLAKE2B 0722cccd2aa4d9e24eb990e460c91d8df503c1adffa680ac5e1f2b900bdfc93099feb06aab43b43ce27defc3183c6b75c594ce99e7f1396f5512babfc9de68d0 SHA512 a9a85b10cfbf6c7a75c317db8d242d29655d14d9891b897171161af613221fe93ad776ddb53fcddd14f08295d1e02c3c3fbccdce027e2a0d1c434fe60e49f349
diff --git a/games-emulation/advancemame/advancemame-3.7.ebuild b/games-emulation/advancemame/advancemame-3.7.ebuild
new file mode 100644
index 000000000000..c371c14107c3
--- /dev/null
+++ b/games-emulation/advancemame/advancemame-3.7.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools flag-o-matic
+
+DESCRIPTION="GNU/Linux port of the MAME emulator with GUI menu"
+HOMEPAGE="http://www.advancemame.it/"
+SRC_URI="https://github.com/amadvance/advancemame/releases/download/v${PV}/${P}.tar.gz"
+
+# Fetch too big upstream patch
+SRC_URI+=" https://github.com/amadvance/advancemame/commit/70f099ac49786a287ebd3949ce8f8670a5731abd.patch -> ${PN}-3.7-use_pkgconfig_for_freetype_and_sdl.patch"
+
+LICENSE="GPL-2 XMAME"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa fbcon oss truetype"
+
+# sdl is required (bug #158417)
+RDEPEND="
+ app-arch/unzip
+ app-arch/zip
+ dev-libs/expat
+ media-libs/libsdl2
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ truetype? ( media-libs/freetype:2 )
+"
+DEPEND="${RDEPEND}
+ virtual/os-headers
+ virtual/pkgconfig
+ x86? ( >=dev-lang/nasm-0.98 )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.2-pic.patch"
+ "${FILESDIR}"/${PN}-1.2-verboselog.patch
+
+ # Patches from upstream
+ "${FILESDIR}/${P}-move_aclocal_to_acinclude.patch"
+ "${DISTDIR}/${P}-use_pkgconfig_for_freetype_and_sdl.patch"
+ "${FILESDIR}/${P}-remove_static_configure_option.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+
+ sed -i -e 's/"-s"//' configure || die
+
+ use x86 && ln -s $(type -P nasm) "${T}/${CHOST}-nasm"
+ ln -s $(type -P sdl2-config) "${T}/${CHOST}-sdl2-config"
+}
+
+src_configure() {
+ # Fix for bug #78030
+ if use ppc; then
+ append-ldflags "-Wl,--relax"
+ fi
+
+ PATH="${PATH}:${T}"
+ econf \
+ --enable-expat \
+ --enable-sdl2 \
+ --disable-sdl \
+ --enable-zlib \
+ --disable-slang \
+ --disable-svgalib \
+ $(use_enable alsa) \
+ $(use_enable fbcon fb) \
+ $(use_enable oss) \
+ $(use_enable truetype freetype) \
+ $(use_enable x86 asm)
+}
+
+src_compile() {
+ STRIPPROG=true emake
+}
+
+src_install() {
+ local f
+
+ for f in adv* ; do
+ if [[ -L "${f}" ]] ; then
+ dobin "${f}"
+ fi
+ done
+
+ insinto "/usr/share/advance"
+ doins support/event.dat
+ keepdir "/usr/share/advance/"{artwork,diff,image,rom,sample,snap}
+
+ dodoc HISTORY README RELEASE
+ cd doc
+ dodoc *.txt
+ HTMLDOCS="*.html" einstalldocs
+
+ for f in *.1 ; do
+ newman ${f} ${f/1/6}
+ done
+}
diff --git a/games-emulation/advancemame/files/advancemame-1.2-pic.patch b/games-emulation/advancemame/files/advancemame-1.2-pic.patch
new file mode 100644
index 000000000000..049befbfac2c
--- /dev/null
+++ b/games-emulation/advancemame/files/advancemame-1.2-pic.patch
@@ -0,0 +1,13 @@
+--- ./advance/blit/blit.c.orig 2004-12-19 01:01:46.039956536 -0500
++++ ./advance/blit/blit.c 2004-12-19 01:01:19.566981040 -0500
+@@ -28,6 +28,10 @@
+ * do so, delete this exception statement from your version.
+ */
+
++#if defined(USE_ASM_INLINE) && defined(__PIC__)
++# undef USE_ASM_INLINE
++#endif
++
+ #include "portable.h"
+
+ #include "blit.h"
diff --git a/games-emulation/advancemame/files/advancemame-1.2-verboselog.patch b/games-emulation/advancemame/files/advancemame-1.2-verboselog.patch
new file mode 100644
index 000000000000..b72c1224e75f
--- /dev/null
+++ b/games-emulation/advancemame/files/advancemame-1.2-verboselog.patch
@@ -0,0 +1,42 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Sun Feb 17 03:39:55 UTC 2013
+Subject: build system
+
+ make build log verbose
+
+--- advancemame-1.2/Makefile.in
++++ advancemame-1.2/Makefile.in
+@@ -77,21 +77,21 @@
+ srcdir=@srcdir@
+ # Don't add the prefix @. This command must be used also in a shell script
+ INSTALL=@INSTALL@
+-CC=@@CC@
+-CXX=@@CXX@
+-LD=@@CC@
+-LDXX=@@CXX@
+-AR=@@AR@
+-ASM=@@ASM@
+-RC=@@RC@
++CC=@CC@
++CXX=@CXX@
++LD=@CC@
++LDXX=@CXX@
++AR=@AR@
++ASM=@ASM@
++RC=@RC@
+ LN_S=@@LN_S@
+ MD=-@@MKDIR@ -p
+ RM=@@RM@ -f
+ ECHO=@@ECHO@
+-CC_FOR_BUILD=@@CC_FOR_BUILD@
+-LD_FOR_BUILD=@@CC_FOR_BUILD@
+-CXX_FOR_BUILD=@@CXX_FOR_BUILD@
+-LDXX_FOR_BUILD=@@CXX_FOR_BUILD@
++CC_FOR_BUILD=@CC_FOR_BUILD@
++LD_FOR_BUILD=@CC_FOR_BUILD@
++CXX_FOR_BUILD=@CXX_FOR_BUILD@
++LDXX_FOR_BUILD=@CXX_FOR_BUILD@
+ EXE=@EXE@
+ EXE_FOR_BUILD=@EXE_FOR_BUILD@
+ SDLCFLAGS=@SDLCFLAGS@
+
diff --git a/games-emulation/advancemame/files/advancemame-3.7-move_aclocal_to_acinclude.patch b/games-emulation/advancemame/files/advancemame-3.7-move_aclocal_to_acinclude.patch
new file mode 100644
index 000000000000..4a30e179ae27
--- /dev/null
+++ b/games-emulation/advancemame/files/advancemame-3.7-move_aclocal_to_acinclude.patch
@@ -0,0 +1,78 @@
+From b0edfe1e5bb1a705fad539e5ab1c299d38dcf9d4 Mon Sep 17 00:00:00 2001
+From: Andrea Mazzoleni <amadvance@gmail.com>
+Date: Tue, 8 May 2018 18:55:39 +0200
+Subject: [PATCH 1/3] Use acinclude instead of aclocal
+
+aclocal.m4 is generated automatically, and we don't have to lose the content.
+---
+ acinclude.m4 | 20 ++++++++++++++++++++
+ aclocal.m4 | 29 ++++++++++++-----------------
+ 2 files changed, 32 insertions(+), 17 deletions(-)
+ create mode 100644 acinclude.m4
+
+diff --git a/acinclude.m4 b/acinclude.m4
+new file mode 100644
+index 00000000..ceed823a
+--- /dev/null
++++ b/acinclude.m4
+@@ -0,0 +1,20 @@
++dnl @synopsis AC_CHECK_CC_OPT(flag, ifyes, ifno)
++dnl
++dnl Shows a message as like "checking wether gcc accepts flag ... no"
++dnl and executess ifyes or ifno.
++
++AC_DEFUN([AC_CHECK_CC_OPT],
++[
++AC_MSG_CHECKING([whether ${CC-cc} accepts $1])
++echo 'void f(){}' > conftest.c
++if test -z "`${CC-cc} -c $1 conftest.c 2>&1`"; then
++ AC_MSG_RESULT([yes])
++ $2
++else
++ AC_MSG_RESULT([no])
++ $3
++fi
++rm -f conftest*
++])
++
++
+diff --git a/aclocal.m4 b/aclocal.m4
+index d6e7b527..56e944be 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -1,20 +1,15 @@
+-dnl @synopsis AC_CHECK_CC_OPT(flag, ifyes, ifno)
+-dnl
+-dnl Shows a message as like "checking wether gcc accepts flag ... no"
+-dnl and executess ifyes or ifno.
++# generated automatically by aclocal 1.15 -*- Autoconf -*-
+
+-AC_DEFUN(AC_CHECK_CC_OPT,
+-[
+-AC_MSG_CHECKING([whether ${CC-cc} accepts $1])
+-echo 'void f(){}' > conftest.c
+-if test -z "`${CC-cc} -c $1 conftest.c 2>&1`"; then
+- AC_MSG_RESULT([yes])
+- $2
+-else
+- AC_MSG_RESULT([no])
+- $3
+-fi
+-rm -f conftest*
+-])
++# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++# PARTICULAR PURPOSE.
++
++m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
++m4_include([acinclude.m4])
+--
+2.17.0
+
diff --git a/games-emulation/advancemame/files/advancemame-3.7-remove_static_configure_option.patch b/games-emulation/advancemame/files/advancemame-3.7-remove_static_configure_option.patch
new file mode 100644
index 000000000000..342ba1c5c07a
--- /dev/null
+++ b/games-emulation/advancemame/files/advancemame-3.7-remove_static_configure_option.patch
@@ -0,0 +1,41 @@
+From 890af36a3939f0978af779caa878ddeb44183d8d Mon Sep 17 00:00:00 2001
+From: Andrea Mazzoleni <amadvance@gmail.com>
+Date: Tue, 8 May 2018 19:32:44 +0200
+Subject: [PATCH 3/3] Remove the --enable-static configure option
+
+I doubt it still work and it doesn't make sense anymore.
+---
+ configure.ac | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4e609993..1c94e037 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -139,13 +139,6 @@ AC_ARG_ENABLE(
+ )
+ AC_SUBST([CONF_DEBUG],[$ac_enable_debug])
+
+-AC_ARG_ENABLE(
+- [static],
+- AC_HELP_STRING([--enable-static],[enable static compilation. (default no)]),
+- [ac_enable_static=$enableval],
+- [ac_enable_static=no]
+-)
+-
+ AC_ARG_ENABLE(
+ [bare],
+ AC_HELP_STRING([--enable-bare],[enable compilation without drivers. (default no)]),
+@@ -232,9 +225,6 @@ if test $ac_auto_ldflags = yes ; then
+ else
+ LDFLAGS="-s"
+ fi
+- if test $ac_enable_static = yes ; then
+- LDFLAGS="-static $LDFLAGS"
+- fi
+ if test ! -z $ac_host_ldflags; then
+ LDFLAGS="$ac_host_ldflags $LDFLAGS"
+ fi
+--
+2.17.0
+
diff --git a/games-emulation/advancemame/metadata.xml b/games-emulation/advancemame/metadata.xml
new file mode 100644
index 000000000000..7583d81c6809
--- /dev/null
+++ b/games-emulation/advancemame/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+AdvanceMAME and AdvanceMESS are unofficial MAME and MESS versions with an advanced video support for
+helping the use with TVs, Arcade Monitors, Fixed Frequencies Monitors and also for PC Monitors.
+
+They run in GNU/Linux, Mac OS X, DOS, Windows and in all the other platforms supported by the SDL library.
+
+The main difference compared with the official emulators is that the Advance versions program directly the
+video board to always get a video mode with the correct size and frequency.
+
+Generally the Advance emulators are able to use a video mode which doesn't require any stretching or other
+unneeded effects to match the original arcade display. When the stretching is required by hardware
+limitations you can anyway choice from different types of stretch.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">advancemame</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/advancemenu-2.7 b/games-emulation/advancemenu-2.7
deleted file mode 100644
index ca1331d839fe..000000000000
--- a/games-emulation/advancemenu-2.7
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install postinst preinst prepare setup unpack
-DEPEND=dev-libs/expat alsa? ( media-libs/alsa-lib ) ncurses? ( sys-libs/ncurses:0 ) sdl? ( media-libs/libsdl ) slang? ( >=sys-libs/slang-1.4 ) !sdl? ( ( !fbcon? ( media-libs/libsdl ) ) ) truetype? ( >=media-libs/freetype-2 ) x86? ( >=dev-lang/nasm-0.98 ) fbcon? ( virtual/os-headers ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Frontend for AdvanceMAME, MAME, MESS, RAINE and any other emulator
-EAPI=5
-HOMEPAGE=http://advancemame.sourceforge.net/menu-readme.html
-IUSE=alsa debug fbcon ncurses oss sdl slang truetype
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-libs/expat alsa? ( media-libs/alsa-lib ) ncurses? ( sys-libs/ncurses:0 ) sdl? ( media-libs/libsdl ) slang? ( >=sys-libs/slang-1.4 ) !sdl? ( ( !fbcon? ( media-libs/libsdl ) ) ) truetype? ( >=media-libs/freetype-2 ) games-misc/games-envd
-SLOT=0
-SRC_URI=mirror://sourceforge/advancemame/advancemenu-2.7.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 base 983774947da124fb7d542ce25a218bb1 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc games 2bb3ede665927a68ffdb7c41eec7efde libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=1b0b6af20ff7d1d532331739d1f47e80
diff --git a/games-emulation/advancemenu-2.9 b/games-emulation/advancemenu-2.9
deleted file mode 100644
index 8d01aec760e3..000000000000
--- a/games-emulation/advancemenu-2.9
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install postinst prepare
-DEPEND=dev-libs/expat alsa? ( media-libs/alsa-lib ) ncurses? ( sys-libs/ncurses:0 ) sdl? ( media-libs/libsdl ) slang? ( >=sys-libs/slang-1.4 ) !sdl? ( ( !fbcon? ( media-libs/libsdl ) ) ) truetype? ( >=media-libs/freetype-2 ) x86? ( >=dev-lang/nasm-0.98 ) fbcon? ( virtual/os-headers ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Frontend for AdvanceMAME, MAME, MESS, RAINE and any other emulator
-EAPI=6
-HOMEPAGE=http://advancemame.sourceforge.net/menu-readme.html
-IUSE=alsa debug fbcon ncurses oss sdl slang truetype
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-libs/expat alsa? ( media-libs/alsa-lib ) ncurses? ( sys-libs/ncurses:0 ) sdl? ( media-libs/libsdl ) slang? ( >=sys-libs/slang-1.4 ) !sdl? ( ( !fbcon? ( media-libs/libsdl ) ) ) truetype? ( >=media-libs/freetype-2 )
-SLOT=0
-SRC_URI=mirror://sourceforge/advancemame/advancemenu-2.9.tar.gz https://dev.gentoo.org/~polynomial-c/advancemenu-2.9-use_pkgconfig_for_freetype_and_sdl.patch
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 libtool 0081a71a261724730ec4c248494f044d multilib 97f470f374f2e94ccab04a2fb21d811e toolchain-funcs 1e35303c63cd707f6c3422b4493d5607
-_md5_=a4999a03de302e59874ef5b15c0cd998
diff --git a/games-emulation/advancemenu/Manifest b/games-emulation/advancemenu/Manifest
new file mode 100644
index 000000000000..09387f7aa4b8
--- /dev/null
+++ b/games-emulation/advancemenu/Manifest
@@ -0,0 +1,9 @@
+AUX advancemenu-2.7-alsa-pkg-config.patch 458 BLAKE2B 74b2d6bc6d5aca8cb2ea70b51ecbe3acfdb735f8dea5bc28696079c28a83877296dcbfc57457822a87ac25d25538af0d4d9726d3e026335f6f3cb1e489771b6c SHA512 d1a97d71ea9e5e412db22925a613f59848486586f5635a60fb0acce376b8c6217ef09a6228dfc39b604294b99e3136a849cb9124b55606e32d9e10c48cb9111e
+AUX advancemenu-2.7-pic.patch 272 BLAKE2B 9e486e8d1eb5e1073252e4484ff02dcbe1b2cceab1b4defb678ef6190e3e5604e3d06142dc9da55b16bb82a069f979943fb460d2b352b66fd55cb96ef9b6bfc8 SHA512 600ac7607374ab2e7654303b8205ac737c7b7aae41c23ea1bd005943361df5579207a91658ec4f3ab9f5f802d87d65336efed71894e2e87c0ce19200c769df9b
+AUX advancemenu-2.9-destdir.patch 3419 BLAKE2B 816edf68becb74022e879ea8812d2ba56d2071cdd6167b556c0805566e49c0025051272c951180f609e13f76afc596e3c7af93c00afa240626399c910e714051 SHA512 8fcf78ae0c1eebe672f0f823a98cdd8afef4efa1fccaa10f50131c577629a1f013c397267c6f990537efc5f6491726454e886c5db1c88245cad0a30b6c8c809f
+DIST advancemenu-2.7.tar.gz 2371297 BLAKE2B 43b468f963ecc2ef99766cf9177d7da2edb4c7497f62d9344e80f6c54f2c082ddef294697b7f6438b2959eefc27ca2c05e5744019c55c9f88f59155507622582 SHA512 72aa75b189e4507ce0fe1c5203476833fd04ec9238102631061ed82c2894890044ae40c82154a76533b6ba0a255c42cdfe2ab5c0f497d595783fa13ea32c71bb
+DIST advancemenu-2.9-use_pkgconfig_for_freetype_and_sdl.patch 18514 BLAKE2B b20922280c72ec151c3611ab3247391bd85785ee3db92d4bbd88ed0f0e50a8351a2b0cc63c2bf10aabba8a2bf57bcc5392230af1ed0eaabbfb28f5e34bc4785c SHA512 f68c2b42b48a9e768ecda54b0319148ed5503670f19be5cd4b23f150c6df9a43a053a0e64c8906836f461b49986c650f7e9f3952a5cf1309db66a79ea061123c
+DIST advancemenu-2.9.tar.gz 2515021 BLAKE2B caccbd311b43699766f2928c78983e7c3c45149d8733ea0795212c4f204828a8f4f22d05becd891947d9adce90d009e4d9b01ebfb0b5698ee9411a09d51c26b7 SHA512 ad19970ac9682b03fcfac36ab71cac1ce43aa88b7323ab6ce3a13ae45a29161cd654ce516115e6a441987055b0e9a47d15abae8ca9875753b81f5d7799908386
+EBUILD advancemenu-2.7.ebuild 2294 BLAKE2B a51023d7f931bb1b3ef47bcade4971bc8cfaae9a765c05b674de241a3155248e8faddf2437499818b866896f21a621069ffe5cc1bb78aa05ac98e09e3e47fb51 SHA512 2185634d2eeccb14800fddd08e88c39aab3c09acd1811ce5ebb161eee12e86933645dbdbdbb75af81146dadd1d54068393923602dfeb03c8fa6d0f4461f5dcec
+EBUILD advancemenu-2.9.ebuild 2237 BLAKE2B a8c0fe65acfcdb17e0d2610e8cf62018cc47557a7026f223deef2d125dacacb748859a0e39003d1c1f01c16e9a414f604d4ceb8c1a1dbe889c8ccced0e6d05ac SHA512 b657f77cbd4ca97be357a0ca56a30b84898a193d2440432c81769acc44f822e0969fb6aeaf620e4ee84515ef3c72dea78cd0b9d39215ca53e32304c6bc5e2046
+MISC metadata.xml 334 BLAKE2B 9c8f19757cfe814fe5650009b03d9eb653e3937cf30b4288dfa616a894560bdc81edba8b1ad235f34f5200a2c7ae8e9b19ba0e9f1e0ec5a2560b806ac9e184d8 SHA512 18cabfd831489b32b4449794c06a28425d91dab0c2868038fb48c94728fc16ccca268ae93a4f4a51be01c5901591582e6df2523460ba4ba98719436944577e1f
diff --git a/games-emulation/advancemenu/advancemenu-2.7.ebuild b/games-emulation/advancemenu/advancemenu-2.7.ebuild
new file mode 100644
index 000000000000..52e1f2e5ecd9
--- /dev/null
+++ b/games-emulation/advancemenu/advancemenu-2.7.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit autotools eutils games
+
+DESCRIPTION="Frontend for AdvanceMAME, MAME, MESS, RAINE and any other emulator"
+HOMEPAGE="http://advancemame.sourceforge.net/menu-readme.html"
+SRC_URI="mirror://sourceforge/advancemame/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa debug fbcon ncurses oss sdl slang truetype"
+
+RDEPEND="dev-libs/expat
+ alsa? ( media-libs/alsa-lib )
+ ncurses? ( sys-libs/ncurses:0 )
+ sdl? ( media-libs/libsdl )
+ slang? ( >=sys-libs/slang-1.4 )
+ !sdl? ( ( !fbcon? ( media-libs/libsdl ) ) )
+ truetype? ( >=media-libs/freetype-2 )"
+DEPEND="${RDEPEND}
+ x86? ( >=dev-lang/nasm-0.98 )
+ fbcon? ( virtual/os-headers )"
+
+src_prepare() {
+ # pic patch - bug #142021
+ epatch \
+ "${FILESDIR}"/${P}-alsa-pkg-config.patch \
+ "${FILESDIR}"/${P}-pic.patch
+ sed -i -e 's/"-s"//' configure.ac || die
+
+ use x86 && ln -s $(type -P nasm) "${T}/${CHOST}-nasm"
+ use sdl && ln -s $(type -P sdl-config) "${T}/${CHOST}-sdl-config"
+ use !sdl && use !fbcon && ln -s $(type -P sdl-config) "${T}/${CHOST}-sdl-config"
+ use truetype && ln -s $(type -P freetype-config) "${T}/${CHOST}-freetype-config"
+ eautoreconf
+}
+
+src_configure() {
+ export PATH="${PATH}:${T}"
+ egamesconf \
+ --enable-expat \
+ --enable-zlib \
+ --disable-svgalib \
+ --disable-static \
+ $(use_enable alsa) \
+ $(use_enable debug) \
+ $(use_enable fbcon fb) \
+ $(use_enable ncurses) \
+ $(use_enable truetype freetype) \
+ $(use_enable oss) \
+ $(use_enable sdl) \
+ $(use_enable slang) \
+ $(use !sdl && use !fbcon && echo --enable-sdl) \
+ $(use_enable x86 asm)
+}
+
+src_compile() {
+ STRIPPROG=true emake
+}
+
+src_install() {
+ dogamesbin advmenu
+ dodoc HISTORY README RELEASE doc/*.txt
+ doman doc/{advmenu,advdev}.1
+ dohtml doc/*.html
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ echo
+ elog "Execute:"
+ elog " advmenu -default"
+ elog "to generate a config file"
+ elog
+ elog "An example emulator config found in advmenu.rc:"
+ elog " emulator \"snes9x\" generic \"${GAMES_BINDIR}/snes9x\" \"%f\""
+ elog " emulator_roms \"snes9x\" \"/home/user/myroms\""
+ elog " emulator_roms_filter \"snes9x\" \"*.smc;*.sfc\""
+ elog
+ elog "For more information, see the advmenu man page."
+}
diff --git a/games-emulation/advancemenu/advancemenu-2.9.ebuild b/games-emulation/advancemenu/advancemenu-2.9.ebuild
new file mode 100644
index 000000000000..532a8cfeca85
--- /dev/null
+++ b/games-emulation/advancemenu/advancemenu-2.9.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools
+
+DESCRIPTION="Frontend for AdvanceMAME, MAME, MESS, RAINE and any other emulator"
+HOMEPAGE="http://advancemame.sourceforge.net/menu-readme.html"
+SRC_URI="mirror://sourceforge/advancemame/${P}.tar.gz"
+
+# Too big to put into FILESDIR
+SRC_URI+=" https://dev.gentoo.org/~polynomial-c/${PN}-2.9-use_pkgconfig_for_freetype_and_sdl.patch"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa debug fbcon ncurses oss sdl slang truetype"
+
+RDEPEND="dev-libs/expat
+ alsa? ( media-libs/alsa-lib )
+ ncurses? ( sys-libs/ncurses:0 )
+ sdl? ( media-libs/libsdl )
+ slang? ( >=sys-libs/slang-1.4 )
+ !sdl? ( ( !fbcon? ( media-libs/libsdl ) ) )
+ truetype? ( >=media-libs/freetype-2 )"
+DEPEND="${RDEPEND}
+ x86? ( >=dev-lang/nasm-0.98 )
+ fbcon? ( virtual/os-headers )"
+
+PATCHES=(
+ # pic patch - bug #142021
+ "${FILESDIR}"/${PN}-2.7-pic.patch
+ "${FILESDIR}/${PN}-2.9-destdir.patch"
+ "${DISTDIR}/${PN}-2.9-use_pkgconfig_for_freetype_and_sdl.patch"
+)
+
+src_prepare() {
+ default
+ sed -i -e 's/"-s"//' configure.ac || die
+
+ use x86 && ln -s $(type -P nasm) "${T}/${CHOST}-nasm"
+ eautoreconf
+}
+
+src_configure() {
+ export PATH="${PATH}:${T}"
+ local myeconfargs=(
+ --enable-expat
+ --enable-zlib
+ --disable-svgalib
+ $(use_enable alsa)
+ $(use_enable debug)
+ $(use_enable fbcon fb)
+ $(use_enable ncurses)
+ $(use_enable truetype freetype)
+ $(use_enable oss)
+ $(use_enable sdl)
+ $(use_enable slang)
+ $(use !sdl && use !fbcon && echo --enable-sdl)
+ $(use_enable x86 asm)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ STRIPPROG=true emake
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc HISTORY README RELEASE doc/*.txt
+ doman doc/{advmenu,advdev}.1
+ docinto html
+ dodoc doc/*.html
+}
+
+pkg_postinst() {
+ echo
+ elog "Execute:"
+ elog " advmenu -default"
+ elog "to generate a config file"
+ elog
+ elog "An example emulator config found in advmenu.rc:"
+ elog " emulator \"snes9x\" generic \"${GAMES_BINDIR}/snes9x\" \"%f\""
+ elog " emulator_roms \"snes9x\" \"/home/user/myroms\""
+ elog " emulator_roms_filter \"snes9x\" \"*.smc;*.sfc\""
+ elog
+ elog "For more information, see the advmenu man page."
+}
diff --git a/games-emulation/advancemenu/files/advancemenu-2.7-alsa-pkg-config.patch b/games-emulation/advancemenu/files/advancemenu-2.7-alsa-pkg-config.patch
new file mode 100644
index 000000000000..1b0f8a8df9cb
--- /dev/null
+++ b/games-emulation/advancemenu/files/advancemenu-2.7-alsa-pkg-config.patch
@@ -0,0 +1,20 @@
+--- advancemenu-2.6.orig/configure.ac
++++ advancemenu-2.6/configure.ac
+@@ -512,7 +512,7 @@
+ [snd_pcm_open],
+ [ac_lib_alsa=yes],
+ [ac_lib_alsa=no],
+- [-lm]
++ [`pkg-config alsa --libs`]
+ )
+ if test $ac_lib_alsa = yes; then
+ AC_MSG_CHECKING([for ALSA])
+@@ -531,7 +531,7 @@
+ [snd_pcm_open],
+ [],
+ [AC_MSG_ERROR([the ALSA library is missing])],
+- [-lm]
++ [`pkg-config alsa --libs`]
+ )
+ AC_MSG_CHECKING([for ALSA version])
+ AC_TRY_COMPILE([
diff --git a/games-emulation/advancemenu/files/advancemenu-2.7-pic.patch b/games-emulation/advancemenu/files/advancemenu-2.7-pic.patch
new file mode 100644
index 000000000000..62f073bed83b
--- /dev/null
+++ b/games-emulation/advancemenu/files/advancemenu-2.7-pic.patch
@@ -0,0 +1,13 @@
+--- ./advance/blit/blit.c.orig
++++ ./advance/blit/blit.c
+@@ -28,6 +28,10 @@
+ * do so, delete this exception statement from your version.
+ */
+
++#if defined(USE_ASM_INLINE) && defined(__PIC__)
++# undef USE_ASM_INLINE
++#endif
++
+ #include "portable.h"
+
+ #include "blit.h"
diff --git a/games-emulation/advancemenu/files/advancemenu-2.9-destdir.patch b/games-emulation/advancemenu/files/advancemenu-2.9-destdir.patch
new file mode 100644
index 000000000000..9ebef883ae25
--- /dev/null
+++ b/games-emulation/advancemenu/files/advancemenu-2.9-destdir.patch
@@ -0,0 +1,112 @@
+--- advancemenu-2.9/advance/advance.mak
++++ advancemenu-2.9/advance/advance.mak
+@@ -284,45 +284,45 @@
+ # Common install
+
+ pkgdir = $(datadir)/advance
+-pkgdocdir = $(docdir)/advance
++pkgdocdir = $(docdir)
+
+ install-dirs:
+- -$(INSTALL_PROGRAM_DIR) $(bindir)
+- -$(INSTALL_DATA_DIR) $(pkgdir)
+- -$(INSTALL_DATA_DIR) $(pkgdocdir)
+- -$(INSTALL_MAN_DIR) $(mandir)/man1
++ -$(INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir)
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdocdir)
++ -$(INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man1
+ ifneq ($(wildcard $(EMUSRC)),)
+- -$(INSTALL_DATA_DIR) $(pkgdir)/rom
+- -$(INSTALL_DATA_DIR) $(pkgdir)/sample
+- -$(INSTALL_DATA_DIR) $(pkgdir)/artwork
+- -$(INSTALL_DATA_DIR) $(pkgdir)/image
+- -$(INSTALL_DATA_DIR) $(pkgdir)/crc
+- -$(INSTALL_DATA_DIR) $(pkgdir)/snap
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/rom
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/sample
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/artwork
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/image
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/crc
++ -$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/snap
+ endif
+
+ install-data: $(INSTALL_DATAFILES) $(INSTALL_ROMFILES) $(INSTALL_SAMPLEFILES) $(INSTALL_SNAPFILES)
+ ifdef INSTALL_DATAFILES
+ @for i in $(INSTALL_DATAFILES); do \
+ echo "$(INSTALL_DATA) $$i $(pkgdir)"; \
+- $(INSTALL_DATA) $$i $(pkgdir); \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdir); \
+ done
+ endif
+ ifdef INSTALL_ROMFILES
+ @for i in $(INSTALL_ROMFILES); do \
+ echo "$(INSTALL_DATA) $$i $(pkgdir)/rom"; \
+- $(INSTALL_DATA) $$i $(pkgdir)/rom; \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdir)/rom; \
+ done
+ endif
+ ifdef INSTALL_SAMPLEFILES
+ @for i in $(INSTALL_SAMPLEFILES); do \
+ echo "$(INSTALL_DATA) $$i $(pkgdir)/sample"; \
+- $(INSTALL_DATA) $$i $(pkgdir)/sample; \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdir)/sample; \
+ done
+ endif
+ ifdef INSTALL_SNAPFILES
+ @for i in $(INSTALL_SNAPFILES); do \
+ echo "$(INSTALL_DATA) $$i $(pkgdir)/snap"; \
+- $(INSTALL_DATA) $$i $(pkgdir)/snap; \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdir)/snap; \
+ done
+ endif
+
+@@ -351,7 +351,7 @@
+ install-bin: $(INSTALL_BINFILES)
+ @for i in $(INSTALL_BINFILES); do \
+ echo "$(INSTALL_PROGRAM) $$i $(bindir)"; \
+- $(INSTALL_PROGRAM) $$i $(bindir); \
++ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir); \
+ done
+
+ uninstall-bin:
+@@ -363,7 +363,7 @@
+ ifdef INSTALL_DOCFILES
+ @for i in $(INSTALL_DOCFILES); do \
+ echo "$(INSTALL_DATA) $$i $(pkgdocdir)"; \
+- $(INSTALL_DATA) $$i $(pkgdocdir); \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdocdir); \
+ done
+ endif
+
+@@ -378,7 +378,7 @@
+ ifdef INSTALL_MANFILES
+ @for i in $(INSTALL_MANFILES); do \
+ echo "$(INSTALL_DATA) $$i $(mandir)/man1"; \
+- $(INSTALL_DATA) $$i $(mandir)/man1; \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man1; \
+ done
+ endif
+
+@@ -401,7 +401,7 @@
+ -rmdir $(pkgdocdir)
+ endif
+
+-install: install-dirs install-bin install-data install-doc install-man
++install: install-dirs install-bin install-data
+
+ uninstall: uninstall-bin uninstall-data uninstall-doc uninstall-man uninstall-dirs
+
+--- advancemenu-2.9/configure.ac
++++ advancemenu-2.9/configure.ac
+@@ -1158,8 +1158,8 @@
+
+ dnl Final
+ AC_SUBST([CONF_LIB_DIRECT],[$ac_lib_direct_flag])
+-AC_SUBST([mandir],['${prefix}/man'])
+-AC_SUBST([docdir],['${prefix}/doc'])
++AC_SUBST([mandir],['${prefix}/share/man'])
++AC_SUBST([docdir],['${prefix}/share/doc/${PF}'])
+ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT
+
diff --git a/games-emulation/advancemenu/metadata.xml b/games-emulation/advancemenu/metadata.xml
new file mode 100644
index 000000000000..879ee3497adc
--- /dev/null
+++ b/games-emulation/advancemenu/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">advancemame</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/advancescan-1.16-r1 b/games-emulation/advancescan-1.16-r1
deleted file mode 100644
index 643884251555..000000000000
--- a/games-emulation/advancescan-1.16-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=install prepare
-DEPEND=dev-libs/expat sys-libs/zlib >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=A command line rom manager for MAME, MESS, AdvanceMAME, AdvanceMESS and Raine
-EAPI=6
-HOMEPAGE=http://advancemame.sourceforge.net/scan-readme.html
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-libs/expat sys-libs/zlib
-SLOT=0
-SRC_URI=mirror://sourceforge/advancemame/advancescan-1.16.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=4b0aabdd30827471ee333ad279753be3
diff --git a/games-emulation/advancescan/Manifest b/games-emulation/advancescan/Manifest
new file mode 100644
index 000000000000..be6ff5210622
--- /dev/null
+++ b/games-emulation/advancescan/Manifest
@@ -0,0 +1,5 @@
+AUX advancescan-1.16-gcc6.patch 24440 BLAKE2B bd7b25859798cc3935fedc6d60ea822189301232426e2b071665aaf6af3a85f16d93c22373e8ad1b46da96ab577fceebe681e86021452aa20e24b0e0fd9b2a8a SHA512 e758ba7d900f1ca5fd6f32c3572fbf4c2a7cf77877f926511bd724ec5ec8ddb9697244f5a582eeb5275188ae2c8a14e8388cac93365ac348e9cc60835884a499
+AUX advancescan-1.16-sys-expat.patch 1543 BLAKE2B 72143e1dec74c828c4051a5b198f706caf3385e1a982eca142fd6f2f4c7a2f3797fb732fd1086b4f3c5cf93560f67077720c14945f52ed388ce981db559230c4 SHA512 a9dc80b75a8b9dbad3fe6c156c4de0cafee171d820845ea7ff2f042b7f73fd6cd10d710c60fb8bf4cfdea139f527008958b445d01838a8fdf6c96d3e76c530f4
+DIST advancescan-1.16.tar.gz 316895 BLAKE2B 1ce2ec88a80cca8ff8d1fa09cba7b9c5583e42a3419bfd561bb184b53fe071c011b864ee813f0107667881112ca4adf01cd2b8e8148712927af1c82bc73f43c1 SHA512 6d359c160d54a0a1cd13db10f5fc9986fae4f1151e205024e40c21b0f933723351907156faec22a92561ad523151e3b7d4ff70a6eebbb6152bd3767063a31031
+EBUILD advancescan-1.16-r1.ebuild 752 BLAKE2B 5929dc6fe1808098966a167e1c82441aa3b105c1b27e4e98e7fbfea03607f35d319d76b8e9da9b39aaabb5f59a833594a8dcf7d014683e446766f932c02f8559 SHA512 70fd6345547813dc994b66a135badf8d0f85ff862dffe4a14cc0ebb2119a303e569b46059b6c1c88182253b73e2164f3171a62039e70f3cde954b8ff1066d2e4
+MISC metadata.xml 334 BLAKE2B 9c8f19757cfe814fe5650009b03d9eb653e3937cf30b4288dfa616a894560bdc81edba8b1ad235f34f5200a2c7ae8e9b19ba0e9f1e0ec5a2560b806ac9e184d8 SHA512 18cabfd831489b32b4449794c06a28425d91dab0c2868038fb48c94728fc16ccca268ae93a4f4a51be01c5901591582e6df2523460ba4ba98719436944577e1f
diff --git a/games-emulation/advancescan/advancescan-1.16-r1.ebuild b/games-emulation/advancescan/advancescan-1.16-r1.ebuild
new file mode 100644
index 000000000000..46c0c1379bcb
--- /dev/null
+++ b/games-emulation/advancescan/advancescan-1.16-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools eutils
+
+DESCRIPTION="A command line rom manager for MAME, MESS, AdvanceMAME, AdvanceMESS and Raine"
+HOMEPAGE="http://advancemame.sourceforge.net/scan-readme.html"
+SRC_URI="mirror://sourceforge/advancemame/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/expat
+ sys-libs/zlib"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-sys-expat.patch
+ "${FILESDIR}"/${P}-gcc6.patch
+)
+
+src_prepare() {
+ rm -rf expat
+ default
+ eautoreconf
+}
+
+src_install() {
+ dobin advscan advdiff
+ dodoc AUTHORS HISTORY README doc/*.txt advscan.rc.linux
+ doman doc/{advscan,advdiff}.1
+ dohtml doc/*.html
+}
diff --git a/games-emulation/advancescan/files/advancescan-1.16-gcc6.patch b/games-emulation/advancescan/files/advancescan-1.16-gcc6.patch
new file mode 100644
index 000000000000..1f9c73f6db60
--- /dev/null
+++ b/games-emulation/advancescan/files/advancescan-1.16-gcc6.patch
@@ -0,0 +1,520 @@
+--- advancescan-1.16/analyze.cc.old 2016-09-25 19:17:21.698171287 -0400
++++ advancescan-1.16/analyze.cc 2016-09-25 19:22:12.027465540 -0400
+@@ -33,467 +33,6 @@
+ { 0, 0, 0 }
+ };
+
+-char MAMEDK_DATA[] = {
+- 0x2e, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2e, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x20,
+- 0x5f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x5f, 0x20, 0x5f, 0x5f, 0x20, 0x5f,
+- 0x5f, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x5f, 0x20,
+- 0x5f, 0x20, 0x5f, 0x20, 0x5f, 0x5f, 0x20, 0x5f,
+- 0x5f, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x5f, 0x5f,
+- 0x20, 0x20, 0x20, 0x5f, 0x5f, 0x7c, 0x20, 0x7c,
+- 0x20, 0x7c, 0x20, 0x5f, 0x5f, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x7c, 0x20, 0x27, 0x5f, 0x20, 0x60, 0x20,
+- 0x5f, 0x20, 0x5c, 0x20, 0x2f, 0x20, 0x5f, 0x60,
+- 0x20, 0x7c, 0x20, 0x27, 0x5f, 0x20, 0x60, 0x20,
+- 0x5f, 0x20, 0x5c, 0x20, 0x2f, 0x20, 0x5f, 0x20,
+- 0x5c, 0x20, 0x2f, 0x20, 0x5f, 0x60, 0x20, 0x7c,
+- 0x20, 0x7c, 0x2f, 0x20, 0x2f, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c,
+- 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x28, 0x5f, 0x7c,
+- 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c,
+- 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x20, 0x5f, 0x5f,
+- 0x2f, 0x7c, 0x20, 0x28, 0x5f, 0x7c, 0x20, 0x7c,
+- 0x20, 0x20, 0x20, 0x3c, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x7c, 0x5f, 0x7c, 0x20, 0x7c, 0x5f, 0x7c,
+- 0x20, 0x7c, 0x5f, 0x7c, 0x5c, 0x5f, 0x5f, 0x2c,
+- 0x5f, 0x7c, 0x5f, 0x7c, 0x20, 0x7c, 0x5f, 0x7c,
+- 0x20, 0x7c, 0x5f, 0x7c, 0x5c, 0x5f, 0x5f, 0x5f,
+- 0x28, 0x5f, 0x29, 0x5f, 0x5f, 0x2c, 0x5f, 0x7c,
+- 0x5f, 0x7c, 0x5c, 0x5f, 0x5c, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x74,
+- 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
+- 0x2e, 0x6d, 0x61, 0x6d, 0x65, 0x2e, 0x64, 0x6b,
+- 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x3e, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x3c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x70, 0x72, 0x6f, 0x75, 0x64, 0x6c, 0x79,
+- 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74,
+- 0x73, 0x20, 0x72, 0x61, 0x66, 0x6c, 0x65, 0x73,
+- 0x69, 0x61, 0x2e, 0x7a, 0x69, 0x70, 0x20, 0x66,
+- 0x6f, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20,
+- 0x6d, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x22, 0x52, 0x61, 0x66, 0x66, 0x6c, 0x65,
+- 0x73, 0x69, 0x61, 0x22, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73,
+- 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67,
+- 0x68, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x6f, 0x72,
+- 0x65, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x2f, 0x20,
+- 0x53, 0x65, 0x67, 0x61, 0x20, 0x31, 0x39, 0x38,
+- 0x36, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x3e, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x3c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x59, 0x6f,
+- 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x68, 0x61,
+- 0x76, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,
+- 0x67, 0x61, 0x6d, 0x65, 0x20, 0x52, 0x4f, 0x4d,
+- 0x20, 0x4f, 0x4e, 0x4c, 0x59, 0x20, 0x69, 0x66,
+- 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65,
+- 0x20, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x6c, 0x79,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65,
+- 0x64, 0x20, 0x73, 0x6f, 0x2e, 0x20, 0x42, 0x79,
+- 0x20, 0x22, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x6c,
+- 0x79, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c,
+- 0x65, 0x64, 0x22, 0x20, 0x77, 0x65, 0x20, 0x6d,
+- 0x65, 0x61, 0x6e, 0x3a, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x59, 0x6f,
+- 0x75, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x74, 0x68,
+- 0x65, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c,
+- 0x20, 0x61, 0x72, 0x63, 0x61, 0x64, 0x65, 0x20,
+- 0x6f, 0x72, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x70,
+- 0x61, 0x6b, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20,
+- 0x52, 0x4f, 0x4d, 0x20, 0x79, 0x6f, 0x75, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61,
+- 0x72, 0x65, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x6c,
+- 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x20,
+- 0x55, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68,
+- 0x65, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69,
+- 0x67, 0x68, 0x74, 0x20, 0x6c, 0x61, 0x77, 0x73,
+- 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x55, 0x2e, 0x53, 0x2e, 0x2c, 0x20, 0x79, 0x6f,
+- 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x6e,
+- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x20, 0x74,
+- 0x6f, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x61, 0x20,
+- 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x20, 0x6f,
+- 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73,
+- 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20,
+- 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65,
+- 0x20, 0x70, 0x61, 0x69, 0x64, 0x20, 0x66, 0x6f,
+- 0x72, 0x2e, 0x20, 0x53, 0x69, 0x6e, 0x63, 0x65,
+- 0x20, 0x52, 0x4f, 0x4d, 0x53, 0x20, 0x63, 0x61,
+- 0x6e, 0x27, 0x74, 0x20, 0x62, 0x65, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+- 0x65, 0x64, 0x20, 0x28, 0x6e, 0x6f, 0x74, 0x20,
+- 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20,
+- 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x20,
+- 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65,
+- 0x29, 0x2c, 0x20, 0x52, 0x4f, 0x4d, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69,
+- 0x6d, 0x61, 0x67, 0x65, 0x73, 0x20, 0x61, 0x72,
+- 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64,
+- 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68,
+- 0x65, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
+- 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65,
+- 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x52, 0x65, 0x6d,
+- 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x74,
+- 0x68, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70, 0x6f,
+- 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e,
+- 0x20, 0x65, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f,
+- 0x72, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20,
+- 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x61,
+- 0x6d, 0x65, 0x73, 0x20, 0x28, 0x73, 0x6f, 0x20,
+- 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65,
+- 0x79, 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20,
+- 0x64, 0x69, 0x73, 0x73, 0x61, 0x70, 0x70, 0x65,
+- 0x61, 0x72, 0x29, 0x2c, 0x20, 0x74, 0x6f, 0x20,
+- 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x79, 0x6f, 0x75,
+- 0x72, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x20,
+- 0x6f, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20,
+- 0x50, 0x43, 0x20, 0x28, 0x73, 0x6f, 0x20, 0x74,
+- 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20,
+- 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x74, 0x69,
+- 0x65, 0x20, 0x75, 0x70, 0x20, 0x74, 0x68, 0x65,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x66, 0x61, 0x6d,
+- 0x69, 0x6c, 0x79, 0x20, 0x54, 0x56, 0x29, 0x20,
+- 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6b,
+- 0x65, 0x65, 0x70, 0x20, 0x61, 0x20, 0x62, 0x61,
+- 0x63, 0x6b, 0x75, 0x70, 0x20, 0x6f, 0x66, 0x20,
+- 0x67, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x79, 0x6f,
+- 0x75, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x69, 0x6e,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63,
+- 0x61, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,
+- 0x67, 0x61, 0x6d, 0x65, 0x20, 0x28, 0x6f, 0x72,
+- 0x20, 0x61, 0x72, 0x63, 0x61, 0x64, 0x65, 0x2f,
+- 0x68, 0x6f, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e,
+- 0x73, 0x6f, 0x6c, 0x65, 0x29, 0x20, 0x66, 0x61,
+- 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x76,
+- 0x65, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64,
+- 0x79, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64,
+- 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x49, 0x74, 0x27, 0x73,
+- 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x64, 0x75,
+- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
+- 0x20, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65,
+- 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x28,
+- 0x69, 0x6e, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20,
+- 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20,
+- 0x61, 0x6e, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x65, 0x6d, 0x75, 0x6c,
+- 0x61, 0x74, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f,
+- 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x29,
+- 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x59, 0x6f, 0x75,
+- 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x4e, 0x45,
+- 0x56, 0x45, 0x52, 0x20, 0x73, 0x65, 0x6c, 0x6c,
+- 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x52,
+- 0x4f, 0x4d, 0x53, 0x20, 0x66, 0x6f, 0x72, 0x20,
+- 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x2e, 0x20,
+- 0x4d, 0x6f, 0x73, 0x74, 0x20, 0x67, 0x61, 0x6d,
+- 0x65, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x70,
+- 0x61, 0x6e, 0x69, 0x65, 0x73, 0x20, 0x64, 0x6f,
+- 0x6e, 0x27, 0x74, 0x20, 0x6d, 0x69, 0x6e, 0x64,
+- 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73,
+- 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
+- 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,
+- 0x69, 0x72, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x27,
+- 0x73, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52,
+- 0x4f, 0x4d, 0x53, 0x20, 0x62, 0x65, 0x63, 0x61,
+- 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79,
+- 0x20, 0x6e, 0x6f, 0x20, 0x6c, 0x6f, 0x6e, 0x67,
+- 0x65, 0x72, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74,
+- 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68,
+- 0x65, 0x79, 0x20, 0x57, 0x49, 0x4c, 0x4c, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x6d, 0x69, 0x6e, 0x64, 0x20, 0x69, 0x66,
+- 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x6f, 0x6e, 0x65,
+- 0x20, 0x73, 0x65, 0x6c, 0x6c, 0x73, 0x20, 0x74,
+- 0x68, 0x65, 0x6d, 0x2e, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x59, 0x6f, 0x75,
+- 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x4e, 0x4f,
+- 0x54, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69,
+- 0x62, 0x75, 0x74, 0x65, 0x20, 0x52, 0x4f, 0x4d,
+- 0x53, 0x20, 0x74, 0x6f, 0x67, 0x65, 0x74, 0x68,
+- 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,
+- 0x65, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72,
+- 0x73, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x73, 0x20,
+- 0x61, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,
+- 0x65, 0x2e, 0x20, 0x41, 0x6e, 0x64, 0x20, 0x61,
+- 0x67, 0x61, 0x69, 0x6e, 0x2c, 0x20, 0x4e, 0x4f,
+- 0x20, 0x73, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67,
+- 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x59, 0x6f,
+- 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x4e,
+- 0x45, 0x56, 0x45, 0x52, 0x20, 0x68, 0x6f, 0x6c,
+- 0x64, 0x20, 0x6d, 0x61, 0x6d, 0x65, 0x2e, 0x64,
+- 0x6b, 0x20, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75,
+- 0x64, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x73,
+- 0x20, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63,
+- 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2c, 0x20,
+- 0x77, 0x65, 0x62, 0x6d, 0x61, 0x73, 0x74, 0x65,
+- 0x72, 0x73, 0x2c, 0x20, 0x65, 0x6d, 0x70, 0x6c,
+- 0x6f, 0x79, 0x65, 0x65, 0x73, 0x2c, 0x20, 0x73,
+- 0x74, 0x61, 0x66, 0x66, 0x20, 0x6f, 0x72, 0x20,
+- 0x61, 0x6e, 0x79, 0x62, 0x6f, 0x64, 0x79, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x65, 0x6c, 0x73, 0x65, 0x20, 0x72, 0x65, 0x6c,
+- 0x61, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20,
+- 0x74, 0x68, 0x69, 0x73, 0x20, 0x77, 0x65, 0x62,
+- 0x73, 0x69, 0x74, 0x65, 0x29, 0x20, 0x6f, 0x72,
+- 0x20, 0x6f, 0x75, 0x72, 0x20, 0x77, 0x65, 0x62,
+- 0x68, 0x6f, 0x73, 0x74, 0x73, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65,
+- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x69, 0x62, 0x6c,
+- 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e,
+- 0x79, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65,
+- 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x64, 0x20,
+- 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20,
+- 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66,
+- 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6c,
+- 0x65, 0x67, 0x61, 0x6c, 0x20, 0x61, 0x63, 0x74,
+- 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x61, 0x6b,
+- 0x65, 0x6e, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e,
+- 0x73, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x66,
+- 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x6f, 0x62, 0x65, 0x79, 0x69,
+- 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61,
+- 0x62, 0x6f, 0x76, 0x65, 0x20, 0x73, 0x74, 0x61,
+- 0x74, 0x65, 0x64, 0x20, 0x72, 0x75, 0x6c, 0x65,
+- 0x73, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x6f,
+- 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74,
+- 0x68, 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x73,
+- 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d,
+- 0x61, 0x6d, 0x65, 0x2e, 0x64, 0x6b, 0x20, 0x68,
+- 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64,
+- 0x75, 0x6d, 0x70, 0x65, 0x64, 0x20, 0x74, 0x68,
+- 0x65, 0x20, 0x52, 0x4f, 0x4d, 0x53, 0x20, 0x6f,
+- 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x77,
+- 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2c, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x72, 0x20,
+- 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x20,
+- 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72,
+- 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x61, 0x20,
+- 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20,
+- 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49,
+- 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20,
+- 0x61, 0x6e, 0x64, 0x20, 0x67, 0x61, 0x6d, 0x69,
+- 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x75,
+- 0x6e, 0x69, 0x74, 0x79, 0x2e, 0x20, 0x4e, 0x6f,
+- 0x20, 0x68, 0x61, 0x72, 0x6d, 0x20, 0x69, 0x73,
+- 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x64, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x6f,
+- 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f,
+- 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x65, 0x73, 0x2c,
+- 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,
+- 0x52, 0x4f, 0x4d, 0x53, 0x20, 0x6f, 0x6e, 0x20,
+- 0x74, 0x68, 0x69, 0x73, 0x20, 0x20, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x65,
+- 0x62, 0x73, 0x69, 0x74, 0x65, 0x20, 0x61, 0x72,
+- 0x65, 0x20, 0x6f, 0x66, 0x20, 0x67, 0x61, 0x6d,
+- 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,
+- 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x20, 0x6c,
+- 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x66, 0x6f,
+- 0x72, 0x20, 0x73, 0x61, 0x6c, 0x65, 0x2c, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x7c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66,
+- 0x72, 0x6f, 0x6d, 0x20, 0x77, 0x68, 0x69, 0x63,
+- 0x68, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x63,
+- 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x65, 0x73,
+- 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, 0x6f, 0x20,
+- 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x70,
+- 0x72, 0x6f, 0x66, 0x69, 0x74, 0x2e, 0x20, 0x20,
+- 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x0d, 0x0a,
+- 0x60, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+- 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0xb4, 0x0d, 0x0a
+-};
+-
+-#define MAMEDK_SIZE 3648
+-
+ analyze_entry::analyze_entry(const string& Aname, unsigned Asize, unsigned Acrc)
+ : name(Aname), size(Asize), crc(Acrc) {
+ }
+@@ -576,49 +115,12 @@
+ return true;
+ }
+
+-static void sset(char* dst, unsigned w, const char* s)
+-{
+- unsigned l = strlen(s);
+- if (l > w)
+- l = w;
+- unsigned b = (w - l) / 2;
+-
+- memset(dst, ' ', w);
+- memcpy(dst + b, s, l);
+-}
+-
+ analyze::analyze(const gamearchive& gar)
+ {
+ // insert some standard crc
+ for(analyze_entry_static* i=GARBAGE;i->size;++i) {
+ garbage.insert(*i);
+ }
+-
+- // insert the MAMEDK crc for the current info
+- for(game_by_name_set::const_iterator i=gar.begin();i!=gar.end();++i) {
+- char t0[128];
+- char t1[128];
+- char t2[128];
+- char name[64];
+-
+- snprintf(t0, sizeof(t0), "proudly presents %s.zip for your mame", i->name_get().c_str());
+- snprintf(t1, sizeof(t1), "\"%s\"", i->description_get().c_str());
+- snprintf(t2, sizeof(t2), "%s %s", i->manufacturer_get().c_str(), i->year_get().c_str());
+-
+- sset(MAMEDK_DATA + 64*9 + 1, 60, t0);
+- sset(MAMEDK_DATA + 64*11 + 1, 60, t1);
+- sset(MAMEDK_DATA + 64*13 + 1, 60, t2);
+-
+- analyze_entry_static e;
+-
+- snprintf(name, sizeof(name), "%s.txt", i->name_get().c_str());
+-
+- e.name = name;
+- e.size = MAMEDK_SIZE;
+- e.crc = crc_compute(MAMEDK_DATA, MAMEDK_SIZE);
+-
+- garbage.insert(e);
+- }
+ }
+
+ analyze_type analyze::operator()(const string& name, unsigned size, unsigned crc) const
diff --git a/games-emulation/advancescan/files/advancescan-1.16-sys-expat.patch b/games-emulation/advancescan/files/advancescan-1.16-sys-expat.patch
new file mode 100644
index 000000000000..0648a0cf068c
--- /dev/null
+++ b/games-emulation/advancescan/files/advancescan-1.16-sys-expat.patch
@@ -0,0 +1,77 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -30,6 +30,7 @@
+
+ # Checks for libraries.
+ AC_CHECK_LIB([z], [adler32], [], [AC_MSG_ERROR([the libz library is missing])])
++AC_CHECK_LIB([expat], [XML_Parse], [], [AC_MSG_ERROR([the expat library is missing])])
+
+ # Checks for header files.
+ AC_HEADER_STDC
+--- a/gamexml.cc
++++ b/gamexml.cc
+@@ -22,7 +22,7 @@
+
+ #include "game.h"
+ #include "strcov.h"
+-#include "expat/expat.h"
++#include <expat.h>
+
+ #include <string>
+ #include <iostream>
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -18,10 +18,7 @@
+ siglock.cc \
+ getopt.c \
+ snprintf.c \
+- lib/readinfo.c \
+- expat/xmlrole.c \
+- expat/xmlparse.c \
+- expat/xmltok.c
++ lib/readinfo.c
+
+ advscan_SOURCES = \
+ scan.cc \
+@@ -43,10 +40,7 @@
+ siglock.cc \
+ getopt.c \
+ snprintf.c \
+- lib/readinfo.c \
+- expat/xmlrole.c \
+- expat/xmlparse.c \
+- expat/xmltok.c
++ lib/readinfo.c
+
+ EXTRA_DIST = advscan.rc.linux advscan.rc.dos \
+ README AUTHORS HISTORY INSTALL COPYING \
+@@ -82,28 +76,7 @@
+ portable.h \
+ lib/readinfo.h \
+ lib/endianrw.h \
+- lib/extra.h \
+- expat/COPYING \
+- expat/README \
+- expat/ascii.h \
+- expat/asciitab.h \
+- expat/expat-1.95.8.diff \
+- expat/expat.h \
+- expat/iasciitab.h \
+- expat/expatcfg.h \
+- expat/expat_external.h \
+- expat/internal.h \
+- expat/latin1tab.h \
+- expat/nametab.h \
+- expat/utf8tab.h \
+- expat/xmlparse.c \
+- expat/xmlrole.c \
+- expat/xmlrole.h \
+- expat/xmltok.c \
+- expat/xmltok.h \
+- expat/xmltok_impl.c \
+- expat/xmltok_impl.h \
+- expat/xmltok_ns.c
++ lib/extra.h
+
+ man_MANS = doc/advscan.1 doc/advdiff.1
+
diff --git a/games-emulation/advancescan/metadata.xml b/games-emulation/advancescan/metadata.xml
new file mode 100644
index 000000000000..879ee3497adc
--- /dev/null
+++ b/games-emulation/advancescan/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">advancemame</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/atari800-3.1.0-r1 b/games-emulation/atari800-3.1.0-r1
deleted file mode 100644
index 3a0367c31d20..000000000000
--- a/games-emulation/atari800-3.1.0-r1
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare
-DEPEND=sdl? ( >=media-libs/libsdl-1.2.0[opengl?,sound?,video] ) ncurses? ( sys-libs/ncurses:0= sound? ( !oss? ( media-libs/libsdl[sound] ) ) ) !sdl? ( !ncurses? ( sys-libs/ncurses:0= sound? ( !oss? ( media-libs/libsdl[sound] ) ) ) ) readline? ( sys-libs/readline:0= sys-libs/ncurses:0= ) media-libs/libpng:0= sys-libs/zlib app-arch/unzip >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Atari 800 emulator
-EAPI=6
-HOMEPAGE=http://atari800.sourceforge.net/
-IUSE=ncurses oss opengl readline +sdl +sound
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2+
-RDEPEND=sdl? ( >=media-libs/libsdl-1.2.0[opengl?,sound?,video] ) ncurses? ( sys-libs/ncurses:0= sound? ( !oss? ( media-libs/libsdl[sound] ) ) ) !sdl? ( !ncurses? ( sys-libs/ncurses:0= sound? ( !oss? ( media-libs/libsdl[sound] ) ) ) ) readline? ( sys-libs/readline:0= sys-libs/ncurses:0= ) media-libs/libpng:0= sys-libs/zlib
-SLOT=0
-SRC_URI=mirror://sourceforge/atari800/atari800-3.1.0.tar.gz mirror://sourceforge/atari800/xf25.zip
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 libtool 0081a71a261724730ec4c248494f044d multilib 97f470f374f2e94ccab04a2fb21d811e toolchain-funcs 1e35303c63cd707f6c3422b4493d5607
-_md5_=546cd194df98f23bb69972422a28d5b1
diff --git a/games-emulation/atari800/Manifest b/games-emulation/atari800/Manifest
new file mode 100644
index 000000000000..5ebd2c1ca923
--- /dev/null
+++ b/games-emulation/atari800/Manifest
@@ -0,0 +1,6 @@
+AUX atari800-3.1.0-tgetent-detection.patch 690 BLAKE2B 49016e922f66214dadd0da179679e61f9359f93020d964f4ccd4b0b27da5ceb0fcdc0eedee6b891f8090bfe2c2d4fb23bbbc8130e660a1b84df8434101248f90 SHA512 dc045dc72b011fe2fab1b440a5fc50c3a34dcb4cd867efa9a8276cc770f21778732adf6c59e5a3daec0cd37364a83f877c739d1120d468af9372d088895850e5
+AUX atari800.cfg 467 BLAKE2B 76caa8d4f73d292adb36ce66186bf657a25f4ef5404f0dedc0456fa933bc672bc5a89819b92555d88033bc47bdff4cd5b376571de01339a1b60a82a3210dcd11 SHA512 17f43f9f1b8dcf1513eefc8b89e94ecdaeb3f4e324a669e09c1f8b180e3c545b474164f73bc4c319dde27dda8effa1f2786957854ade81d161221e081c87d358
+DIST atari800-3.1.0.tar.gz 1492289 BLAKE2B cad7a3111bf714321d01aff1f8b30408efc1eca0876d9b795395d62d18eabdf78b71d3b2af887e8ba03e33e3824fcd5b45070e39cddd0e5ad0bda2d853f724b1 SHA512 c8f035c9be000c67dd854a14a236d165e6e2d30b5138f8772c6ea5c5290b0410525570e3ed9dcb2f9bcb129f97a36e6eef5993f0a5ad3cc993c6b59b127bcabe
+DIST xf25.zip 188942 BLAKE2B c10b9108eebc571ac334ea6fca76d227e3d2fcde1595e8823a3d178dc31d9efa9b209572ee03875461289093615470192cf5c9a06cf0b4363d097a9eac201db4 SHA512 306612fc2af41ed10d76103af83e141cfd8bd3ba2ea3cbd1d0b81d4d5b0108c06948a5c626648c8a2424536757a42a3f8b9af1fb63fa3c31096447ffed0f9923
+EBUILD atari800-3.1.0-r1.ebuild 1860 BLAKE2B c286b79674f42d3a421be8e5e5c8ac02387c81ee5994fc7e9657e0732c46d1a38ee93ba240530f5072baaad88b648c28ed533114a9aa986a8b51a3f4e18ffede SHA512 ad3fc9d642d739fd8024c81db883d5b5bffa46e6e5b9967aa5dcbb1d45373eafb7cb399118e01354fbdb878b7ea49d5d76b38189d1bd643503a78ed2ed3ed0e4
+MISC metadata.xml 961 BLAKE2B 5f5e394a1ea4099f9d33f1e4f542b98ea31038e2855d839a86ea55fca18f02b9d99f2b0b554e0816142d80ca84adcbe2e1af1c664d773fb8df2794600fe21b48 SHA512 f31b0309a14446c07f11c72be8bb0cda851e5e0f424211f7a26eb5030935119a31eccfc1d81d80987cf6a6ef22d56e74edd258eba13d2635cccd584fadaaf123
diff --git a/games-emulation/atari800/atari800-3.1.0-r1.ebuild b/games-emulation/atari800/atari800-3.1.0-r1.ebuild
new file mode 100644
index 000000000000..31aa318cdebb
--- /dev/null
+++ b/games-emulation/atari800/atari800-3.1.0-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop autotools
+
+DESCRIPTION="Atari 800 emulator"
+HOMEPAGE="http://atari800.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
+ mirror://sourceforge/${PN}/xf25.zip"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ncurses oss opengl readline +sdl +sound"
+
+NOTSDL_DEPS="
+ sys-libs/ncurses:0=
+ sound? (
+ !oss? ( media-libs/libsdl[sound] )
+ )
+"
+RDEPEND="
+ sdl? ( >=media-libs/libsdl-1.2.0[opengl?,sound?,video] )
+ ncurses? ( ${NOTSDL_DEPS} )
+ !sdl? ( !ncurses? ( ${NOTSDL_DEPS} ) )
+ readline? (
+ sys-libs/readline:0=
+ sys-libs/ncurses:0= )
+ media-libs/libpng:0=
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+"
+
+src_prepare() {
+ default
+
+ # remove some not-so-interesting ones
+ rm -f DOC/{INSTALL.*,*.in,CHANGES.OLD} || die
+ sed -i \
+ -e '1s/ 1 / 6 /' \
+ src/atari800.man || die
+ sed "s:/usr/share/games:/usr/share:" \
+ "${FILESDIR}"/atari800.cfg > "${T}"/atari800.cfg || die
+
+ # Bug 544608
+ eapply "${FILESDIR}/${P}-tgetent-detection.patch"
+ pushd src > /dev/null && eautoreconf
+ popd > /dev/null
+}
+
+src_configure() {
+ local video="ncurses"
+ local sound=no
+
+ use sdl && video="sdl"
+ if use sound ; then
+ if use sdl ; then
+ sound=sdl
+ elif use oss ; then
+ sound=oss
+ else
+ echo
+ elog "Sound requested but neither sdl nor oss specified."
+ elog "Disabling sound suport."
+ fi
+ fi
+
+ cd src && \
+ econf \
+ $(use_with readline) \
+ --with-video=${video} \
+ --with-sound=${sound}
+}
+
+src_compile() {
+ emake -C src
+}
+
+src_install () {
+ dobin src/atari800
+ newman src/atari800.man atari800.6
+ dodoc README.1ST DOC/*
+ insinto "/usr/share/${PN}"
+ doins "${WORKDIR}/"*.ROM
+ insinto /etc
+ doins "${T}"/atari800.cfg
+ newicon data/atari2.svg ${PN}.svg
+ make_desktop_entry ${PN} "Atari 800 emulator"
+}
diff --git a/games-emulation/atari800/files/atari800-3.1.0-tgetent-detection.patch b/games-emulation/atari800/files/atari800-3.1.0-tgetent-detection.patch
new file mode 100644
index 000000000000..018e423af6b4
--- /dev/null
+++ b/games-emulation/atari800/files/atari800-3.1.0-tgetent-detection.patch
@@ -0,0 +1,12 @@
+diff -ruN atari800-3.1.0/src/configure.ac new/src/configure.ac
+--- atari800-3.1.0/src/configure.ac 2014-04-12 15:58:16.000000000 +0200
++++ new/src/configure.ac 2015-03-26 23:36:24.419178078 +0100
+@@ -982,7 +982,7 @@
+ dnl existence of the tgetent symbol in readline. If not, we search for tgetent
+ dnl in a few other libraries. All done with a single AC_SEARCH_LIBS statement.
+ have_readline=no
+- AC_SEARCH_LIBS(tgetent, [readline termcap ncursesw ncurses curses], [
++ AC_SEARCH_LIBS(tgetent, [readline termcap tinfow ncursesw ncurses curses], [
+ AC_SEARCH_LIBS(readline, readline, [
+ AC_CHECK_HEADER([readline/readline.h], [
+ have_readline=yes
diff --git a/games-emulation/atari800/files/atari800.cfg b/games-emulation/atari800/files/atari800.cfg
new file mode 100644
index 000000000000..b31c67de0958
--- /dev/null
+++ b/games-emulation/atari800/files/atari800.cfg
@@ -0,0 +1,24 @@
+Atari 800 Emulator, Version 1.2.2
+OS/A_ROM=atariosa.rom
+OS/B_ROM=/usr/share/games/atari800/ATARIOSB.ROM
+XL/XE_ROM=/usr/share/games/atari800/ATARIXL.ROM
+BASIC_ROM=/usr/share/games/atari800/ATARIBAS.ROM
+5200_ROM=
+DISK_DIR=
+ROM_DIR=
+H1_DIR=
+H2_DIR=
+H3_DIR=
+H4_DIR=
+HD_READ_ONLY=1
+EXE_DIR=
+STATE_DIR=
+PRINT_COMMAND=lpr %s
+SCREEN_REFRESH_RATIO=1
+MACHINE_TYPE=Atari OS/B
+RAM_SIZE=48
+DEFAULT_TV_MODE=NTSC
+DISABLE_BASIC=1
+ENABLE_SIO_PATCH=1
+ENABLE_H_PATCH=1
+ENABLE_P_PATCH=1
diff --git a/games-emulation/atari800/metadata.xml b/games-emulation/atari800/metadata.xml
new file mode 100644
index 000000000000..6489dd5ca137
--- /dev/null
+++ b/games-emulation/atari800/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+Atari800 is an Atari 800, 800XL, 130XE and 5200 emulator for Unix, Amiga, MS-DOS, Atari
+TT/Falcon, SDL and WinCE. Our main objective is to create a freely distributable portable
+emulator (i.e. with source code available). It can be configured to run in the following
+ways :
+
+ * BASIC mode
+ * CURSES mode
+ * SVGALIB for Linux Systems
+ * X Window + Optional XVIEW or MOTIF User Interface
+ * CBM Amiga
+ * MS-DOS
+ * TOS (Atari Falcon030/TT030 and compatible)
+ * MS Windows (DirectX)
+ * SDL (many different platforms and systems)
+ * WinCE
+ * MacOS X
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">atari800</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/caps-20071115 b/games-emulation/caps-20071115
deleted file mode 100644
index b0fd0878647c..000000000000
--- a/games-emulation/caps-20071115
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=install
-DEPEND=app-arch/unzip
-DESCRIPTION=Support library for accessing and using C.A.P.S. images
-EAPI=5
-HOMEPAGE=http://www.softpres.org/
-IUSE=doc
-KEYWORDS=amd64 x86
-LICENSE=CAPS
-RESTRICT=strip
-SLOT=0
-SRC_URI=mirror://gentoo/ipfdevlib_linux-20060612.tgz amd64? ( mirror://gentoo/ipflib_linux-amd64-20071115.tgz ) doc? ( mirror://gentoo/ipfdoc102a.zip ) mirror://gentoo/config_uae_ocs13_512c-512s.zip
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=46c0a1a69c0c5b177ef47f7bcb55b43a
diff --git a/games-emulation/caps/Manifest b/games-emulation/caps/Manifest
new file mode 100644
index 000000000000..9c5bddc0ab1a
--- /dev/null
+++ b/games-emulation/caps/Manifest
@@ -0,0 +1,6 @@
+DIST config_uae_ocs13_512c-512s.zip 1613 BLAKE2B 75262e48802d9dbfa95d9fc18aeb032176e98be86aeae65e893b9d8db57f6d6fb089df35273f27abcbbcd568d5dc96fec25281034f752862e06a8e22dcf38450 SHA512 38aa65030f874756780239191e08c7dbf41a241b44a82a58d8adef8dd94879d3db221c26e860d980a602fd89734f4ce8053e7c7037a8889e9a6f69a1d2dc4d8e
+DIST ipfdevlib_linux-20060612.tgz 60265 BLAKE2B 8ab649aef5be48287d88777e8ae94ea784922174f6a127ac5e8bfd906bb852caa9ffd624fbd51d062971c6b13ea0ae7089c0ad9356a10697cad425c348599b9a SHA512 6d01b35850af9f5f4a45f8ee7f9c9b7a02ffaf3830588c46cf718c5007316baac49c1c7c928f0fc78e9014e3f094cb6a2d6e842c1440a7b8e34e6c31899699d7
+DIST ipfdoc102a.zip 264258 BLAKE2B 07af5bd9e466d588472171694f778f6416d6cbad157782ab60ce0e7b764e6d5b9b1b3107d837edeee3253cba4332f182751894c0e897433124f6e6f1dd9ddf3d SHA512 f4b34349c65a5cffc6fad8370959ea0c2516087f46cbb43770b45cf14c573062e03abd77350cf4c8f690dc6a1d461dd0613a03ab70c1f8a72a3a43b9085730f0
+DIST ipflib_linux-amd64-20071115.tgz 24278 BLAKE2B 37cfa092dfaeb190de02233e021923c55d74a0445e850d35aeb2333a04a29c863769d770fd71a1110a112b719bcf5cecdc0d74f35546de51711b62da86077bbc SHA512 f306503a0aed7fd781bb6aea22a94fe72a5de952e3e26bb923d551ec5f165aa3fced4014df6a50f20b0f4526710b7e8643aa47a4de85f09bb2f3fe040d0b0f70
+EBUILD caps-20071115.ebuild 1548 BLAKE2B 410627ac26df710dcfb9279ada9f1a4d96f1d75988dc77dbd3ae441fea1a0aa84b4df9be3002fd44d327bd165a26e22d2112e47e0f05b8edde4bdfd71ece70ef SHA512 4b0cb66de587ed30daab8b203fbb3a086995786ceffb6d1e678b0308518b2ea4fd67b18ec5dfd9e9eb31b59dc106a44d70ffe1cbfe9a8d86fbcc04aecc48171f
+MISC metadata.xml 603 BLAKE2B 3a37c2c85d43ee38463f362f4ca6e85d0368ea684f3e63adb4438d08bd42b5562cb2a79067774f45ca773254c07bcc31b24e6a45d927ca54ab19c2dff6eb9fd5 SHA512 fedf1973e487ee47ad0ee6552e3867b2b9732084dae90cec32168bfea54dd8d6b25fedf3c7336205706a14b72a7c14cb4653a4b18293f7eb6661c3edb781e3b5
diff --git a/games-emulation/caps/caps-20071115.ebuild b/games-emulation/caps/caps-20071115.ebuild
new file mode 100644
index 000000000000..e466d2a9e18c
--- /dev/null
+++ b/games-emulation/caps/caps-20071115.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib
+
+DESCRIPTION="Support library for accessing and using C.A.P.S. images"
+HOMEPAGE="http://www.softpres.org/"
+SRC_URI="mirror://gentoo/ipfdevlib_linux-20060612.tgz
+ amd64? ( mirror://gentoo/ipflib_linux-amd64-${PV}.tgz )
+ doc? ( mirror://gentoo/ipfdoc102a.zip )
+ mirror://gentoo/config_uae_ocs13_512c-512s.zip"
+
+LICENSE="CAPS"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc"
+RESTRICT="strip"
+
+DEPEND="app-arch/unzip"
+RDEPEND=""
+
+S=${WORKDIR}
+
+QA_PREBUILT="usr/lib*/libcapsimage.so* usr/bin/ipfinfo"
+
+src_install() {
+ insinto /usr/include/caps
+ doins ipfdevlib_linux/include/caps/capsimage.h
+
+ case ${ARCH} in
+ ppc)
+ dolib.so ipfdevlib_linux/lib/ppc/libcapsimage.so.2.0
+ dobin ipfdevlib_linux/examples/ppc/ipfinfo
+ ;;
+ x86)
+ dolib.so ipfdevlib_linux/lib/i686/libcapsimage.so.2.0
+ dobin ipfdevlib_linux/examples/i686/ipfinfo
+ ;;
+ amd64)
+ dolib.so ipflib_linux-amd64/libcapsimage.so.2.3
+ dobin ipflib_linux-amd64/ipfinfo
+ ;;
+ *)
+ eerror "Unsupported platform"
+ ;;
+ esac
+
+ case ${ARCH} in
+ ppc|x86)
+ dosym libcapsimage.so.2.0 \
+ /usr/$(get_libdir)/libcapsimage.so.2
+ dodoc ipfdevlib_linux/{HISTORY,README}
+ ;;
+ amd64)
+ dosym libcapsimage.so.2.3 \
+ /usr/$(get_libdir)/libcapsimage.so.2
+ dodoc ipflib_linux-amd64/{HISTORY,README}
+ ;;
+ esac
+
+ insinto /usr/share/${PN}
+ doins OCS_13_1Mb_800_600.uae
+ doins ipfdevlib_linux/examples/ipfinfo.c
+
+ use doc && dodoc CAPSLib102a-40.pdf
+}
diff --git a/games-emulation/caps/metadata.xml b/games-emulation/caps/metadata.xml
new file mode 100644
index 000000000000..927538501fc1
--- /dev/null
+++ b/games-emulation/caps/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ C.A.P.S., the Classic Amiga Preservation Society, as the name implies,
+ dedicates itself to the preservation of classic Amiga software for the
+ future, namely classic Amiga games. This is the C.A.P.S. support
+ library that allows third party applications access to and use of
+ C.A.P.S. images.
+ </longdescription>
+</pkgmetadata>
diff --git a/games-emulation/daphne-1.0 b/games-emulation/daphne-1.0
deleted file mode 100644
index 276239251353..000000000000
--- a/games-emulation/daphne-1.0
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install postinst preinst prepare setup unpack
-DEPEND=media-libs/libogg media-libs/libvorbis sys-libs/zlib media-libs/libsdl[joystick,video] media-libs/sdl-mixer media-libs/libmpeg2 virtual/opengl media-libs/glew
-DESCRIPTION=Laserdisc Arcade Game Emulator
-EAPI=5
-HOMEPAGE=http://www.daphne-emu.com/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2+
-RDEPEND=media-libs/libogg media-libs/libvorbis sys-libs/zlib media-libs/libsdl[joystick,video] media-libs/sdl-mixer media-libs/libmpeg2 virtual/opengl media-libs/glew games-misc/games-envd
-SLOT=0
-SRC_URI=http://www.daphne-emu.com/download/daphne-1.0-src.tar.gz
-_eclasses_=base 983774947da124fb7d542ce25a218bb1 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc games 2bb3ede665927a68ffdb7c41eec7efde ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=2ec82219ddb7579fd68866f12fc26260
diff --git a/games-emulation/daphne/Manifest b/games-emulation/daphne/Manifest
new file mode 100644
index 000000000000..ed0bebb0665a
--- /dev/null
+++ b/games-emulation/daphne/Manifest
@@ -0,0 +1,10 @@
+AUX daphne-1.0-gcc43.patch 486 BLAKE2B 2f316f61b6386c3bbb3ddb4eae154953fcca2e38cd3f83b46c5d4c5cd77efce514540ddee385ebfebe172c921dc19522cd2996b8dfa57e386c2516538b5d9d1e SHA512 ab47c9d7c45191ff0b8b5dcb5de2553da0983785f5497cc4a683c1501cee5d1fde0bc70311a1fca68785ede36e410a367b0d1863c8c51b52d4501a4d14a57ac2
+AUX daphne-1.0-ldflags.patch 620 BLAKE2B f3603a7b4793e7e61ae6ead36c427046843b4723ac9e278d446956b6ee0eb228cc60bf479bf2cde3822f4e83825aeccc4869fcb765b96686e92478a9bfd1b7a0 SHA512 5dd63bd25b8fc583b95bf5be338ddad5e636f72e68f7a19052e84fa2c55da068bc6d9a449b693e69b87700d85e002731916f3cf9f0a6226e864112b4a3f3576a
+AUX daphne-1.0-system-lmpeg2.patch 1547 BLAKE2B d80c4a9ca8fc4cfe6aea555e6585220f149841b5887ef28ab73274664127e34ad26897f34d5a49acad9c2457a7b4c81844114ed27a3c56c3c329e004882aadfe SHA512 ffa1fd05c4a676b0f5342f10764b872b14ad0a6bdfabd7b6b6e306594ae1c4fd7827688906fdc123d1aaab889b1659441a03e16f758528f4e14117f9c8cba892
+AUX daphne-1.0-typefix.patch 1951 BLAKE2B f3f88058245db9b0b3beade18fa48f6aa21eb786935b768324f6287b1c06d800976bc061b038eebc35139f7af114a1288a00d82452db98ba3d971442d07de46a SHA512 b97a32e54d14e40b5857623065ded2985868abce8e26a21fcf2452a90bbcc2ebd7b0d6f24a36d62351a254cf3f66514c5c55014cfce03246ccf3f884a07f5352
+AUX daphne-1.0-underlink.patch 407 BLAKE2B c8583863874ce2dfac04fbb8832f0d1060200816dcd02a0ce63ea14ceeee03bfb435b8730d6cec55bcaf4b028925e729240d2c9f879219472ab822edf5c212db SHA512 ecbe457ea90aad322275b5b4ea29b7a3a28442afc87a1338987691799241350bc2583a9dc568c2215c489a21806ad918ebcb3091096ec827ac0f091a93451edb
+AUX daphne-1.0-vorbisfilefix.patch 500 BLAKE2B c8fa57b17b22392d4ef153e3ba7b27a8d5d3780c3d718852326aee28d33a41d93aa5e5e16ee870826cc1a2e6f71cf9066b381d043738420a670893f9134a57a8 SHA512 1fcea4e31f29a165da3746a35fe7a9c839caa0b6eabfe9247bd5b4f603985f114b3dec952cd680f3dc243c8014db012e4b0bc26c8721e8b74807271b80803433
+AUX daphne-1.0-zlib.patch 356 BLAKE2B 6130956ae52788c180330e653191a99a3b88c57431bd9e93c2ee599e699969b113bc26142bff3e747953c6034b5bf566932bc92ec504e7fc7507f7eed3bab562 SHA512 8c76ab069589fedceae114140eb845324f75c664dd76f257065293a8eecf57d9e2487c00af9d310afffe36f990b09c73c7648979b785886f3ca814f8a64d33e6
+DIST daphne-1.0-src.tar.gz 4316387 BLAKE2B 12063360931b36aaf301e6cd8169706f43456363140f9abbe9b09b711126a1c90f451cbbafc0f0d9fa23d538e01b3a99d2c50056e00ced51607572a1108621b8 SHA512 e15e3e86cd03b8eea410eedb667c878f9e2fb044a9bf2cc54e54db641f1c2c6fd99e889cfab308bf972336b577059e13d6cf2a353016ded8e28dae9ddedc0ad4
+EBUILD daphne-1.0.ebuild 1964 BLAKE2B 5a813b31b1cc4309a820b4de7f875e415f664ac230be813c3f3bb376a54db7641d515cbead8c9066efa5a7a0ae2d13f6e3beb04a0a5b457b24e6cde3c1626b6a SHA512 5aa88307cb2dda478879b64c40f1f728e717d7fb9849c1b95db26f8a24a7445d8dbbfed74b7512005524ce638dcd460b52162cf48b44710a556dc813f60c0134
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/daphne/daphne-1.0.ebuild b/games-emulation/daphne/daphne-1.0.ebuild
new file mode 100644
index 000000000000..ce1a8f457df6
--- /dev/null
+++ b/games-emulation/daphne/daphne-1.0.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils toolchain-funcs games
+
+DESCRIPTION="Laserdisc Arcade Game Emulator"
+HOMEPAGE="http://www.daphne-emu.com/"
+SRC_URI="http://www.daphne-emu.com/download/${P}-src.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="media-libs/libogg
+ media-libs/libvorbis
+ sys-libs/zlib
+ media-libs/libsdl[joystick,video]
+ media-libs/sdl-mixer
+ media-libs/libmpeg2
+ virtual/opengl
+ media-libs/glew"
+RDEPEND=${DEPEND}
+
+S=${WORKDIR}/v_1_0/src
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-vorbisfilefix.patch \
+ "${FILESDIR}"/${P}-typefix.patch \
+ "${FILESDIR}"/${P}-gcc43.patch \
+ "${FILESDIR}"/${P}-ldflags.patch \
+ "${FILESDIR}"/${P}-zlib.patch \
+ "${FILESDIR}"/${P}-underlink.patch \
+ "${FILESDIR}"/${P}-system-lmpeg2.patch
+
+ sed -i "/m_appdir =/s:\.:${GAMES_DATADIR}/${PN}:" \
+ io/homedir.cpp || die
+ sed -i "s:pics/:${GAMES_DATADIR}/${PN}/&:" \
+ video/video.cpp || die
+ sed -i "s:sound/:${GAMES_DATADIR}/${PN}/&:" \
+ sound/sound.cpp || die
+ sed -i "s:./lib:$(games_get_libdir)/${PN}/lib:" \
+ io/dll.h || die
+
+ sed \
+ -e "s:-DNATIVE_CPU_X86::" \
+ -e "s:-DUSE_MMX::" \
+ -e '/export USE_MMX = 1/s:^:# :' \
+ Makefile.vars.linux_x86 >Makefile.vars || die
+}
+
+src_configure() {
+ cd vldp2
+ egamesconf --disable-accel-detect
+}
+
+src_compile() {
+ local archflags
+
+ if use x86; then
+ archflags="-DNATIVE_CPU_X86 -DMMX_RGB2YUV -DUSE_MMX"
+ export USE_MMX=1
+ else
+ # -fPIC is needed on amd64 but fails on x86.
+ archflags="-fPIC"
+ fi
+
+ emake \
+ CXX=$(tc-getCXX) \
+ DFLAGS="${CXXFLAGS} ${archflags}"
+ emake -C vldp2 \
+ -f Makefile.linux \
+ CC=$(tc-getCC) \
+ DFLAGS="${CFLAGS} ${archflags}"
+}
+
+src_install() {
+ cd ..
+ newgamesbin daphne.bin daphne
+ exeinto "$(games_get_libdir)"/${PN}
+ doexe libvldp2.so
+ insinto "${GAMES_DATADIR}"/${PN}
+ doins -r pics roms sound
+ dodoc doc/*.{ini,txt}
+ dohtml -r doc/*
+ prepgamesdirs
+}
diff --git a/games-emulation/daphne/files/daphne-1.0-gcc43.patch b/games-emulation/daphne/files/daphne-1.0-gcc43.patch
new file mode 100644
index 000000000000..07c505c27814
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-gcc43.patch
@@ -0,0 +1,12 @@
+--- a/Makefile.old 2009-01-19 16:22:07.000000000 +0100
++++ b/Makefile 2009-01-19 16:22:17.000000000 +0100
+@@ -33,7 +33,7 @@
+ endif
+
+ # Platform specific cflags defined in the Makefile.vars file
+-export CFLAGS = ${PFLAGS} ${DEFINE_STATIC_VLDP} -Wall -Winline -Werror
++export CFLAGS = ${PFLAGS} ${DEFINE_STATIC_VLDP} -Wall -Winline
+
+ OBJS = ldp-out/*.o cpu/*.o game/*.o io/*.o timer/*.o ldp-in/*.o video/*.o \
+ sound/*.o daphne.o cpu/x86/*.o scoreboard/*.o ${VLDP_OBJS}
+
diff --git a/games-emulation/daphne/files/daphne-1.0-ldflags.patch b/games-emulation/daphne/files/daphne-1.0-ldflags.patch
new file mode 100644
index 000000000000..245e8f5e216b
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-ldflags.patch
@@ -0,0 +1,22 @@
+--- a/Makefile.old 2010-10-05 08:48:46.000000000 +0200
++++ b/Makefile 2010-10-05 08:49:10.000000000 +0200
+@@ -43,7 +43,7 @@
+ .SUFFIXES: .cpp
+
+ all: ${LOCAL_OBJS} sub
+- ${CXX} ${DFLAGS} ${OBJS} -o ${EXE} ${LIBS}
++ ${CXX} $(LDFLAGS) ${DFLAGS} ${OBJS} -o ${EXE} ${LIBS}
+
+ sub:
+ cd ldp-out && $(MAKE)
+--- a/vldp2/Makefile.linux.old 2010-10-05 09:29:52.000000000 +0200
++++ b/vldp2/Makefile.linux 2010-10-05 09:30:13.000000000 +0200
+@@ -33,7 +33,7 @@
+ all: vldp2
+
+ vldp2: ${OBJS}
+- ${CC} -shared -o ${LIBNAME} ${OBJS} ${LIBS}
++ ${CC} $(LDFLAGS) -shared -o ${LIBNAME} ${OBJS} ${LIBS}
+ cp ${LIBNAME} ../../.
+
+ clean:
diff --git a/games-emulation/daphne/files/daphne-1.0-system-lmpeg2.patch b/games-emulation/daphne/files/daphne-1.0-system-lmpeg2.patch
new file mode 100644
index 000000000000..e82d2ecf0d40
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-system-lmpeg2.patch
@@ -0,0 +1,41 @@
+diff -ur v_1_0.old/src/vldp2/Makefile.am v_1_0/src/vldp2/Makefile.am
+--- a/vldp2/Makefile.am 2009-12-29 18:04:15.000000000 +0200
++++ b/vldp2/Makefile.am 2009-12-29 18:10:42.000000000 +0200
+@@ -1,3 +1,3 @@
+-SUBDIRS = autotools include libmpeg2 libvo doc src vc++ test
++SUBDIRS = autotools
+
+ EXTRA_DIST = bootstrap
+diff -ur v_1_0.old/src/vldp2/Makefile.in v_1_0/src/vldp2/Makefile.in
+--- a/vldp2/Makefile.in 2009-12-29 18:04:15.000000000 +0200
++++ b/vldp2/Makefile.in 2009-12-29 18:10:51.000000000 +0200
+@@ -128,7 +128,7 @@
+ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+-SUBDIRS = autotools include libmpeg2 libvo doc src vc++ test
++SUBDIRS = autotools
+
+ EXTRA_DIST = bootstrap
+ subdir = .
+diff -ur v_1_0.old/src/vldp2/Makefile.linux v_1_0/src/vldp2/Makefile.linux
+--- a/vldp2/Makefile.linux 2009-12-29 18:04:15.000000000 +0200
++++ b/vldp2/Makefile.linux 2009-12-29 18:13:12.000000000 +0200
+@@ -14,14 +14,9 @@
+ DFLAGS = -O3 -march=i686 -fomit-frame-pointer -funroll-loops
+
+ CFLAGS = ${DFLAGS} `sdl-config --cflags` -I./include
+-LIBS = `sdl-config --libs`
++LIBS = `sdl-config --libs` -lmpeg2
+
+-OBJS = vldp/vldp.o vldp/vldp_internal.o vldp/mpegscan.o \
+- libmpeg2/cpu_accel.o libmpeg2/alloc.o libmpeg2/cpu_state.o \
+- libmpeg2/decode.o libmpeg2/header.o libmpeg2/motion_comp.o \
+- libmpeg2/idct.o libmpeg2/idct_mmx.o libmpeg2/motion_comp_mmx.o \
+- libmpeg2/slice.o \
+- libvo/video_out.o libvo/video_out_null.o
++OBJS = vldp/vldp.o vldp/vldp_internal.o vldp/mpegscan.o
+
+ LIBNAME = libvldp2.so
+
+
diff --git a/games-emulation/daphne/files/daphne-1.0-typefix.patch b/games-emulation/daphne/files/daphne-1.0-typefix.patch
new file mode 100644
index 000000000000..790d93a3af87
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-typefix.patch
@@ -0,0 +1,47 @@
+amd64 does not like int pointers
+
+diff -ruN v_1_0.orig/src/ldp-in/ldv1000.cpp v_1_0/src/ldp-in/ldv1000.cpp
+--- a/ldp-in/ldv1000.cpp 2008-01-29 18:04:34.000000000 +0100
++++ b/ldp-in/ldv1000.cpp 2008-09-19 14:29:40.000000000 +0200
+@@ -607,9 +607,9 @@
+
+ void ldv1000_event_callback(void *eventType)
+ {
+- g_ldv1000_last_event = (unsigned int) eventType;
++ g_ldv1000_last_event = (unsigned long) eventType;
+
+- switch ((unsigned int) eventType)
++ switch ((unsigned long) eventType)
+ {
+ case LDV1000_EVENT_VSYNC_END:
+ #ifdef DEBUG
+diff -ruN v_1_0.orig/src/vldp2/libvo/video_out_null.c v_1_0/src/vldp2/libvo/video_out_null.c
+--- a/vldp2/libvo/video_out_null.c 2008-01-29 18:04:43.000000000 +0100
++++ b/vldp2/libvo/video_out_null.c 2008-09-19 14:30:03.000000000 +0200
+@@ -82,7 +82,7 @@
+ // this is the potentially expensive callback that gets the hardware overlay
+ // ready to be displayed, so we do this before we sleep
+ // NOTE : if this callback fails, we don't want to display the frame due to double buffering considerations
+- if (g_in_info->prepare_frame(&g_yuv_buf[(int) id]))
++ if (g_in_info->prepare_frame(&g_yuv_buf[(long) id]))
+ {
+ #ifndef VLDP_BENCHMARK
+
+@@ -133,7 +133,7 @@
+ #endif
+ // draw the frame
+ // we are using the pointer 'id' as an index, kind of risky, but convenient :)
+- g_in_info->display_frame(&g_yuv_buf[(int) id]);
++ g_in_info->display_frame(&g_yuv_buf[(long) id]);
+ #ifndef VLDP_BENCHMARK
+ } // end if we didn't get a new command to interrupt the frame being displayed
+ #endif
+@@ -272,7 +272,7 @@
+ uint8_t ** buf, void ** id)
+ {
+ static buffer_index = 0;
+- *id = (int *) buffer_index; // THIS IS A LITTLE TRICKY
++ *id = (long *) buffer_index; // THIS IS A LITTLE TRICKY
+ // We are setting an integer value to a pointer ...
+ // Because it is convenient to let the pointer hold the value of this integer for us
+ // Hopefully it doesn't cause any trouble later ;)
diff --git a/games-emulation/daphne/files/daphne-1.0-underlink.patch b/games-emulation/daphne/files/daphne-1.0-underlink.patch
new file mode 100644
index 000000000000..dd4c3d1467e2
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-underlink.patch
@@ -0,0 +1,8 @@
+--- a/Makefile.vars.linux_x86.old 2011-09-21 12:27:42.480566742 +0200
++++ b/Makefile.vars.linux_x86 2011-09-21 12:27:57.490564959 +0200
+@@ -24,4 +24,4 @@
+ -DUSE_MMX -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DUSE_OPENGL
+
+ # platform-specific lib flags
+-LIBS = `sdl-config --libs` -ldl -lz -logg -lvorbis -lvorbisfile -lGLEW
++LIBS = `sdl-config --libs` -ldl -lz -logg -lvorbis -lvorbisfile -lGLEW -lGL -lm
diff --git a/games-emulation/daphne/files/daphne-1.0-vorbisfilefix.patch b/games-emulation/daphne/files/daphne-1.0-vorbisfilefix.patch
new file mode 100644
index 000000000000..05a0403a8af4
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-vorbisfilefix.patch
@@ -0,0 +1,14 @@
+Fix no sound issue with >=media-libs/libvorbis-1.2.0
+
+diff -ruN v_1_0.orig/src/ldp-out/ldp-vldp-audio.cpp v_1_0/src/ldp-out/ldp-vldp-audio.cpp
+--- a/ldp-out/ldp-vldp-audio.cpp 2008-01-29 18:04:07.000000000 +0100
++++ b/ldp-out/ldp-vldp-audio.cpp 2008-09-19 13:43:10.000000000 +0200
+@@ -146,7 +146,7 @@
+ switch (whence)
+ {
+ case SEEK_SET:
+- if (offset < g_audio_filesize)
++ if (offset <= g_audio_filesize)
+ {
+ // make sure offset is positive so we don't get into trouble
+ if (offset >= 0)
diff --git a/games-emulation/daphne/files/daphne-1.0-zlib.patch b/games-emulation/daphne/files/daphne-1.0-zlib.patch
new file mode 100644
index 000000000000..d94af3b174f4
--- /dev/null
+++ b/games-emulation/daphne/files/daphne-1.0-zlib.patch
@@ -0,0 +1,13 @@
+--- a/io/unzip.h 2011-09-21 12:13:28.911668053 +0200
++++ b/io/unzip.h 2011-09-21 12:14:53.074658064 +0200
+@@ -57,6 +57,10 @@
+ #include "zlib.h"
+ #endif
+
++#ifndef OF
++#define OF _Z_OF
++#endif
++
+ #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+ /* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */
diff --git a/games-emulation/daphne/metadata.xml b/games-emulation/daphne/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/daphne/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/desmume-0.9.11-r1 b/games-emulation/desmume-0.9.11-r1
deleted file mode 100644
index 97ed94daa612..000000000000
--- a/games-emulation/desmume-0.9.11-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=postinst postrm preinst prepare
-DEPEND=dev-libs/zziplib gnome-base/libglade media-libs/libsdl[joystick,opengl,video] sys-libs/zlib virtual/opengl x11-libs/agg >=x11-libs/gtk+-2.8.0:2 x11-libs/gtkglext dev-util/intltool virtual/pkgconfig dev-util/desktop-file-utils x11-misc/shared-mime-info
-DESCRIPTION=Nintendo DS emulator
-EAPI=6
-HOMEPAGE=http://desmume.org/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-libs/zziplib gnome-base/libglade media-libs/libsdl[joystick,opengl,video] sys-libs/zlib virtual/opengl x11-libs/agg >=x11-libs/gtk+-2.8.0:2 x11-libs/gtkglext
-SLOT=0
-SRC_URI=mirror://sourceforge/desmume/desmume-0.9.11.tar.gz
-_eclasses_=xdg 6cd76cc914c1a759dee032778487b57f xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=474801794fd8b6412f33f7d35632f164
diff --git a/games-emulation/desmume/Manifest b/games-emulation/desmume/Manifest
new file mode 100644
index 000000000000..377ab85a7308
--- /dev/null
+++ b/games-emulation/desmume/Manifest
@@ -0,0 +1,6 @@
+AUX desmume-0.9.11-fix-pointer-conversion-warning.diff 370 BLAKE2B 8e019cf69a13b3669166f1ee04d26e6538a392e494d356b2eeabd43ac69fe9489ddeda146054ab5d1f821b3a52719d58ae493ca870f46461eacaab26ffb9eba1 SHA512 f7d5f4ac4d96f244aa6ee81a90f64e754aceebf075f1c4ff84dde2d1d2beaf617631569c5aa9a8afb40ae4499067e2233ba00a4b9d606a9608915714766d0bff
+AUX desmume-0.9.11-gcc6.patch 1991 BLAKE2B ffb0a58f7317aa50fe17c4abe1ba6c9bbf9cb937736479214b86187c32af8c1659aa719eccce184a5f0fa1b31f15634276fb676bf97ec64feba603fa89ee289f SHA512 e9249a613f1bf3b6d72dcce47cbc39daeadb1b4f7b9be2748b537ec3389a61f46b5f15f5a10d55bc4b1dbd69dd87526b5ce79e58b539cf432679da9bc803e0cd
+AUX desmume-0.9.11-gcc7.patch 832 BLAKE2B 80accd7e22d22163692be58f2da288db4b4009603f9cf9fca4d709e44dfae4496c9b7610c82bf6bfc47c470837dccec83a95e124c3ad9a8cead654cd389a3476 SHA512 9c9b0452a6aaf860583ad97737fb7142601a5ff6f4b720037c9b4d2aeab533c12ffbb1a216753f7e9e4f04350a4e276c5606624ab633f4c2bea517ec0233db8f
+DIST desmume-0.9.11.tar.gz 5359305 BLAKE2B 31764dcb2d0facf32eddd5c66f40e2268f8afd5c2562bf246b93bb60c191d7888587991732014dee11417016515a4367bda9acf79f699703754aa904dcaeeb01 SHA512 160cb6ec0ede04ad1fbddde2b7b04aa41fa464c8338d7eb9d7536196a82d8d716889b40be4fb831a22e3fe8532b947f7f0b41311601b6842be2516dff7cae46c
+EBUILD desmume-0.9.11-r1.ebuild 800 BLAKE2B 5cf60a8343d47e2e7adce5697fe8904bc733f503d9d56a37515708def52dd403ae52bec61b20bb6183335266e61916b2d0591e6f89ca20ce5cdbff76c565cbd6 SHA512 91fc616b3935e92f6b1f88346a47b6683835d02a2a35f32fc2b2d127971546fe45ef3af8d1d690f9e39b595f51c405664cf29ae9b62e63f024e8c98214786e7d
+MISC metadata.xml 407 BLAKE2B a64ba166734f13f34fec0ca394d4d51bc70f2cb9539981e068e544f3139584ee3ec2da89a02ef9203008cb73213213adb148c978311ae36d95749e553d10605b SHA512 89d3a5b608525bfa1f05503017619520d82c663241668c3d5fa5602e625cbfe02564b04d7bac0e97bbe53ff8eba08a6895fb0e8cd519d0d88efd29a0ca64ac4b
diff --git a/games-emulation/desmume/desmume-0.9.11-r1.ebuild b/games-emulation/desmume/desmume-0.9.11-r1.ebuild
new file mode 100644
index 000000000000..e98e0846012b
--- /dev/null
+++ b/games-emulation/desmume/desmume-0.9.11-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit xdg
+
+DESCRIPTION="Nintendo DS emulator"
+HOMEPAGE="http://desmume.org/"
+SRC_URI="mirror://sourceforge/desmume/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-libs/zziplib
+ gnome-base/libglade
+ media-libs/libsdl[joystick,opengl,video]
+ sys-libs/zlib
+ virtual/opengl
+ x11-libs/agg
+ >=x11-libs/gtk+-2.8.0:2
+ x11-libs/gtkglext"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS ChangeLog README README.LIN )
+
+# fix QA compiler warning, see
+# https://sourceforge.net/p/desmume/patches/172/
+PATCHES=(
+ "${FILESDIR}/${P}-fix-pointer-conversion-warning.diff"
+ "${FILESDIR}/${P}-gcc6.patch"
+ "${FILESDIR}/${P}-gcc7.patch"
+)
diff --git a/games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff b/games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff
new file mode 100644
index 000000000000..8975085133ff
--- /dev/null
+++ b/games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff
@@ -0,0 +1,11 @@
+--- a/src/path.h 2015-02-14 16:05:26.000000000 +0100
++++ b/src/path.h 2016-07-11 12:09:59.591987169 +0200
+@@ -375,7 +375,7 @@
+ else if (strchr(strftimeArgs, *p))
+ {
+ char tmp[MAX_PATH];
+- char format[] = { '%', *p, NULL };
++ char format[] = { '%', *p, '\0' };
+ strftime(tmp, MAX_PATH, format, time_struct);
+ file.append(tmp);
+ }
diff --git a/games-emulation/desmume/files/desmume-0.9.11-gcc6.patch b/games-emulation/desmume/files/desmume-0.9.11-gcc6.patch
new file mode 100644
index 000000000000..761ccef045cf
--- /dev/null
+++ b/games-emulation/desmume/files/desmume-0.9.11-gcc6.patch
@@ -0,0 +1,47 @@
+--- a/src/wifi.cpp
++++ b/src/wifi.cpp
+@@ -314,9 +314,9 @@
+
+ #if (WIFI_LOGGING_LEVEL >= 1)
+ #if WIFI_LOG_USE_LOGC
+- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__);
++ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__);
+ #else
+- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__);
++ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__);
+ #endif
+ #else
+ #define WIFI_LOG(level, ...) {}
+--- a/src/MMU_timing.h
++++ b/src/MMU_timing.h
+@@ -155,8 +155,8 @@
+ enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };
+ enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };
+ enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };
+- enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
+- enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
++ enum { TAGMASK = (u32)(~0U << TAGSHIFT) };
++ enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) };
+ enum { WORDSIZE = sizeof(u32) };
+ enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };
+ enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };
+--- a/src/ctrlssdl.cpp
++++ b/src/ctrlssdl.cpp
+@@ -200,7 +200,7 @@
+ break;
+ case SDL_JOYAXISMOTION:
+ /* Dead zone of 50% */
+- if( (abs(event.jaxis.value) >> 14) != 0 )
++ if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
+ {
+ key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1);
+ if (event.jaxis.value > 0) {
+@@ -370,7 +370,7 @@
+ Note: button constants have a 1bit offset. */
+ case SDL_JOYAXISMOTION:
+ key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1);
+- if( (abs(event->jaxis.value) >> 14) != 0 )
++ if( ((u32)abs(event->jaxis.value) >> 14) != 0 )
+ {
+ if (event->jaxis.value > 0)
+ key_code |= 1;
diff --git a/games-emulation/desmume/files/desmume-0.9.11-gcc7.patch b/games-emulation/desmume/files/desmume-0.9.11-gcc7.patch
new file mode 100644
index 000000000000..8b8a67f2291a
--- /dev/null
+++ b/games-emulation/desmume/files/desmume-0.9.11-gcc7.patch
@@ -0,0 +1,21 @@
+Bug: https://bugs.gentoo.org/646352
+Patch: https://sources.debian.org/data/main/d/desmume/0.9.11-3/debian/patches/gcc7_fixes.patch
+
+From e1f7039f1b06add4fb75b2f8774000b8f05574af Mon Sep 17 00:00:00 2001
+From: rogerman <rogerman@users.sf.net>
+Date: Mon, 17 Aug 2015 21:15:04 +0000
+Subject: Fix bug with libfat string handling.
+
+diff --git a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp
+index 765d7ae5..b6d7f01f 100644
+--- a/src/utils/libfat/directory.cpp
++++ b/src/utils/libfat/directory.cpp
+@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len
+ int bytes;
+ size_t count = 0;
+
+- while (count < len-1 && src != '\0') {
++ while (count < len-1 && *src != '\0') {
+ bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps);
+ if (bytes > 0) {
+ *dst = (ucs2_t)tempChar;
diff --git a/games-emulation/desmume/metadata.xml b/games-emulation/desmume/metadata.xml
new file mode 100644
index 000000000000..d906b044dcad
--- /dev/null
+++ b/games-emulation/desmume/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hanno@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">desmume</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/dgen-sdl-1.33-r1 b/games-emulation/dgen-sdl-1.33-r1
deleted file mode 100644
index b39a08e2f1e1..000000000000
--- a/games-emulation/dgen-sdl-1.33-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install
-DEPEND=media-libs/libsdl[joystick?,opengl?] app-arch/libarchive opengl? ( virtual/opengl ) x86? ( dev-lang/nasm )
-DESCRIPTION=A Linux/SDL-Port of the famous DGen MegaDrive/Genesis-Emulator
-EAPI=6
-HOMEPAGE=http://dgen.sourceforge.net/
-IUSE=joystick opengl
-KEYWORDS=~amd64 ~x86
-LICENSE=dgen-sdl BSD BSD-2 free-noncomm LGPL-2.1+ GPL-2+
-RDEPEND=media-libs/libsdl[joystick?,opengl?] app-arch/libarchive opengl? ( virtual/opengl )
-SLOT=0
-SRC_URI=mirror://sourceforge/dgen/files/dgen-sdl-1.33.tar.gz
-_md5_=830a2beccd34f2f593e83ef279fbc1d4
diff --git a/games-emulation/dgen-sdl/Manifest b/games-emulation/dgen-sdl/Manifest
new file mode 100644
index 000000000000..27f46d59279b
--- /dev/null
+++ b/games-emulation/dgen-sdl/Manifest
@@ -0,0 +1,4 @@
+AUX dgen-sdl-1.33-joystick.patch 406 BLAKE2B 175ac9aee89e657dc48f2c0d8f63019da310fc33dbde271dfb3d7cab79d9533136b02c4761063fc56f88764c0f6afacc687f13fe3e4a1acf99fbd0792694e76c SHA512 0057f4099b941cc1aa1fc4d2d260c3bb7601f8149542ab4a87b3306f839ec6e8306fd00d0f2f87d770cc956a60841ff608095ca7bbc3e0e143f6c057f4d21e58
+DIST dgen-sdl-1.33.tar.gz 939297 BLAKE2B e7d107425f8d2c396e37bd140c9ccebe96f7365ac729faac748e1ccf53ebae30fedc59f05070cdcb16d59a7870b6679e4f6e0dda83a697342c2a692c565a4d13 SHA512 c98ab8cdced62a5d26fd677ad36b031e756620114c946ac067599e84ae6ebcfab731554dd4337b6314c3b5db4601c8a6cc67c285d2aad136e659b9973c01a749
+EBUILD dgen-sdl-1.33-r1.ebuild 825 BLAKE2B 6094564d53612df217efc0d81040883390d4bac149c1630e09b6a1078d4157bfc4720c49af45042e44c1f4f3f02312d6efb5d8a4e475419a46119a91cb352376 SHA512 b9d088beb9a75205745f19a97557c20eae8c2c3318d85576a153a12e831ad578ada032d8ddfe6d05927bac0485c6ffeb04e38a349c39d19f26d057ae2faec6d2
+MISC metadata.xml 327 BLAKE2B c719679eeb00833778ba9a80981dd32cfba3e8d498b378b07eff877d65bbed1c878a0522abe25c5d60f78c89e637a23ae4bbd79a5200cf26677fe25a4e74020a SHA512 17031a8025df3d06c71dfb85bf2870eac32e84e86797296aa4a7e7cd24ac579a7305a7664d05e2054e4ad11da6c683011e8132dce0e6ea7dab0b8f70dc984a9b
diff --git a/games-emulation/dgen-sdl/dgen-sdl-1.33-r1.ebuild b/games-emulation/dgen-sdl/dgen-sdl-1.33-r1.ebuild
new file mode 100644
index 000000000000..5d9acdc094b9
--- /dev/null
+++ b/games-emulation/dgen-sdl/dgen-sdl-1.33-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="A Linux/SDL-Port of the famous DGen MegaDrive/Genesis-Emulator"
+HOMEPAGE="http://dgen.sourceforge.net/"
+SRC_URI="mirror://sourceforge/dgen/files/${P}.tar.gz"
+
+LICENSE="dgen-sdl BSD BSD-2 free-noncomm LGPL-2.1+ GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="joystick opengl"
+
+RDEPEND="
+ media-libs/libsdl[joystick?,opengl?]
+ app-arch/libarchive
+ opengl? ( virtual/opengl )
+"
+DEPEND="${RDEPEND}
+ x86? ( dev-lang/nasm )
+"
+
+PATCHES=( "${FILESDIR}"/${P}-joystick.patch )
+
+src_configure() {
+ econf \
+ $(use_enable x86 asm) \
+ $(use_enable joystick) \
+ $(use_enable opengl)
+}
+
+src_compile() {
+ emake -C musa m68kops.h
+ emake
+}
+
+src_install() {
+ DOCS="AUTHORS ChangeLog README sample.dgenrc" default
+}
diff --git a/games-emulation/dgen-sdl/files/dgen-sdl-1.33-joystick.patch b/games-emulation/dgen-sdl/files/dgen-sdl-1.33-joystick.patch
new file mode 100644
index 000000000000..6cb4e936b35b
--- /dev/null
+++ b/games-emulation/dgen-sdl/files/dgen-sdl-1.33-joystick.patch
@@ -0,0 +1,18 @@
+--- a/sdl/sdl.cpp.orig
++++ b/sdl/sdl.cpp
+@@ -6285,6 +6285,7 @@
+ #endif
+ static unsigned long hide_mouse_when;
+ static bool hide_mouse;
++ bool pressed;
+ #ifdef WITH_JOYSTICK
+ static uint32_t const axis_value[][3] = {
+ // { pressed, [implicitly released ...] }
+@@ -6301,7 +6302,6 @@
+ };
+ unsigned int hat_value_map;
+ intptr_t joypad;
+- bool pressed;
+ #endif
+ uint32_t plist[8];
+ uint32_t rlist[8];
diff --git a/games-emulation/dgen-sdl/metadata.xml b/games-emulation/dgen-sdl/metadata.xml
new file mode 100644
index 000000000000..fc165789cb5e
--- /dev/null
+++ b/games-emulation/dgen-sdl/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">dgen</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/dolphin-5.0 b/games-emulation/dolphin-5.0
deleted file mode 100644
index 72f0238dd5ad..000000000000
--- a/games-emulation/dolphin-5.0
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm prepare test
-DEPEND=>=media-libs/libsfml-2.1 >net-libs/enet-1.3.7 >=net-libs/mbedtls-2.1.1:= dev-libs/lzo media-libs/libpng:0= sys-libs/readline:0= sys-libs/zlib:= x11-libs/libXext x11-libs/libXi x11-libs/libXrandr virtual/libusb:1 virtual/opengl alsa? ( media-libs/alsa-lib ) ao? ( media-libs/libao ) bluetooth? ( net-wireless/bluez ) egl? ( media-libs/mesa[egl] ) evdev? ( dev-libs/libevdev virtual/udev ) ffmpeg? ( libav? ( media-video/libav:= ) !libav? ( media-video/ffmpeg:= ) ) llvm? ( sys-devel/llvm:* ) openal? ( media-libs/openal media-libs/libsoundtouch ) portaudio? ( media-libs/portaudio ) profile? ( dev-util/oprofile ) pulseaudio? ( media-sound/pulseaudio ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 ) sdl? ( media-libs/libsdl2[haptic,joystick] ) upnp? ( >=net-libs/miniupnpc-1.7 ) wxwidgets? ( dev-libs/glib:2 x11-libs/gtk+:2 x11-libs/wxGTK:3.0[opengl,X] ) app-arch/zip media-libs/freetype sys-devel/gettext virtual/pkgconfig sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4
-DESCRIPTION=Gamecube and Wii game emulator
-EAPI=5
-HOMEPAGE=https://www.dolphin-emu.org/
-IUSE=alsa ao bluetooth doc egl +evdev ffmpeg libav llvm log lto openal +pch portaudio profile pulseaudio qt5 sdl upnp +wxwidgets
-KEYWORDS=amd64
-LICENSE=GPL-2
-RDEPEND=>=media-libs/libsfml-2.1 >net-libs/enet-1.3.7 >=net-libs/mbedtls-2.1.1:= dev-libs/lzo media-libs/libpng:0= sys-libs/readline:0= sys-libs/zlib:= x11-libs/libXext x11-libs/libXi x11-libs/libXrandr virtual/libusb:1 virtual/opengl alsa? ( media-libs/alsa-lib ) ao? ( media-libs/libao ) bluetooth? ( net-wireless/bluez ) egl? ( media-libs/mesa[egl] ) evdev? ( dev-libs/libevdev virtual/udev ) ffmpeg? ( libav? ( media-video/libav:= ) !libav? ( media-video/ffmpeg:= ) ) llvm? ( sys-devel/llvm:* ) openal? ( media-libs/openal media-libs/libsoundtouch ) portaudio? ( media-libs/portaudio ) profile? ( dev-util/oprofile ) pulseaudio? ( media-sound/pulseaudio ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 ) sdl? ( media-libs/libsdl2[haptic,joystick] ) upnp? ( >=net-libs/miniupnpc-1.7 ) wxwidgets? ( dev-libs/glib:2 x11-libs/gtk+:2 x11-libs/wxGTK:3.0[opengl,X] )
-SLOT=0
-SRC_URI=https://github.com/dolphin-emu/dolphin/archive/5.0.zip -> dolphin-5.0.zip
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 l10n 97f2753e3f1f3753d53d856c7c0bbb0b ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 pax-utils b963274a93e76570a88168c1f1db4cd7 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf versionator 26ca8a8bd95d6a74122c08ba98a4ee72 wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=97e139b28b846eb3bd7a03a66f50296c
diff --git a/games-emulation/dolphin-9999 b/games-emulation/dolphin-9999
deleted file mode 100644
index 5889c486771a..000000000000
--- a/games-emulation/dolphin-9999
+++ /dev/null
@@ -1,11 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm prepare test unpack
-DEPEND=>=media-libs/libsfml-2.1 >net-libs/enet-1.3.7 >=net-libs/mbedtls-2.1.1:= dev-libs/lzo media-libs/libpng:0= sys-libs/readline:0= sys-libs/zlib:= x11-libs/libXext x11-libs/libXi x11-libs/libXrandr virtual/libusb:1 virtual/opengl alsa? ( media-libs/alsa-lib ) ao? ( media-libs/libao ) bluetooth? ( net-wireless/bluez ) egl? ( media-libs/mesa[egl] ) evdev? ( dev-libs/libevdev virtual/udev ) ffmpeg? ( libav? ( media-video/libav:= ) !libav? ( media-video/ffmpeg:= ) ) llvm? ( sys-devel/llvm:* ) openal? ( media-libs/openal media-libs/libsoundtouch ) portaudio? ( media-libs/portaudio ) profile? ( dev-util/oprofile ) pulseaudio? ( media-sound/pulseaudio ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 ) sdl? ( media-libs/libsdl2[haptic,joystick] ) upnp? ( >=net-libs/miniupnpc-1.7 ) wxwidgets? ( dev-libs/glib:2 x11-libs/gtk+:2 x11-libs/wxGTK:3.0[opengl,X] ) app-arch/zip media-libs/freetype sys-devel/gettext virtual/pkgconfig sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4 >=dev-vcs/git-1.8.2.1[curl]
-DESCRIPTION=Gamecube and Wii game emulator
-EAPI=5
-HOMEPAGE=https://www.dolphin-emu.org/
-IUSE=alsa ao bluetooth doc egl +evdev ffmpeg libav llvm log lto openal +pch portaudio profile pulseaudio qt5 sdl upnp +wxwidgets
-LICENSE=GPL-2
-RDEPEND=>=media-libs/libsfml-2.1 >net-libs/enet-1.3.7 >=net-libs/mbedtls-2.1.1:= dev-libs/lzo media-libs/libpng:0= sys-libs/readline:0= sys-libs/zlib:= x11-libs/libXext x11-libs/libXi x11-libs/libXrandr virtual/libusb:1 virtual/opengl alsa? ( media-libs/alsa-lib ) ao? ( media-libs/libao ) bluetooth? ( net-wireless/bluez ) egl? ( media-libs/mesa[egl] ) evdev? ( dev-libs/libevdev virtual/udev ) ffmpeg? ( libav? ( media-video/libav:= ) !libav? ( media-video/ffmpeg:= ) ) llvm? ( sys-devel/llvm:* ) openal? ( media-libs/openal media-libs/libsoundtouch ) portaudio? ( media-libs/portaudio ) profile? ( dev-util/oprofile ) pulseaudio? ( media-sound/pulseaudio ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 ) sdl? ( media-libs/libsdl2[haptic,joystick] ) upnp? ( >=net-libs/miniupnpc-1.7 ) wxwidgets? ( dev-libs/glib:2 x11-libs/gtk+:2 x11-libs/wxGTK:3.0[opengl,X] )
-SLOT=0
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 git-r3 8f6de46b0aa318aea0e8cac62ece098b gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 l10n 97f2753e3f1f3753d53d856c7c0bbb0b ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 pax-utils b963274a93e76570a88168c1f1db4cd7 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf versionator 26ca8a8bd95d6a74122c08ba98a4ee72 wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=7b95d8e1f15be5b258a9da5d21eb8cf4
diff --git a/games-emulation/dolphin/Manifest b/games-emulation/dolphin/Manifest
new file mode 100644
index 000000000000..41198106b068
--- /dev/null
+++ b/games-emulation/dolphin/Manifest
@@ -0,0 +1,5 @@
+AUX dolphin-5.0-CHAR_WIDTH-collision.patch 2043 BLAKE2B d29f1f9ff360d79105d7020174bfc5063ad18c544d17056dca055174d8d0c837671f5d04f95de98e140d8634651f869e1a0d9e79b834f0f039ce59900c0696b0 SHA512 47c25a3fd5e6c47e34fe23d5faa71ea316c708fa2bbcbc5136a415fc25a0b207c4d18bfedb2d7c4e2a71394581d1e41fd7d4cca3544d34e3f4a6a84fee360314
+DIST dolphin-5.0.zip 41802909 BLAKE2B 57fb7741e86b8b5194c9ccaf99e60be0202429209ce98d08aec4ed1d6f47fb347d9149509de7ac1e4bb28435cba35e357b87cf5d29efe2867706dbb3b903c886 SHA512 36c4f371e066537331a9a8ec4a17befa278465cdebe258e1cbf1157752ba69bff9c1b8a6e8698bbb650aa257bd48b6b42ee9f61357904b09fd01738af8223d3a
+EBUILD dolphin-5.0.ebuild 4538 BLAKE2B 2cdf537c696d52e637b644500fac6b5528f863104f9ffe8b8c30d9bcefd91a6309854ed744f8174766281266b3beac403ebeaa707749fbd03b1750990ec331c1 SHA512 8c3dff0ac08c394f05256b0736209425ec4e4a8d87299bd788e5b1df9ae01aafff61c6b4484b3f064b13d5fc0e999fc434aa162b2d70268d4293b6ab138c80ce
+EBUILD dolphin-9999.ebuild 4591 BLAKE2B ef1c50ccf6887336ba8aa86ff7e3e4a8c601d6ff15b54ee2ae9f0001dc5de1dae09a195bc224f8dbac51e261eb5f99dceb372ded1fe78ed81404231c49c6a77e SHA512 569cb7d38d0cc1900a52b0fec1fb1a82071d8923adf9bec703ffd6e935fbe471b9cd314babf2de2d569009d706367d4c93a198bb7e0fc187af3d822da5370635
+MISC metadata.xml 836 BLAKE2B 786a1a9f4e7d76c0111bd9755f784a0bba5607465e2693986c6e2f37e0a32f9ceea84c902464ea47b66f84c183660d5767f569ae933c6b8774d47a15de4c6f30 SHA512 7bdcb2ba2f3a1fa247080a08da495274bea1f61bec1a88e824ebd44fb7e21e74e7ef52855c1c6fba07f12b278df19c0014ba98a5b6ec50f62c08b0ee31e5fc6b
diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild b/games-emulation/dolphin/dolphin-5.0.ebuild
new file mode 100644
index 000000000000..6110f03b0a04
--- /dev/null
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PLOCALES="ar ca cs da_DK de el en es fa fr hr hu it ja ko ms_MY nb nl pl pt pt_BR ro_RO ru sr sv tr zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+WX_GTK_VER="3.0"
+
+inherit cmake-utils desktop gnome2-utils l10n pax-utils toolchain-funcs versionator wxwidgets
+
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.zip -> ${P}.zip"
+KEYWORDS="amd64"
+
+DESCRIPTION="Gamecube and Wii game emulator"
+HOMEPAGE="https://www.dolphin-emu.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="alsa ao bluetooth doc egl +evdev ffmpeg libav llvm log lto openal +pch portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
+
+RDEPEND="
+ >=media-libs/libsfml-2.1
+ >net-libs/enet-1.3.7
+ >=net-libs/mbedtls-2.1.1:=
+ dev-libs/lzo
+ media-libs/libpng:0=
+ sys-libs/readline:0=
+ sys-libs/zlib:=
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ virtual/libusb:1
+ virtual/opengl
+ alsa? ( media-libs/alsa-lib )
+ ao? ( media-libs/libao )
+ bluetooth? ( net-wireless/bluez )
+ egl? ( media-libs/mesa[egl] )
+ evdev? (
+ dev-libs/libevdev
+ virtual/udev
+ )
+ ffmpeg? (
+ libav? ( media-video/libav:= )
+ !libav? ( media-video/ffmpeg:= )
+ )
+ llvm? ( sys-devel/llvm:* )
+ openal? (
+ media-libs/openal
+ media-libs/libsoundtouch
+ )
+ portaudio? ( media-libs/portaudio )
+ profile? ( dev-util/oprofile )
+ pulseaudio? ( media-sound/pulseaudio )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ )
+ sdl? ( media-libs/libsdl2[haptic,joystick] )
+ upnp? ( >=net-libs/miniupnpc-1.7 )
+ wxwidgets? (
+ dev-libs/glib:2
+ x11-libs/gtk+:2
+ x11-libs/wxGTK:${WX_GTK_VER}[opengl,X]
+ )"
+DEPEND="${RDEPEND}
+ app-arch/zip
+ media-libs/freetype
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${P}-CHAR_WIDTH-collision.patch )
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # Remove automatic dependencies to prevent building without flags enabled.
+ if use !alsa; then
+ sed -i -e '/include(FindALSA/d' CMakeLists.txt || die
+ fi
+ if use !ao; then
+ sed -i -e '/check_lib(AO/d' CMakeLists.txt || die
+ fi
+ if use !bluetooth; then
+ sed -i -e '/check_lib(BLUEZ/d' CMakeLists.txt || die
+ fi
+ if use !llvm; then
+ sed -i -e '/include(FindLLVM/d' CMakeLists.txt || die
+ fi
+ if use !openal; then
+ sed -i -e '/include(FindOpenAL/d' CMakeLists.txt || die
+ fi
+ if use !portaudio; then
+ sed -i -e '/CMAKE_REQUIRED_LIBRARIES portaudio/d' CMakeLists.txt || die
+ fi
+ if use !pulseaudio; then
+ sed -i -e '/check_lib(PULSEAUDIO/d' CMakeLists.txt || die
+ fi
+
+ # Remove ALL the bundled libraries, aside from:
+ # - SOIL: The sources are not public.
+ # - Bochs-disasm: Don't know what it is.
+ # - gtest: Their build set up solely relies on the build in gtest.
+ # - xxhash: Not on the tree.
+ mv Externals/SOIL . || die
+ mv Externals/Bochs_disasm . || die
+ mv Externals/gtest . || die
+ mv Externals/xxhash . || die
+ rm -r Externals/* || die "Failed to delete Externals dir."
+ mv Bochs_disasm Externals || die
+ mv SOIL Externals || die
+ mv gtest Externals || die
+ mv xxhash Externals || die
+
+ remove_locale() {
+ # Ensure preservation of the backup locale when no valid LINGUA is set
+ if [[ "${PLOCALE_BACKUP}" == "${1}" ]] && [[ "${PLOCALE_BACKUP}" == "$(l10n_get_locales)" ]]; then
+ return
+ else
+ rm "Languages/po/${1}.po" || die
+ fi
+ }
+
+ l10n_find_plocales_changes "Languages/po/" "" '.po'
+ l10n_for_each_disabled_locale_do remove_locale
+}
+
+src_configure() {
+ if use wxwidgets; then
+ need-wxwidgets unicode
+ fi
+
+ local mycmakeargs=(
+ -DUSE_SHARED_ENET=ON
+ $( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
+ $( cmake-utils_use log FASTLOG )
+ $( cmake-utils_use profile OPROFILING )
+ $( cmake-utils_use_disable wxwidgets WX )
+ $( cmake-utils_use_enable evdev EVDEV )
+ $( cmake-utils_use_enable lto LTO )
+ $( cmake-utils_use_enable pch PCH )
+ $( cmake-utils_use_enable qt5 QT2 )
+ $( cmake-utils_use_enable sdl SDL )
+ $( cmake-utils_use_use egl EGL )
+ $( cmake-utils_use_use upnp UPNP )
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ dodoc Readme.md
+ if use doc; then
+ dodoc -r docs/ActionReplay docs/DSP docs/WiiMote
+ fi
+
+ doicon -s 48 Data/dolphin-emu.png
+ doicon -s scalable Data/dolphin-emu.svg
+ doicon Data/dolphin-emu.svg
+}
+
+pkg_postinst() {
+ # Add pax markings for hardened systems
+ pax-mark -m "${EPREFIX}"/usr/games/bin/"${PN}"-emu
+
+ if ! use portaudio; then
+ ewarn "If you want microphone capabilities in dolphin-emu, rebuild with"
+ ewarn "USE=\"portaudio\""
+ fi
+
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/dolphin/dolphin-9999.ebuild b/games-emulation/dolphin/dolphin-9999.ebuild
new file mode 100644
index 000000000000..78c1cdbac9d0
--- /dev/null
+++ b/games-emulation/dolphin/dolphin-9999.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PLOCALES="ar ca cs da_DK de el en es fa fr hr hu it ja ko ms_MY nb nl pl pt pt_BR ro_RO ru sr sv tr zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+WX_GTK_VER="3.0"
+
+inherit cmake-utils desktop gnome2-utils l10n pax-utils toolchain-funcs versionator wxwidgets
+
+if [[ ${PV} == *9999 ]]
+then
+ EGIT_REPO_URI="https://github.com/dolphin-emu/dolphin"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.zip -> ${P}.zip"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Gamecube and Wii game emulator"
+HOMEPAGE="https://www.dolphin-emu.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="alsa ao bluetooth doc egl +evdev ffmpeg libav llvm log lto openal +pch portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
+
+RDEPEND="
+ >=media-libs/libsfml-2.1
+ >net-libs/enet-1.3.7
+ >=net-libs/mbedtls-2.1.1:=
+ dev-libs/lzo
+ media-libs/libpng:0=
+ sys-libs/readline:0=
+ sys-libs/zlib:=
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ virtual/libusb:1
+ virtual/opengl
+ alsa? ( media-libs/alsa-lib )
+ ao? ( media-libs/libao )
+ bluetooth? ( net-wireless/bluez )
+ egl? ( media-libs/mesa[egl] )
+ evdev? (
+ dev-libs/libevdev
+ virtual/udev
+ )
+ ffmpeg? (
+ libav? ( media-video/libav:= )
+ !libav? ( media-video/ffmpeg:= )
+ )
+ llvm? ( sys-devel/llvm:* )
+ openal? (
+ media-libs/openal
+ media-libs/libsoundtouch
+ )
+ portaudio? ( media-libs/portaudio )
+ profile? ( dev-util/oprofile )
+ pulseaudio? ( media-sound/pulseaudio )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ )
+ sdl? ( media-libs/libsdl2[haptic,joystick] )
+ upnp? ( >=net-libs/miniupnpc-1.7 )
+ wxwidgets? (
+ dev-libs/glib:2
+ x11-libs/gtk+:2
+ x11-libs/wxGTK:${WX_GTK_VER}[opengl,X]
+ )"
+DEPEND="${RDEPEND}
+ app-arch/zip
+ media-libs/freetype
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # Remove automatic dependencies to prevent building without flags enabled.
+ if use !alsa; then
+ sed -i -e '/include(FindALSA/d' CMakeLists.txt || die
+ fi
+ if use !ao; then
+ sed -i -e '/check_lib(AO/d' CMakeLists.txt || die
+ fi
+ if use !bluetooth; then
+ sed -i -e '/check_lib(BLUEZ/d' CMakeLists.txt || die
+ fi
+ if use !llvm; then
+ sed -i -e '/include(FindLLVM/d' CMakeLists.txt || die
+ fi
+ if use !openal; then
+ sed -i -e '/include(FindOpenAL/d' CMakeLists.txt || die
+ fi
+ if use !portaudio; then
+ sed -i -e '/CMAKE_REQUIRED_LIBRARIES portaudio/d' CMakeLists.txt || die
+ fi
+ if use !pulseaudio; then
+ sed -i -e '/check_lib(PULSEAUDIO/d' CMakeLists.txt || die
+ fi
+
+ # Remove ALL the bundled libraries, aside from:
+ # - SOIL: The sources are not public.
+ # - Bochs-disasm: Don't know what it is.
+ # - gtest: Their build set up solely relies on the build in gtest.
+ # - xxhash: Not on the tree.
+ mv Externals/SOIL . || die
+ mv Externals/Bochs_disasm . || die
+ mv Externals/gtest . || die
+ mv Externals/xxhash . || die
+ rm -r Externals/* || die "Failed to delete Externals dir."
+ mv Bochs_disasm Externals || die
+ mv SOIL Externals || die
+ mv gtest Externals || die
+ mv xxhash Externals || die
+
+ remove_locale() {
+ # Ensure preservation of the backup locale when no valid LINGUA is set
+ if [[ "${PLOCALE_BACKUP}" == "${1}" ]] && [[ "${PLOCALE_BACKUP}" == "$(l10n_get_locales)" ]]; then
+ return
+ else
+ rm "Languages/po/${1}.po" || die
+ fi
+ }
+
+ l10n_find_plocales_changes "Languages/po/" "" '.po'
+ l10n_for_each_disabled_locale_do remove_locale
+}
+
+src_configure() {
+ if use wxwidgets; then
+ need-wxwidgets unicode
+ fi
+
+ local mycmakeargs=(
+ -DUSE_SHARED_ENET=ON
+ $( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
+ $( cmake-utils_use log FASTLOG )
+ $( cmake-utils_use profile OPROFILING )
+ $( cmake-utils_use_disable wxwidgets WX )
+ $( cmake-utils_use_enable evdev EVDEV )
+ $( cmake-utils_use_enable lto LTO )
+ $( cmake-utils_use_enable pch PCH )
+ $( cmake-utils_use_enable qt5 QT2 )
+ $( cmake-utils_use_enable sdl SDL )
+ $( cmake-utils_use_use egl EGL )
+ $( cmake-utils_use_use upnp UPNP )
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ dodoc Readme.md
+ if use doc; then
+ dodoc -r docs/ActionReplay docs/DSP docs/WiiMote
+ fi
+
+ doicon -s 48 Data/dolphin-emu.png
+ doicon -s scalable Data/dolphin-emu.svg
+ doicon Data/dolphin-emu.svg
+}
+
+pkg_postinst() {
+ # Add pax markings for hardened systems
+ pax-mark -m "${EPREFIX}"/usr/games/bin/"${PN}"-emu
+
+ if ! use portaudio; then
+ ewarn "If you want microphone capabilities in dolphin-emu, rebuild with"
+ ewarn "USE=\"portaudio\""
+ fi
+
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch b/games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch
new file mode 100644
index 000000000000..d6e4c7a2dc0e
--- /dev/null
+++ b/games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch
@@ -0,0 +1,49 @@
+Avoid clash with TS 18661-1:2014 macros
+https://bugs.gentoo.org/637986
+
+--- a/Source/Core/VideoBackends/OGL/RasterFont.cpp
++++ b/Source/Core/VideoBackends/OGL/RasterFont.cpp
+@@ -15,7 +15,7 @@
+ namespace OGL
+ {
+
+-static const int CHAR_WIDTH = 8;
++static const int DOLPHIN_CHAR_WIDTH = 8;
+ static const int CHAR_HEIGHT = 13;
+ static const int CHAR_OFFSET = 32;
+ static const int CHAR_COUNT = 95;
+@@ -146,20 +146,20 @@
+ glGenTextures(1, &texture);
+ glActiveTexture(GL_TEXTURE8);
+ glBindTexture(GL_TEXTURE_2D, texture);
+- std::vector<u32> texture_data(CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT);
++ std::vector<u32> texture_data(DOLPHIN_CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT);
+ for (int y = 0; y < CHAR_HEIGHT; y++)
+ {
+ for (int c = 0; c < CHAR_COUNT; c++)
+ {
+- for (int x = 0; x < CHAR_WIDTH; x++)
++ for (int x = 0; x < DOLPHIN_CHAR_WIDTH; x++)
+ {
+- bool pixel = (0 != (rasters[c][y] & (1 << (CHAR_WIDTH - x - 1))));
+- texture_data[CHAR_WIDTH * CHAR_COUNT * y + CHAR_WIDTH * c + x] = pixel ? -1 : 0;
++ bool pixel = (0 != (rasters[c][y] & (1 << (DOLPHIN_CHAR_WIDTH - x - 1))));
++ texture_data[DOLPHIN_CHAR_WIDTH * CHAR_COUNT * y + DOLPHIN_CHAR_WIDTH * c + x] = pixel ? -1 : 0;
+ }
+ }
+ }
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CHAR_WIDTH * CHAR_COUNT, CHAR_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
++ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, DOLPHIN_CHAR_WIDTH * CHAR_COUNT, CHAR_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
+
+ // generate shader
+ ProgramShaderCache::CompileShader(s_shader, s_vertexShaderSrc, s_fragmentShaderSrc);
+@@ -196,7 +196,7 @@
+ std::vector<GLfloat> vertices(text.length() * 6 * 4);
+
+ int usage = 0;
+- GLfloat delta_x = GLfloat(2 * CHAR_WIDTH) / GLfloat(bbWidth);
++ GLfloat delta_x = GLfloat(2 * DOLPHIN_CHAR_WIDTH) / GLfloat(bbWidth);
+ GLfloat delta_y = GLfloat(2 * CHAR_HEIGHT) / GLfloat(bbHeight);
+ GLfloat border_x = 2.0f / GLfloat(bbWidth);
+ GLfloat border_y = 4.0f / GLfloat(bbHeight);
diff --git a/games-emulation/dolphin/metadata.xml b/games-emulation/dolphin/metadata.xml
new file mode 100644
index 000000000000..e5f72fa203b6
--- /dev/null
+++ b/games-emulation/dolphin/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="egl">Enable EGL support</flag>
+ <flag name="evdev">Enable evdev input support</flag>
+ <flag name="llvm">Enable the LLVM-based disassembler for debugger mode</flag>
+ <flag name="log">Increase logging output</flag>
+ <flag name="lto">Add support for link-time optimizations.</flag>
+ </use>
+ <longdescription lang="en">
+Dolphin is a Gamecube and Wii emulator. Most games run perfectly or with minor
+bugs. Games are playable at HD quality, with 1080p and more.
+ </longdescription>
+ <maintainer type="person">
+ <email>twitch153@gentoo.org</email>
+ <name>Devan Franchini</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">dolphin-emu/dolphin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/dosbox-0.74_p20160629 b/games-emulation/dosbox-0.74_p20160629
deleted file mode 100644
index 334876e156f7..000000000000
--- a/games-emulation/dosbox-0.74_p20160629
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install prepare
-DEPEND=alsa? ( media-libs/alsa-lib ) opengl? ( virtual/glu virtual/opengl ) debug? ( sys-libs/ncurses:0 ) media-libs/libpng:0 media-libs/libsdl[joystick,video,X] media-libs/sdl-net media-libs/sdl-sound app-arch/unzip >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=DOS emulator
-EAPI=6
-HOMEPAGE=http://dosbox.sourceforge.net/
-IUSE=alsa debug hardened opengl
-KEYWORDS=amd64 ~arm ppc64 x86
-LICENSE=GPL-2
-RDEPEND=alsa? ( media-libs/alsa-lib ) opengl? ( virtual/glu virtual/opengl ) debug? ( sys-libs/ncurses:0 ) media-libs/libpng:0 media-libs/libsdl[joystick,video,X] media-libs/sdl-net media-libs/sdl-sound
-SLOT=0
-SRC_URI=mirror://gentoo/dosbox-code-0-3989-dosbox-trunk.zip
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=be0257ff2a9c6054437efa4bc2694ce8
diff --git a/games-emulation/dosbox-0.74_p20160629-r1 b/games-emulation/dosbox-0.74_p20160629-r1
deleted file mode 100644
index b4e34d721cb9..000000000000
--- a/games-emulation/dosbox-0.74_p20160629-r1
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install postinst prepare
-DEPEND=alsa? ( media-libs/alsa-lib ) glide? ( media-libs/openglide ) opengl? ( virtual/glu virtual/opengl ) debug? ( sys-libs/ncurses:0 ) media-libs/libpng:0 media-libs/libsdl[joystick,video,X] media-libs/sdl-net media-libs/sdl-sound app-arch/unzip >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=DOS emulator
-EAPI=6
-HOMEPAGE=http://dosbox.sourceforge.net/
-IUSE=alsa debug glide hardened opengl
-KEYWORDS=~amd64 ~arm ~ppc64 ~x86
-LICENSE=GPL-2
-RDEPEND=alsa? ( media-libs/alsa-lib ) glide? ( media-libs/openglide ) opengl? ( virtual/glu virtual/opengl ) debug? ( sys-libs/ncurses:0 ) media-libs/libpng:0 media-libs/libsdl[joystick,video,X] media-libs/sdl-net media-libs/sdl-sound
-SLOT=0
-SRC_URI=mirror://gentoo/dosbox-code-0-3989-dosbox-trunk.zip glide? ( https://raw.githubusercontent.com/voyageur/openglide/3722fc563b737d2d7933df6a771651c2154e6f7b/platform/dosbox/dosbox_glide.diff -> dosbox_glide-3722fc563b737d2d7933df6a771651c2154e6f7b.diff )
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=d51952680e9e9928e893c6c34f8abf35
diff --git a/games-emulation/dosbox-9999 b/games-emulation/dosbox-9999
deleted file mode 100644
index c0ac1da9473a..000000000000
--- a/games-emulation/dosbox-9999
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=configure install postinst preinst prepare unpack
-DEPEND=alsa? ( media-libs/alsa-lib ) glide? ( media-libs/openglide ) opengl? ( virtual/glu virtual/opengl ) debug? ( sys-libs/ncurses:0 ) media-libs/libpng:0 media-libs/libsdl[joystick,video,X] media-libs/sdl-net media-libs/sdl-sound || ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] dev-vcs/subversion[webdav-serf] ) net-misc/rsync >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=DOS emulator
-EAPI=6
-HOMEPAGE=http://dosbox.sourceforge.net/
-IUSE=alsa debug glide hardened opengl
-LICENSE=GPL-2
-RDEPEND=alsa? ( media-libs/alsa-lib ) glide? ( media-libs/openglide ) opengl? ( virtual/glu virtual/opengl ) debug? ( sys-libs/ncurses:0 ) media-libs/libpng:0 media-libs/libsdl[joystick,video,X] media-libs/sdl-net media-libs/sdl-sound
-SLOT=0
-SRC_URI=glide? ( https://raw.githubusercontent.com/voyageur/openglide/841e1071597b64ead14dd08c25a03206b2d1d1b6/platform/dosbox/dosbox_glide.diff -> dosbox_glide-841e1071597b64ead14dd08c25a03206b2d1d1b6.diff )
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 subversion a5d5826a85609611f098c0553eb24cc1 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=2006a7920a7fefcd22d6fb09f02741da
diff --git a/games-emulation/dosbox/Manifest b/games-emulation/dosbox/Manifest
new file mode 100644
index 000000000000..872b32c2d143
--- /dev/null
+++ b/games-emulation/dosbox/Manifest
@@ -0,0 +1,8 @@
+AUX dosbox-0.74-gcc46.patch 274 BLAKE2B 6375a8c0752eed6481cfc987ac3b7c7f699d745498e619862223dcbf660eef21f7619ef5b8e2034d20ad09716714988875e30d1959fe29393fd96559a2d710df SHA512 3175ba75be568d24286501844073bebbd2ae2e770ca6bdd9d409b290ca7b9f98a8406b5b92b89a9965eeda8045f2ac9634aacf8eb01917cbf02087996de53177
+DIST dosbox-code-0-3989-dosbox-trunk.zip 1327592 BLAKE2B 7a9eccd381c1ce7a08d6e650d94de9e82aa5fb1b63abd23b0f42d10d95df4ca2ba4b2c319f3375e030c1578f032ee7bde528f9c4bbc27b665733f7d035865376 SHA512 625eacc1a1190d87d56713f7af54e6a7886e7666ba9f7f0b1d553c96a2eb02ec7810ac2da73d014d5ea3b69f2a7658bdd445532abe030e7f6ef85a3c20bdd3c7
+DIST dosbox_glide-3722fc563b737d2d7933df6a771651c2154e6f7b.diff 96346 BLAKE2B c22d8897b3767b3351aec4d7bd64d201c32e2191c0520478f33973b0b36652e9770f571ea32fee6d30a4de35cae1c4d223d56af070b3f3916f6827ab47ec0585 SHA512 d2be6ee8bd1f13058c76ccae595b67f15ab87e0e36dab0d938ebbd7fc5d379f6f054d30c32ef4723b9fcdbbcea7bf0e1aa2c8b1aab1737f1d0e4d2a2df0f7714
+DIST dosbox_glide-841e1071597b64ead14dd08c25a03206b2d1d1b6.diff 96801 BLAKE2B d24d1f4262129899d807c275b1ae2d6c09056a126441665f37359302428f30576f399c4778b55f4eaec674e714d85243f576bfa3064887c5801daddc9e507aad SHA512 4cbe0ede9c4242aa346ca6c609b7a4d8e4e1d204d79d93ff741d58d3ca14e43a2e49cd696bd4bd54c13e62d1080320ee233963bac26f25bb0b4fada86e813ca2
+EBUILD dosbox-0.74_p20160629-r1.ebuild 1787 BLAKE2B 7a7c60b909d4a4b4e424d5baa03b5ca7247697c6d993f5aed8690d9eb35b708e62626febc56b94dbd7ca70ecbfd3b93ce4327128e2272a97f5ff1ddd26307a03 SHA512 f4e67047d01f2ca91fa446136ec2829c589c37f2cca664e1ff1292a5ec78fa8a44f78defcdfd23e556ffa2a2d3b2f9a403e4178f3dca36b5ea58307ca1c52889
+EBUILD dosbox-0.74_p20160629.ebuild 1074 BLAKE2B 1d8f874307886cd84f6573784e4d1af6117841c49242352a57109b82879a58ae12a8a512f40eb65fc64b3e294455d278671f3ee7dd46497569954219c566a8a6 SHA512 00edfb8cf1fa3b1f7bee6ef96b5dee033cf1ca48737e9f00a4ddbe09b29c717cf2ae1f10577ca29fa4b886ec7a28f2131e1e12dc41fed5a4c5831b0194ce58b8
+EBUILD dosbox-9999.ebuild 1884 BLAKE2B d5fb6c6b1f123e83d960dd3ff7323845e9ab2673aa889c08d4dc660e18617503b56dfd765f405cb03d3509e88e1cb78242c96b37161a263b966c7fc54eec25a3 SHA512 9ae090a3377bc63b13cb6b6325ffdc36e1cd3a1df512f5c50d1334005a41893dbb6459e008594fe8550fb31948b1f149913bd641fc281fdffea2a7b7e5cfb970
+MISC metadata.xml 623 BLAKE2B 2ff1106b2288c775d3bcff26145af604b63edd350f28ff3fd9c8407a738910d080425fa635b6b03436b0b8c24dde9c7dbd342df1f1bacdfacc391246db565ac0 SHA512 a7aff1ef1c4c2c97e8287b3aec84c1c270b8d052e12d4719704a6732575f1f62e4f9024af3d4e1f234e18c3d47aec863bdf6e6472e03cabd24124e7473c28e87
diff --git a/games-emulation/dosbox/dosbox-0.74_p20160629-r1.ebuild b/games-emulation/dosbox/dosbox-0.74_p20160629-r1.ebuild
new file mode 100644
index 000000000000..f622d980d347
--- /dev/null
+++ b/games-emulation/dosbox/dosbox-0.74_p20160629-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools eutils flag-o-matic
+
+PATCH=3989
+GLIDE_PATCH=3722fc563b737d2d7933df6a771651c2154e6f7b
+
+DESCRIPTION="DOS emulator"
+HOMEPAGE="http://dosbox.sourceforge.net/"
+SRC_URI="mirror://gentoo/dosbox-code-0-${PATCH}-dosbox-trunk.zip
+ glide? ( https://raw.githubusercontent.com/voyageur/openglide/${GLIDE_PATCH}/platform/dosbox/dosbox_glide.diff -> dosbox_glide-${GLIDE_PATCH}.diff )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
+IUSE="alsa debug glide hardened opengl"
+
+RDEPEND="alsa? ( media-libs/alsa-lib )
+ glide? ( media-libs/openglide )
+ opengl? ( virtual/glu virtual/opengl )
+ debug? ( sys-libs/ncurses:0 )
+ media-libs/libpng:0
+ media-libs/libsdl[joystick,video,X]
+ media-libs/sdl-net
+ media-libs/sdl-sound"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/${PN}-code-0-${PATCH}-dosbox-trunk
+
+PATCHES=(
+"${FILESDIR}"/dosbox-0.74-gcc46.patch
+)
+
+src_prepare() {
+ use glide && eapply "${DISTDIR}"/dosbox_glide-${GLIDE_PATCH}.diff
+ default
+ eautoreconf
+}
+
+src_configure() {
+ use glide && append-cppflags -I"${EPREFIX}"/usr/include/openglide
+
+ econf \
+ $(use_enable alsa alsa-midi) \
+ $(use_enable !hardened dynamic-core) \
+ $(use_enable !hardened dynamic-x86) \
+ $(use_enable debug) \
+ $(use_enable opengl)
+}
+
+src_install() {
+ default
+ make_desktop_entry dosbox DOSBox /usr/share/pixmaps/dosbox.ico
+ doicon src/dosbox.ico
+}
+
+pkg_postinst() {
+ if use glide; then
+ elog "You have enabled unofficial Glide emulation. To use this, symlink"
+ elog "or copy ${EPREFIX}/usr/share/openglide/glide2x-dosbox.ovl to your game's"
+ elog "directory and add the following to your DOSBox configuration."
+ elog ""
+ elog "[glide]"
+ elog "glide=true"
+ fi
+}
diff --git a/games-emulation/dosbox/dosbox-0.74_p20160629.ebuild b/games-emulation/dosbox/dosbox-0.74_p20160629.ebuild
new file mode 100644
index 000000000000..45b0b0fdb711
--- /dev/null
+++ b/games-emulation/dosbox/dosbox-0.74_p20160629.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools eutils
+
+PATCH=3989
+DESCRIPTION="DOS emulator"
+HOMEPAGE="http://dosbox.sourceforge.net/"
+SRC_URI="mirror://gentoo/dosbox-code-0-${PATCH}-dosbox-trunk.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc64 x86"
+IUSE="alsa debug hardened opengl"
+
+RDEPEND="alsa? ( media-libs/alsa-lib )
+ opengl? ( virtual/glu virtual/opengl )
+ debug? ( sys-libs/ncurses:0 )
+ media-libs/libpng:0
+ media-libs/libsdl[joystick,video,X]
+ media-libs/sdl-net
+ media-libs/sdl-sound"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/${PN}-code-0-${PATCH}-dosbox-trunk
+
+PATCHES=(
+"${FILESDIR}"/dosbox-0.74-gcc46.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable alsa alsa-midi) \
+ $(use_enable !hardened dynamic-core) \
+ $(use_enable !hardened dynamic-x86) \
+ $(use_enable debug) \
+ $(use_enable opengl)
+}
+
+src_install() {
+ default
+ make_desktop_entry dosbox DOSBox /usr/share/pixmaps/dosbox.ico
+ doicon src/dosbox.ico
+}
diff --git a/games-emulation/dosbox/dosbox-9999.ebuild b/games-emulation/dosbox/dosbox-9999.ebuild
new file mode 100644
index 000000000000..bceaab9e8150
--- /dev/null
+++ b/games-emulation/dosbox/dosbox-9999.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+GLIDE_PATCH=841e1071597b64ead14dd08c25a03206b2d1d1b6
+SRC_URI="glide? ( https://raw.githubusercontent.com/voyageur/openglide/${GLIDE_PATCH}/platform/dosbox/dosbox_glide.diff -> dosbox_glide-${GLIDE_PATCH}.diff )"
+
+if [[ ${PV} = 9999 ]]; then
+ ESVN_REPO_URI="https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk"
+ inherit subversion
+else
+ SRC_URI+=" mirror://sourceforge/dosbox/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
+fi
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="DOS emulator"
+HOMEPAGE="http://dosbox.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="alsa debug glide hardened opengl"
+
+DEPEND="alsa? ( media-libs/alsa-lib )
+ glide? ( media-libs/openglide )
+ opengl? ( virtual/glu virtual/opengl )
+ debug? ( sys-libs/ncurses:0 )
+ media-libs/libpng:0
+ media-libs/libsdl[joystick,video,X]
+ media-libs/sdl-net
+ media-libs/sdl-sound"
+RDEPEND=${DEPEND}
+
+if [[ ${PV} = 9999 ]]; then
+ S=${WORKDIR}/${PN}
+fi
+
+PATCHES=( "${FILESDIR}/${PN}-0.74-gcc46.patch" )
+
+src_prepare() {
+ use glide && eapply "${DISTDIR}"/dosbox_glide-${GLIDE_PATCH}.diff
+ default
+ eautoreconf
+}
+
+src_configure() {
+ use glide && append-cppflags -I"${EPREFIX}"/usr/include/openglide
+
+ econf \
+ $(use_enable alsa alsa-midi) \
+ $(use_enable !hardened dynamic-core) \
+ $(use_enable !hardened dynamic-x86) \
+ $(use_enable debug) \
+ $(use_enable opengl)
+}
+
+src_install() {
+ default
+ make_desktop_entry dosbox DOSBox /usr/share/pixmaps/dosbox.ico
+ doicon src/dosbox.ico
+}
+
+pkg_postinst() {
+ if use glide; then
+ elog "You have enabled unofficial Glide emulation. To use this, symlink"
+ elog "or copy ${EPREFIX}/usr/share/openglide/glide2x-dosbox.ovl to your game's"
+ elog "directory and add the following to your DOSBox configuration."
+ elog ""
+ elog "[glide]"
+ elog "glide=true"
+ fi
+}
diff --git a/games-emulation/dosbox/files/dosbox-0.74-gcc46.patch b/games-emulation/dosbox/files/dosbox-0.74-gcc46.patch
new file mode 100644
index 000000000000..98b4508f519f
--- /dev/null
+++ b/games-emulation/dosbox/files/dosbox-0.74-gcc46.patch
@@ -0,0 +1,10 @@
+--- a/include/dos_inc.h 2011-04-28 08:46:04.505011354 +0200
++++ b/include/dos_inc.h 2011-04-28 08:46:27.104408178 +0200
+@@ -21,6 +21,7 @@
+ #ifndef DOSBOX_DOS_INC_H
+ #define DOSBOX_DOS_INC_H
+
++#include <cstddef>
+ #ifndef DOSBOX_DOS_SYSTEM_H
+ #include "dos_system.h"
+ #endif
diff --git a/games-emulation/dosbox/metadata.xml b/games-emulation/dosbox/metadata.xml
new file mode 100644
index 000000000000..4c30301896f0
--- /dev/null
+++ b/games-emulation/dosbox/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+<maintainer type="project">
+ <email>wine@gentoo.org</email>
+ <name>Gentoo Wine Project</name>
+ <description>Should be cc'ed for issues with dosbox-0.74-_p* snapshot versions</description>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">dosbox</remote-id>
+</upstream>
+<use>
+ <flag name="glide">Enable unofficial Glide emulation via media-libs/openglide</flag>
+</use>
+</pkgmetadata>
diff --git a/games-emulation/emutos-0.9.4-r1 b/games-emulation/emutos-0.9.4-r1
deleted file mode 100644
index 9bf2ea66eb26..000000000000
--- a/games-emulation/emutos-0.9.4-r1
+++ /dev/null
@@ -1,10 +0,0 @@
-DEFINED_PHASES=install
-DEPEND=app-arch/unzip
-DESCRIPTION=Single-user single-tasking operating system for 32 bit Atari computer emulators
-EAPI=6
-HOMEPAGE=http://emutos.sourceforge.net
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-SLOT=0
-SRC_URI=mirror://sourceforge/emutos/emutos-src-0.9.3.tar.gz mirror://sourceforge/emutos/emutos-512k-0.9.4.zip mirror://sourceforge/emutos/emutos-256k-0.9.4.zip
-_md5_=ae77d07d7fb2081cd8cba088f7cc3d70
diff --git a/games-emulation/emutos-0.9.9.1 b/games-emulation/emutos-0.9.9.1
deleted file mode 100644
index 8b4476d2ec7b..000000000000
--- a/games-emulation/emutos-0.9.9.1
+++ /dev/null
@@ -1,10 +0,0 @@
-DEFINED_PHASES=install
-DEPEND=app-arch/unzip
-DESCRIPTION=Single-user single-tasking operating system for 32 bit Atari computer emulators
-EAPI=6
-HOMEPAGE=http://emutos.sourceforge.net
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-SLOT=0
-SRC_URI=mirror://sourceforge/emutos/emutos-512k-0.9.9.1.zip mirror://sourceforge/emutos/emutos-256k-0.9.9.1.zip
-_md5_=21ce29ff1dba671a4f55675d3441a505
diff --git a/games-emulation/emutos/Manifest b/games-emulation/emutos/Manifest
new file mode 100644
index 000000000000..15b6ffc7ccef
--- /dev/null
+++ b/games-emulation/emutos/Manifest
@@ -0,0 +1,8 @@
+DIST emutos-256k-0.9.4.zip 1600186 BLAKE2B 2c5243165d651a8f4f3b56d0b4bf30bbfd183e4c9d3ae2b1087c3864d540efe445cf10b68e98e862a12be9f34c388548959376a665aac91f09e05b4b39abce58 SHA512 ce7ce9e53c82f7861752ee454a4e3ce616bca73ce580e2b803deea22497de06e5ab49a69af6507ce98ab337312dbb879d258ba2acdf868443f406761caa69404
+DIST emutos-256k-0.9.9.1.zip 1913841 BLAKE2B 3f6093b5df9f694c8f75c07378bbb2e6326b4cf5235fd76059d6cd49701744e16b6fcbf8a92ece7d7bc67c480578f6245bd2e5d48a3e73240b7ae57f0c9ad4d6 SHA512 9ede677a53414bf86b111b3703386aea2b9600abbd6a4fd632b3549faa50f7308fcc7a0eb78626d59a4f2c7d8b844dc2ad5137d2b927f070ab1482799605a56d
+DIST emutos-512k-0.9.4.zip 314877 BLAKE2B 69388ce090c56c05861b859061a9b47998354dc240a0b482f616c5a2c9440ee897abdad96b946f922f77f60ee7d781e37538a42bfc778a6e15ab82225596d91b SHA512 00c8718f364712f5d346859dc40ed83c1792521c9600520aacf199f7d6b24d5cf7a3e2533e1e343d6aa9e77ed3056f8636713bb7c3e9739254e0658c921a78a8
+DIST emutos-512k-0.9.9.1.zip 273400 BLAKE2B baf7001b1150aa5aa5482920733c613c8ebc2d9eeb944de6c1cae471e6889062ed935a3bfe17d209a54733dd5ca453244fde6d906b7dd7f68772633d456df594 SHA512 38f5084df230883634715a1bd1ec542ed63027fae5690a7857986653a918f302126a288600aefa38bd12920d40c1a535cd467b66d55a1b0471364a590ca7986a
+DIST emutos-src-0.9.3.tar.gz 935570 BLAKE2B bcbf216e8bfbae681a404fdaa07e7bc00e1a865e4f6430bf70741ea9a92ee16ab90eef99140c29f3cf381bac93d72e20312e7f21b2e96bc23144c73af0b9191f SHA512 45e19a9f8ebbd1675059a78d1416d0571bc54c3979b36c684f2394f508f48f6f1dae10f4eb966e1757ff10698644302c788ee3e51bf42fe10d131d87508d9824
+EBUILD emutos-0.9.4-r1.ebuild 640 BLAKE2B 8a3f4bb6cfa1d3e87bb6d17f4d17e66d46c99f020824fb067dd865438414b28fb33f23d9a7d4bc2485403763aaf76fd7dbe5048bd54b4e2229eb8fe4dcb2f071 SHA512 2c5b4da9049091414ab55b0caf51953701fcec33742b66e0e78f1c030592d89d0fe51175bbf8275b2bb2956074091577522b92db4c88db258dd8b71ef8916d14
+EBUILD emutos-0.9.9.1.ebuild 587 BLAKE2B 828a08810fcd647a4dc5b06c48635c042b28b83f0b0cb6d67859f0d04c228c9d2eeb137d288f2b72550eeeff26a1f73b24ef3278832239383a64f2b620713d09 SHA512 adb1a1bffe4f24f784a2083d96d28eb20e1dade2b8f9917188db24a3a48ed0e5e46db8719e476aa010c46f7342c6eb2f3e39b27d990255dcbe7e03c4edac744e
+MISC metadata.xml 329 BLAKE2B 3751df88821c56b414164dd686cc65be252f2968ecf92c93f2c6b3c6bd88a77bdc28a2fd33f4d08d2956e6e4d42c3304c0bc7a01226551850c44a438f1d2dd5e SHA512 5af91295f3ae78fb613b90a573aa870ac2e5e00623f305a00981637ac480320f2df7b16f35155e880344254521a0d08adf12ae92cffa15d4a3c3dab2aa8d661a
diff --git a/games-emulation/emutos/emutos-0.9.4-r1.ebuild b/games-emulation/emutos/emutos-0.9.4-r1.ebuild
new file mode 100644
index 000000000000..0e2acfe94e1c
--- /dev/null
+++ b/games-emulation/emutos/emutos-0.9.4-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Single-user single-tasking operating system for 32 bit Atari computer emulators"
+HOMEPAGE="http://emutos.sourceforge.net"
+SRC_URI="mirror://sourceforge/emutos/emutos-src-0.9.3.tar.gz
+ mirror://sourceforge/emutos/emutos-512k-${PV}.zip
+ mirror://sourceforge/emutos/emutos-256k-${PV}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"
+
+src_install() {
+ dolib */*.img
+ dodoc emutos-512k-${PV}/{readme.txt,doc/{announce,authors,changelog,status}.txt}
+}
diff --git a/games-emulation/emutos/emutos-0.9.9.1.ebuild b/games-emulation/emutos/emutos-0.9.9.1.ebuild
new file mode 100644
index 000000000000..10bd4656d74a
--- /dev/null
+++ b/games-emulation/emutos/emutos-0.9.9.1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Single-user single-tasking operating system for 32 bit Atari computer emulators"
+HOMEPAGE="http://emutos.sourceforge.net"
+SRC_URI="mirror://sourceforge/emutos/${PN}-512k-${PV}.zip
+ mirror://sourceforge/emutos/${PN}-256k-${PV}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins */*.img
+ dodoc ${PN}-512k-${PV}/{readme,doc/{announce,authors,changelog,status}}.txt
+}
diff --git a/games-emulation/emutos/metadata.xml b/games-emulation/emutos/metadata.xml
new file mode 100644
index 000000000000..3f4ee01ee5eb
--- /dev/null
+++ b/games-emulation/emutos/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">emutos</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/fakenes-0.5.8-r3 b/games-emulation/fakenes-0.5.8-r3
deleted file mode 100644
index 1d2b0369a2c4..000000000000
--- a/games-emulation/fakenes-0.5.8-r3
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile install postinst postrm preinst prepare
-DEPEND=>=media-libs/allegro-4.4.1.1:0[opengl?] dev-games/hawknl openal? ( media-libs/openal media-libs/freealut ) zlib? ( sys-libs/zlib ) virtual/pkgconfig >=sys-apps/sed-4
-DESCRIPTION=Portable, Open Source NES emulator which is written mostly in C
-EAPI=6
-HOMEPAGE=http://fakenes.sourceforge.net/
-IUSE=openal opengl zlib
-KEYWORDS=~amd64 ~x86
-LICENSE=ZLIB
-RDEPEND=>=media-libs/allegro-4.4.1.1:0[opengl?] dev-games/hawknl openal? ( media-libs/openal media-libs/freealut ) zlib? ( sys-libs/zlib )
-SLOT=0
-SRC_URI=mirror://sourceforge/fakenes/fakenes-0.5.8.tar.bz2
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=ee280ad40161769129cbcfc903833ee4
diff --git a/games-emulation/fakenes/Manifest b/games-emulation/fakenes/Manifest
new file mode 100644
index 000000000000..c74bf58a2a6b
--- /dev/null
+++ b/games-emulation/fakenes/Manifest
@@ -0,0 +1,5 @@
+AUX fakenes-0.5.8-underlink.patch 194 BLAKE2B f15bef6e75e4be31a7ea5aff318eeafa42b7c0aa0f4a9fe85ae81209edbf1e9b9203816e907fc8ee9be6d8272c61d784664f223b713d704e33e2392db6d4a09b SHA512 1c523353ebb40f12433dc13b9e003f5da95a2e67af5b0f29e438ba985942696061919fb5b8a41ded0f2c618871994b97070d05456e5b3607fe9f59536d772236
+AUX fakenes-0.5.8-zlib.patch 6297 BLAKE2B cedd715d31f552852c7271edb43c81019442bfbd0d10bbcc8b35c22f75b8ccfd4f23442a1f980ba5b7cbd242746bc6b729d26ce0d5900183c5ecf3707d24c5c2 SHA512 a152e8edffafb36b891bf1ee83ce9fd3c9248a82910d09019d4025c5c7fb77fe6c70cfc22b66e9b15da21081d6d14fcc175f051025c35730ba06fac0bb87556f
+DIST fakenes-0.5.8.tar.bz2 274503 BLAKE2B 64b410052e54c0cd1b474f5bacce220f39455c0de9024582cfc98ea307900b771428eeb9cb4e83e0cd72b0a221d10856f23f1c34b3058050a7dbc81b03e88c07 SHA512 2a22c51cf7171661a92584e083c3dfd69d009b586c22f8b5a4b4022065309ae4d6370a81997c035a9e19ff225e87d92e1b572b313585f2e05776cbf7c1c971aa
+EBUILD fakenes-0.5.8-r3.ebuild 1586 BLAKE2B 0e83991a1377d0aa075e64778351d7bdcb8a15e8261ed3d292688d03a0d4e3678f66e7ac3337c7ae2a44d3bd83837e3408dfe344f13b2545ff92a95d9d7a4e73 SHA512 5e84382587a661c9932b1e7d5ce5772394489df434c58e9bcb6e2f000ecce44822b988868d8dd853871a752db9f6682e662d23407e0aadbd4a0c2ca12386e4c7
+MISC metadata.xml 330 BLAKE2B 31881a989488e32b8a6e034fbb1a1dd88722cf0fc512d40a2ddb53e0a92a68c9787c3a18557dbaed50863d3f4491c2df2617a21703d6777ccd8782978e6c33d2 SHA512 40a9b0382052203f7855ddedfed71e9db3fd128ab5ec0c45b6e6ea4170f919f1ffb3f285b0f708e80f9a37b7af53a584d1ee915ad1f776e99b816bcceb756753
diff --git a/games-emulation/fakenes/fakenes-0.5.8-r3.ebuild b/games-emulation/fakenes/fakenes-0.5.8-r3.ebuild
new file mode 100644
index 000000000000..e8aeb3a8b2c0
--- /dev/null
+++ b/games-emulation/fakenes/fakenes-0.5.8-r3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop flag-o-matic toolchain-funcs gnome2-utils
+
+DESCRIPTION="Portable, Open Source NES emulator which is written mostly in C"
+HOMEPAGE="http://fakenes.sourceforge.net/"
+SRC_URI="mirror://sourceforge/fakenes/${P}.tar.bz2"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="openal opengl zlib"
+
+RDEPEND="
+ >=media-libs/allegro-4.4.1.1:0[opengl?]
+ dev-games/hawknl
+ openal? (
+ media-libs/openal
+ media-libs/freealut
+ )
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ default
+ sed -i \
+ -e "s:openal-config:pkg-config openal:" \
+ build/openal.cbd || die
+
+ sed -i \
+ -e "s:LIBAGL = agl:LIBAGL = alleggl:" \
+ build/alleggl.cbd || die
+ eapply "${FILESDIR}"/${P}-{underlink,zlib}.patch
+}
+
+src_compile() {
+ local myconf
+
+ append-ldflags -Wl,-z,noexecstack
+
+ echo "$(tc-getBUILD_CC) cbuild.c -o cbuild"
+ $(tc-getBUILD_CC) cbuild.c -o cbuild || die "cbuild build failed"
+
+ use openal || myconf="$myconf -openal"
+ use opengl || myconf="$myconf -alleggl"
+ use zlib || myconf="$myconf -zlib"
+
+ LD="$(tc-getCC) ${CFLAGS}" ./cbuild ${myconf} --verbose || die "cbuild failed"
+}
+
+src_install() {
+ dobin fakenes
+ insinto "/usr/share/${PN}"
+ doins support/*
+
+ cd docs && HTML_DOCS="faq.html" einstalldocs && cd ..
+
+ newicon -s 32 support/icon-32x32.png ${PN}.png
+ make_desktop_entry ${PN} "FakeNES"
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/fakenes/files/fakenes-0.5.8-underlink.patch b/games-emulation/fakenes/files/fakenes-0.5.8-underlink.patch
new file mode 100644
index 000000000000..48f37a5fd83d
--- /dev/null
+++ b/games-emulation/fakenes/files/fakenes-0.5.8-underlink.patch
@@ -0,0 +1,8 @@
+--- a/build/hawknl.cbd.old 2011-06-22 17:28:16.733408930 +0200
++++ b/build/hawknl.cbd 2011-06-22 17:28:29.217203187 +0200
+@@ -22,4 +22,4 @@
+
+ # --
+
+-LDFLAGS += ' -lNL'
++LDFLAGS += ' -lNL -lm'
diff --git a/games-emulation/fakenes/files/fakenes-0.5.8-zlib.patch b/games-emulation/fakenes/files/fakenes-0.5.8-zlib.patch
new file mode 100644
index 000000000000..15549051a6a5
--- /dev/null
+++ b/games-emulation/fakenes/files/fakenes-0.5.8-zlib.patch
@@ -0,0 +1,170 @@
+diff -ur fakenes-0.5.8-old/src/include/unzip.h fakenes-0.5.8/src/include/unzip.h
+--- fakenes-0.5.8-old/src/include/unzip.h 2012-08-22 20:51:45.310735240 +0200
++++ fakenes-0.5.8/src/include/unzip.h 2012-08-22 20:56:40.737069700 +0200
+@@ -119,9 +119,9 @@
+ tm_unz tmu_date;
+ } unz_file_info;
+
+-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
++extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,
+ const char* fileName2,
+- int iCaseSensitivity));
++ int iCaseSensitivity);
+ /*
+ Compare two filename (fileName1,fileName2).
+ If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+@@ -132,7 +132,7 @@
+ */
+
+
+-extern unzFile ZEXPORT unzOpen OF((const char *path));
++extern unzFile ZEXPORT unzOpen (const char *path);
+ /*
+ Open a Zip file. path contain the full pathname (by example,
+ on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
+@@ -143,24 +143,24 @@
+ of this unzip package.
+ */
+
+-extern int ZEXPORT unzClose OF((unzFile file));
++extern int ZEXPORT unzClose (unzFile file);
+ /*
+ Close a ZipFile opened with unzipOpen.
+ If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+ these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+ return UNZ_OK if there is no problem. */
+
+-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
+- unz_global_info *pglobal_info));
++extern int ZEXPORT unzGetGlobalInfo (unzFile file,
++ unz_global_info *pglobal_info);
+ /*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem. */
+
+
+-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
++extern int ZEXPORT unzGetGlobalComment (unzFile file,
+ char *szComment,
+- uLong uSizeBuf));
++ uLong uSizeBuf);
+ /*
+ Get the global comment string of the ZipFile, in the szComment buffer.
+ uSizeBuf is the size of the szComment buffer.
+@@ -171,22 +171,22 @@
+ /***************************************************************************/
+ /* Unzip package allow you browse the directory of the zipfile */
+
+-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
++extern int ZEXPORT unzGoToFirstFile (unzFile file);
+ /*
+ Set the current file of the zipfile to the first file.
+ return UNZ_OK if there is no problem
+ */
+
+-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
++extern int ZEXPORT unzGoToNextFile (unzFile file);
+ /*
+ Set the current file of the zipfile to the next file.
+ return UNZ_OK if there is no problem
+ return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+ */
+
+-extern int ZEXPORT unzLocateFile OF((unzFile file,
++extern int ZEXPORT unzLocateFile (unzFile file,
+ const char *szFileName,
+- int iCaseSensitivity));
++ int iCaseSensitivity);
+ /*
+ Try locate the file szFileName in the zipfile.
+ For the iCaseSensitivity signification, see unzStringFileNameCompare
+@@ -197,14 +197,14 @@
+ */
+
+
+-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
++extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
+ unz_file_info *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+- uLong commentBufferSize));
++ uLong commentBufferSize);
+ /*
+ Get Info about the current file
+ if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+@@ -223,22 +223,22 @@
+ from it, and close it (you can close it before reading all the file)
+ */
+
+-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
++extern int ZEXPORT unzOpenCurrentFile (unzFile file);
+ /*
+ Open for reading data the current file in the zipfile.
+ If there is no error, the return value is UNZ_OK.
+ */
+
+-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
++extern int ZEXPORT unzCloseCurrentFile (unzFile file);
+ /*
+ Close the file in zip opened with unzOpenCurrentFile
+ Return UNZ_CRCERROR if all the file was read but the CRC is not good
+ */
+
+
+-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
++extern int ZEXPORT unzReadCurrentFile (unzFile file,
+ voidp buf,
+- unsigned len));
++ unsigned len);
+ /*
+ Read bytes from the current file (opened by unzOpenCurrentFile)
+ buf contain buffer where data must be copied
+@@ -250,19 +250,19 @@
+ (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+ */
+
+-extern z_off_t ZEXPORT unztell OF((unzFile file));
++extern z_off_t ZEXPORT unztell (unzFile file);
+ /*
+ Give the current position in uncompressed data
+ */
+
+-extern int ZEXPORT unzeof OF((unzFile file));
++extern int ZEXPORT unzeof (unzFile file);
+ /*
+ return 1 if the end of file was reached, 0 elsewhere
+ */
+
+-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
++extern int ZEXPORT unzGetLocalExtrafield (unzFile file,
+ voidp buf,
+- unsigned len));
++ unsigned len);
+ /*
+ Read extra field from the current file (opened by unzOpenCurrentFile)
+ This is the local-header version of the extra field (sometimes, there is
+diff -ur fakenes-0.5.8-old/src/unzip.c fakenes-0.5.8/src/unzip.c
+--- fakenes-0.5.8-old/src/unzip.c 2012-08-22 20:51:45.300735366 +0200
++++ fakenes-0.5.8/src/unzip.c 2012-08-22 20:57:42.596243769 +0200
+@@ -500,7 +500,7 @@
+ /*
+ Get Info about the current file in the zipfile, with internal only info
+ */
+-local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
++local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
+ unz_file_info *pfile_info,
+ unz_file_info_internal
+ *pfile_info_internal,
+@@ -509,7 +509,7 @@
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+- uLong commentBufferSize));
++ uLong commentBufferSize);
+
+ local int unzlocal_GetCurrentFileInfoInternal (file,
+ pfile_info,
diff --git a/games-emulation/fakenes/metadata.xml b/games-emulation/fakenes/metadata.xml
new file mode 100644
index 000000000000..b669d82dff83
--- /dev/null
+++ b/games-emulation/fakenes/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">fakenes</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/fbzx-3.0.0-r1 b/games-emulation/fbzx-3.0.0-r1
deleted file mode 100644
index 71bfba0c685b..000000000000
--- a/games-emulation/fbzx-3.0.0-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=install prepare
-DEPEND=media-libs/libsdl[video] media-sound/pulseaudio media-libs/alsa-lib virtual/pkgconfig
-DESCRIPTION=Full Screen Sinclair Spectrum emulator
-EAPI=6
-HOMEPAGE=https://github.com/rastersoft/fbzx
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-3+
-RDEPEND=media-libs/libsdl[video] media-sound/pulseaudio media-libs/alsa-lib
-SLOT=0
-SRC_URI=https://github.com/rastersoft/fbzx/archive/3.0.0.tar.gz -> fbzx-3.0.0.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097
-_md5_=34b8ad3379d74e63b272024ae661fa9b
diff --git a/games-emulation/fbzx/Manifest b/games-emulation/fbzx/Manifest
new file mode 100644
index 000000000000..8ca6b3508aed
--- /dev/null
+++ b/games-emulation/fbzx/Manifest
@@ -0,0 +1,4 @@
+AUX fbzx-3.0.0-gentoo.patch 6372 BLAKE2B 0e218a83a4eee9f7fbb632f74eb64358149715835f566c4256cecfa5857c615d732073a1346b0e8f4998fb5c560d7c2d39a083e5c1ae99cf4c889b6de42b8cde SHA512 4de9830dcfe015833939c1795f016d37afa0d364b94de2cc64b941f8d4df2acbe7220be951fa403bab6eba0db4882a8c15c376eac108fe6331e67708515b876e
+DIST fbzx-3.0.0.tar.gz 435239 BLAKE2B 5105995a7972c7310628c0e4d3af7f1a749192bc24ac312e493d8821edf5ec329a65eedcbfa6c8479a4f4d134ca730acef7ee27ef2f89253f2e179c7cf8c2bf1 SHA512 cf2a01a1dde62da03c1f04e91f226859ae4cf06d099597dc1a1554c4ff9782dd287f9d924083829eee40cf0450c053d818f963f68381f9e16e0e61ca1f3d3083
+EBUILD fbzx-3.0.0-r1.ebuild 852 BLAKE2B c2c32bf293dc5803cbbc21b56cc5baee95bfc28f6e258482c3b9499f94cbe2f909329869e86bd1b49a4a5d6fb24054cb999d4bfc1dbbe45dc60ab9a0065e57c0 SHA512 775bfb04e9ba7c1bf47aa69260d4413caa5270202ca12434dd15f870570657d584eb2dee11cb4abeba57765dde96b4df2352a60504429203fa0ff7f44532cebf
+MISC metadata.xml 469 BLAKE2B 9c35e70c04d622fbda873c4f3d225b5a7813627bfc6bb01e14ebf011869385d9449652d056e3f2a4ff175337b55e63f987234fa2b3b600576611ec42f01187ca SHA512 72d484a764834cd1691665dea6904f154af7a4a6f4c8dc43eaeafe71ec775c8bf0b62ffe42d3cf244829292ff4d0f8a677eccce1902110b94e6f1fdd31219a25
diff --git a/games-emulation/fbzx/fbzx-3.0.0-r1.ebuild b/games-emulation/fbzx/fbzx-3.0.0-r1.ebuild
new file mode 100644
index 000000000000..8fcb34dbfc9c
--- /dev/null
+++ b/games-emulation/fbzx/fbzx-3.0.0-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop
+
+DESCRIPTION="Full Screen Sinclair Spectrum emulator"
+HOMEPAGE="https://github.com/rastersoft/fbzx"
+SRC_URI="https://github.com/rastersoft/fbzx/archive/3.0.0.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ media-libs/libsdl[video]
+ media-sound/pulseaudio
+ media-libs/alsa-lib
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ default
+ sed -i -e "s|/usr/share/|/usr/share/${PN}/|g" src/llscreen.cpp || die
+ eapply "${FILESDIR}"/${P}-gentoo.patch
+}
+
+src_install() {
+ dobin src/fbzx
+ insinto "/usr/share/${PN}"
+ doins -r data/{keymap.bmp,spectrum-roms}
+ dodoc AMSTRAD CAPABILITIES FAQ PORTING README* TODO VERSIONS
+ doicon data/fbzx.svg
+ make_desktop_entry fbzx FBZX
+}
diff --git a/games-emulation/fbzx/files/fbzx-3.0.0-gentoo.patch b/games-emulation/fbzx/files/fbzx-3.0.0-gentoo.patch
new file mode 100644
index 000000000000..0e1f02337146
--- /dev/null
+++ b/games-emulation/fbzx/files/fbzx-3.0.0-gentoo.patch
@@ -0,0 +1,118 @@
+diff -ru fbzx-3.0.0.orig/src/Makefile fbzx-3.0.0/src/Makefile
+--- fbzx-3.0.0.orig/src/Makefile 2015-04-01 17:22:47.000000000 -0400
++++ fbzx-3.0.0/src/Makefile 2016-04-01 13:15:27.230190807 -0400
+@@ -1,78 +1,74 @@
+-CC=g++ -c -O2
+-CPP=g++ -c -O2
+-LN=g++ -O2
+-
+ CFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
+-CPPFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
++CXXFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
+ LDFLAGS += `pkg-config --libs sdl libpulse-simple alsa`
+
+
+ fbzx: cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o
+- $(LN) -o fbzx cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o $(LDFLAGS)
++ $(CXX) -o fbzx cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o $(LDFLAGS)
+
+ Z80free.o: z80free/Z80free.c z80free/Z80free.h
+- $(CC) -o Z80free.o z80free/Z80free.c
++ $(CXX) -c $(CFLAGS) -o Z80free.o z80free/Z80free.c
+
+ Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
+- $(CC) -o Z80free_codes.o z80free/Z80free_codes.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codes.o z80free/Z80free_codes.c
+
+ Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
+- $(CC) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
+
+ Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
+- $(CC) -o Z80free_codesED.o z80free/Z80free_codesED.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codesED.o z80free/Z80free_codesED.c
+
+ Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
+- $(CC) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
+
+ Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
+- $(CC) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
+
+ Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
+- $(CC) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
+
+ Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
+- $(CC) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
++ $(CXX) -c $(CFLAGS) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
+
+ cargador.o: cargador.cpp spk_ay.hh keyboard.hh emulator.hh screen.hh osd.hh z80free/Z80free.h computer.hh signals.hh llscreen.hh tape.hh cargador.hh
+- $(CPP) $(CPPFLAGS) -o cargador.o cargador.cpp
++ $(CXX) -c $(CXXFLAGS) -o cargador.o cargador.cpp
+
+ cmdline.o: cmdline.cpp cmdline.hh
+- $(CPP) $(CPPFLAGS) -o cmdline.o cmdline.cpp
++ $(CXX) -c $(CXXFLAGS) -o cmdline.o cmdline.cpp
+
+ computer.o: computer.cpp z80free/Z80free.h llsound.hh keyboard.hh computer.hh screen.hh signals.hh llscreen.hh tape.hh emulator.hh osd.hh spk_ay.hh microdrive.hh menus.hh
+- $(CPP) $(CPPFLAGS) -o computer.o computer.cpp
++ $(CXX) -c $(CXXFLAGS) -o computer.o computer.cpp
+
+ emulator.o: emulator.cpp spk_ay.hh keyboard.hh llsound.hh cmdline.hh computer.hh screen.hh signals.hh llscreen.hh z80free/Z80free.h tape.hh emulator.hh osd.hh microdrive.hh menus.hh cargador.hh
+- $(CPP) $(CPPFLAGS) -o emulator.o emulator.cpp
++ $(CXX) -c $(CXXFLAGS) -o emulator.o emulator.cpp
+
+ keyboard.o: keyboard.cpp menus.hh llscreen.hh llsound.hh computer.hh screen.hh signals.hh z80free/Z80free.h tape.hh emulator.hh osd.hh keyboard.hh
+- $(CPP) $(CPPFLAGS) -o keyboard.o keyboard.cpp
++ $(CXX) -c $(CXXFLAGS) -o keyboard.o keyboard.cpp
+
+ llscreen.o: llscreen.cpp osd.hh font.h llscreen.hh
+- $(CPP) $(CPPFLAGS) -o llscreen.o llscreen.cpp
++ $(CXX) -c $(CXXFLAGS) -o llscreen.o llscreen.cpp
+
+ llsound.o: llsound.cpp emulator.hh screen.hh osd.hh z80free/Z80free.h computer.hh signals.hh llscreen.hh tape.hh llsound.hh
+- $(CPP) $(CPPFLAGS) -o llsound.o llsound.cpp
++ $(CXX) -c $(CXXFLAGS) -o llsound.o llsound.cpp
+
+ menus.o: menus.cpp spk_ay.hh microdrive.hh z80free/Z80free.h keyboard.hh llsound.hh llscreen.hh menus.hh tape.hh signals.hh emulator.hh screen.hh osd.hh computer.hh cargador.hh
+- $(CPP) $(CPPFLAGS) -o menus.o menus.cpp
++ $(CXX) -c $(CXXFLAGS) -o menus.o menus.cpp
+
+ microdrive.o: microdrive.cpp osd.hh emulator.hh screen.hh z80free/Z80free.h computer.hh signals.hh llscreen.hh tape.hh microdrive.hh
+- $(CPP) $(CPPFLAGS) -o microdrive.o microdrive.cpp
++ $(CXX) -c $(CXXFLAGS) -o microdrive.o microdrive.cpp
+
+ osd.o: osd.cpp osd.hh
+- $(CPP) $(CPPFLAGS) -o osd.o osd.cpp
++ $(CXX) -c $(CXXFLAGS) -o osd.o osd.cpp
+
+ screen.o: screen.cpp keyboard.hh computer.hh screen.hh signals.hh llscreen.hh z80free/Z80free.h tape.hh emulator.hh osd.hh
+- $(CPP) $(CPPFLAGS) -o screen.o screen.cpp
++ $(CXX) -c $(CXXFLAGS) -o screen.o screen.cpp
+
+ signals.o: signals.cpp signals.hh
+- $(CPP) $(CPPFLAGS) -o signals.o signals.cpp
++ $(CXX) -c $(CXXFLAGS) -o signals.o signals.cpp
+
+ spk_ay.o: spk_ay.cpp spk_ay.hh llsound.hh computer.hh screen.hh signals.hh llscreen.hh z80free/Z80free.h tape.hh emulator.hh osd.hh
+- $(CPP) $(CPPFLAGS) -o spk_ay.o spk_ay.cpp
++ $(CXX) -c $(CXXFLAGS) -o spk_ay.o spk_ay.cpp
+
+ tape.o: tape.cpp z80free/Z80free.h tape.hh signals.hh emulator.hh screen.hh osd.hh computer.hh llscreen.hh
+- $(CPP) $(CPPFLAGS) -o tape.o tape.cpp
++ $(CXX) -c $(CXXFLAGS) -o tape.o tape.cpp
+
+diff -ru fbzx-3.0.0.orig/src/menus.cpp fbzx-3.0.0/src/menus.cpp
+--- fbzx-3.0.0.orig/src/menus.cpp 2015-04-01 17:22:47.000000000 -0400
++++ fbzx-3.0.0/src/menus.cpp 2016-04-01 13:15:33.213974823 -0400
+@@ -1691,7 +1691,7 @@
+
+ void keyboard_menu() {
+
+- llscreen->paint_picture("fbzx/keymap.bmp");
++ llscreen->paint_picture("keymap.bmp");
+ print_copy();
+ wait_key();
+ llscreen->clear_screen();
diff --git a/games-emulation/fbzx/metadata.xml b/games-emulation/fbzx/metadata.xml
new file mode 100644
index 000000000000..375b39e89bcb
--- /dev/null
+++ b/games-emulation/fbzx/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+ FBZX is a Sinclair Spectrum emulator, designed to work at full screen
+ using the FrameBuffer.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">rastersoft/fbzx</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/fceux-2.2.3 b/games-emulation/fceux-2.2.3
deleted file mode 100644
index 3533fda9b409..000000000000
--- a/games-emulation/fceux-2.2.3
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=lua? ( dev-lang/lua:0 ) media-libs/libsdl[opengl?,video] logo? ( media-libs/gd[png] ) opengl? ( virtual/opengl ) gtk? ( x11-libs/gtk+:3 ) sys-libs/zlib[minizip] dev-util/scons[python_targets_python2_7]
-DESCRIPTION=A portable Famicom/NES emulator, an evolution of the original FCE Ultra
-EAPI=5
-HOMEPAGE=http://fceux.com/
-IUSE=gtk logo +lua +opengl
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=lua? ( dev-lang/lua:0 ) media-libs/libsdl[opengl?,video] logo? ( media-libs/gd[png] ) opengl? ( virtual/opengl ) gtk? ( x11-libs/gtk+:3 ) sys-libs/zlib[minizip]
-SLOT=0
-SRC_URI=mirror://sourceforge/fceultra/fceux-2.2.3.src.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f multiprocessing cac3169468f893670dac3e7cb940e045 scons-utils abbc7625ff457854eae0edaa1fd55cc7
-_md5_=25c7f2802fd46a71d1acdca0754a8f7f
diff --git a/games-emulation/fceux/Manifest b/games-emulation/fceux/Manifest
new file mode 100644
index 000000000000..7b3b3d33444a
--- /dev/null
+++ b/games-emulation/fceux/Manifest
@@ -0,0 +1,4 @@
+AUX fceux-2.2.2-warnings.patch 1306 BLAKE2B eb52e35f7933e1d194ca14b9d6a782f727e3b120ce8632f2b3db2036b06b7328d4dbf2f3e8fcd2cd27511f811b56e2840c943855076768598c0d899c59ffddc7 SHA512 75df61b98e94ce659a1cc9732a491cdcfe6b826ce9d8f9b22e5542217ade6074e86429cdcc326cb770a21fff049cf20760f8172c4b3ce52de1ee404ff5a7193a
+DIST fceux-2.2.3.src.tar.gz 9292792 BLAKE2B 44412934a50f2cab581cb194932a079071e8c7c1cb4cb4d173e9d7cf4898806fe1b0948d6e86fd70d1265eb596c47f77f751e3a113f03aba9b95e1f5def9c2a8 SHA512 6deb83e9e773694f4040f5f325b0b5b4f45d58bb3481db67b4659c940d90c4c87e3ffeac712b72ddb3f5d089cd9fc7b55b497db61f708c23a7c43c17eda55c7b
+EBUILD fceux-2.2.3.ebuild 1191 BLAKE2B 6471d82ac2f1ef1d0fcf36fe59b5b5d29c103f6c32739242c244fb834bd2fde62bf12e0c7f7c1eb6b0b2e59bdf1aefcbdb1f911ef144146f903b8be795d82439 SHA512 793f5ce80df5e0ee4b116fd89c68b6923a2fbf02cd54f632cddd69345289e783b61a2c6a09464efa21de4881bb3d7446a6ba1b2dc29c518d4caa26b52f3fd81f
+MISC metadata.xml 432 BLAKE2B 69c86fec99d0d08d0672142afbb39b2f2c352af4a8ff953516522f721e2482a4624b542593c8eac0be3570a75037cf27b0c48bd19033429d1c5d66e85fcdb952 SHA512 f6f073a198d89d195daa4da1c4c8bdf631258db0ff8cc5fefd9d8a6d93beb38081d37a70df0d0f62d7bf79f7595a3456d88ac0c724535d8c453f3096d2256b96
diff --git a/games-emulation/fceux/fceux-2.2.3.ebuild b/games-emulation/fceux/fceux-2.2.3.ebuild
new file mode 100644
index 000000000000..93ccbe28693f
--- /dev/null
+++ b/games-emulation/fceux/fceux-2.2.3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit desktop epatch scons-utils
+
+DESCRIPTION="A portable Famicom/NES emulator, an evolution of the original FCE Ultra"
+HOMEPAGE="http://fceux.com/"
+SRC_URI="mirror://sourceforge/fceultra/${P}.src.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="gtk logo +lua +opengl"
+
+RDEPEND="
+ lua? ( dev-lang/lua:0 )
+ media-libs/libsdl[opengl?,video]
+ logo? ( media-libs/gd[png] )
+ opengl? ( virtual/opengl )
+ gtk? ( x11-libs/gtk+:3 )
+ sys-libs/zlib[minizip]
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.2.2-warnings.patch
+}
+
+src_compile() {
+ escons \
+ GTK=0 \
+ CREATE_AVI=1 \
+ SYSTEM_LUA=1 \
+ SYSTEM_MINIZIP=1 \
+ $(use_scons gtk GTK3) \
+ $(use_scons logo LOGO) \
+ $(use_scons opengl OPENGL) \
+ $(use_scons lua LUA)
+}
+
+src_install() {
+ dobin bin/fceux
+
+ doman documentation/fceux.6
+ docompress -x /usr/share/doc/${PF}/documentation /usr/share/doc/${PF}/fceux.chm
+ dodoc -r Authors changelog.txt TODO-SDL bin/fceux.chm documentation
+ rm -f "${D}/usr/share/doc/${PF}/documentation/fceux.6"
+ make_desktop_entry fceux FCEUX
+ doicon fceux.png
+}
diff --git a/games-emulation/fceux/files/fceux-2.2.2-warnings.patch b/games-emulation/fceux/files/fceux-2.2.2-warnings.patch
new file mode 100644
index 000000000000..f0af4631abda
--- /dev/null
+++ b/games-emulation/fceux/files/fceux-2.2.2-warnings.patch
@@ -0,0 +1,33 @@
+diff -ru fceux-2.2.2.orig/src/input.cpp fceux-2.2.2/src/input.cpp
+--- fceux-2.2.2.orig/src/input.cpp 2013-06-15 15:44:11.000000000 -0400
++++ fceux-2.2.2/src/input.cpp 2014-12-31 01:32:46.302001912 -0500
+@@ -1161,7 +1161,7 @@
+ // FIXME this will always evaluate to true, should this be
+ // if (*lastSavestateMade...) to check if it holds a string or just
+ // a '\0'?
+- if (lastSavestateMade && (undoSS || redoSS))
++ if (*lastSavestateMade && (undoSS || redoSS))
+ SwapSaveState();
+ }
+
+diff -ru fceux-2.2.2.orig/src/state.cpp fceux-2.2.2/src/state.cpp
+--- fceux-2.2.2.orig/src/state.cpp 2013-09-18 19:03:59.000000000 -0400
++++ fceux-2.2.2/src/state.cpp 2014-12-31 01:33:11.453155054 -0500
+@@ -1048,7 +1048,7 @@
+ //Both files must exist
+ //--------------------------------------------------------------------------------------------
+
+- if (!lastSavestateMade)
++ if (!*lastSavestateMade)
+ {
+ FCEUI_DispMessage("Can't Undo",0);
+ FCEUI_printf("Undo savestate was attempted but unsuccessful because there was not a recently used savestate.\n");
+@@ -1153,7 +1153,7 @@
+ void RedoLoadState()
+ {
+ if (!redoLS) return;
+- if (lastLoadstateMade && redoLS)
++ if (*lastLoadstateMade && redoLS)
+ {
+ FCEUSS_Load(lastLoadstateMade);
+ FCEUI_printf("Redoing %s\n",lastLoadstateMade);
diff --git a/games-emulation/fceux/metadata.xml b/games-emulation/fceux/metadata.xml
new file mode 100644
index 000000000000..a6bb4cbf9bfa
--- /dev/null
+++ b/games-emulation/fceux/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="logo">Enable the ability to add a logo screen when creating AVIs</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">fceultra</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/gambatte-0.5.0_p20131102-r2 b/games-emulation/gambatte-0.5.0_p20131102-r2
deleted file mode 100644
index 89e38b3bbf9d..000000000000
--- a/games-emulation/gambatte-0.5.0_p20131102-r2
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=media-libs/libsdl[X,sound,joystick,video] sys-libs/zlib dev-util/scons[python_targets_python2_7]
-DESCRIPTION=An accuracy-focused Gameboy / Gameboy Color emulator
-EAPI=6
-HOMEPAGE=https://sourceforge.net/projects/gambatte
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=media-libs/libsdl[X,sound,joystick,video] sys-libs/zlib
-SLOT=0
-SRC_URI=https://dev.gentoo.org/~hasufell/distfiles/gambatte-0.5.0_p20131102.tar.xz
-_eclasses_=multiprocessing cac3169468f893670dac3e7cb940e045 scons-utils abbc7625ff457854eae0edaa1fd55cc7
-_md5_=12675c7e7c10deaeff9a28623a866254
diff --git a/games-emulation/gambatte/Manifest b/games-emulation/gambatte/Manifest
new file mode 100644
index 000000000000..a5191aaacb28
--- /dev/null
+++ b/games-emulation/gambatte/Manifest
@@ -0,0 +1,3 @@
+DIST gambatte-0.5.0_p20131102.tar.xz 353212 BLAKE2B ad17289f29a00230d7ccec2825d6487ed994a6148a931254a9d5c941c5dbb643c5eb4dbd9f43decfcb86fb693f82358e795a4912c4d40258b27b0d8611961ec1 SHA512 9f27af85d2fceb128231eb3e5bf2806a1773c575990296f37eb3c0a14bca5c72f7f161cdf77f710f4ff85b2b3266db9ba098e5ef6772bc5bf7b2c97b8281999b
+EBUILD gambatte-0.5.0_p20131102-r2.ebuild 1624 BLAKE2B 59fd76fbfc8afd9aaa57f77d3aca89277e0bdf96c5bfda0f098845b4e3b6d47ec629d0a8b1fc8e84583dbf8868c23772a0a581e65024d04625a0342d4a2ecd88 SHA512 ee9838bc274b9c6682af17b8c185d81d7ec1b176eec3d386e3da6e489489b3f5cc9b74d5c3aaa840ce7047bd83e52b87f4304a847437cf69d9a21a6d7a3bfb77
+MISC metadata.xml 331 BLAKE2B b739e6db5361a25503fed526b7417578fff92612b1ca90c4a6e8578bd678f3b3b69736238a9ad882a654c7c9bd66b8d1ac296899129610b23ab96918067012d8 SHA512 c46ee0b944bbf88420eb47c11f60d00a6516fe2bb28b5078e8f11857636f16381969cac9edb98d554d07d0894c224817e12560410092ca532da036e697433b1a
diff --git a/games-emulation/gambatte/gambatte-0.5.0_p20131102-r2.ebuild b/games-emulation/gambatte/gambatte-0.5.0_p20131102-r2.ebuild
new file mode 100644
index 000000000000..57ce854affa0
--- /dev/null
+++ b/games-emulation/gambatte/gambatte-0.5.0_p20131102-r2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit scons-utils
+
+DESCRIPTION="An accuracy-focused Gameboy / Gameboy Color emulator"
+HOMEPAGE="https://sourceforge.net/projects/gambatte"
+SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ media-libs/libsdl[X,sound,joystick,video]
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+
+fix_scons() {
+ local i
+ for i; do
+ cat >> $i << END
+import os
+import SCons.Util
+
+if os.environ.has_key('AR'):
+ env['AR'] = os.environ['AR']
+if os.environ.has_key('RANLIB'):
+ env['RANLIB'] = os.environ['RANLIB']
+if os.environ.has_key('CC'):
+ env['CC'] = os.environ['CC']
+if os.environ.has_key('CFLAGS'):
+ env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+if os.environ.has_key('CXX'):
+ env['CXX'] = os.environ['CXX']
+if os.environ.has_key('CXXFLAGS'):
+ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+if os.environ.has_key('CPPFLAGS'):
+ env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS'])
+if os.environ.has_key('LDFLAGS'):
+ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+END
+ done
+}
+
+src_prepare() {
+ default
+
+ # Fix zlib/minizip build error
+ sed -i \
+ -e '1i#define OF(x) x' \
+ libgambatte/src/file/unzip/{unzip,ioapi}.h \
+ || die "sed iompi.h failed"
+
+ fix_scons {gambatte_sdl,libgambatte}/SConstruct
+}
+
+src_compile() {
+ # build core library
+ cd "${S}"/libgambatte || die
+ escons
+
+ # build sdl frontend
+ cd "${S}"/gambatte_sdl || die
+ escons
+}
+
+src_install() {
+ dobin gambatte_sdl/gambatte_sdl
+ einstalldocs
+}
diff --git a/games-emulation/gambatte/metadata.xml b/games-emulation/gambatte/metadata.xml
new file mode 100644
index 000000000000..a2f679865cad
--- /dev/null
+++ b/games-emulation/gambatte/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gambatte</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/gcube-0.4-r2 b/games-emulation/gcube-0.4-r2
deleted file mode 100644
index abfc1595b1ab..000000000000
--- a/games-emulation/gcube-0.4-r2
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=install prepare
-DEPEND=virtual/opengl media-libs/libsdl[joystick,opengl,sound,video] virtual/jpeg:0 sys-libs/ncurses:0= sys-libs/zlib
-DESCRIPTION=Gamecube emulator
-EAPI=6
-HOMEPAGE=http://gcube.exemu.net/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2+
-RDEPEND=virtual/opengl media-libs/libsdl[joystick,opengl,sound,video] virtual/jpeg:0 sys-libs/ncurses:0= sys-libs/zlib
-SLOT=0
-SRC_URI=http://gcube.exemu.net/downloads/gcube-0.4-src.tar.bz2
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=cd56f5f6313b06c3ae2b570f495e0ea3
diff --git a/games-emulation/gcube/Manifest b/games-emulation/gcube/Manifest
new file mode 100644
index 000000000000..9f1dd254f3bf
--- /dev/null
+++ b/games-emulation/gcube/Manifest
@@ -0,0 +1,6 @@
+AUX gcube-0.4-gcc47.patch 429 BLAKE2B 2da4477aa5fc8b33bae0404a5347e6a0bac493ed2c2ff54d743d1d1920a7055c89f2c3b4e9ebe29a42f88991cd45ad9702916070a91895bca2c465fb1c14d505 SHA512 e6cf8d03734d26b5051c50f9fbb3ae3d62f34ea2dc6a29177cac72426c9a5e5887acf88cff437c0b830eff5648ac30f477a9fea4e945cc53b9606788cff80889
+AUX gcube-0.4-ldflags.patch 915 BLAKE2B 7bc5425df1dd9a7afdc2844c7e4044f634c824c4b857c49162e73cad98f888049beda2963c353c7e9c412c680e5c49ebe91d57f94b4158338a322f542414f513 SHA512 62343ae3871a406e21c219a779e568b5a053cc474893b5ad690f8995b01c86cabecf5e1e9c55d91f0adab046f652f2f6d9b3c298edc92872d62976d6de2733f4
+AUX gcube-0.4-underlink.patch 447 BLAKE2B 05fea68713edaf3d38656fb5911a64d48b8ae7bda74c50153ddf63beabad8cdf36eb311dc40233728b5900d4797858f89d0b3ba0b3d57212603ae391b1dac4c3 SHA512 e916f3b3f901857f6c7af1bdbdf06ec9ae649d42ed9a166f146c4a319c67644312614550c17a7c4269dd116b6a5a03cf87a62acd5db8b29fc4fa4413b68ed36d
+DIST gcube-0.4-src.tar.bz2 803503 BLAKE2B a9f5db1b824d5319e89a5e865c1ca539a2f11458f4c542d34168c06b79f9f589ea928768ca26275f31aad51b01f51efe8453a1121ba947aaf067beb2f9dea13f SHA512 f73665386d547322f20ed5e358f4f394b07d74fd90bddbfe1158a7a5d896bff36dabc9833f2d820a7af7673b8c8af62490f7fa07b06a2bbca4df6356a1e3c91a
+EBUILD gcube-0.4-r2.ebuild 922 BLAKE2B fc74e6ce689ed888c61d254c1daa5102e0ed205a0609794ef5993914e7396e55bf88574817850daa8d9223cd3c17e8696044121054e80a603d5b4103e1de63d5 SHA512 e3515c29982ed53c204d7d8c09e081c3fd81adc085914249cf02b818055f8374a44d6884a5cf8335444ecb29875d9e0abf717337723013c903d69dfee34f3ccb
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/gcube/files/gcube-0.4-gcc47.patch b/games-emulation/gcube/files/gcube-0.4-gcc47.patch
new file mode 100644
index 000000000000..48ac167a1f0d
--- /dev/null
+++ b/games-emulation/gcube/files/gcube-0.4-gcc47.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.rules.old 2012-10-23 14:06:54.417782365 +0200
++++ b/Makefile.rules 2012-10-23 14:07:11.516377033 +0200
+@@ -1,6 +1,6 @@
+
+ SDL_CONFIG=sdl-config
+-LIBS=`$(SDL_CONFIG) --libs` -mno-windows -mcygwin -lz -l$(OPENGL) -lm
++LIBS=`$(SDL_CONFIG) --libs` -lz -l$(OPENGL) -lm
+
+ PROFLAGS=-g -Wall -pg -fprofile-arcs -ftest-coverage
+ OPTFLAGS=-O3 -fno-strict-aliasing -fomit-frame-pointer -ffast-math -march=$(CPU) $(OPTIMIZE)
diff --git a/games-emulation/gcube/files/gcube-0.4-ldflags.patch b/games-emulation/gcube/files/gcube-0.4-ldflags.patch
new file mode 100644
index 000000000000..b4a64f16aede
--- /dev/null
+++ b/games-emulation/gcube/files/gcube-0.4-ldflags.patch
@@ -0,0 +1,30 @@
+--- a/Makefile.rules.old 2010-10-01 07:16:16.000000000 +0200
++++ b/Makefile.rules 2010-10-01 07:18:04.000000000 +0200
+@@ -88,22 +88,22 @@
+ profiler: default
+
+ gcube: $(OBJECTS) gcube.o
+- $(CC) $(CFLAGS) $^ -o $@ $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $^ -o $@ $(LIBS)
+
+ gcubedbg: $(OBJECTS) gcubedbg.o cpu_dbg.o
+ $(CC) $(CFLAGS) $^ -o $@ $(LIBS)
+
+ bin2dol: bin2dol.c general.o
+- $(CC) $(CFLAGS) $^ -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $^ -o $@
+
+ tplx: tplx.o general.o
+- $(CC) $(CFLAGS) $^ -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $^ -o $@
+
+ thpview: thpview.o general.o jpeg_tools.o
+- $(CC) $(CFLAGS) `$(SDL_CONFIG) --cflags` $^ -o $@ -ljpeg `$(SDL_CONFIG) --libs`
++ $(CC) $(LDFLAGS) $(CFLAGS) `$(SDL_CONFIG) --cflags` $^ -o $@ -ljpeg `$(SDL_CONFIG) --libs`
+
+ isopack: isopack.o general.o
+- $(CC) $(CFLAGS) $^ -o $@ -lz
++ $(CC) $(LDFLAGS) $(CFLAGS) $^ -o $@ -lz
+
+ ppc_disasm.o: ppc_disasm.c
+ $(CC) -g -c -o $@ $<
diff --git a/games-emulation/gcube/files/gcube-0.4-underlink.patch b/games-emulation/gcube/files/gcube-0.4-underlink.patch
new file mode 100644
index 000000000000..f4b3d5b6969d
--- /dev/null
+++ b/games-emulation/gcube/files/gcube-0.4-underlink.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.rules.old 2011-06-10 14:14:08.372105234 +0200
++++ b/Makefile.rules 2011-06-10 14:14:18.504746649 +0200
+@@ -1,6 +1,6 @@
+
+ SDL_CONFIG=sdl-config
+-LIBS=`$(SDL_CONFIG) --libs` -mno-windows -mcygwin -lz -l$(OPENGL)
++LIBS=`$(SDL_CONFIG) --libs` -mno-windows -mcygwin -lz -l$(OPENGL) -lm
+
+ PROFLAGS=-g -Wall -pg -fprofile-arcs -ftest-coverage
+ OPTFLAGS=-O3 -fno-strict-aliasing -fomit-frame-pointer -ffast-math -march=$(CPU) $(OPTIMIZE)
diff --git a/games-emulation/gcube/gcube-0.4-r2.ebuild b/games-emulation/gcube/gcube-0.4-r2.ebuild
new file mode 100644
index 000000000000..6194fc6a2103
--- /dev/null
+++ b/games-emulation/gcube/gcube-0.4-r2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic
+
+DESCRIPTION="Gamecube emulator"
+HOMEPAGE="http://gcube.exemu.net/"
+SRC_URI="http://gcube.exemu.net/downloads/${P}-src.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ virtual/opengl
+ media-libs/libsdl[joystick,opengl,sound,video]
+ virtual/jpeg:0
+ sys-libs/ncurses:0=
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PV}"
+
+src_prepare() {
+ default
+
+ sed -i -e '/^CFLAGS=-g/d' Makefile.rules || die
+
+ eapply "${FILESDIR}"/${P}-ldflags.patch \
+ "${FILESDIR}"/${P}-underlink.patch \
+ "${FILESDIR}"/${P}-gcc47.patch
+
+ sed -i -e '/^CC=/d' Makefile || die
+
+ append-cflags -std=gnu89 # build with gcc5 (bug #570504)
+}
+
+src_install() {
+ local x
+
+ dobin gcmap gcube
+ for x in bin2dol isopack thpview tplx ; do
+ newbin ${x} ${PN}-${x}
+ done
+
+ einstalldocs
+}
diff --git a/games-emulation/gcube/metadata.xml b/games-emulation/gcube/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/gcube/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/generator-0.35_p4-r1 b/games-emulation/generator-0.35_p4-r1
deleted file mode 100644
index 36134c296043..000000000000
--- a/games-emulation/generator-0.35_p4-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install prepare
-DEPEND=>=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Sega Genesis / Mega Drive emulator
-EAPI=6
-HOMEPAGE=http://www.squish.net/generator/
-IUSE=+sdlaudio
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-SLOT=0
-SRC_URI=http://www.squish.net/generator/cbiere/generator/generator-0.35-cbiere-r4.tar.bz2
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 libtool 0081a71a261724730ec4c248494f044d multilib 97f470f374f2e94ccab04a2fb21d811e toolchain-funcs 1e35303c63cd707f6c3422b4493d5607
-_md5_=e32416b56986a9701a24fc86fbf14081
diff --git a/games-emulation/generator/Manifest b/games-emulation/generator/Manifest
new file mode 100644
index 000000000000..95dc701335c6
--- /dev/null
+++ b/games-emulation/generator/Manifest
@@ -0,0 +1,6 @@
+AUX generator-0.35_p4-configure.patch 3634 BLAKE2B 726c133bb419bc8226d31043b851cceb6077e8a3dc7fd4a351d9117933b219012d812b25c6b96b0569e066191adc786e2ec02ed723b7eb14ca3e3e326188aa40 SHA512 bed25bc2d951d4c369265b4790754ba4e63d5beda803a655dc240ac76004b57ba1bc3823c4a35f6fa2ee5e5a9b22827c46e090f63536b4d6b959986cc016c1ed
+AUX generator-0.35_p4-inline.patch 465 BLAKE2B 8818f566ad1987e09fbc49eae5b216c5d620bfa989fdbed61e0c700862ee9fd6f20e6e0010284ee6854a8fc4299a685fde41937f2d5e32675298f3adf8615b4c SHA512 9776dbe2e8f725b8f542ae382fe8da193987c9e12d857c359de2c32402f4dee729c92837aa543efe4ba7c6c66d81e3e505496a783598621d20f724509d4358ba
+AUX generator-0.35_p4-underlink.patch 513 BLAKE2B 8424efa3326db4f627ffab9a8a6c8f55e0f5477f31a830fada195d6cfd3ded01734d70981ea27ca06341009385ea00cbe1ac3f7ffa23bdba5eb3f2c35f800820 SHA512 0947c6365ee33d15c136906385da761e0f6e4d92356b0e3eaf8c3cdcd82c87982d18e6bc35690ac448b9e9dab213358f5f55c0d3be2f3eaece7bdd776479319b
+DIST generator-0.35-cbiere-r4.tar.bz2 435289 BLAKE2B 962785fd5f87cfd03cba3238fb0d9d29b6ea42f2b44a5314c328c1c008f9fe005696556be79632e36e29948474612a8f3014dfecd47eca06014b1d7174787ed5 SHA512 73fd36d8004135c172025b3eb3385f731e294935413d7ac905672f1a88434ca332325821c5f15d5ae83fb1385fcde9f1e7f32242f8ac175bb96bd535b5d91620
+EBUILD generator-0.35_p4-r1.ebuild 1092 BLAKE2B de4360b80c7109f3c8c0925a67f53a113bb2c48aa50ebdde7c3ade30363eff0ee2b007819936aab0ff8783c292158af9a699bc0cc70503365c7d040ef131240f SHA512 f54d48b13d10a30529a946a44f1a35ecb7dfcf032a578ceda75404affb15058def9ddadc3b2cf40b5b2f2a9922c926f978d108f63fbcc5cd34d410485ddb30e1
+MISC metadata.xml 326 BLAKE2B b5532fc7965a4b39312288491e98a48de5acdf76c1c5c92ddff370631484f6a57160eb2f983f6086d249b6cf9bba8b8dae47633c2bb38325e2d3faa175099253 SHA512 10d43e88d746f422d5751b87175a6ec76468d1f829d65aa554acced5075cfa39b6fd0d589a87d71a3127f70a718653e24444710f3e669dab3c0587a6b138ca67
diff --git a/games-emulation/generator/files/generator-0.35_p4-configure.patch b/games-emulation/generator/files/generator-0.35_p4-configure.patch
new file mode 100644
index 000000000000..a918c4a97113
--- /dev/null
+++ b/games-emulation/generator/files/generator-0.35_p4-configure.patch
@@ -0,0 +1,94 @@
+--- a/configure.ac.original 2008-03-17 13:07:48.000000000 -0400
++++ b/configure.ac 2008-03-17 13:08:03.000000000 -0400
+@@ -28,15 +28,12 @@
+ AC_ARG_WITH(tcltk,
+ AS_HELP_STRING(--with-tcltk,Create tcltk version),
+ MY_PROG="generator-tcltk")
+- AC_ARG_WITH(gtk,
+- AS_HELP_STRING(--with-gtk,Create gtk version),
+- MY_PROG="generator-gtk")
+ AC_ARG_WITH(sdl,
+ AS_HELP_STRING(--with-sdl,Create SDL version),
+ [MY_PROG="generator-sdl"; USE_SDL_AUDIO=yes])
+ if [[ "x$MY_PROG" = "x" ]]; then
+ AC_MSG_ERROR(You must select a user interface type:
+- svgalib allegro tcltk gtk sdl)
++ svgalib allegro tcltk sdl)
+ fi
+ if [[ "x$MY_PROG" = "xgenerator-allegro" ]]; then
+ AC_DEFINE(ALLEGRO, 1, [Allegro version])
+@@ -202,50 +199,6 @@
+ CFLAGS="$CFLAGS -Wstrict-prototypes -Wunused"
+ fi
+ fi
+- if [[ "x$DEBUG" != "xno" ]]; then
+- AC_MSG_RESULT(Turning on debug flags)
+- CFLAGS="$CFLAGS -g -O"
+- optimum=no
+- else
+- if [[ "x$GCCVER" != "xno" ]]; then
+- AC_MSG_RESULT(Turning on gcc optimisations)
+- CFLAGS="$CFLAGS -O3 -fomit-frame-pointer"
+- if [[ "x$GCCVER" = "x3" ]]; then
+- AC_MSG_RESULT(Turning on gcc 3 optimisations)
+- CFLAGS="$CFLAGS -fno-math-errno"
+- fi
+- case "$CFLAGS" in
+- *mcpu*|*march*) AC_MSG_RESULT(Skipping target optimisations)
+- ;;
+- *) case "$target_cpu" in
+- i386) AC_MSG_RESULT(Turning on i386 optimisations)
+- CFLAGS="$CFLAGS -march=i386 -ffast-math"
+- ;;
+- i486) AC_MSG_RESULT(Turning on i486 optimisations)
+- CFLAGS="$CFLAGS -march=i486 -ffast-math"
+- ;;
+- i586) AC_MSG_RESULT(Turning on pentium optimisations)
+- # cannot do malign-double as we link to other libraries and
+- # it would break binary compatibility
+- CFLAGS="$CFLAGS -march=pentium -ffast-math"
+- ;;
+- i?86) AC_MSG_RESULT(Turning on i686 optimisations)
+- # cannot do malign-double as we link to other libraries and
+- # it would break binary compatibility
+- CFLAGS="$CFLAGS -march=i686 -ffast-math"
+- ;;
+- alpha*) AC_MSG_RESULT(Adding -mieee for Alpha)
+- CFLAGS="$CFLAGS -mieee"
+- ;;
+- *) AC_MSG_RESULT(Sorry unknown target CPU)
+- ;;
+- esac
+- esac
+- else
+- AC_MSG_WARN(You did not opt for gcc optimisations!)
+- optimum=no
+- fi
+- fi
+ AC_CHECK_LIB(jpeg, jpeg_start_compress,
+ [ MY_LIBS="-ljpeg $MY_LIBS"; AC_DEFINE(JPEG, 1, [JPEG features]) ])
+
+@@ -272,14 +225,7 @@
+
+ AC_PATH_XTRA
+
+- if [[ "x$MY_PROG" = "xgenerator-gtk" ]]; then
+- MY_SUBDIRS="glade gtkopts $MY_SUBDIRS"
+- AM_PATH_GTK(1.2.10,,AC_MSG_ERROR(Generator needs gtk 1.2.10 or later))
+- AM_PATH_SDL(1.2.6,,AC_MSG_ERROR(Generator needs sdk 1.2.6 or later))
+-
+- MY_LIBS="$MY_LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
+- CFLAGS="$CFLAGS $X_CFLAGS"
+- elif [[ "x$MY_PROG" = "xgenerator-sdl" ]]; then
++ if [[ "x$MY_PROG" = "xgenerator-sdl" ]]; then
+ MY_SUBDIRS="gtkopts $MY_SUBDIRS"
+ AM_PATH_SDL(1.2.6,,AC_MSG_ERROR(Generator needs sdk 1.2.6 or later))
+
+@@ -305,6 +251,7 @@
+ AC_CHECK_SIZEOF(unsigned long, 4)
+ AC_CHECK_SIZEOF(unsigned long long, 8)
+ AC_CHECK_HEADERS(sys/param.h)
++ AC_CHECK_HEADERS(sys/time.h)
+ AC_CHECK_HEADERS(bzlib.h)
+ AC_CHECK_HEADERS(zlib.h)
+ AC_CHECK_HEADERS(tcl8.0.h)
diff --git a/games-emulation/generator/files/generator-0.35_p4-inline.patch b/games-emulation/generator/files/generator-0.35_p4-inline.patch
new file mode 100644
index 000000000000..e7f09fa3689c
--- /dev/null
+++ b/games-emulation/generator/files/generator-0.35_p4-inline.patch
@@ -0,0 +1,12 @@
+diff -aur generator-0.35-cbiere-r4/ym2612/support.h generator-0.35-cbiere-r4-patched/ym2612/support.h
+--- generator-0.35-cbiere-r4/ym2612/support.h 2005-08-27 05:12:29.000000000 -0400
++++ generator-0.35-cbiere-r4-patched/ym2612/support.h 2018-03-26 11:49:36.000000000 -0400
+@@ -3,7 +3,7 @@
+ #include "config.h"
+
+ #define errorlog 0
+-#define INLINE inline
++#define INLINE
+ #define HAS_YM2612 1
+ #define YM2612UpdateRequest(x)
+ #define AY8910_set_clock(chip,clock)
diff --git a/games-emulation/generator/files/generator-0.35_p4-underlink.patch b/games-emulation/generator/files/generator-0.35_p4-underlink.patch
new file mode 100644
index 000000000000..b350e8b8a334
--- /dev/null
+++ b/games-emulation/generator/files/generator-0.35_p4-underlink.patch
@@ -0,0 +1,11 @@
+--- a/main/Makefile.am.old 2011-06-20 21:35:25.832460030 +0200
++++ b/main/Makefile.am 2011-06-20 21:36:29.490503981 +0200
+@@ -7,7 +7,7 @@
+ bin_PROGRAMS = @PROGRAM@
+ EXTRA_PROGRAMS = generator-svgalib generator-tcltk generator-allegro \
+ generator-gtk generator-sdl
+-LDADD = ../cpu68k/lib68k.a ../ym2612/libym2612.a @MY_LIBS@ \
++LDADD = ../cpu68k/lib68k.a ../ym2612/libym2612.a @MY_LIBS@ -lm \
+ ../sn76496/libsn76496.a
+
+ ## this should be generator_tcltk_DATA but it won't let me do that
diff --git a/games-emulation/generator/generator-0.35_p4-r1.ebuild b/games-emulation/generator/generator-0.35_p4-r1.ebuild
new file mode 100644
index 000000000000..14ef210d58a8
--- /dev/null
+++ b/games-emulation/generator/generator-0.35_p4-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools toolchain-funcs
+
+MY_P="${PN}-${PV/_p/-cbiere-r}"
+DESCRIPTION="Sega Genesis / Mega Drive emulator"
+HOMEPAGE="http://www.squish.net/generator/"
+SRC_URI="http://www.squish.net/generator/cbiere/generator/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+sdlaudio"
+
+RDEPEND="
+ virtual/jpeg:0
+ media-libs/libsdl[joystick,video]
+ sdlaudio? ( media-libs/libsdl[sound] )
+"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ default
+ eapply \
+ "${FILESDIR}"/${P}-configure.patch \
+ "${FILESDIR}"/${P}-underlink.patch \
+ "${FILESDIR}"/${P}-inline.patch
+
+ sed -i -e 's/@GTK_CFLAGS@//g' main/Makefile.am || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-cmz80 \
+ --with-sdl \
+ --without-tcltk \
+ --with-gcc=$(gcc-major-version) \
+ $(use_with sdlaudio sdl-audio)
+}
+
+src_compile() {
+ [[ -f Makefile ]] && emake clean
+ emake -j1
+}
+
+src_install() {
+ dobin main/generator-sdl
+ dodoc AUTHORS ChangeLog NEWS README TODO docs/*
+}
diff --git a/games-emulation/generator/metadata.xml b/games-emulation/generator/metadata.xml
new file mode 100644
index 000000000000..4f260fbfd598
--- /dev/null
+++ b/games-emulation/generator/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="sdlaudio">Enable SDL Audio</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-emulation/gens-2.15.5-r1 b/games-emulation/gens-2.15.5-r1
deleted file mode 100644
index 7d2298093e2e..000000000000
--- a/games-emulation/gens-2.15.5-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=configure install prepare
-DEPEND=virtual/opengl >=media-libs/libsdl-1.2[joystick,video] x11-libs/gtk+:2 >=dev-lang/nasm-0.98
-DESCRIPTION=A Sega Genesis/CD/32X emulator
-EAPI=6
-HOMEPAGE=https://sourceforge.net/projects/gens/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=virtual/opengl >=media-libs/libsdl-1.2[joystick,video] x11-libs/gtk+:2
-SLOT=0
-SRC_URI=mirror://sourceforge/gens/gens-2.15.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=afdb1cd8583e7641c267594bff9b0313
diff --git a/games-emulation/gens/Manifest b/games-emulation/gens/Manifest
new file mode 100644
index 000000000000..9d767dd2b427
--- /dev/null
+++ b/games-emulation/gens/Manifest
@@ -0,0 +1,7 @@
+AUX gens-2.15.5-as-needed.patch 367 BLAKE2B 145f1d54665e2a0a50a11c18bca22c9ec17b420d3439812f4d82ca259486ee4e3ffcf8b47a5cff7bd61a838ad6723ce9fa9d1d4448d3d51b5638861d5109f970 SHA512 be44bd13b869a9181d740f850dcb7a6f6cfc8660bf31cdf515beffa989fc64e120e7dc3b683f702ec6059805bc37f18a104f420fd3f84a438f26b09da82dd4a8
+AUX gens-2.15.5-gcc34.patch 1545 BLAKE2B c0a4b73fb0ead7ccd98660c8684e88dc8b04179cee114c3d984b9ab699a8f3f5c680b55068847d225645ea32f03eed21841e0e01aeb2c80d15f40d7ad52a5f13 SHA512 8af2946ac09a18adc2d35ea7797acfdb107b86b29b6bf412a87080e4cc66e45bb5a61823095766bde2ca3e95768a1ac243e39b1d06f9bd99f20b7fdec71d1ef0
+AUX gens-2.15.5-ovflfix.patch 581 BLAKE2B a4b44f6b59e03021f9b68603b0011d88fc14284e3e817c970d97a2e8ebbc1454eef339869da680e0b5073b96a7786fb39a1fa997c0d0a6911837c0220a59b0b1 SHA512 cc21dfabeba4cf413853c8d7d0779448c9aab318c2bd83894622ea132eae645000b77d9ef803bb1643f5f6b1b11263f4dfaf66e50a905730e592a628654c33f7
+AUX gens-2.15.5-romsdir.patch 575 BLAKE2B 2af287d30b5ff6c28a306fb35733cd8a715ffe1ae20da117b5f9dd3520f54c39a906d9bcd6b6003ce2cb4bd09d55d10bf25164d71f9400548360b9736cb5aa06 SHA512 73b75f4b8087931b20b1b8c220ce64e957ca0cdeb91a59a90b29b4376420e567093f0ae6d6525cdf3930f555720b27c9f152ec5bbf0365743a0bac236da115e6
+DIST gens-2.15.5.tar.gz 741852 BLAKE2B 17501077737ea7320f9675c130c89cc0e078ad413e7af32c55c5db8d0fa2ba099db26d1272c32e09e86bb11fd49f364b0597540261414d366198afb24a10bc7a SHA512 7163f6a1e09bac420e0e4aa0f8f3ed255406d9aff3cc7366c40226e7fece78baca5428d0fe87daf0f12f6e10b428477a795b54d008db5e3dcbf7692ed9d9fe7d
+EBUILD gens-2.15.5-r1.ebuild 1039 BLAKE2B 3f45d90fe1ed3b9210a03fe33fec6d86d75854dde240aa45d6c9ccb3acdd013108280a40c81518eb5cb9e1ad26f9e88cd796a79f8d085dbc30adda55b4426679 SHA512 9a2486425226271ab06d8c5977590f86885748c63b51c35246e55ea5ffd69f22ee909214b8d2d084c6444e881857306f1729e1819b349d59ae2f0d1a079265ed
+MISC metadata.xml 327 BLAKE2B 2eb11640da9741a65ebe22b58a03e88d5432c69cef02a4db90801bc65d06987e3a8056401efca51ed70846666922d312bb1f38189cea7a53e9e0c1afbde55fa9 SHA512 651fefa76d513b3f2a0ecf865547bf7046605ef21fa689e620820464a28b3b2e5b288623e7ca71bcae93cc016871240025caf1fdb04a45a0695ec457098434b4
diff --git a/games-emulation/gens/files/gens-2.15.5-as-needed.patch b/games-emulation/gens/files/gens-2.15.5-as-needed.patch
new file mode 100644
index 000000000000..2b58e7f94b33
--- /dev/null
+++ b/games-emulation/gens/files/gens-2.15.5-as-needed.patch
@@ -0,0 +1,11 @@
+--- a/configure.old 2009-02-04 14:41:40.000000000 +0100
++++ b/configure 2009-02-04 14:48:52.000000000 +0100
+@@ -4929,7 +4929,7 @@
+ { echo "$as_me:$LINENO: result: $with_opengl" >&5
+ echo "${ECHO_T}$with_opengl" >&6; }
+ if test x$with_opengl = xyes; then
+- LDFLAGS="$LDFLAGS -lGL"
++ LIBS="$LIBS -lGL"
+
+ fi
+ fi
diff --git a/games-emulation/gens/files/gens-2.15.5-gcc34.patch b/games-emulation/gens/files/gens-2.15.5-gcc34.patch
new file mode 100644
index 000000000000..77acd5c4e970
--- /dev/null
+++ b/games-emulation/gens/files/gens-2.15.5-gcc34.patch
@@ -0,0 +1,46 @@
+from https://sourceforge.net/p/gens/patches/25/
+
+--- gens.orig/src/gens/gens_core/cpu/68k/cpu_68k.c 2004-05-22 09:02:12.000000000 -0700
++++ gens/src/gens/gens_core/cpu/68k/cpu_68k.c 2005-03-21 10:52:24.000000000 -0800
+@@ -24,9 +24,9 @@
+
+ struct STARSCREAM_PROGRAMREGION M68K_Fetch[] = {
+ {0x000000, 0x3FFFFF, (unsigned) 0x000000},
+- {0xFF0000, 0xFFFFFF, (unsigned) &Ram_68k[0] - 0xFF0000},
+- {0xF00000, 0xF0FFFF, (unsigned) &Ram_68k[0] - 0xF00000},
+- {0xEF0000, 0xEFFFFF, (unsigned) &Ram_68k[0] - 0xEF0000},
++ {0xFF0000, 0xFFFFFF, (unsigned) NULL},
++ {0xF00000, 0xF0FFFF, (unsigned) NULL},
++ {0xEF0000, 0xEFFFFF, (unsigned) NULL},
+ {-1, -1, (unsigned) NULL},
+ {-1, -1, (unsigned) NULL},
+ {-1, -1, (unsigned) NULL}
+@@ -60,7 +60,7 @@
+
+
+ struct STARSCREAM_PROGRAMREGION S68K_Fetch[] = {
+- {0x000000, 0x07FFFF, (unsigned) &Ram_Prg[0]},
++ {0x000000, 0x07FFFF, (unsigned) NULL},
+ {-1, -1, (unsigned) NULL},
+ {-1, -1, (unsigned) NULL}
+ };
+@@ -109,6 +109,10 @@
+ int
+ M68K_Init (void)
+ {
++ M68K_Fetch[1].offset=(unsigned) &Ram_68k[0] - 0xFF0000;
++ M68K_Fetch[2].offset=(unsigned) &Ram_68k[0] - 0xF00000;
++ M68K_Fetch[3].offset=(unsigned) &Ram_68k[0] - 0xEF0000;
++
+ memset (&Context_68K, 0, sizeof (Context_68K));
+
+ Context_68K.s_fetch = Context_68K.u_fetch = Context_68K.fetch = M68K_Fetch;
+@@ -134,6 +138,8 @@
+ int
+ S68K_Init (void)
+ {
++ S68K_Fetch[0].offset=(unsigned) &Ram_Prg[0];
++
+ memset (&Context_68K, 0, sizeof (Context_68K));
+
+ Context_68K.s_fetch = Context_68K.u_fetch = Context_68K.fetch = S68K_Fetch;
diff --git a/games-emulation/gens/files/gens-2.15.5-ovflfix.patch b/games-emulation/gens/files/gens-2.15.5-ovflfix.patch
new file mode 100644
index 000000000000..fdbef69dba0a
--- /dev/null
+++ b/games-emulation/gens/files/gens-2.15.5-ovflfix.patch
@@ -0,0 +1,13 @@
+--- a/src/gens/gens_core/cpu/68k/cpu_68k.c.old 2010-10-28 09:34:52.000000000 +0200
++++ b/src/gens/gens_core/cpu/68k/cpu_68k.c 2010-10-28 09:35:53.000000000 +0200
+@@ -239,8 +239,8 @@
+ memset (Ram_Word_2M, 0, 256 * 1024);
+ memset (Ram_Word_1M, 0, 256 * 1024);
+
+- memset (COMM.Command, 0, 8 * 5);
+- memset (COMM.Status, 0, 8 * 5);
++ memset (COMM.Command, 0, sizeof (COMM.Command));
++ memset (COMM.Status, 0, sizeof (COMM.Status));
+
+ LED_Status = S68K_State = S68K_Mem_WP = S68K_Mem_PM = Ram_Word_State = 0;
+ COMM.Flag = Init_Timer_INT3 = Timer_INT3 = Int_Mask_S68K = 0;
diff --git a/games-emulation/gens/files/gens-2.15.5-romsdir.patch b/games-emulation/gens/files/gens-2.15.5-romsdir.patch
new file mode 100644
index 000000000000..c885552f12d5
--- /dev/null
+++ b/games-emulation/gens/files/gens-2.15.5-romsdir.patch
@@ -0,0 +1,13 @@
+diff -ruN gens-rc3.5-opengl/src/gens/util/rom.c gens-rc3.5-opengl-patched/src/gens/util/rom.c
+--- a/src/gens/util/file/rom.c 2005-01-10 22:24:01.000000000 +0100
++++ b/src/gens/util/file/rom.c 2006-10-29 14:58:14.000000000 +0100
+@@ -411,6 +411,9 @@
+ create_file_chooser_dialog ("Open Rom", GTK_FILE_CHOOSER_ACTION_OPEN);
+ // fileselection_set_dir (fd.filesel, Rom_Dir);
+ addRomsFilter (widget);
++
++ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), Rom_Dir);
++
+ res = gtk_dialog_run (GTK_DIALOG (widget));
+ if (res == GTK_RESPONSE_OK)
+ {
diff --git a/games-emulation/gens/gens-2.15.5-r1.ebuild b/games-emulation/gens/gens-2.15.5-r1.ebuild
new file mode 100644
index 000000000000..de49e5ffa082
--- /dev/null
+++ b/games-emulation/gens/gens-2.15.5-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop flag-o-matic
+
+DESCRIPTION="A Sega Genesis/CD/32X emulator"
+HOMEPAGE="https://sourceforge.net/projects/gens/"
+SRC_URI="mirror://sourceforge/gens/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ virtual/opengl
+ >=media-libs/libsdl-1.2[joystick,video]
+ x11-libs/gtk+:2
+"
+DEPEND="${RDEPEND}
+ >=dev-lang/nasm-0.98
+"
+
+src_prepare() {
+ default
+ eapply \
+ "${FILESDIR}"/${P}-romsdir.patch \
+ "${FILESDIR}"/${P}-as-needed.patch \
+ "${FILESDIR}"/${P}-ovflfix.patch \
+ "${FILESDIR}"/${P}-gcc34.patch
+ sed -i -e '1i#define OF(x) x' src/gens/util/file/unzip.h || die
+ append-ldflags -Wl,-z,noexecstack
+}
+
+src_configure() {
+ use amd64 && multilib_toolchain_setup x86 #441876
+ econf \
+ --disable-gtktest \
+ --disable-sdltest
+}
+
+src_install() {
+ DOCS="AUTHORS BUGS README gens.txt history.txt" \
+ default
+ newicon pixmaps/gens_small.png ${PN}.png
+ make_desktop_entry "${PN}" "Gens"
+}
diff --git a/games-emulation/gens/metadata.xml b/games-emulation/gens/metadata.xml
new file mode 100644
index 000000000000..da30fe35d4bc
--- /dev/null
+++ b/games-emulation/gens/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gens</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/gfceux-2.1.1-r1 b/games-emulation/gfceux-2.1.1-r1
deleted file mode 100644
index 96a2aa8f0623..000000000000
--- a/games-emulation/gfceux-2.1.1-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare setup test unpack
-DEPEND=dev-python/pygtk >=sys-apps/sed-4 python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]
-DESCRIPTION=A graphical frontend for the FCEUX emulator
-EAPI=5
-HOMEPAGE=http://fceux.com
-IUSE=python_targets_python2_7
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-python/pygtk games-emulation/fceux python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)] games-misc/games-envd
-REQUIRED_USE=|| ( python_targets_python2_7 )
-SLOT=0
-SRC_URI=mirror://sourceforge/fceultra/fceux-2.1.1.src.tar.bz2
-_eclasses_=base 983774947da124fb7d542ce25a218bb1 desktop 1b286a7e7143d8c4ec89cd0d2743a097 distutils-r1 63fea93ca1cc4fdc5fa2247afc4e3a15 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc games 2bb3ede665927a68ffdb7c41eec7efde gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multibuild 35719a9cd25ec71ee49c966f6868454c multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 preserve-libs ef207dc62baddfddfd39a164d9797648 python-r1 0b5829eb6369d7af3a834b6eed7b7107 python-utils-r1 7db901256449fef43c3aaa4d486c1c63 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=6632ec0bf6e3db5c8c97bd8a50eb8ae3
diff --git a/games-emulation/gfceux/Manifest b/games-emulation/gfceux/Manifest
new file mode 100644
index 000000000000..74a7bb36002e
--- /dev/null
+++ b/games-emulation/gfceux/Manifest
@@ -0,0 +1,3 @@
+DIST fceux-2.1.1.src.tar.bz2 3263945 BLAKE2B 96c1dfcf51f34eff273c948d7467c4c5503079423d839c6e52596f5a47bb7a2c148a1603fbd784d838c62476e71818418615f4d10f9d04669d319466b379f078 SHA512 19a1253a3ff1d88baec5636dbebab287b106e5e114081ab4040f52dfcda28b878af748a759e08dc2fe1381eb8f59e728d36993a9aca9ce184ed8760114cf3149
+EBUILD gfceux-2.1.1-r1.ebuild 1258 BLAKE2B 125f8cc0c48c208f9d689be19aba0640d440f295d261f8be796b08497e94f8ae1d6e397f157aa8a8b6ba354d5aed2ef7898e5efbb9986ea983c35476fd0bfa26 SHA512 f95bedd06faf08fc9ffb28a9d229d6dfd20ee298025f8b06c349641d4fe8de23d860b48532fb8171af43e1f4a546a48d669d374bc761dffc2ddc8af7d27d274b
+MISC metadata.xml 331 BLAKE2B b36952158ee85e8e6614447dca54480d07a8e2fc23b059d16ede28fa9b31f65d21b606e0515e073c0d42d770a68cadcfec8965c6e9bd1343ef484f914e977434 SHA512 c64be39c5960c471c673a706561fc8962a9badcd31912280acbc999ec6617f72eaf432e0bd6f148fae4967f6c83770d8468c990cd191376f919207ae85037fa7
diff --git a/games-emulation/gfceux/gfceux-2.1.1-r1.ebuild b/games-emulation/gfceux/gfceux-2.1.1-r1.ebuild
new file mode 100644
index 000000000000..faf11fdaf183
--- /dev/null
+++ b/games-emulation/gfceux/gfceux-2.1.1-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils gnome2-utils distutils-r1 games
+
+DESCRIPTION="A graphical frontend for the FCEUX emulator"
+HOMEPAGE="http://fceux.com"
+SRC_URI="mirror://sourceforge/fceultra/fceux-${PV}.src.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-python/pygtk"
+RDEPEND="${DEPEND}
+ games-emulation/fceux"
+
+S=${WORKDIR}/${PN}
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ sed -i \
+ -e "s#data/gfceux.glade#${GAMES_DATADIR}/${PN}/gfceux.glade#" \
+ src/main.py || die
+}
+
+python_install() {
+ distutils-r1_python_install --install-scripts="${GAMES_BINDIR}"
+}
+
+src_prepare() {
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ distutils-r1_src_compile
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ doicon -s 48 data/${PN}.png
+ newicon -s 128 data/${PN}_big.png ${PN}.png
+
+ # respect games variables
+ dodir "${GAMES_DATADIR}"/${PN}
+ mv "${ED}"/usr/share/${PN}/* "${ED}${GAMES_DATADIR}"/${PN}/ || die
+
+ prepgamesdirs
+}
+
+pkg_preinst() {
+ games_pkg_preinst
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/gfceux/metadata.xml b/games-emulation/gfceux/metadata.xml
new file mode 100644
index 000000000000..3c71f364aead
--- /dev/null
+++ b/games-emulation/gfceux/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">fceultra</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/gngb-20060309-r1 b/games-emulation/gngb-20060309-r1
deleted file mode 100644
index 6984356d3782..000000000000
--- a/games-emulation/gngb-20060309-r1
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure prepare
-DEPEND=media-libs/libsdl[sound,joystick,video] sys-libs/zlib app-arch/bzip2 opengl? ( virtual/opengl ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Gameboy / Gameboy Color emulator
-EAPI=6
-HOMEPAGE=http://m.peponas.free.fr/gngb/
-IUSE=opengl
-KEYWORDS=~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos
-LICENSE=GPL-2
-RDEPEND=media-libs/libsdl[sound,joystick,video] sys-libs/zlib app-arch/bzip2 opengl? ( virtual/opengl )
-SLOT=0
-SRC_URI=http://m.peponas.free.fr/gngb/download/gngb-20060309.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 libtool 0081a71a261724730ec4c248494f044d multilib 97f470f374f2e94ccab04a2fb21d811e toolchain-funcs 1e35303c63cd707f6c3422b4493d5607
-_md5_=0d34dc919ae47342eee2b5ea03f47985
diff --git a/games-emulation/gngb/Manifest b/games-emulation/gngb/Manifest
new file mode 100644
index 000000000000..7a56b75c4b36
--- /dev/null
+++ b/games-emulation/gngb/Manifest
@@ -0,0 +1,10 @@
+AUX gngb-20060309-amd64.patch 982 BLAKE2B 767efcd0db8ae30296a2326ae74b16f2ea776bee490a77ae6c7960ed96ac127e54e6bb896cc4bcaca43a5c3a5508ebb0bcad17c5c7af3add1104c95540090811 SHA512 91f3782ecaeac60ad60c14b8e173099683e85917765f1d8e1ce92edbbba929042e0254c2d7f4432124c1dd2c8965603e88172076bf4e3c6b427e8c46f25c0312
+AUX gngb-20060309-gcc34.patch 623 BLAKE2B 8861c3224bc01d4ce1ec5c062d473bb2ad6f533e834550ba7d53f416d684c44580169d36aa016a65d916f8ffe05aa336f1b60da285e253b7aa288c33f8518860 SHA512 651a0771d1b43762083bece5eb12ecba5833774fb095bdb00c0031e20d11b4a59daae4bdd519a2840a2dd5aa5ea0a852d968da7cf96de8acd7ac1ddd90968167
+AUX gngb-20060309-gcc5.patch 818 BLAKE2B 8b937260859a3bed1339f3d3a253fcc58aff3991503f03fbdc529446666e7a0c344469d10793e6ab31dba42f9b4db4b29181e1e3bdaed23bc41175056cc5f747 SHA512 f61dd42c766ee9fcdd02228401011b38dc9ecc7e87044b34f6d726a4fc9862ebabb39223b83967fce247a675a6cfa8037747e49ead4077b9a0aff522f7377e79
+AUX gngb-20060309-gcc7.patch 1693 BLAKE2B a47637993a219502c6f81750987ea7679935cd07e7cb2ad8ffbdb648a8b11c329ca55585949f172c3b0ce2b18592572a37c4302d59b9172e4d481d1a81871644 SHA512 ff73a5344c1b3d090fbd16c774ffb535f4586cd2b876f71654d1e3e127c1527bb9abe096e24f6c8fb5cff2d19c29b12aa1e6f56e760b00362ff44755711ec433
+AUX gngb-20060309-inline.patch 463 BLAKE2B 8946f6bc81e518b482fb93bac335b3a15a728736a06bb753692d6ac896d1ffc4f550d3aff8b41dbd1bf5d79d38c5c3edf969b7686d9fb05e654e49384d65055b SHA512 6a1916555f7855abde4a1ce3a6ba19575c3b92cd8e3eb9283757b54e1747ee37dce7005c2311d9faaeb5059e8157c742abfba072c912b1c6d5e40555a28c2b25
+AUX gngb-20060309-joystick.patch 2162 BLAKE2B f2c9bf3aad5468e5a4e587489b0737270c07d743a7ee710aada49a041f73d6a8afbdf4b8f1efa7ec2a582603b7a39e75c5b33765d965f9b85538dc7a7ff87d01 SHA512 535fcccfc986fdb4e555d0edca7ad4cbe33ed656a904bd32d4de516a4735ecdc7743e58e38a20d2b6015f515f7dbed6260a974ec92797b497a111b0e5bb1c24c
+AUX gngb-20060309-qwerty.patch 590 BLAKE2B 1042df2d545203547a691322ddfee05a76cd9a8a099e7ce14917f7b93ccee606ff9746a88c056409b838e4cd4a53703248bd1232be177d582a7774a80cf141af SHA512 756923c0d35b42adb69da6bf7c3c7cd89adc6402d758b8f2f50d2e527181841685b108cd9903c70a2e62b7ce3319dd1a784045866d50d9a21eabc870115779b9
+DIST gngb-20060309.tar.gz 168911 BLAKE2B 9377b107c3318041cf903de1661ec6a43078e1cade77b2899b6412616b2c5c32e217d5efc69fcc5324c75242f880493b1b3e678c5bc0a71a4a3ef2dbfd756b4c SHA512 169fdb94eac439240ff15fc2337908cb40e06259338d03c0193a0cb04acb9ee688832fc3157ec56e4e541a8889c4b1a4e7d0efb035b5829ffb856192b60d259f
+EBUILD gngb-20060309-r1.ebuild 951 BLAKE2B ee37545f7f64fc3f75d464523e47768bfb24b27f633481518b66dcf28ac29d5986e8450895bd720950fc9b0f609f1f7267c9f88d161d43cfb59c688713e47797 SHA512 b83debaf3d28f5a7da50dd1cb10b7eaf339cfffdebbec798295dde6c23f520bea064a4ecb43e8e8e2591bbfde1ec9f7554aa7e7972c4bee2af084770c523a9de
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/gngb/files/gngb-20060309-amd64.patch b/games-emulation/gngb/files/gngb-20060309-amd64.patch
new file mode 100644
index 000000000000..1e63ee00dd26
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-amd64.patch
@@ -0,0 +1,30 @@
+From: Chris Lamb <lamby@debian.org>
+Date: Wed, 16 Aug 2017 22:53:10 +0200
+Subject: reproducible build
+
+Bug-Debian: https://bugs.debian.org/831773
+---
+ configure.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 9b8aeec..145bd73 100644
+--- a/configure.in
++++ b/configure.in
+@@ -90,6 +90,7 @@ fi
+ dnl Arch
+
+ case `uname -m` in
++*x86_64) arch_info=x86_64 ;;
+ *686) arch_info=i686 ;;
+ *i586) arch_info=i586 ;;
+ *i486) arch_info=i486 ;;
+@@ -107,7 +108,7 @@ sys_info=`uname -s`
+ AC_MSG_RESULT(System: $sys_info)
+
+ case $arch_info in
+-i686|i586|i486|i386) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \
++x86_64|i686|i586|i486|i386) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \
+ -ffast-math -falign-functions=2 -falign-jumps=2 \
+ -falign-loops=2 -fomit-frame-pointer -Wall " ;;
+ sun4u) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \
diff --git a/games-emulation/gngb/files/gngb-20060309-gcc34.patch b/games-emulation/gngb/files/gngb-20060309-gcc34.patch
new file mode 100644
index 000000000000..112569287fd3
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-gcc34.patch
@@ -0,0 +1,22 @@
+From: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
+Date: Thu, 10 Aug 2017 19:06:35 +0000
+Subject: FTBFS_with_gcc-3.4_conflicting_types
+
+===================================================================
+---
+ src/save.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/save.c b/src/save.c
+index c7e4395..bf50bdf 100644
+--- a/src/save.c
++++ b/src/save.c
+@@ -404,6 +404,8 @@ int save_load_rt_info(GNGB_FILE * stream,char op) {
+ return 0;
+ }
+
++void movie_add_pad(Uint8 pad);
++
+ int save_load_pad_movie(GNGB_FILE * stream,char op) {
+ if (!op) { /* Write */
+ PAD_SAVE *p=gngb_movie.first_pad;
diff --git a/games-emulation/gngb/files/gngb-20060309-gcc5.patch b/games-emulation/gngb/files/gngb-20060309-gcc5.patch
new file mode 100644
index 000000000000..72dd21a494fb
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-gcc5.patch
@@ -0,0 +1,35 @@
+From: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
+Date: Thu, 10 Aug 2017 19:06:36 +0000
+Subject: gngb_fcc5_fix
+
+---
+ src/cpu.c | 2 +-
+ src/vram.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cpu.c b/src/cpu.c
+index f03a811..57bc209 100644
+--- a/src/cpu.c
++++ b/src/cpu.c
+@@ -2826,7 +2826,7 @@ __inline__ void rom_timer_inc(void) {
+ }
+ }
+
+-__inline__ void cpu_run(void) {
++extern __inline__ void cpu_run(void) {
+ static Uint32 divid_cycle;
+ int v=0;
+ Uint8 a;
+diff --git a/src/vram.c b/src/vram.c
+index 206b625..7213b4e 100644
+--- a/src/vram.c
++++ b/src/vram.c
+@@ -242,7 +242,7 @@ void switch_fullscreen(void) {
+ conf.fs^=1;
+ }
+
+-__inline__ Uint8 get_nb_spr(void)
++extern __inline__ Uint8 get_nb_spr(void)
+ {
+ Uint8 *sp=oam_space;
+ Sint16 no_tile,x,y,att;
diff --git a/games-emulation/gngb/files/gngb-20060309-gcc7.patch b/games-emulation/gngb/files/gngb-20060309-gcc7.patch
new file mode 100644
index 000000000000..557e69501dc9
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-gcc7.patch
@@ -0,0 +1,73 @@
+From: Markus Koschany <apo@debian.org>
+Date: Thu, 10 Aug 2017 19:39:05 +0000
+Subject: gcc7
+
+Bug-Debian: https://bugs.debian.org/853425
+Forwarded: no
+---
+ src/cpu.c | 10 +++++-----
+ src/memory.c | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/cpu.c b/src/cpu.c
+index 57bc209..5209548 100644
+--- a/src/cpu.c
++++ b/src/cpu.c
+@@ -61,7 +61,7 @@ static Uint8 a;
+ #define H (gbcpu->hl.b.h)
+ #define L (gbcpu->hl.b.l)
+
+-__inline__ Uint16 get_word(void)
++extern __inline__ Uint16 get_word(void)
+ {
+ //Uint16 v=((Uint16)(mem_read(PC)));
+ Uint16 v1,v2;
+@@ -74,7 +74,7 @@ __inline__ Uint16 get_word(void)
+ //return v;
+ }
+
+-__inline__ Uint8 get_byte(void)
++extern __inline__ Uint8 get_byte(void)
+ {
+ //Uint8 t=mem_read(PC);
+ Uint8 t;
+@@ -83,7 +83,7 @@ __inline__ Uint8 get_byte(void)
+ return t;
+ }
+
+-__inline__ void push_r(REG *r)
++extern __inline__ void push_r(REG *r)
+ {
+ //mem_write(--SP,(r)->b.h);
+ //mem_write(--SP,(r)->b.l);
+@@ -93,7 +93,7 @@ __inline__ void push_r(REG *r)
+ mem_write_fast(SP,(r)->b.l);
+ }
+
+-__inline__ void pop_r(REG *r)
++extern __inline__ void pop_r(REG *r)
+ {
+ //(r)->b.l=mem_read(SP);
+ mem_read_fast(SP,(r)->b.l);
+@@ -176,7 +176,7 @@ __inline__ Uint8 unknown(void){
+
+
+
+-__inline__ Uint8 gbcpu_exec_one(void)
++extern __inline__ Uint8 gbcpu_exec_one(void)
+ {
+ static Uint8 opcode;
+ if (gbcpu->ei_flag==1) {
+diff --git a/src/memory.c b/src/memory.c
+index 26e42d9..fd06738 100644
+--- a/src/memory.c
++++ b/src/memory.c
+@@ -737,7 +737,7 @@ Uint8 mem_read_default(Uint16 adr)
+ return 0xFF;
+ }
+
+-__inline__ void update_gb_pad(void) {
++extern __inline__ void update_gb_pad(void) {
+ gb_pad=0;
+ if (!conf.play_movie) {
+
diff --git a/games-emulation/gngb/files/gngb-20060309-inline.patch b/games-emulation/gngb/files/gngb-20060309-inline.patch
new file mode 100644
index 000000000000..d73ed4cb617b
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-inline.patch
@@ -0,0 +1,24 @@
+From: Arthur Marble <arthur@info9.net>
+Date: Wed, 16 Aug 2017 23:49:59 +0200
+Subject: clang-ftbfs
+
+Bug-Debian: https://bugs.debian.org/757486
+---
+ src/global.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/global.h b/src/global.h
+index bb46387..6a6d2b3 100644
+--- a/src/global.h
++++ b/src/global.h
+@@ -22,5 +22,10 @@
+ #include <config.h>
+ #include <SDL.h>
+
++#ifdef __clang__
++#define __inline__
++#else
++#define __inline__ inline
++#endif
+
+ #endif
diff --git a/games-emulation/gngb/files/gngb-20060309-joystick.patch b/games-emulation/gngb/files/gngb-20060309-joystick.patch
new file mode 100644
index 000000000000..ec5003a52c61
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-joystick.patch
@@ -0,0 +1,56 @@
+From: Markus Koschany <apo@debian.org>
+Date: Wed, 16 Aug 2017 23:25:30 +0200
+Subject: joystick axis
+
+Bug-Debian: https://bugs.debian.org/592777
+Forwarded: http://m.peponas.free.fr/gngb/news.html
+Origin: http://m.peponas.free.fr/gngb/download/memory.c.diff
+---
+ src/memory.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/src/memory.c b/src/memory.c
+index fd06738..9eaef1f 100644
+--- a/src/memory.c
++++ b/src/memory.c
+@@ -67,7 +67,11 @@ Uint8 ram_mask;
+ MEM_READ_ENTRY mem_read_tab[0x10];
+ MEM_WRITE_ENTRY mem_write_tab[0x10];
+
++/* doesn't work for negative joy_?_min */
++/*
+ Sint16 joy_x_min=0;joy_x_max=0;joy_y_min=0;joy_y_max=0;
++*/
++Sint16 joy_x_min=-32767;joy_x_max=32767;joy_y_min=-32767;joy_y_max=32767;
+
+ void (*select_rom_page)(Uint16 adr,Uint8 v);
+ void (*select_ram_page)(Uint16 adr,Uint8 v);
+@@ -755,15 +759,28 @@ extern __inline__ void update_gb_pad(void) {
+ Sint16 joy_x_pos=joy_axis[jmap[PAD_LEFT]];
+ Sint16 joy_y_pos=joy_axis[jmap[PAD_UP]];
+
++ /* unnecessary if joy_?_min and joy_?_max are minimum and maximum
++ * values of Sint16
+ if (joy_x_pos>joy_x_max) joy_x_max=joy_x_pos;
+ if (joy_x_pos<joy_x_min) joy_x_min=joy_x_pos;
+ if (joy_y_pos>joy_y_max) joy_y_max=joy_y_pos;
+ if (joy_y_pos<joy_y_min) joy_y_min=joy_y_pos;
++ */
+
++ /* this doesn't work when joy_x_min or joy_y_min < 0 (mid should be ~0),
++ * because ((+max) - (-min)) / 2 = ((+max) + (+min)) / 2
+ Sint16 joy_x_mid=(joy_x_max-joy_x_min) / 2;
+ Sint16 joy_y_mid=(joy_y_max-joy_y_min) / 2;
++ */
++ Sint16 joy_x_mid=(joy_x_max+joy_x_min) >> 1;
++ Sint16 joy_y_mid=(joy_y_max+joy_y_min) >> 1;
++ /* this doesn't work as joy_x_mid or joy_y_mid approaches 0
+ Sint16 joy_x_qua=joy_x_mid / 2;
+ Sint16 joy_y_qua=joy_y_mid / 2;
++ */
++ /* (difference) / 100 = 1% of possible values */
++ Sint16 joy_x_qua=(joy_x_max - joy_x_min) / 100;
++ Sint16 joy_y_qua=(joy_y_max - joy_y_min) / 100;
+
+ if ((joy_x_pos<(joy_x_mid-joy_x_qua)) || (key[kmap[PAD_LEFT]])) gb_pad|=0x20;
+ if ((joy_x_pos>(joy_x_mid+joy_x_qua)) || (key[kmap[PAD_RIGHT]])) gb_pad|=0x10;
diff --git a/games-emulation/gngb/files/gngb-20060309-qwerty.patch b/games-emulation/gngb/files/gngb-20060309-qwerty.patch
new file mode 100644
index 000000000000..29f563b749e9
--- /dev/null
+++ b/games-emulation/gngb/files/gngb-20060309-qwerty.patch
@@ -0,0 +1,24 @@
+From: Markus Koschany <apo@debian.org>
+Date: Thu, 17 Aug 2017 00:15:26 +0200
+Subject: sample_gngbrc
+
+Bug-Debian: https://bugs.debian.org/597910
+Forwarded: no
+---
+ sample_gngbrc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sample_gngbrc b/sample_gngbrc
+index a76b465..d0fdd3f 100644
+--- a/sample_gngbrc
++++ b/sample_gngbrc
+@@ -65,6 +65,9 @@ map_joy 1,1,0,0,3,2,0,1
+
+ map_key 273,274,276,275,120,119,13,303
+
++# Key configuration qwerty example
++# map_key 273,274,276,275,122,120,13,303
++
+
+ # Normal GB palette (bright to dark)
+ pal_1 0xB8A68D,0x917D5E,0x635030,0x211A10
diff --git a/games-emulation/gngb/gngb-20060309-r1.ebuild b/games-emulation/gngb/gngb-20060309-r1.ebuild
new file mode 100644
index 000000000000..ebe0e3fb3b34
--- /dev/null
+++ b/games-emulation/gngb/gngb-20060309-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools
+
+DESCRIPTION="Gameboy / Gameboy Color emulator"
+HOMEPAGE="http://m.peponas.free.fr/gngb/"
+SRC_URI="http://m.peponas.free.fr/gngb/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="opengl"
+
+RDEPEND="
+ media-libs/libsdl[sound,joystick,video]
+ sys-libs/zlib
+ app-arch/bzip2
+ opengl? ( virtual/opengl )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ # From Debian
+ "${FILESDIR}"/${P}-amd64.patch
+ "${FILESDIR}"/${P}-gcc34.patch
+ "${FILESDIR}"/${P}-gcc5.patch
+ "${FILESDIR}"/${P}-gcc7.patch
+ "${FILESDIR}"/${P}-inline.patch
+ "${FILESDIR}"/${P}-joystick.patch
+ "${FILESDIR}"/${P}-qwerty.patch
+)
+
+src_prepare() {
+ default
+ sed -i -e '70i#define OF(x) x' src/unzip.h || die
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable opengl gl)
+}
diff --git a/games-emulation/gngb/metadata.xml b/games-emulation/gngb/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/gngb/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/gngeo-0.8-r1 b/games-emulation/gngeo-0.8-r1
deleted file mode 100644
index 1b555973733e..000000000000
--- a/games-emulation/gngeo-0.8-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=configure install prepare
-DEPEND=virtual/opengl media-libs/libsdl[joystick,opengl,sound,video] sys-libs/zlib[minizip] >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=A NeoGeo emulator
-EAPI=6
-HOMEPAGE=https://code.google.com/p/gngeo/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=virtual/opengl media-libs/libsdl[joystick,opengl,sound,video] sys-libs/zlib[minizip]
-SLOT=0
-SRC_URI=https://gngeo.googlecode.com/files/gngeo-0.8.tar.gz https://storage.googleapis.com/google-code-archive/v2/code.google.com/gngeo/logo.png -> gngeo.png
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=c03075ca8e1f672c700840cf148fb066
diff --git a/games-emulation/gngeo/Manifest b/games-emulation/gngeo/Manifest
new file mode 100644
index 000000000000..6d147332d635
--- /dev/null
+++ b/games-emulation/gngeo/Manifest
@@ -0,0 +1,8 @@
+AUX gngeo-0.8-cflags.patch 1946 BLAKE2B 208a35296c2d943c65dfdcb02b3724bbc9bad4823103f10ec2fb7b069793a7ca901a51a41543175458f9e4326518f075eed924cdc492b1310159914a8c88e074 SHA512 5df77d438efd9040efcae7f1a19c5939967ae158a50408592b1dd81db26776215ec7994c8173db0e6f9888f45fa2c043bd1338f41a4c535e886c2b0f633a38b7
+AUX gngeo-0.8-concurrentMake.patch 635 BLAKE2B 5f2e96d55ad902a4f9904a28c0de855cd4fe7a65677d5a106688b9194a678b7f4a4be066942839a45c36ae717da62e53be36cdd7832a5abe72bc148b498f1766 SHA512 1d84bac8ad5dbe3f95ff148284d24432aece67191b566927dedf040cab080bf59f2b70f5ae788ab02e5d549b1c56fe2c8f92d5255b8c670433a2efb17483e460
+AUX gngeo-0.8-execstacks.patch 2505 BLAKE2B db1d2bdfe1cc45c76be070c3243439adbebac47b10aba46c85f3d3059d85cc90133e9a75e329b4d3d3ce369018797b166782dd0c795bf18511772013a66bb92d SHA512 cfd0cc424ce0862fb49a1349ec53c65051a13dc031bf66f4df3d96b5d44d9a1a0768c1184b5d6e35d6e72bbf779c0e499989f6b57cde1e25d0ce50bbbdbefdea
+AUX gngeo-0.8-zlib.patch 335 BLAKE2B 4b18c076a3285659f7e199a6d86c3ea2a899fe8dade51b03b36035c4cf9378a1b80ae16aa81c12f75a51bf0053f7d44dfb3b1025f7d95274a79689737ce6d1cb SHA512 6f09ebb89173bc172dc035247727d5e046fb36b3b05789d4b8e98648a229a260f3749fa3e2e35065a418e339d8d80830411ca3614171ef7aadeba0147a4f6a70
+DIST gngeo-0.8.tar.gz 1043579 BLAKE2B b4d1ffdb53e32ea25ed743af113573ce9ebd9f864bff1fed88797573141aecd3a2f799731316ced19892b9e45a334c8a8b59593fce4ec5651754bf80196c9e13 SHA512 4301e0f48afd8686cdc45bd8c3e7b724f4ab7a2482567c7fe99ee8960f652dbcefb00fcdd7071d85b02636a9ae9795d03169ffc79e8ae6f4c5515a5a53c090c7
+DIST gngeo.png 1488 BLAKE2B e474aaec3f9d79b83ecb3519680b172cfecbca27931bb3a039d6ee46c53737557ca2c110b22d0f974840039e465b7bfafa364ae2076f9ea785858099fe402922 SHA512 bc0403cf06fd1095095d87e5e6b8cd8d9e018a2a5b20f7168935d0c48d288af55bd98a72150f3c6d6089646a0780b65ff24f135bf5a680690af160c9be8945e5
+EBUILD gngeo-0.8-r1.ebuild 1045 BLAKE2B 0b002644090a65142e44a40fa2b6437318281973c800bc416f7e70f3035194ea5fd70ac22f9df046c22917154a3b16aba85a05f09d41fbf770adba594d13160b SHA512 7193404f6a63cf323f910f132809e865ca9eb65a6406e39252fbcd55980136dfe0879366abeea048edab343ca1bc51115f47eee64cf1eadd736c8a8a7f845fc5
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/gngeo/files/gngeo-0.8-cflags.patch b/games-emulation/gngeo/files/gngeo-0.8-cflags.patch
new file mode 100644
index 000000000000..0dcc3e7c5bf8
--- /dev/null
+++ b/games-emulation/gngeo/files/gngeo-0.8-cflags.patch
@@ -0,0 +1,41 @@
+--- a/configure.in.orig 2016-03-31 04:15:45.913917791 -0400
++++ b/configure.in 2016-03-31 04:16:23.447607551 -0400
+@@ -236,20 +236,12 @@
+ AC_DEFINE(PROCESSOR_INTEL, 1, [Define if you have an x86 processor])
+ ALIGNLONGS=0
+ proc_i386=true
+- CFLAGS="$CFLAGS -O3 -fstrength-reduce -frerun-loop-opt -Wall -Wno-unused -funroll-loops \
+- -ffast-math -falign-functions=2 -falign-jumps=2 -fexpensive-optimizations \
+- -falign-loops=2 -fschedule-insns2 -malign-double -fomit-frame-pointer -g \
+- -fno-strict-aliasing -pipe -mtune=$target_cpu -DCPU=$target_cpu"
+ ;;
+ x86_64)
+ AC_MSG_RESULT(Turning on x86_64 processor optimisations)
+ AC_DEFINE(PROCESSOR_ADM64, 1, [Define if you have an x86_64 processor])
+ ALIGNLONGS=0
+ proc_x64=true
+- CFLAGS="$CFLAGS -O3 -fstrength-reduce -frerun-loop-opt -Wall -Wno-unused -funroll-loops \
+- -ffast-math -fexpensive-optimizations \
+- -malign-double -fomit-frame-pointer -g \
+- -fno-strict-aliasing -pipe -DCPU=$target_cpu"
+ ;;
+ sparc*) AC_MSG_RESULT(Turning on sparc processor optimisations)
+ AC_DEFINE(PROCESSOR_SPARC, 1, [Define if you have a sparc processor])
+@@ -258,8 +250,6 @@
+ if test $target_cpu = sparc64 && test $CC_MAJOR -ge 3 ; then
+ CFLAGS="$CFLAGS -mcpu=v9"
+ fi
+- CFLAGS="$CFLAGS -O3 -Wall -Wno-unused -funroll-loops \
+- -ffast-math -fomit-frame-pointer -g"
+ ;;
+ arm) AC_MSG_RESULT(Turning on arm processor optimisations)
+ AC_DEFINE(PROCESSOR_ARM, 1, [Define if you have an ARM processor])
+@@ -273,8 +263,6 @@
+ *) AC_MSG_RESULT(Processor type unknown - Use generic optimisations)
+ ALIGNLONGS=1
+ optimum=no
+- CFLAGS="$CFLAGS -O3 -Wall -Wno-unused -funroll-loops \
+- -ffast-math -g"
+ ;;
+ esac
+
diff --git a/games-emulation/gngeo/files/gngeo-0.8-concurrentMake.patch b/games-emulation/gngeo/files/gngeo-0.8-concurrentMake.patch
new file mode 100644
index 000000000000..f039ecf544d9
--- /dev/null
+++ b/games-emulation/gngeo/files/gngeo-0.8-concurrentMake.patch
@@ -0,0 +1,16 @@
+--- a/src/generator68k/Makefile.am.orig 2015-01-23 18:37:37.998723294 -0500
++++ b/src/generator68k/Makefile.am 2015-01-23 18:38:39.995391133 -0500
+@@ -71,9 +71,12 @@
+
+ #def68k : def68k.c
+ # gcc def68k.c tab68k.c -o def68k -I .. -I ../.. -I . `sdl-config --cflags`
+-def68k.o gen68k.o tab68k2.o : %.o : %.c
++def68k.o tab68k2.o : %.o : %.c
+ $(gcc_build_verbose)$(CC_FOR_BUILD) -c $< -o $@ -I .. -I ../.. -I . `sdl-config --cflags`
+
++gen68k.o: gen68k.c def68k-iibs.h
++ $(CC_FOR_BUILD) -c $< -o $@ -I .. -I ../.. -I . `sdl-config --cflags`
++
+ def68k : def68k.o tab68k2.o
+ $(gcc_build_verbose)$(CC_FOR_BUILD) def68k.o tab68k2.o -o $@
+
diff --git a/games-emulation/gngeo/files/gngeo-0.8-execstacks.patch b/games-emulation/gngeo/files/gngeo-0.8-execstacks.patch
new file mode 100644
index 000000000000..a3face06f35c
--- /dev/null
+++ b/games-emulation/gngeo/files/gngeo-0.8-execstacks.patch
@@ -0,0 +1,105 @@
+--- a/src/effect/2xsaimmx.asm
++++ b/src/effect/2xsaimmx.asm
+@@ -2107,3 +2107,7 @@
+ final1b resb 8
+ final2a resb 8
+ final2b resb 8
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+--- a/src/effect/effect_i386.asm
++++ b/src/effect/effect_i386.asm
+@@ -88,3 +88,7 @@
+ emms
+
+ endproc
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+--- a/src/effect/hq2x16.asm
++++ b/src/effect/hq2x16.asm
+@@ -1935,3 +1935,7 @@
+ dd ..@cross8, ..@flag0, ..@flag0, ..@flag0,
+ dd ..@flag0, ..@flag0, ..@flag0, ..@flag0
+
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+--- a/src/effect/hq3x16.asm
++++ b/src/effect/hq3x16.asm
+@@ -2520,3 +2520,7 @@
+ dd ..@cross8, ..@flag0, ..@flag0, ..@flag0,
+ dd ..@flag0, ..@flag0, ..@flag0, ..@flag0
+
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+--- a/src/memcpy.S
++++ b/src/memcpy.S
+@@ -495,4 +495,8 @@
+
+ Lmemcpy_bsrcul1l4:
+ add r1, r1, #1
+-b Lmemcpy_bl4
+\ No newline at end of file
++b Lmemcpy_bl4
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",@progbits
++#endif
+--- a/src/raze/Makefile.am
++++ b/src/raze/Makefile.am
+@@ -20,7 +20,7 @@
+ $(srcdir)/strip_ $< $@
+
+ raze2.asm: raze.asmu raze.incu raze.regu
+- nasm -w+orphan-labels -I $(srcdir)/ -e $< -o $@
++ nasm -w+orphan-labels -f elf -I $(srcdir)/ -e $< -o $@
+
+ # This assembles the file, once it's been pre-processed
+ raze.o: raze2.asm
+--- a/src/raze/raze.asm
++++ b/src/raze/raze.asm
+@@ -4259,3 +4259,6 @@
+
+ ;- the end ------------------------------------------------------------------;
+
++%ifidn ___OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+--- a/src/screen_i386.asm
++++ b/src/screen_i386.asm
+@@ -96,3 +96,6 @@
+ endproc
+
+
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+--- a/src/star/star.c
++++ b/src/star/star.c
+@@ -2431,6 +2431,10 @@
+ */
+ static void suffixes(void) {
+ emit("end\n");
++
++ emit("%%ifidn ___OUTPUT_FORMAT__,elf\n");
++ emit("section .note.GNU-stack noalloc noexec nowrite progbits\n");
++ emit("%%endif\n");
+ }
+
+ /****************************************************************************
+--- a/src/video_i386.asm
++++ b/src/video_i386.asm
+@@ -86,3 +86,7 @@
+
+ popa
+ endproc
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
diff --git a/games-emulation/gngeo/files/gngeo-0.8-zlib.patch b/games-emulation/gngeo/files/gngeo-0.8-zlib.patch
new file mode 100644
index 000000000000..9aa4a6b5f479
--- /dev/null
+++ b/games-emulation/gngeo/files/gngeo-0.8-zlib.patch
@@ -0,0 +1,9 @@
+diff -ru gngeo-0.8.orig/configure.in gngeo-0.8/configure.in
+--- gngeo-0.8.orig/configure.in 2012-11-15 17:57:57.849578009 -0500
++++ gngeo-0.8/configure.in 2012-11-15 18:19:55.305923094 -0500
+@@ -95,6 +95,7 @@
+ #AC_SUBST(LIBOBJS)
+ AC_CHECK_LIB([m], [acos])
+ AC_CHECK_LIB([z], [inflate])
++AC_CHECK_LIB([minizip], [unzReadCurrentFile])
+
diff --git a/games-emulation/gngeo/gngeo-0.8-r1.ebuild b/games-emulation/gngeo/gngeo-0.8-r1.ebuild
new file mode 100644
index 000000000000..3e7f2be86fc0
--- /dev/null
+++ b/games-emulation/gngeo/gngeo-0.8-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools desktop flag-o-matic
+
+DESCRIPTION="A NeoGeo emulator"
+HOMEPAGE="https://code.google.com/p/gngeo/"
+SRC_URI="https://gngeo.googlecode.com/files/${P}.tar.gz
+ https://storage.googleapis.com/google-code-archive/v2/code.google.com/gngeo/logo.png -> ${PN}.png"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="virtual/opengl
+ media-libs/libsdl[joystick,opengl,sound,video]
+ sys-libs/zlib[minizip]"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ default
+ eapply \
+ "${FILESDIR}"/${P}-execstacks.patch \
+ "${FILESDIR}"/${P}-zlib.patch \
+ "${FILESDIR}"/${P}-concurrentMake.patch \
+ "${FILESDIR}"/${P}-cflags.patch
+ mv configure.in configure.ac || die
+ eautoreconf
+ append-cflags -std=gnu89 # build with gcc5 (bug #571056)
+}
+
+src_configure() {
+ econf --disable-i386asm
+}
+
+src_install() {
+ DOCS=( AUTHORS FAQ NEWS README* TODO sample_gngeorc )
+ default
+ doicon "${DISTDIR}"/${PN}.png
+ make_desktop_entry ${PN}
+}
diff --git a/games-emulation/gngeo/metadata.xml b/games-emulation/gngeo/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/gngeo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/gnuboy-1.0.3-r2 b/games-emulation/gnuboy-1.0.3-r2
deleted file mode 100644
index 839bdca2dfb4..000000000000
--- a/games-emulation/gnuboy-1.0.3-r2
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install prepare
-DEPEND=sdl? ( media-libs/libsdl ) !X? ( media-libs/libsdl ) X? ( x11-libs/libXext ) X? ( x11-base/xorg-proto ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Gameboy emulator with multiple renderers
-EAPI=6
-HOMEPAGE=https://sourceforge.net/projects/gnuboy/
-IUSE=X sdl
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=sdl? ( media-libs/libsdl ) !X? ( media-libs/libsdl ) X? ( x11-libs/libXext )
-SLOT=0
-SRC_URI=mirror://gentoo/gnuboy-1.0.3.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 libtool 0081a71a261724730ec4c248494f044d multilib 97f470f374f2e94ccab04a2fb21d811e toolchain-funcs 1e35303c63cd707f6c3422b4493d5607
-_md5_=0b38f808ac0f4679de887905554d568e
diff --git a/games-emulation/gnuboy/Manifest b/games-emulation/gnuboy/Manifest
new file mode 100644
index 000000000000..91a13c156629
--- /dev/null
+++ b/games-emulation/gnuboy/Manifest
@@ -0,0 +1,6 @@
+AUX gnuboy-1.0.3-exec-stack.patch 487 BLAKE2B 09cc0019eed65610d67b4c305588b990c9458f8d59349b98fb9ddb274b614c85548928ee38ef68db871db095be40da6450c1444d45f72eb997db9d348eae0332 SHA512 b579b15906bf104f9db86bb49452c26a3eff0cebe2a66349f3b308742d9fe29823879df7658ce542a2d7397b664b7ba5297eb3c266fab1ddfb32ad73da78a693
+AUX gnuboy-1.0.3-include.patch 350 BLAKE2B 30d5bd6fc959e56cd3f6a49b38b86f973cb2b119856921675cdd1c5b665e13e62e9fd675adbc5340c9e1ed715aead8445c50e63b78a31106497fdf08cbcb79a7 SHA512 9815515c39bf0a387b32e0038a050dd7ca51b5b47d539ee39fcb77b1908735890aac9abfd7d1fe03733d7c9359398b1688f401aa2170ac48d0ed6d2d50acf04d
+AUX gnuboy-1.0.3-linux-headers.patch 1721 BLAKE2B 2ce538da8270a7893ddeb4233954b9abc8237785ed085cef8129108eaef93d5c34e37b65db246c91c61b2b7e71bf452b0317ceb5ee7b5a169b764e5f1fb44790 SHA512 710fd830cabea8fee05ab07a6342470a1176d7ed1c5ed14c110f47218d7d3b57704c09e0887da6152b05ed1b12e5a6959efde865359c220756176290617b3917
+DIST gnuboy-1.0.3.tar.gz 187627 BLAKE2B 1fe01abceae56244d28544f10cc5659063cfe19ac491374bcb2b818f01385e065385fcba01e0038f51d4b29bcb3018f02402adb820c0a556c201334766595a51 SHA512 89e8075dac5ec17b375a5739367b46c55130211fb487a052be1cca49a5d86cc1a7f1619b2b2473d744fbe3c51fdb1a11110b15836cc9cc9de588932b91d258e6
+EBUILD gnuboy-1.0.3-r2.ebuild 1068 BLAKE2B 8f750b31e7ce52c19992abbf167385d217a78f114f548e8ef39f4648b099e3ea98066cedf7a80129b54f8fb957bde2579090a7f5b2fb025980197448f326801a SHA512 7eb6e0885259eb224d93b1505d943113f8db50e2ca08efd50368ec941dcd96bddf78b7d624d383323736146b136f75e5ae49497112bc936c4764436d5fa61d28
+MISC metadata.xml 329 BLAKE2B 121873380b3adf5f6fc460d258de391a75a04f4d50b285c1f882e7461814133507981e7829ae1a783eddfc56933c328fdced934d04e5092a9c0e0f6eca7bfbdf SHA512 79c14f0442b618a82acc9b067360ef978d009fb61a44d869d0c6b4df375b005bc721ce8b90ac80be2bdb8e40e95e111b941a5ac9f006470eefc3b41459b52463
diff --git a/games-emulation/gnuboy/files/gnuboy-1.0.3-exec-stack.patch b/games-emulation/gnuboy/files/gnuboy-1.0.3-exec-stack.patch
new file mode 100644
index 000000000000..a263ee49599e
--- /dev/null
+++ b/games-emulation/gnuboy/files/gnuboy-1.0.3-exec-stack.patch
@@ -0,0 +1,27 @@
+--- a/asm/i386/cpu.s
++++ b/asm/i386/cpu.s
+@@ -2428,3 +2428,6 @@
+
+
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+--- a/asm/i386/lcd.s
++++ b/asm/i386/lcd.s
+@@ -288,3 +288,6 @@
+
+
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+--- a/asm/i386/refresh.s
++++ b/asm/i386/refresh.s
+@@ -283,3 +283,6 @@
+
+
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/games-emulation/gnuboy/files/gnuboy-1.0.3-include.patch b/games-emulation/gnuboy/files/gnuboy-1.0.3-include.patch
new file mode 100644
index 000000000000..15573000511e
--- /dev/null
+++ b/games-emulation/gnuboy/files/gnuboy-1.0.3-include.patch
@@ -0,0 +1,14 @@
+diff -ru gnuboy-1.0.3.orig/defs.h gnuboy-1.0.3/defs.h
+--- gnuboy-1.0.3.orig/defs.h 2001-01-23 07:04:22.000000000 -0500
++++ gnuboy-1.0.3/defs.h 2014-07-04 03:56:46.685149736 -0400
+@@ -4,6 +4,10 @@
+ #ifndef __DEFS_H__
+ #define __DEFS_H__
+
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++#include <ctype.h>
+
+
+ #ifdef IS_LITTLE_ENDIAN
diff --git a/games-emulation/gnuboy/files/gnuboy-1.0.3-linux-headers.patch b/games-emulation/gnuboy/files/gnuboy-1.0.3-linux-headers.patch
new file mode 100644
index 000000000000..543bd2434eed
--- /dev/null
+++ b/games-emulation/gnuboy/files/gnuboy-1.0.3-linux-headers.patch
@@ -0,0 +1,93 @@
+# -ansi breaks <linux/joystick.h>
+
+--- a/configure.in
++++ b/configure.in
+@@ -133,7 +133,7 @@
+ if test "$enable_warnings" = yes ; then
+ case "$CC" in *gcc*)
+ AC_MSG_RESULT(enabling selected compiler warnings)
+-CFLAGS="$CFLAGS -ansi -pedantic -Wall -Wno-implicit -Wno-long-long" ;;
++CFLAGS="$CFLAGS -Wall -Wno-implicit -Wno-long-long" ;;
+ *)
+ AC_MSG_RESULT(disabling warnings for non-gcc compiler) ;;
+ esac
+--- a/loader.c
++++ b/loader.c
+@@ -11,7 +11,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-char *strdup();
+
+ static int mbc_table[256] =
+ {
+--- a/main.c
++++ b/main.c
+@@ -8,7 +8,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-char *strdup();
+
+ #include <stdarg.h>
+ #include <signal.h>
+--- a/path.c
++++ b/path.c
+@@ -5,7 +5,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-char *strdup();
+
+ #ifdef ALT_PATH_SEP
+ #define SEP ';'
+--- a/rckeys.c
++++ b/rckeys.c
+@@ -4,7 +4,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-char *strdup();
+
+ #include "defs.h"
+ #include "rc.h"
+--- a/rcvars.c
++++ b/rcvars.c
+@@ -5,7 +5,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-char *strdup();
+
+ #include "defs.h"
+ #include "rc.h"
+--- a/sys/linux/fbdev.c
++++ b/sys/linux/fbdev.c
+@@ -10,7 +10,6 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+-char *strdup();
+ #include <unistd.h>
+ #include <sys/mman.h>
+ #include <linux/fb.h>
+--- a/sys/linux/joy.c
++++ b/sys/linux/joy.c
+@@ -2,7 +2,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-char *strdup();
+ #include <linux/joystick.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+--- a/sys/oss/oss.c
++++ b/sys/oss/oss.c
+@@ -2,7 +2,6 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+-char *strdup();
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
diff --git a/games-emulation/gnuboy/gnuboy-1.0.3-r2.ebuild b/games-emulation/gnuboy/gnuboy-1.0.3-r2.ebuild
new file mode 100644
index 000000000000..177799b9c235
--- /dev/null
+++ b/games-emulation/gnuboy/gnuboy-1.0.3-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools
+
+DESCRIPTION="Gameboy emulator with multiple renderers"
+HOMEPAGE="https://sourceforge.net/projects/gnuboy/"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X sdl"
+
+RDEPEND="
+ sdl? ( media-libs/libsdl )
+ !X? ( media-libs/libsdl )
+ X? ( x11-libs/libXext )
+"
+DEPEND="${RDEPEND}
+ X? ( x11-base/xorg-proto )
+"
+
+src_prepare() {
+ default
+ eapply \
+ "${FILESDIR}"/${P}-exec-stack.patch \
+ "${FILESDIR}"/${P}-linux-headers.patch \
+ "${FILESDIR}"/${P}-include.patch
+
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if ! use X ; then
+ myconf="--with-sdl"
+ fi
+
+ econf \
+ $(use_with X x) \
+ $(use_with sdl) \
+ $(use_enable x86 asm) \
+ ${myconf} \
+ --disable-arch \
+ --disable-optimize
+}
+
+src_install() {
+ for f in sdlgnuboy xgnuboy
+ do
+ if [[ -f ${f} ]] ; then
+ dobin ${f}
+ fi
+ done
+ dodoc README docs/{CHANGES,CONFIG,CREDITS,FAQ,HACKING,WHATSNEW}
+}
diff --git a/games-emulation/gnuboy/metadata.xml b/games-emulation/gnuboy/metadata.xml
new file mode 100644
index 000000000000..3e42cc8d1267
--- /dev/null
+++ b/games-emulation/gnuboy/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gnuboy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/hatari-2.1.0 b/games-emulation/hatari-2.1.0
deleted file mode 100644
index 3c122bd0c1ac..000000000000
--- a/games-emulation/hatari-2.1.0
+++ /dev/null
@@ -1,15 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm prepare setup test
-DEPEND=python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_jython2_7(-),-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),python_single_target_python2_7(+)] games-emulation/caps sdl2? ( media-libs/libsdl2[X,sound,video] ) !sdl2? ( media-libs/libsdl[X,sound,video] ) media-libs/portaudio media-libs/portmidi sys-libs/readline:0= media-libs/libpng:0= sys-libs/zlib:0= virtual/pkgconfig sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=Atari ST emulator
-EAPI=6
-HOMEPAGE=http://hatari.tuxfamily.org/
-IUSE=+sdl2 python_targets_python2_7
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-PDEPEND=dev-python/pygtk[python_targets_python2_7(-)?,-python_single_target_jython2_7(-),-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),python_single_target_python2_7(+)] >=games-emulation/emutos-0.9.9.1
-RDEPEND=python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_jython2_7(-),-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),python_single_target_python2_7(+)] games-emulation/caps sdl2? ( media-libs/libsdl2[X,sound,video] ) !sdl2? ( media-libs/libsdl[X,sound,video] ) media-libs/portaudio media-libs/portmidi sys-libs/readline:0= media-libs/libpng:0= sys-libs/zlib:0=
-REQUIRED_USE=python_targets_python2_7
-SLOT=0
-SRC_URI=http://download.tuxfamily.org/hatari/2.1.0/hatari-2.1.0.tar.bz2
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 python-single-r1 26fdbe5e685d53f67303a3a43d9e4848 python-utils-r1 7db901256449fef43c3aaa4d486c1c63 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=b518ce003e9f4c93921721b7b54057e2
diff --git a/games-emulation/hatari/Manifest b/games-emulation/hatari/Manifest
new file mode 100644
index 000000000000..b004751ca1f6
--- /dev/null
+++ b/games-emulation/hatari/Manifest
@@ -0,0 +1,3 @@
+DIST hatari-2.1.0.tar.bz2 4072778 BLAKE2B 934ab28e799d0d13c26c291005513511367eb2ddbeda0f9756c19f10fa9e6bb8e10451057fa7e0b49a30e3f562eb5f327057d324b2a92e09b1115f63132dca97 SHA512 d1fbf6e60e2df2c43d070bee6a9c1dc93c36a8ea7f75bbf2a67790840952661cee136ebccd6b2ed523ef9b7b56391e058384f2e3f46acb609bb362cac05b9753
+EBUILD hatari-2.1.0.ebuild 1951 BLAKE2B 256870db02e0c0cb6402157af5dc1a108f9dba4b3dbb414a7fa7d0ab3692877dd9baf0462f6a044e027a5d92d313fa479cee7251da75c8a87ed38d140897462b SHA512 7d6b881dfe3d1fbffb800b5ae866699891ee3cdfdbc88dc9633a755b1361d003ef1617648b8b30d1c72b709dc700fb9db4e3b3a5abc030270598b0035cad90d3
+MISC metadata.xml 318 BLAKE2B be4d8512e3f8fe751fc03aeae422216c9a366fc4cea3a49e4b8050f2a8280054fcc335f820718743fdf49cdb9a1fb73633e596ac8bf989b22f0f5a5fa33bd93b SHA512 2e304611622c91d0bd54f986ac3f02fc504bbd28e5ce03e5b958100b8567012ea0fe2a46884d29dfa18c6a4408fd0283679eb4a4f62c80a40ad748f5c811d943
diff --git a/games-emulation/hatari/hatari-2.1.0.ebuild b/games-emulation/hatari/hatari-2.1.0.ebuild
new file mode 100644
index 000000000000..92eba857519e
--- /dev/null
+++ b/games-emulation/hatari/hatari-2.1.0.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+inherit toolchain-funcs cmake-utils python-single-r1
+
+DESCRIPTION="Atari ST emulator"
+HOMEPAGE="http://hatari.tuxfamily.org/"
+SRC_URI="http://download.tuxfamily.org/hatari/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+sdl2"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ games-emulation/caps
+ sdl2? ( media-libs/libsdl2[X,sound,video] )
+ !sdl2? ( media-libs/libsdl[X,sound,video] )
+ media-libs/portaudio
+ media-libs/portmidi
+ sys-libs/readline:0=
+ media-libs/libpng:0=
+ sys-libs/zlib:0="
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+PDEPEND="dev-python/pygtk[${PYTHON_USEDEP}]
+ >=games-emulation/emutos-0.9.9.1"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+You need a TOS ROM to run hatari. EmuTOS, a free TOS implementation,
+has been installed in /usr/lib*/hatari with a .img extension (there
+are several from which to choose).
+Another option is to go to http://www.atari.st/ and get a real TOS:
+http://www.atari.st/
+The first time you run hatari, you should configure it to find the
+TOS you prefer to use. Be sure to save your settings.
+"
+
+DOCS="readme.txt doc/*.txt"
+HTML_DOCS="doc/"
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ sed -i -e '/Encoding/d' ./python-ui/hatariui.desktop || die
+ sed -i -e "s/python/${EPYTHON}/" tools/atari-hd-image.sh || die
+ sed -i -e "s#@DOCDIR@#/usr/share/doc/${PF}/html/#" python-ui/uihelpers.py || die
+}
+
+src_configure() {
+ mycmakeargs=(
+ "-DDOCDIR=/usr/share/doc/${PF}"
+ "-DENABLE_SDL2=$(usex sdl2)"
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ python_fix_shebang "${ED%/}"/usr/share/hatari/{hatariui,hconsole}/
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+}
diff --git a/games-emulation/hatari/metadata.xml b/games-emulation/hatari/metadata.xml
new file mode 100644
index 000000000000..d4511e749d48
--- /dev/null
+++ b/games-emulation/hatari/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+<use>
+ <flag name="sdl2">Use libsdl2 instead of libsdl</flag>
+</use>
+</pkgmetadata>
diff --git a/games-emulation/higan-106_p1-r1 b/games-emulation/higan-106_p1-r1
deleted file mode 100644
index 1908f4c9d95b..000000000000
--- a/games-emulation/higan-106_p1-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile install postinst postrm preinst prepare
-DEPEND=x11-libs/gtk+:2 x11-libs/libX11 x11-libs/libXext icarus? ( x11-libs/gtksourceview:2.0 x11-libs/gtk+:2 x11-libs/pango dev-libs/atk x11-libs/cairo x11-libs/gdk-pixbuf dev-libs/glib:2 media-libs/fontconfig media-libs/freetype ) ao? ( media-libs/libao ) openal? ( media-libs/openal ) alsa? ( media-libs/alsa-lib ) pulseaudio? ( media-sound/pulseaudio ) xv? ( x11-libs/libXv ) opengl? ( virtual/opengl ) sdl? ( media-libs/libsdl[X,joystick,video] ) udev? ( virtual/udev ) app-arch/p7zip virtual/pkgconfig >=sys-apps/sed-4
-DESCRIPTION=A multi-system game emulator formerly known as bsnes
-EAPI=6
-HOMEPAGE=https://byuu.org/emulation/higan/ https://gitlab.com/higan/higan
-IUSE=ao +alsa +icarus openal opengl oss pulseaudio +sdl udev xv
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-3
-RDEPEND=x11-libs/gtk+:2 x11-libs/libX11 x11-libs/libXext icarus? ( x11-libs/gtksourceview:2.0 x11-libs/gtk+:2 x11-libs/pango dev-libs/atk x11-libs/cairo x11-libs/gdk-pixbuf dev-libs/glib:2 media-libs/fontconfig media-libs/freetype ) ao? ( media-libs/libao ) openal? ( media-libs/openal ) alsa? ( media-libs/alsa-lib ) pulseaudio? ( media-sound/pulseaudio ) xv? ( x11-libs/libXv ) opengl? ( virtual/opengl ) sdl? ( media-libs/libsdl[X,joystick,video] ) udev? ( virtual/udev )
-REQUIRED_USE=|| ( ao openal alsa pulseaudio oss ) || ( xv opengl sdl )
-SLOT=0
-SRC_URI=https://gitlab.com/higan/higan/repository/41efdba45afa770db99bc7484a8ad340ccc597d2/archive.tar.bz2 -> higan-106_p1.tar.bz2
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 qmake-utils bdf97e69a34b864d6d545f4ec3143ff7 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=92b402fce5ca880e1840c756303f5e3c
diff --git a/games-emulation/higan/Manifest b/games-emulation/higan/Manifest
new file mode 100644
index 000000000000..937ad0d49b76
--- /dev/null
+++ b/games-emulation/higan/Manifest
@@ -0,0 +1,6 @@
+AUX higan-106_p1-QA.patch 3708 BLAKE2B 25f3707c4336e423017eb879e9dfc02fee9660ee8c5e8390813906614eab8fd4306eabbe15e4330f7f00efed0231a335ec83a3682eb338bdc3f772546fd5d9b7 SHA512 ba5bf66a242baf7b2385ffd7a26c5a180589f917b5a636fa99dd488b4a733c09e6e3eb3ccc013b63817661c498149d943a53d3e536674251ae94f352516a4f44
+AUX higan-106_p1-header-locations.patch 598 BLAKE2B d7935edf4f241802ffc5200f8b4944fe1dff4596941993c7539e290f1640eb5e552a263d1a8d0c6db6b2d909b35bc34350aa84a4ba7ea9f8fb06d8466c59a673 SHA512 756893707d9048bf9f34818733ab812d7a81da329646c77536fc6feef74e97b6e3804dfdfd062e5899bba30c70343afdd3b62a5dfd1b79488b7fdec7bde57a91
+AUX higan-106_p1-wrapper 166 BLAKE2B 87659c19e485a4eca90178a9c2faf96214af7a13fb16c04a2175f3157dd4b522e6414fed9216a9acb293111f2f994837a9a496075ab0bebd2c78e3a5710330a4 SHA512 db297cfc9b6f5ff1553b52587a9988af46ad7d2aadbaa17743676250679e2bada68d97f85e934ce8c1eb7f57ac3f18c43a33eaca809a1f10f5a4f22c8cbe137a
+DIST higan-106_p1.tar.bz2 954533 BLAKE2B e7ea44f97f7e2c3ce86b57b853aa59c4372f37185846f8a928ba659b525965aed39f7859721394a776990e53e2f671fc0e7071d17f9397973343d9a7adcf70ac SHA512 f4d8dbfacaa20b948bd382fd0ef48e89cbb21a0569a70b6a4beca6c0a2ba404efc4c28d14bfd3df14d4fd76c763ca1537166bb24d765a8da33423bbea32df4c3
+EBUILD higan-106_p1-r1.ebuild 3213 BLAKE2B 0b7dfc5a07055b96c3d8cbd4c936acf6137bcc77d6f906c675910f3e426c169636752d1f9cf33452af2156d345976e4003168377bca172302624d253db7e8519 SHA512 ac879d774978c2804c067e2434296e6d9ed42da7d37dbd2c332506c5eded6cbabe6bd8fe3b07597036bcd3fe784b463442e53d3d389758c0af9f43ed108d7a96
+MISC metadata.xml 377 BLAKE2B aefc33327d342c730de8b2bdd95c2299692c894fd67a3f43d378964e7b776e467d2a4644777e7c8a1eb94b41ee300a65cad084decf64fc02abbac8c02de509c1 SHA512 2faa3ffcca01d5740a5ca1c4f554c51e90e81c6c19cde15cf817c448debb5585e09a1b784d94e3ecd06321ed28a740ce846f1afbd149bce590ca69ef5b1ce9f4
diff --git a/games-emulation/higan/files/higan-106_p1-QA.patch b/games-emulation/higan/files/higan-106_p1-QA.patch
new file mode 100644
index 000000000000..140fdf9a48e7
--- /dev/null
+++ b/games-emulation/higan/files/higan-106_p1-QA.patch
@@ -0,0 +1,117 @@
+From 3ca37e53f22bfbb4ef436829904dc75b1f4940ec Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 21 Jan 2018 11:16:53 +0100
+Subject: [PATCH] Quickport higan-099-QA.patch to v106r1
+
+---
+ higan/GNUmakefile | 5 ++---
+ higan/target-tomoko/GNUmakefile | 6 +++---
+ icarus/GNUmakefile | 4 ++--
+ nall/GNUmakefile | 19 -------------------
+ 4 files changed, 7 insertions(+), 27 deletions(-)
+
+diff --git a/higan/GNUmakefile b/higan/GNUmakefile
+index 5eac824..2616ed1 100644
+--- a/higan/GNUmakefile
++++ b/higan/GNUmakefile
+@@ -26,7 +26,6 @@ else ifneq ($(filter $(platform),linux bsd),)
+ flags += -fopenmp
+ link += -fopenmp
+ ifeq ($(binary),application)
+- flags += -march=native
+ link += -Wl,-export-dynamic
+ link += -lX11 -lXext
+ else ifeq ($(binary),library)
+@@ -40,9 +39,9 @@ endif
+ compile = \
+ $(strip \
+ $(if $(filter %.c,$<), \
+- $(compiler) $(cflags) $(flags) $1 -c $< -o $@, \
++ $(compiler) $(cflags) $(flags) $(CFLAGS) $1 -c $< -o $@, \
+ $(if $(filter %.cpp,$<), \
+- $(compiler) $(cppflags) $(flags) $1 -c $< -o $@ \
++ $(compiler) $(cppflags) $(flags) $(CXXFLAGS) $1 -c $< -o $@ \
+ ) \
+ ) \
+ )
+diff --git a/higan/target-tomoko/GNUmakefile b/higan/target-tomoko/GNUmakefile
+index bfdcbe2..bdb6d44 100644
+--- a/higan/target-tomoko/GNUmakefile
++++ b/higan/target-tomoko/GNUmakefile
+@@ -48,10 +48,10 @@ objects := $(ui_objects) $(objects)
+ objects := $(patsubst %,obj/%.o,$(objects))
+
+ obj/ruby.o: ../ruby/ruby.cpp $(call rwildcard,../ruby/)
+- $(compiler) $(rubyflags) -c $< -o $@
++ $(compiler) $(rubyflags) $(CXXFLAGS) -c $< -o $@
+
+ obj/hiro.o: ../hiro/hiro.cpp $(call rwildcard,../hiro/)
+- $(compiler) $(hiroflags) -c $< -o $@
++ $(compiler) $(hiroflags) $(CXXFLAGS) -c $< -o $@
+
+ obj/ui-tomoko.o: $(ui)/tomoko.cpp $(call rwildcard,$(ui)/)
+ obj/ui-program.o: $(ui)/program/program.cpp $(call rwildcard,$(ui)/)
+@@ -67,7 +67,7 @@ obj/ui-resource.o:
+
+ # targets
+ build: $(objects)
+- $(strip $(compiler) -o out/$(name) $(objects) $(link))
++ $(strip $(compiler) $(CXXFLAGS) -o out/$(name) $(objects) $(link))
+ ifeq ($(platform),macos)
+ @if [ -d out/$(name).app ]; then rm -r out/$(name).app; fi
+ mkdir -p out/$(name).app/Contents/MacOS/
+diff --git a/icarus/GNUmakefile b/icarus/GNUmakefile
+index d01465e..999c004 100644
+--- a/icarus/GNUmakefile
++++ b/icarus/GNUmakefile
+@@ -3,7 +3,7 @@ include ../nall/GNUmakefile
+ include ../hiro/GNUmakefile
+
+ name := icarus
+-flags += -I..
++flags += -I.. $(CXXFLAGS)
+ link +=
+
+ ifeq ($(platform),windows)
+@@ -15,7 +15,7 @@ objects += obj/icarus.o
+ objects += $(if $(call streq,$(platform),windows),obj/resource.o)
+
+ all: $(objects)
+- $(strip $(compiler) -o out/$(name) $(objects) $(link) $(hirolink))
++ $(strip $(compiler) -o out/$(name) $(objects) $(link) $(hirolink) $(LDFLAGS))
+ ifeq ($(platform),macos)
+ @if [ -d out/$(name).app ]; then rm -r out/$(name).app; fi
+ mkdir -p out/$(name).app/Contents/MacOS/
+diff --git a/nall/GNUmakefile b/nall/GNUmakefile
+index f9865de..f864cde 100644
+--- a/nall/GNUmakefile
++++ b/nall/GNUmakefile
+@@ -59,25 +59,6 @@ ifeq ($(compiler),)
+ endif
+ endif
+
+-# build settings
+-ifeq ($(build),optimize)
+- flags += -O3
+-else ifeq ($(build),release)
+- flags += -O2
+-else ifeq ($(build),stable)
+- flags += -O1
+-else ifeq ($(build),debug)
+- flags += -g
+-else ifeq ($(build),profile)
+- flags += -pg
+- link += -pg
+-else ifeq ($(build),instrument)
+- flags += -O3 -fprofile-generate
+- link += -lgcov
+-else ifeq ($(build),optimize)
+- flags += -O3 -fprofile-use
+-endif
+-
+ # clang settings
+ ifeq ($(findstring clang++,$(compiler)),clang++)
+ flags += -fno-strict-aliasing -fwrapv
+--
+2.16.0.rc2
+
diff --git a/games-emulation/higan/files/higan-106_p1-header-locations.patch b/games-emulation/higan/files/higan-106_p1-header-locations.patch
new file mode 100644
index 000000000000..7f72a1311491
--- /dev/null
+++ b/games-emulation/higan/files/higan-106_p1-header-locations.patch
@@ -0,0 +1,24 @@
+From 420b10135f678367560621416799c48af0ef3764 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 21 Jan 2018 11:44:22 +0100
+Subject: [PATCH] Patch header locations for Gentoo
+
+---
+ nall/GNUmakefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/nall/GNUmakefile b/nall/GNUmakefile
+index f864cde..41fdc08 100644
+--- a/nall/GNUmakefile
++++ b/nall/GNUmakefile
+@@ -82,6 +82,7 @@ endif
+
+ # linux settings
+ ifeq ($(platform),linux)
++ flags += -I/usr/include/cairo/ -I/usr/include/gtk-2.0/ -I/usr/include/gtksourceview-2.0/
+ link += -ldl
+ endif
+
+--
+2.16.0.rc2
+
diff --git a/games-emulation/higan/files/higan-106_p1-wrapper b/games-emulation/higan/files/higan-106_p1-wrapper
new file mode 100644
index 000000000000..1de577fd1923
--- /dev/null
+++ b/games-emulation/higan/files/higan-106_p1-wrapper
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+[ -e "${HOME}"/.local/share/higan ] || mkdir "${HOME}"/.local/share/higan
+cp -ru /usr/share/higan/* "${HOME}"/.local/share/higan/
+exec ${0}.bin "$@"
diff --git a/games-emulation/higan/higan-106_p1-r1.ebuild b/games-emulation/higan/higan-106_p1-r1.ebuild
new file mode 100644
index 000000000000..a39e0db7e729
--- /dev/null
+++ b/games-emulation/higan/higan-106_p1-r1.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils gnome2-utils toolchain-funcs qmake-utils
+
+MY_COMMIT=41efdba45afa770db99bc7484a8ad340ccc597d2
+
+DESCRIPTION="A multi-system game emulator formerly known as bsnes"
+HOMEPAGE="https://byuu.org/emulation/higan/ https://gitlab.com/higan/higan"
+SRC_URI="https://gitlab.com/higan/higan/repository/${MY_COMMIT}/archive.tar.bz2 -> ${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ao +alsa +icarus openal opengl oss pulseaudio +sdl udev xv"
+REQUIRED_USE="|| ( ao openal alsa pulseaudio oss )
+ || ( xv opengl sdl )"
+
+RDEPEND="
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/libXext
+ icarus? ( x11-libs/gtksourceview:2.0
+ x11-libs/gtk+:2
+ x11-libs/pango
+ dev-libs/atk
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf
+ dev-libs/glib:2
+ media-libs/fontconfig
+ media-libs/freetype
+ )
+ ao? ( media-libs/libao )
+ openal? ( media-libs/openal )
+ alsa? ( media-libs/alsa-lib )
+ pulseaudio? ( media-sound/pulseaudio )
+ xv? ( x11-libs/libXv )
+ opengl? ( virtual/opengl )
+ sdl? ( media-libs/libsdl[X,joystick,video] )
+ udev? ( virtual/udev )
+"
+DEPEND="${RDEPEND}
+ app-arch/p7zip
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${PN}-${MY_COMMIT}-${MY_COMMIT}
+
+disable_module() {
+ sed -i \
+ -e "s|$1\b||" \
+ "${S}"/higan/target-tomoko/GNUmakefile || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-header-locations.patch
+ epatch "${FILESDIR}"/${P}-QA.patch
+
+ sed -i \
+ -e "/handle/s#/usr/local/lib#/usr/$(get_libdir)#" \
+ nall/dl.hpp || die "fixing libdir failed!"
+
+ eapply_user
+
+ # audio modules
+ use ao || disable_module audio.ao
+ use openal || disable_module audio.openal
+ use pulseaudio || { disable_module audio.pulseaudio
+ disable_module audio.pulseaudiosimple ;}
+ use oss || disable_module audio.oss
+ use alsa || disable_module audio.alsa
+
+ # video modules
+ use opengl || disable_module video.glx
+ use xv || disable_module video.xvideo
+ use sdl || disable_module video.sdl
+
+ # input modules
+ use sdl || disable_module input.sdl
+ use udev || disable_module input.udev
+}
+
+src_compile() {
+ local mytoolkit
+
+ mytoolkit="gtk"
+
+ # Needed for fluent audio (even on i5 hardware)
+ export CFLAGS="${CFLAGS} -O3"
+ export CXXFLAGS="${CXXFLAGS} -O3"
+
+ if use icarus; then
+ cd "${S}/icarus" || die
+ emake \
+ platform="linux" \
+ compiler="$(tc-getCXX)"
+ fi
+
+ cd "${S}/higan" || die
+ emake \
+ platform="linux" \
+ compiler="$(tc-getCXX)" \
+ hiro="${mytoolkit}"
+}
+
+src_install() {
+ if use icarus; then
+ newbin "${S}"/icarus/out/icarus icarus
+ fi
+ newbin "${S}"/higan/out/${PN} ${PN}.bin
+ newbin "${FILESDIR}"/${P}-wrapper ${PN}
+ make_desktop_entry "${PN}" "${PN}"
+
+ # copy home directory stuff to a global location (matching "${FILESDIR}"/${P}-wrapper)
+ insinto /usr/share/${PN}
+ doins -r higan/systems/*.sys
+
+ doicon -s 512 higan/data/${PN}.png
+ doicon higan/data/${PN}.svg
+}
+
+pkg_preinst() {
+ games_pkg_preinst
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ #elog "optional dependencies:"
+ #elog " dev-games/higan-ananke (extra rom load options)"
+ #elog " games-util/higan-purify (Rom purifier)"
+
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/higan/metadata.xml b/games-emulation/higan/metadata.xml
new file mode 100644
index 000000000000..5bef912000c6
--- /dev/null
+++ b/games-emulation/higan/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="icarus">Build icarus library manager</flag>
+ <flag name="udev">Enable udev based input</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-emulation/hugo-2.12 b/games-emulation/hugo-2.12
deleted file mode 100644
index 4a56aecc09a5..000000000000
--- a/games-emulation/hugo-2.12
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install postinst preinst prepare setup unpack
-DEPEND=x11-libs/gtk+:2 media-libs/libsdl[video] media-libs/libvorbis virtual/pkgconfig
-DESCRIPTION=PC-Engine (Turbografx16) emulator for linux
-EAPI=5
-HOMEPAGE=http://www.zeograd.com/
-KEYWORDS=~x86
-LICENSE=GPL-2
-RDEPEND=x11-libs/gtk+:2 media-libs/libsdl[video] media-libs/libvorbis games-misc/games-envd
-SLOT=0
-SRC_URI=http://www.zeograd.com/download/hugo-2.12.tar.gz
-_eclasses_=base 983774947da124fb7d542ce25a218bb1 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 games 2bb3ede665927a68ffdb7c41eec7efde ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=dff2bee4ef7faa52cc8fa1da3df8b8c5
diff --git a/games-emulation/hugo/Manifest b/games-emulation/hugo/Manifest
new file mode 100644
index 000000000000..c4c2fe97a3af
--- /dev/null
+++ b/games-emulation/hugo/Manifest
@@ -0,0 +1,4 @@
+AUX hugo-2.12-gcc41.patch 306 BLAKE2B 8539b43f23bbf008f3c000e7fc86480ffba3cd096297bf38b97ff8efe3ee4efe1ac9c6b09361a8a39214103751652362af0ae25e9bc5c8ac706fc77806a66553 SHA512 5b8203867dd6f524ef6f6e70f158b02de45f70aa4f0ac5bd85c171580a7def6c14cd93afe98c90717e10a77fa040ee3d613812ebda6b1768149c8621365ff782
+DIST hugo-2.12.tar.gz 456991 BLAKE2B 21bcb1fbab1020cbc26039b0f9a49ef653ee21409c84a61747940437dd57c39a453772dbbf82d3e74b18b477ed6a505402108fb1969e56279b650a734b91a40b SHA512 38342e6e7a130caeac711de4f72138a5159c2a34e443ce5e16bcb7ac02fbefd085fa5c48583550d8089bfe3528785853df1863e7d1b32652a7f88300ad09d21d
+EBUILD hugo-2.12.ebuild 727 BLAKE2B c057f1963bea30d576f1c93d22c55a5a7eba9d5f36f8f57dfa52b2057cdf9eacb2789e7082191bf9d19d806c5d4d5a6b1fcf6d22629d094965e6cb13cb9dc66d SHA512 1d464f5fa48cfc0726ec2ea7bcc6d285b773bf2efb98214fc4c92c6171b80774d7f355d1d66bd98e57eac5be11a8295c77b5a174db293f4e8b4eb3795dc566dd
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/hugo/files/hugo-2.12-gcc41.patch b/games-emulation/hugo/files/hugo-2.12-gcc41.patch
new file mode 100644
index 000000000000..14050cc79f16
--- /dev/null
+++ b/games-emulation/hugo/files/hugo-2.12-gcc41.patch
@@ -0,0 +1,11 @@
+--- pce.h.old 2006-05-02 20:06:13.000000000 +0200
++++ pce.h 2006-05-02 20:06:33.000000000 +0200
+@@ -196,7 +196,7 @@
+ extern UChar language;
+ // the current language
+
+-extern int BaseClock, UPeriod;
++extern int UPeriod;
+
+ extern UChar US_encoded_card;
+ // Do we have to swap even and odd bytes in the rom
diff --git a/games-emulation/hugo/hugo-2.12.ebuild b/games-emulation/hugo/hugo-2.12.ebuild
new file mode 100644
index 000000000000..86bcffd6e456
--- /dev/null
+++ b/games-emulation/hugo/hugo-2.12.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils flag-o-matic games
+
+DESCRIPTION="PC-Engine (Turbografx16) emulator for linux"
+HOMEPAGE="http://www.zeograd.com/"
+SRC_URI="http://www.zeograd.com/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND="x11-libs/gtk+:2
+ media-libs/libsdl[video]
+ media-libs/libvorbis"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}"-gcc41.patch
+ append-cppflags $(pkg-config sdl --cflags)
+
+}
+
+src_install() {
+ dogamesbin hugo
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r pixmaps
+ dodoc AUTHORS ChangeLog NEWS README TODO
+ dohtml doc/*html
+ prepgamesdirs
+}
diff --git a/games-emulation/hugo/metadata.xml b/games-emulation/hugo/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/hugo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/kigb-2.02 b/games-emulation/kigb-2.02
deleted file mode 100644
index eba9442c57a8..000000000000
--- a/games-emulation/kigb-2.02
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install postinst preinst prepare setup unpack
-DESCRIPTION=A Gameboy (GB, SGB, GBA) Emulator for Linux
-EAPI=5
-HOMEPAGE=http://kigb.emuunlim.com/
-KEYWORDS=-* ~x86
-LICENSE=all-rights-reserved
-RDEPEND=x11-libs/libXext sys-libs/zlib dev-games/hawknl =virtual/libstdc++-3* games-misc/games-envd
-RESTRICT=mirror bindist strip
-SLOT=0
-SRC_URI=http://kigb.emuunlim.com/kigb_lin.tar.gz
-_eclasses_=base 983774947da124fb7d542ce25a218bb1 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc games 2bb3ede665927a68ffdb7c41eec7efde ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=cd4236177571ce893bc1c928e26eab8c
diff --git a/games-emulation/kigb/Manifest b/games-emulation/kigb/Manifest
new file mode 100644
index 000000000000..f9d0a07f0470
--- /dev/null
+++ b/games-emulation/kigb/Manifest
@@ -0,0 +1,4 @@
+AUX kigb 328 BLAKE2B 203e8a844831400c1b4569c9faa4b59a48a5ddd4ca9084c3967298b2aaca204b1490165c3b2b8dfe22fd1a24b22857e97925e474e735059788682ff0c690cc4d SHA512 4316e4b6ece9ce9d1f8e36a1d69d4a3c33ee635c4758ce8e4a6b85b3a13a1cae703340e2479e6615b655312db33c21d8d7ee84233049e63716e83efed1cc3128
+DIST kigb_lin.tar.gz 477324 BLAKE2B 4e15c77bd5a0e1ff0740bd6af53548e54c3dfc7d27ba07290201d11793e38015f12266e169969511f3852cf8742055ea491ce57213e7aefde5ed8b99b1f2e985 SHA512 ca8b10cc05884c92157dde2b034c7e95f28ed7eed771d0383265f942f0cacea791284516b551e96ba07a035068a7039c8faa19ec417ee117b6a350692bbff01d
+EBUILD kigb-2.02.ebuild 863 BLAKE2B bd855bafb96aeb48eab2850042a3830f15e3c6f8df8526cb0e4a7b3c8e1ec8dd652553a9d180c0fed24992346096cfcb763869c36c17fed2334454d9a1469630 SHA512 63f5dfa4e78caf5ec72a06a3d447eb290371237444c4594ffc1acef8d4cc9a8dab99e4f870c6d610807f6d7f3c9ca7b8e1afff72405d4ab92b10071e076a4969
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/kigb/files/kigb b/games-emulation/kigb/files/kigb
new file mode 100644
index 000000000000..c07095bb53ee
--- /dev/null
+++ b/games-emulation/kigb/files/kigb
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+kigb_dir="${HOME}/.kigb"
+
+if [[ ! -d "${kigb_dir}" ]] ; then
+ mkdir -p "${kigb_dir}"
+ cd "${kigb_dir}"
+ mkdir cfg inp rom save snap state
+ ln -s GENTOODIR/kigb/kigb kigb
+fi
+
+cd "${kigb_dir}"
+exec ./kigb "$@"
diff --git a/games-emulation/kigb/kigb-2.02.ebuild b/games-emulation/kigb/kigb-2.02.ebuild
new file mode 100644
index 000000000000..bbccc19ef464
--- /dev/null
+++ b/games-emulation/kigb/kigb-2.02.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit games
+
+DESCRIPTION="A Gameboy (GB, SGB, GBA) Emulator for Linux"
+HOMEPAGE="http://kigb.emuunlim.com/"
+SRC_URI="http://kigb.emuunlim.com/${PN}_lin.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="-* ~x86"
+IUSE=""
+RESTRICT="mirror bindist strip"
+
+RDEPEND="x11-libs/libXext
+ sys-libs/zlib
+ dev-games/hawknl
+ =virtual/libstdc++-3*"
+
+S=${WORKDIR}
+
+src_prepare() {
+ # use the system version
+ rm -f libNL.so*
+ # wrapper script creates these in the users' home directories.
+ rm -rf cfg inp snap state rom save
+ cp "${FILESDIR}/kigb" "${T}/" || die
+ sed -i \
+ -e "s:GENTOODIR:${GAMES_PREFIX_OPT}:" "${T}/kigb" || die
+}
+
+src_install() {
+ dogamesbin "${T}/kigb"
+ exeinto "${GAMES_PREFIX_OPT}/${PN}"
+ doexe kigb
+ dodoc doc/*
+ prepgamesdirs
+}
diff --git a/games-emulation/kigb/metadata.xml b/games-emulation/kigb/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/kigb/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/lxdream-0.9.1-r3 b/games-emulation/lxdream-0.9.1-r3
deleted file mode 100644
index b9db88bebc21..000000000000
--- a/games-emulation/lxdream-0.9.1-r3
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure prepare
-DEPEND=app-misc/lirc media-libs/alsa-lib media-libs/libpng:0= pulseaudio? ( media-sound/pulseaudio ) sdl? ( media-libs/libsdl[sound] ) virtual/opengl x11-libs/gtk+:2 virtual/pkgconfig sys-devel/gettext virtual/os-headers !!gnustep-base/gnustep-gui
-DESCRIPTION=An emulator for the Sega Dreamcast system
-EAPI=6
-HOMEPAGE=http://www.lxdream.org/
-IUSE=debug profile pulseaudio sdl
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=app-misc/lirc media-libs/alsa-lib media-libs/libpng:0= pulseaudio? ( media-sound/pulseaudio ) sdl? ( media-libs/libsdl[sound] ) virtual/opengl x11-libs/gtk+:2
-SLOT=0
-SRC_URI=http://www.lxdream.org/count.php?file=lxdream-0.9.1.tar.gz -> lxdream-0.9.1.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=1b7295f4d4b580f4177fe137c8ae2f07
diff --git a/games-emulation/lxdream/Manifest b/games-emulation/lxdream/Manifest
new file mode 100644
index 000000000000..227e0f3ec147
--- /dev/null
+++ b/games-emulation/lxdream/Manifest
@@ -0,0 +1,4 @@
+AUX lxdream-0.9.1-glib-single-include.patch 10725 BLAKE2B 01a76a7e7a6477fcf8e9a9b9b44f7fff04b9c6c88fd361ff47b0ef9c754eb263c89c846b3919d2a48bfc2e4c79e123cc45fbb5008c2a7378772342a08ec7099d SHA512 1e8130ae228799f6b0b53895edb309579d47f93e1f5f7e88387bc9b2e97d201603f43eebc084604e8e5b2b3a93be68daa040c995a7eed59f7b3aaeb903b606dc
+DIST lxdream-0.9.1.tar.gz 2556802 BLAKE2B c69452e95d833c42c930f45e8a9d407e8d1246b2f67c21c2763ae5583d271caa9e28b111a0aa6ec7f5ff7ea9867c18d53ebe1a39bd37a2f47e68544e71c6f6e0 SHA512 f56119e99f82931bb22cc596938caba09f02da9a7e74b6c8ce79880214e3566a9a8091b31f89d5dc56f0802d00ac485ce22c3468350d44b2e1cf140f22983055
+EBUILD lxdream-0.9.1-r3.ebuild 1470 BLAKE2B f65c23e37f6cb99540aaf1c90b042eafdeef78d7004844a15c8ffb2174d89b5e96465d530b4be50a0eb2fa8bfd8eb3163cd6b7ba786b3703c9349d9d85b7e7dc SHA512 5e8d3d55615a3aec0b961b36263f587dc120381edf97f5bfb031ab1ab43e5136c7cf51ab3118b964976a54204204788dea536ae00f98a5d67396a49a562d199f
+MISC metadata.xml 379 BLAKE2B 9407fbbb5013bc923a712f50b05cfe8c14d7648bf673a28dcb798d591e52c34e105a95d196d8d95f348eaf0e0c710f6a7263acc51a0f643bdc546093cc159c7f SHA512 ec81121ea013b5ee3e2863c317bad1c4e6c324f44d41202be5f105b7d0416f52d8a5144a9ab354dceb8793c947bf7cc85b192aaee65b0e3f44cfae19340e9399
diff --git a/games-emulation/lxdream/files/lxdream-0.9.1-glib-single-include.patch b/games-emulation/lxdream/files/lxdream-0.9.1-glib-single-include.patch
new file mode 100644
index 000000000000..7872174ed859
--- /dev/null
+++ b/games-emulation/lxdream/files/lxdream-0.9.1-glib-single-include.patch
@@ -0,0 +1,395 @@
+Index: lxdream-0.9.1/src/aica/audio.c
+===================================================================
+--- lxdream-0.9.1.orig/src/aica/audio.c
++++ lxdream-0.9.1/src/aica/audio.c
+@@ -19,7 +19,7 @@
+
+ #include "aica/aica.h"
+ #include "aica/audio.h"
+-#include <glib/gmem.h>
++#include <glib.h>
+ #include "dream.h"
+ #include <assert.h>
+ #include <string.h>
+Index: lxdream-0.9.1/src/aica/audio.h
+===================================================================
+--- lxdream-0.9.1.orig/src/aica/audio.h
++++ lxdream-0.9.1/src/aica/audio.h
+@@ -20,7 +20,7 @@
+
+ #include <stdint.h>
+ #include <stdio.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include "gettext.h"
+ #include "plugin.h"
+
+Index: lxdream-0.9.1/src/cocoaui/cocoa_ctrl.m
+===================================================================
+--- lxdream-0.9.1.orig/src/cocoaui/cocoa_ctrl.m
++++ lxdream-0.9.1/src/cocoaui/cocoa_ctrl.m
+@@ -23,7 +23,7 @@
+ #include "maple/maple.h"
+ #include "vmu/vmulist.h"
+
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+
+ #define FIRST_SECONDARY_DEVICE MAPLE_PORTS
+
+Index: lxdream-0.9.1/src/cocoaui/paths_osx.m
+===================================================================
+--- lxdream-0.9.1.orig/src/cocoaui/paths_osx.m
++++ lxdream-0.9.1/src/cocoaui/paths_osx.m
+@@ -19,7 +19,7 @@
+ */
+
+ #include <string.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+
+ #include "lxdream.h"
+ #include "lxpaths.h"
+Index: lxdream-0.9.1/src/config.c
+===================================================================
+--- lxdream-0.9.1.orig/src/config.c
++++ lxdream-0.9.1/src/config.c
+@@ -21,8 +21,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <glib/gmem.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include "dream.h"
+Index: lxdream-0.9.1/src/config.h
+===================================================================
+--- lxdream-0.9.1.orig/src/config.h
++++ lxdream-0.9.1/src/config.h
+@@ -19,8 +19,7 @@
+ #ifndef lxdream_config_H
+ #define lxdream_config_H 1
+
+-#include <glib/gtypes.h>
+-#include <glib/glist.h>
++#include <glib.h>
+ #include "gettext.h"
+
+ #ifdef __cplusplus
+Index: lxdream-0.9.1/src/drivers/input_lirc.c
+===================================================================
+--- lxdream-0.9.1.orig/src/drivers/input_lirc.c
++++ lxdream-0.9.1/src/drivers/input_lirc.c
+@@ -28,7 +28,6 @@
+ #include <dirent.h>
+ #include <ctype.h>
+
+-#include <glib/giochannel.h>
+ #include <glib.h>
+
+ #include <lirc/lirc_client.h>
+Index: lxdream-0.9.1/src/drivers/joy_linux.c
+===================================================================
+--- lxdream-0.9.1.orig/src/drivers/joy_linux.c
++++ lxdream-0.9.1/src/drivers/joy_linux.c
+@@ -32,7 +32,6 @@
+ #include <ctype.h>
+
+ #include <linux/joystick.h>
+-#include <glib/giochannel.h>
+ #include <glib.h>
+
+ #include "lxdream.h"
+Index: lxdream-0.9.1/src/drivers/osx_iokit.m
+===================================================================
+--- lxdream-0.9.1.orig/src/drivers/osx_iokit.m
++++ lxdream-0.9.1/src/drivers/osx_iokit.m
+@@ -19,8 +19,7 @@
+ * GNU General Public License for more details.
+ */
+
+-#include <glib/gmem.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <sys/param.h>
+ #include <paths.h>
+ #include <string.h>
+Index: lxdream-0.9.1/src/gdlist.c
+===================================================================
+--- lxdream-0.9.1.orig/src/gdlist.c
++++ lxdream-0.9.1/src/gdlist.c
+@@ -19,7 +19,7 @@
+
+ #include <string.h>
+ #include <stdlib.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <libgen.h>
+ #include "gettext.h"
+ #include "gdrom/gdrom.h"
+Index: lxdream-0.9.1/src/gdrom/gddriver.h
+===================================================================
+--- lxdream-0.9.1.orig/src/gdrom/gddriver.h
++++ lxdream-0.9.1/src/gdrom/gddriver.h
+@@ -24,7 +24,7 @@
+ #include <stdio.h>
+ #include "lxdream.h"
+ #include "gdrom/gdrom.h"
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+Index: lxdream-0.9.1/src/gdrom/gdi.c
+===================================================================
+--- lxdream-0.9.1.orig/src/gdrom/gdi.c
++++ lxdream-0.9.1/src/gdrom/gdi.c
+@@ -23,7 +23,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <sys/stat.h>
+-#include <glib/gutils.h>
++#include <glib.h>
+ #include "gdrom/gddriver.h"
+
+
+Index: lxdream-0.9.1/src/gdrom/gdrom.c
+===================================================================
+--- lxdream-0.9.1.orig/src/gdrom/gdrom.c
++++ lxdream-0.9.1/src/gdrom/gdrom.c
+@@ -20,7 +20,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <ctype.h>
+-#include <glib/gutils.h>
++#include <glib.h>
+ #include "gdrom/ide.h"
+ #include "gdrom/gdrom.h"
+ #include "gdrom/gddriver.h"
+Index: lxdream-0.9.1/src/gdrom/gdrom.h
+===================================================================
+--- lxdream-0.9.1.orig/src/gdrom/gdrom.h
++++ lxdream-0.9.1/src/gdrom/gdrom.h
+@@ -22,7 +22,7 @@
+
+ #include "lxdream.h"
+ #include "hook.h"
+-#include <glib/glist.h>
++#include <glib.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+Index: lxdream-0.9.1/src/gdrom/nrg.c
+===================================================================
+--- lxdream-0.9.1.orig/src/gdrom/nrg.c
++++ lxdream-0.9.1/src/gdrom/nrg.c
+@@ -20,7 +20,7 @@
+ #include <assert.h>
+ #include <stdio.h>
+ #include <errno.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include "gdrom/gddriver.h"
+ #include "dream.h"
+
+Index: lxdream-0.9.1/src/gui.h
+===================================================================
+--- lxdream-0.9.1.orig/src/gui.h
++++ lxdream-0.9.1/src/gui.h
+@@ -19,7 +19,7 @@
+ #ifndef lxdream_gui_H
+ #define lxdream_gui_H
+
+-#include <glib/gtypes.h>
++#include <glib.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+Index: lxdream-0.9.1/src/loader.h
+===================================================================
+--- lxdream-0.9.1.orig/src/loader.h
++++ lxdream-0.9.1/src/loader.h
+@@ -20,7 +20,7 @@
+ #define lxdream_loader_H 1
+
+ #include <stdio.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+Index: lxdream-0.9.1/src/lxdream.h
+===================================================================
+--- lxdream-0.9.1.orig/src/lxdream.h
++++ lxdream-0.9.1/src/lxdream.h
+@@ -20,7 +20,7 @@
+ #define lxdream_lxdream_H 1
+
+ #include <stdint.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+
+ #include "../config.h"
+
+Index: lxdream-0.9.1/src/lxpaths.c
+===================================================================
+--- lxdream-0.9.1.orig/src/lxpaths.c
++++ lxdream-0.9.1/src/lxpaths.c
+@@ -19,8 +19,7 @@
+ #include <ctype.h>
+ #include <unistd.h>
+ #include <wordexp.h>
+-#include <glib/gstrfuncs.h>
+-#include <glib/gutils.h>
++#include <glib.h>
+
+ #include "gui.h"
+ #include "config.h"
+Index: lxdream-0.9.1/src/maple/maple.c
+===================================================================
+--- lxdream-0.9.1.orig/src/maple/maple.c
++++ lxdream-0.9.1/src/maple/maple.c
+@@ -18,7 +18,7 @@
+ #define MODULE maple_module
+
+ #include <assert.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include "dream.h"
+ #include "mem.h"
+ #include "asic.h"
+Index: lxdream-0.9.1/src/mem.c
+===================================================================
+--- lxdream-0.9.1.orig/src/mem.c
++++ lxdream-0.9.1/src/mem.c
+@@ -20,7 +20,7 @@
+ #include <sys/types.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <assert.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+Index: lxdream-0.9.1/src/paths_unix.c
+===================================================================
+--- lxdream-0.9.1.orig/src/paths_unix.c
++++ lxdream-0.9.1/src/paths_unix.c
+@@ -18,7 +18,7 @@
+
+ #include <string.h>
+ #include <stdlib.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+
+ #include "lxdream.h"
+ #include "config.h"
+Index: lxdream-0.9.1/src/plugin.c
+===================================================================
+--- lxdream-0.9.1.orig/src/plugin.c
++++ lxdream-0.9.1/src/plugin.c
+@@ -20,8 +20,7 @@
+ #include <dirent.h>
+ #include <dlfcn.h>
+ #include <string.h>
+-#include <glib/gmem.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include "plugin.h"
+ #include "lxpaths.h"
+
+Index: lxdream-0.9.1/src/pvr2/glutil.c
+===================================================================
+--- lxdream-0.9.1.orig/src/pvr2/glutil.c
++++ lxdream-0.9.1/src/pvr2/glutil.c
+@@ -17,7 +17,7 @@
+ */
+
+ #include <string.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include "pvr2/glutil.h"
+
+ gboolean isGLSecondaryColorSupported()
+Index: lxdream-0.9.1/src/sh4/sh4core.h
+===================================================================
+--- lxdream-0.9.1.orig/src/sh4/sh4core.h
++++ lxdream-0.9.1/src/sh4/sh4core.h
+@@ -19,7 +19,7 @@
+ #ifndef lxdream_sh4core_H
+ #define lxdream_sh4core_H 1
+
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <stdint.h>
+ #include <stdio.h>
+ #include "mem.h"
+Index: lxdream-0.9.1/src/syscall.h
+===================================================================
+--- lxdream-0.9.1.orig/src/syscall.h
++++ lxdream-0.9.1/src/syscall.h
+@@ -20,7 +20,7 @@
+ #define lxdream_syscall_H 1
+
+ #include <stdint.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+Index: lxdream-0.9.1/src/tools/actparse.c
+===================================================================
+--- lxdream-0.9.1.orig/src/tools/actparse.c
++++ lxdream-0.9.1/src/tools/actparse.c
+@@ -21,7 +21,7 @@
+ #include <string.h>
+ #include <ctype.h>
+ #include <sys/stat.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include "tools/gendec.h"
+
+ static int add_action( struct action *actions, struct ruleset *rules, char *operation, const char *file, int line, char *action )
+Index: lxdream-0.9.1/src/tools/gendec.c
+===================================================================
+--- lxdream-0.9.1.orig/src/tools/gendec.c
++++ lxdream-0.9.1/src/tools/gendec.c
+@@ -23,7 +23,7 @@
+ #include <getopt.h>
+ #include <errno.h>
+ #include <ctype.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <assert.h>
+ #include "tools/gendec.h"
+
+Index: lxdream-0.9.1/src/vmu/vmulist.c
+===================================================================
+--- lxdream-0.9.1.orig/src/vmu/vmulist.c
++++ lxdream-0.9.1/src/vmu/vmulist.c
+@@ -18,8 +18,7 @@
+
+ #include <string.h>
+ #include <stdlib.h>
+-#include <glib/glist.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include "vmulist.h"
+ #include "config.h"
+
+Index: lxdream-0.9.1/src/vmu/vmuvol.c
+===================================================================
+--- lxdream-0.9.1.orig/src/vmu/vmuvol.c
++++ lxdream-0.9.1/src/vmu/vmuvol.c
+@@ -16,8 +16,7 @@
+ * GNU General Public License for more details.
+ */
+
+-#include <glib/gmem.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdio.h>
diff --git a/games-emulation/lxdream/lxdream-0.9.1-r3.ebuild b/games-emulation/lxdream/lxdream-0.9.1-r3.ebuild
new file mode 100644
index 000000000000..a2024a899bc9
--- /dev/null
+++ b/games-emulation/lxdream/lxdream-0.9.1-r3.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic
+
+DESCRIPTION="An emulator for the Sega Dreamcast system"
+HOMEPAGE="http://www.lxdream.org/"
+SRC_URI="http://www.lxdream.org/count.php?file=${P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# lirc configure option is not recogniced
+IUSE="debug profile pulseaudio sdl" #lirc
+
+RDEPEND="
+ app-misc/lirc
+
+ media-libs/alsa-lib
+ media-libs/libpng:0=
+ pulseaudio? ( media-sound/pulseaudio )
+ sdl? ( media-libs/libsdl[sound] )
+ virtual/opengl
+ x11-libs/gtk+:2
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ virtual/os-headers
+ !!gnustep-base/gnustep-gui" #377635
+
+src_prepare() {
+ default
+
+ eapply "${FILESDIR}/${PN}-0.9.1-glib-single-include.patch"
+
+ # Make .desktop file pass desktop-file-validate
+ sed -i \
+ -e '/Encoding/d' \
+ -e '/FilePattern/d' \
+ -e '/Categories/s|$|;|' \
+ ${PN}.desktop || die
+ # Do not override user-specified CFLAGS
+ sed -i \
+ -e s/'CFLAGS=\"-g -fexceptions\"'/'CFLAGS=\"${CFLAGS} -g -fexceptions\"'/ \
+ -e '/CCOPT/d' \
+ -e '/OBJCOPT/d' \
+ configure || die
+ append-libs -lX11 -lm
+}
+
+src_configure() {
+ # lirc configure option is not recognized
+ # $(use_with lirc) \
+ econf \
+ --datadir="/usr/share" \
+ $(use_enable debug trace) \
+ $(use_enable debug watch) \
+ $(use_enable profile profiled) \
+ $(use_with pulseaudio pulse) \
+ $(use_with sdl) \
+ --without-esd
+}
diff --git a/games-emulation/lxdream/metadata.xml b/games-emulation/lxdream/metadata.xml
new file mode 100644
index 000000000000..4731fb707fd1
--- /dev/null
+++ b/games-emulation/lxdream/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>chithanh@gentoo.org</email>
+ <name>Chí-Thanh Christopher Nguyễn</name>
+ </maintainer>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/games-emulation/m64py-0.2.4 b/games-emulation/m64py-0.2.4
deleted file mode 100644
index 9dedcb3ac87a..000000000000
--- a/games-emulation/m64py-0.2.4
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm prepare test
-DEPEND=python_targets_python3_4? ( dev-lang/python:3.4 ) python_targets_python3_5? ( dev-lang/python:3.5 ) python_targets_python3_6? ( dev-lang/python:3.6 ) >=dev-lang/python-exec-2:=[python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)]
-DESCRIPTION=A frontend for Mupen64Plus
-EAPI=6
-HOMEPAGE=http://m64py.sourceforge.net/
-IUSE=7z rar python_targets_python3_4 python_targets_python3_5 python_targets_python3_6
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-3 LGPL-3 public-domain GPL-2 BSD CC-BY-SA-3.0
-RDEPEND=dev-python/PyQt5[gui,opengl,widgets,python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)] dev-python/PySDL2[python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)] media-libs/libsdl2[joystick,video] >=games-emulation/mupen64plus-core-2.5:0/2-sdl2 7z? ( || ( dev-python/pylzma[python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)] app-arch/p7zip ) ) rar? ( || ( dev-python/rarfile[python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)] app-arch/unrar app-arch/rar ) ) python_targets_python3_4? ( dev-lang/python:3.4 ) python_targets_python3_5? ( dev-lang/python:3.5 ) python_targets_python3_6? ( dev-lang/python:3.6 ) >=dev-lang/python-exec-2:=[python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)]
-REQUIRED_USE=|| ( python_targets_python3_4 python_targets_python3_5 python_targets_python3_6 )
-SLOT=0
-SRC_URI=mirror://sourceforge/m64py/m64py-0.2.4.tar.gz
-_eclasses_=distutils-r1 63fea93ca1cc4fdc5fa2247afc4e3a15 multibuild 35719a9cd25ec71ee49c966f6868454c multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 python-r1 0b5829eb6369d7af3a834b6eed7b7107 python-utils-r1 7db901256449fef43c3aaa4d486c1c63 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=b1a697928c0e47dda3c429abbbc7e401
diff --git a/games-emulation/m64py/Manifest b/games-emulation/m64py/Manifest
new file mode 100644
index 000000000000..c03daa0feb37
--- /dev/null
+++ b/games-emulation/m64py/Manifest
@@ -0,0 +1,3 @@
+DIST m64py-0.2.4.tar.gz 209621 BLAKE2B 05fe7044ec096767ae1eb57aad9f326b157d67ea709ca0bb74cdd68ae16a23eb662a2842bef5e038d1b29cbf0a5252669ff54268d1227390f47e8c9029b63e6a SHA512 ab78565466c6dcfe604cdc00b7e63dee2f0f33514dbf4f9115af646b1f6562042516513d054bd5cb489ad89c9d30431e9ce531f8b27925ecb9c6f7b509836348
+EBUILD m64py-0.2.4.ebuild 1067 BLAKE2B a21eeabf0ac3bb7c88486ca1ac12efac04c58ade8c666b9efd73c011a1f499879d522c0cb721177b8014a23f4b322fe5229e2eafeceb42ed8b433448609d5e96 SHA512 8a66a89849ace632528543c73725a3ba1c2e60e84a4b81a4c9af4e0cb36bea9c622a4ad130d9ecdef0e74d9a089856ddeed0ae7af858a857e2672af073d8acb6
+MISC metadata.xml 455 BLAKE2B 094f3f1db818c82e55c07512db2e94ed800bfd14595d70aa8ddca7d63e862807c5552210f9a71c01ea0fbcc61f3d46a139a762d1026d75b1f932e15ec7e0e589 SHA512 41d3ca220e71119ec7bf4ea8b1ea92289d901ba3a0058e75423dd50580d03a0cbc9aae2c368fc3c47793e0405c0e167fc546c65f039661b5b11fbb274846301b
diff --git a/games-emulation/m64py/m64py-0.2.4.ebuild b/games-emulation/m64py/m64py-0.2.4.ebuild
new file mode 100644
index 000000000000..7d0c4054d8dc
--- /dev/null
+++ b/games-emulation/m64py/m64py-0.2.4.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+
+inherit distutils-r1 xdg-utils
+
+DESCRIPTION="A frontend for Mupen64Plus"
+HOMEPAGE="http://m64py.sourceforge.net/"
+SRC_URI="mirror://sourceforge/m64py/${P}.tar.gz"
+
+LICENSE="GPL-3 LGPL-3 public-domain GPL-2 BSD CC-BY-SA-3.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="7z rar"
+
+RDEPEND="
+ dev-python/PyQt5[gui,opengl,widgets,${PYTHON_USEDEP}]
+ dev-python/PySDL2[${PYTHON_USEDEP}]
+ media-libs/libsdl2[joystick,video]
+ >=games-emulation/mupen64plus-core-2.5:0/2-sdl2
+ 7z? (
+ || (
+ dev-python/pylzma[${PYTHON_USEDEP}]
+ app-arch/p7zip
+ )
+ )
+ rar? (
+ || (
+ dev-python/rarfile[${PYTHON_USEDEP}]
+ app-arch/unrar
+ app-arch/rar
+ )
+ )"
+
+python_prepare_all() {
+ # set the correct search path
+ cat >> src/m64py/platform.py <<-_EOF_
+ SEARCH_DIRS = ["/usr/$(get_libdir)/mupen64plus"]
+_EOF_
+
+ distutils-r1_python_prepare_all
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+}
diff --git a/games-emulation/m64py/metadata.xml b/games-emulation/m64py/metadata.xml
new file mode 100644
index 000000000000..00cb74caa25a
--- /dev/null
+++ b/games-emulation/m64py/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name='7z'>Ensure support for .7z archives.</flag>
+ <flag name='rar'>Ensure support for .rar archives.</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">m64py</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mamory-0.2.25-r1 b/games-emulation/mamory-0.2.25-r1
deleted file mode 100644
index 2af946f4f8a3..000000000000
--- a/games-emulation/mamory-0.2.25-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=configure install prepare
-DEPEND=dev-libs/expat >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=ROM management tools and library
-EAPI=6
-HOMEPAGE=http://mamory.sourceforge.net/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-libs/expat
-SLOT=0
-SRC_URI=mirror://sourceforge/mamory/mamory-0.2.25.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=91c81601ac19179dc51415972b680514
diff --git a/games-emulation/mamory/Manifest b/games-emulation/mamory/Manifest
new file mode 100644
index 000000000000..58b2d16d4e56
--- /dev/null
+++ b/games-emulation/mamory/Manifest
@@ -0,0 +1,3 @@
+DIST mamory-0.2.25.tar.gz 437223 BLAKE2B 2893595245ac3fde7c049448f7dc1cbe0ac24767a7efdcf22b5000154026961ef9b700844cc53d4808e7f90b5042f192d0d2a9338cb47e42d6f9d534f5946044 SHA512 d59539646fa61a3964e46123e0c8d09170f5561355e57b8c93dc89c11d99af1a2edeb60389e7f42b14f431c9c495c6ce20c70517ac4977ccaef62f0ed47f0d76
+EBUILD mamory-0.2.25-r1.ebuild 1051 BLAKE2B ddb02d41af08032313a818b8f066645f28775331a5e08f846f3b8e8c9ac797fe2959bdd528711609e30701428d42987142cb6888cc5d7fb1aca1707951ad9ad5 SHA512 b917e62eb8f075291e5e9dec9c481a60a99eb333bfc8d02e66efee9da457068e92531bd4c743df35ce0fb5133e3f8dd00e47e70e3bbc52f10657bcd65df8278f
+MISC metadata.xml 329 BLAKE2B b6c6f06e91bfcd0d053f2f057b1651981d60204b07faad12072375b97d84808fa77d6c2549ca3dde5a92881840c4f475fe8af578e1c4c0e1320936ebb0fa9e18 SHA512 58aa61207f4409bc50a405342e2f68cf5d576e7819def22d5bd2788869225fc7d4d8769f1efebd78b40195a30e8a104e2d4107dca6bb1d11a66291353088a75c
diff --git a/games-emulation/mamory/mamory-0.2.25-r1.ebuild b/games-emulation/mamory/mamory-0.2.25-r1.ebuild
new file mode 100644
index 000000000000..cccd915c6f27
--- /dev/null
+++ b/games-emulation/mamory/mamory-0.2.25-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools flag-o-matic
+
+DESCRIPTION="ROM management tools and library"
+HOMEPAGE="http://mamory.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/expat"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ default
+
+ # Make sure the system expat is used
+ sed -i \
+ -e 's/#ifdef.*SYSEXPAT/#if 1/' \
+ mamory/amlxml.c mamory/amlxml.h || die
+
+ # Remove hardcoded CFLAGS options
+ sed -i \
+ -e '/AC_ARG_ENABLE(debug,/ {N;N;N;d}' \
+ configure.ac || die
+
+ # Make it possible for eautoreconf to fix fPIC etc.
+ sed -i \
+ -e '/libcommon_la_LDFLAGS= -static/d' \
+ common/Makefile.am || die
+
+ AT_M4DIR="config" eautoreconf
+ append-cflags -std=gnu89 # build with gcc5 (bug #570500)
+}
+
+src_configure() {
+ econf \
+ --includedir=/usr/include \
+ --disable-static
+}
+
+src_install() {
+ HTML_DOCS="DOCS/mamory.html" default
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/games-emulation/mamory/metadata.xml b/games-emulation/mamory/metadata.xml
new file mode 100644
index 000000000000..20c41e11778e
--- /dev/null
+++ b/games-emulation/mamory/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">mamory</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mastergear-bin-4.3 b/games-emulation/mastergear-bin-4.3
deleted file mode 100644
index 526f9db3978e..000000000000
--- a/games-emulation/mastergear-bin-4.3
+++ /dev/null
@@ -1,11 +0,0 @@
-DEFINED_PHASES=install
-DESCRIPTION=SEGA Master System / Game Gear emulator
-EAPI=6
-HOMEPAGE=https://fms.komkon.org/MG/
-KEYWORDS=~amd64
-LICENSE=all-rights-reserved
-RDEPEND=>=sys-libs/glibc-2.15 sys-libs/zlib x11-libs/libX11 x11-libs/libXext || ( media-sound/pulseaudio media-sound/apulse )
-RESTRICT=bindist mirror strip
-SLOT=0
-SRC_URI=https://fms.komkon.org/MG/MG43-Ubuntu-x86-bin.tgz
-_md5_=88978a9ec5cff940deb45df4687f192d
diff --git a/games-emulation/mastergear-bin/Manifest b/games-emulation/mastergear-bin/Manifest
new file mode 100644
index 000000000000..e566a8493899
--- /dev/null
+++ b/games-emulation/mastergear-bin/Manifest
@@ -0,0 +1,3 @@
+DIST MG43-Ubuntu-x86-bin.tgz 169112 BLAKE2B d54ad5ce84b02e1ff870510fce71447420a27d90b77101280b131f8862e4549767db5a375142e7eb3293465c5da805acc93f5ee737b3c56df66e1cba9d9420e9 SHA512 b39f03902d5046e8d8a64cd45d5d4fc1522a70d97d812dfa859d315a381181ba3c05a3292e24a92662ee4a95b501e6cb3c516eb1dea9d1d5b7e74abe8a2b3dda
+EBUILD mastergear-bin-4.3.ebuild 585 BLAKE2B 202c653a577b2009a89c320dc54eb6bd304b990a15b5c26472d0a66e6a65cd9fb2e0c6804a02dc2670c89c105873615da08bb90aaca21a2c9b48ddfae2ed4718 SHA512 355eebe6427871fb2ddd9c4153193a21454fe38fbc74200fad652c79d0f321d373a254dd23207ed1454f5301d8f067310ba4409b3de2a3689a0deb88b623f684
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/mastergear-bin/mastergear-bin-4.3.ebuild b/games-emulation/mastergear-bin/mastergear-bin-4.3.ebuild
new file mode 100644
index 000000000000..da157fcf3639
--- /dev/null
+++ b/games-emulation/mastergear-bin/mastergear-bin-4.3.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="SEGA Master System / Game Gear emulator"
+HOMEPAGE="https://fms.komkon.org/MG/"
+SRC_URI="https://fms.komkon.org/MG/MG${PV//\./}-Ubuntu-x86-bin.tgz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="bindist mirror strip"
+
+RDEPEND=">=sys-libs/glibc-2.15
+ sys-libs/zlib
+ x11-libs/libX11
+ x11-libs/libXext
+ || ( media-sound/pulseaudio media-sound/apulse )"
+
+S="${WORKDIR}"
+
+src_install() {
+ newbin mg mastergear
+ docinto html
+ dodoc MG.html
+}
diff --git a/games-emulation/mastergear-bin/metadata.xml b/games-emulation/mastergear-bin/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/mastergear-bin/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/mednafen-0.9.46 b/games-emulation/mednafen-0.9.46
deleted file mode 100644
index c8ebccef86f2..000000000000
--- a/games-emulation/mednafen-0.9.46
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install prepare pretend
-DEPEND=dev-libs/libcdio >=dev-libs/lzo-2.10 media-libs/libsdl[sound,joystick,opengl,video] media-libs/libsndfile sys-libs/zlib[minizip] virtual/opengl alsa? ( media-libs/alsa-lib ) jack? ( media-sound/jack-audio-connection-kit ) nls? ( virtual/libintl ) virtual/pkgconfig nls? ( sys-devel/gettext ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=Argument-driven multi-system emulator utilizing OpenGL and SDL
-EAPI=6
-HOMEPAGE=https://mednafen.github.io/
-IUSE=alsa altivec cjk debugger jack nls pax_kernel
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-libs/libcdio >=dev-libs/lzo-2.10 media-libs/libsdl[sound,joystick,opengl,video] media-libs/libsndfile sys-libs/zlib[minizip] virtual/opengl alsa? ( media-libs/alsa-lib ) jack? ( media-sound/jack-audio-connection-kit ) nls? ( virtual/libintl )
-SLOT=0
-SRC_URI=https://mednafen.github.io/releases/files/mednafen-0.9.46.tar.xz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e pax-utils b963274a93e76570a88168c1f1db4cd7 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=011823ed3813cc72f542ee55fb448fa3
diff --git a/games-emulation/mednafen/Manifest b/games-emulation/mednafen/Manifest
new file mode 100644
index 000000000000..5d0b95a33574
--- /dev/null
+++ b/games-emulation/mednafen/Manifest
@@ -0,0 +1,3 @@
+DIST mednafen-0.9.46.tar.xz 3187988 BLAKE2B c33da02bfb0cce37e9029efc98d11e233686c41c7ecb51110a3fe805b3a13f2fef293dd86b7bc7a3ff172f7f0f507e07804a2927e5b41c1927ca52673f068dfb SHA512 ea624f076922570001393d5d04cc1b20b3d005d31de4095ee5c7a985be2b61e8d3aa5e78c64e751e8233adc89a31be955372caeb2818d0a5cc71ba9380931620
+EBUILD mednafen-0.9.46.ebuild 3367 BLAKE2B c8029cf25b7211db7a4e3b04eb679cd15cf73307731aba5f4306ab80f4893d3c8e39e56df79fe9c22ee561dfe80ece9cbcc95cec8250a3eb6e766e0b5fb763ed SHA512 3dc665af4a7a96d244d40d01897c53311a55c626f04ace5b1e9db32708613ea816338a042790f4bca5c3d399d8d8f99e857c8f88686210ea0c828d0d70e02a0f
+MISC metadata.xml 475 BLAKE2B f1a569bb5271cd8e5e62dc19873ce2dd5ac1cce0a84ad8c8afd68e38451301eeb7db8200636abcbdca35e0e3d310cb1bc72e3a8e0fe048f24ee483c8ba22fdc7 SHA512 d13e5f6522d5150282ed8bfb44bcdef66a30c392abdd8bf142a0c04fa3d2fd9dc09395510c771fb110cc6123e4f738cc28f33f93cf75a8f5538063eef4ce8cc5
diff --git a/games-emulation/mednafen/mednafen-0.9.46.ebuild b/games-emulation/mednafen/mednafen-0.9.46.ebuild
new file mode 100644
index 000000000000..a42d9936b35c
--- /dev/null
+++ b/games-emulation/mednafen/mednafen-0.9.46.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic pax-utils
+
+DESCRIPTION="Argument-driven multi-system emulator utilizing OpenGL and SDL"
+HOMEPAGE="https://mednafen.github.io/"
+SRC_URI="https://mednafen.github.io/releases/files/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa altivec cjk debugger jack nls pax_kernel"
+
+RDEPEND="
+ dev-libs/libcdio
+ >=dev-libs/lzo-2.10
+ media-libs/libsdl[sound,joystick,opengl,video]
+ media-libs/libsndfile
+ sys-libs/zlib[minizip]
+ virtual/opengl
+ alsa? ( media-libs/alsa-lib )
+ jack? ( media-sound/jack-audio-connection-kit )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/${PN}
+
+pkg_pretend() {
+ if has ccache ${FEATURES}; then
+ ewarn
+ ewarn "If you experience build failure, try turning off ccache in FEATURES."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Unfortunately, upstream is insane and thinks mucking with CFLAGS is okay, if
+ # it prevents "users who don't understand the consequences of what they're doing".
+ # We use sed's here, as they're more forward-compatible than patches which need to
+ # be constantly rebased. DO NOT REPLACE THEM UNLESS YOU HAVE PERMISSION FROM GAMES.
+ sed -e '/-fno-fast-math/d' \
+ -e '/-fno-unsafe-math-optimizations/d' \
+ -e '/-fno-aggressive-loop-optimizations/d' \
+ -e '/-fno-ipa-icf/d' \
+ -e '/-fno-printf-return-value/d' \
+ -e '/-fomit-frame-pointer/d' \
+ -e '/-fno-pic/d' \
+ -e '/-fno-pie/d' \
+ -e '/-fno-PIC/d' \
+ -e '/-fno-PIE/d' \
+ -e '/-nopie/d' \
+ -e '/-no-pie/d' \
+ -e '/-fno-stack-protector/d' \
+ -e '/-fno-stack-protector-all/d' \
+ -e '/-fno-stack-protector-strong/d' \
+ -e '/-mtune=haswell/d' \
+ -i configure.ac || die
+
+ # Furthermore, upstream is also insane about bundling libraries and considers it
+ # "an aesthetics issue" and is even unwilling to make unbundling optional.
+ # Libs to unbundle: minilzo, minizip
+ sed -e '/PKG_PROG_PKG_CONFIG/a PKG_CHECK_MODULES([LZO], [lzo2])' \
+ -i configure.ac || die
+ sed -e '/bin_PROGRAMS/a mednafen_CPPFLAGS = \$(LZO_CFLAGS)' \
+ -i src/Makefile.am || die
+ sed -e 's:"compress/minilzo.h":<lzo1x.h>:' \
+ -i src/{mednafen,qtrecord}.cpp || die
+ sed -e 's:compress/ioapi.c::' \
+ -e 's:compress/unzip.c::' \
+ -e 's:compress/minilzo.c::' \
+ -i src/compress/Makefile.am.inc || die
+ sed -e 's:"compress/unzip.h":<minizip/unzip.h>:' \
+ -i src/file.cpp || die
+ sed -e 's:\(mednafen_LDADD.*trio/libtrio\.a\):\1 -lminizip \$(LZO_LIBS):' \
+ -i src/Makefile.am || die
+ # delete bundled files just to be sure...
+ rm src/compress/{ioapi.?,*lzo*,unzip.?} || die
+
+ # The insanity continues... upstream now believes it needs to
+ # warn users when compiling with -fPIC/-fPIE enabled
+ sed -e '/Compiling with position-independent code generation enabled is not recommended, for performance reasons/d' \
+ -i src/types.h || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # very dodgy code (bug #539992)
+ strip-flags
+ append-flags -fomit-frame-pointer -fwrapv
+
+ econf \
+ $(use_enable alsa) \
+ $(use_enable altivec) \
+ $(use_enable cjk cjk-fonts) \
+ $(use_enable debugger) \
+ $(use_enable jack) \
+ $(use_enable nls)
+}
+
+src_install() {
+ default
+ dodoc Documentation/cheats.txt
+
+ if use pax_kernel; then
+ pax-mark m "${ED%/}"/usr/bin/mednafen || die
+ fi
+}
diff --git a/games-emulation/mednafen/metadata.xml b/games-emulation/mednafen/metadata.xml
new file mode 100644
index 000000000000..0afad2b3f24e
--- /dev/null
+++ b/games-emulation/mednafen/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="debugger">Build with internal debugger</flag>
+ <flag name="pax_kernel">Triggers a paxmarking of the binary</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">mednafen</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mednaffe-0.8.7 b/games-emulation/mednaffe-0.8.7
deleted file mode 100644
index 43ed3585bb30..000000000000
--- a/games-emulation/mednaffe-0.8.7
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=configure postinst postrm preinst prepare
-DEPEND=>=dev-libs/glib-2.32:2 games-emulation/mednafen[debugger] >=x11-libs/gtk+-3.4:3 app-arch/unzip virtual/pkgconfig >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 >=sys-apps/sed-4
-DESCRIPTION=A front-end (GUI) for mednafen emulator
-EAPI=6
-HOMEPAGE=https://github.com/AmatCoder/mednaffe
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-3+
-RDEPEND=>=dev-libs/glib-2.32:2 games-emulation/mednafen[debugger] >=x11-libs/gtk+-3.4:3
-SLOT=0
-SRC_URI=https://github.com/AmatCoder/mednaffe/releases/download/0.8.7/mednaffe-0.8.7.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=57f1b30478405fc7c884bc06439565f9
diff --git a/games-emulation/mednaffe/Manifest b/games-emulation/mednaffe/Manifest
new file mode 100644
index 000000000000..c5358cc1cb28
--- /dev/null
+++ b/games-emulation/mednaffe/Manifest
@@ -0,0 +1,3 @@
+DIST mednaffe-0.8.7.tar.gz 304300 BLAKE2B 80a57f2afbea0e33ec547f16088b678fd9a319a124bbebe71fe7848497e1276ae77c0fb47718324d8549dbb69709685f46c970dedf982f48ac095f1923b42dbd SHA512 3495ecd3b87f19ab65d8760ea8adfa830c4dc9fe959f2e2f349216b36f58d9623c9cfd0c7e40fe5e8b7b90846fe85d9808c2a5885f36d5d8b16659b25cf8a3a1
+EBUILD mednaffe-0.8.7.ebuild 869 BLAKE2B b04ffa62a023f0c2f49babc8ebc88e70d8ab9ab24fea303db31d80aa4c66378659dca954df244c762b3273091b97edc5d16f2caab17a98d28422a988b44e6407 SHA512 ac868f6139863cdbec397523688b342640c5f2403fe6e1ceda3326fa04085f6e823b26e0049f4e49cf3114dcfa14f5afad0f264679f78a9c320bd12032341d91
+MISC metadata.xml 336 BLAKE2B 36957f8dd3f83bd9fbbf5e504e5dd8b0fced6a57b51a4f31bc322b498ef16178641e13c9033cd6e3746677a6e9fe39e10b049f8a681ef04b0426a682ddec70b5 SHA512 5d0ade58e84b321f763690314eb9fa4d8aa2f8b06f4470466101e4213828d92ad200565d1cd5324a0a4e9ccd9daa0a13ff14f9574f6d6f639c92d0d9235dacb7
diff --git a/games-emulation/mednaffe/mednaffe-0.8.7.ebuild b/games-emulation/mednaffe/mednaffe-0.8.7.ebuild
new file mode 100644
index 000000000000..904241ddac84
--- /dev/null
+++ b/games-emulation/mednaffe/mednaffe-0.8.7.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools flag-o-matic gnome2-utils
+
+DESCRIPTION="A front-end (GUI) for mednafen emulator"
+HOMEPAGE="https://github.com/AmatCoder/mednaffe"
+SRC_URI="https://github.com/AmatCoder/mednaffe/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ >=dev-libs/glib-2.32:2
+ games-emulation/mednafen[debugger]
+ >=x11-libs/gtk+-3.4:3
+"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ default
+ append-cflags -Wl,-export-dynamic
+ sed -i -e 's:$(datadir):/usr/share:' share/Makefile.am || die
+ eautoreconf
+}
+
+src_configure() {
+ econf --enable-gtk3
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/mednaffe/metadata.xml b/games-emulation/mednaffe/metadata.xml
new file mode 100644
index 000000000000..d5520fd1401b
--- /dev/null
+++ b/games-emulation/mednaffe/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">AmatCoder/mednaffe</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mekanix-070-r1 b/games-emulation/mekanix-070-r1
deleted file mode 100644
index 8e50588dc69a..000000000000
--- a/games-emulation/mekanix-070-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=install
-DESCRIPTION=SG-1000, SC-3000, SF-7000, SSC, SMS, GG, COLECO, and OMV emulator
-EAPI=6
-HOMEPAGE=http://www.smspower.org/meka/
-KEYWORDS=~x86
-LICENSE=mekanix
-RDEPEND=media-libs/libpng x11-libs/libXpm
-RESTRICT=strip
-SLOT=0
-SRC_URI=http://www.smspower.org/meka/releases/mekanix070.tgz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=37174b6194d3fd7603f7012ca8ac6501
diff --git a/games-emulation/mekanix/Manifest b/games-emulation/mekanix/Manifest
new file mode 100644
index 000000000000..8515d7d7d1f1
--- /dev/null
+++ b/games-emulation/mekanix/Manifest
@@ -0,0 +1,3 @@
+DIST mekanix070.tgz 759553 BLAKE2B ffb8a0392edd8d4887cc668e2d18b5ad955e54bf4c53cc26a06c33a3364bb7db4bd5c6ee8e5406d2885e9c173b16b0894fcc2ee3a111d03c70ad8326920011e1 SHA512 9298d74c0ff7e8d13fbe79f13f2107ea966e6f2602bb3215207a76a433d9f705cd57a33db8295d44cb975e3735a510f23a189d624ea69b83ecfc7ba6509cc3df
+EBUILD mekanix-070-r1.ebuild 702 BLAKE2B 2f3b11c2b186fd5638ae9453d7fc3b3e88b583e44517f0471d3d84ddd430f7cfcff99aab1149031f2c71a09dbd8b60b302b99334711f2830b150a3317427ca0d SHA512 8f128f5446e4dbba8d0de7a9ddd11276de58731fa277109c1739411a9f4ea5872e7ed1fc5024bca0f9706cd8cff4c53fc0db7921bc423f9e7604cb239166fe7f
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/mekanix/mekanix-070-r1.ebuild b/games-emulation/mekanix/mekanix-070-r1.ebuild
new file mode 100644
index 000000000000..ee7f2d85c12d
--- /dev/null
+++ b/games-emulation/mekanix/mekanix-070-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="SG-1000, SC-3000, SF-7000, SSC, SMS, GG, COLECO, and OMV emulator"
+HOMEPAGE="http://www.smspower.org/meka/"
+SRC_URI="http://www.smspower.org/meka/releases/${PN}${PV}.tgz"
+
+LICENSE="mekanix"
+SLOT="0"
+KEYWORDS="~x86"
+RESTRICT="strip"
+IUSE=""
+
+RDEPEND="media-libs/libpng
+ x11-libs/libXpm"
+
+S=${WORKDIR}/${PN}
+
+# file verfies that it's an elf, not win32, binary:
+QA_PREBUILT="opt/${PN}/meka.exe"
+
+src_install() {
+ local dir="/opt/${PN}"
+
+ insinto "${dir}"
+ doins * || die "doins failed"
+ fperms a+x "${dir}/meka.exe"
+ make_wrapper mekanix ./meka.exe "${dir}"
+}
diff --git a/games-emulation/mekanix/metadata.xml b/games-emulation/mekanix/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/mekanix/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/metadata.xml b/games-emulation/metadata.xml
new file mode 100644
index 000000000000..1d99058d9f44
--- /dev/null
+++ b/games-emulation/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The games-emulation category contains game platform emulators.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie games-emulation enthält Emulatoren für verschiedene Spieleplattformen.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría games-emulation contiene emuladores de juegos de plataforma.
+ </longdescription>
+ <longdescription lang="ja">
+ games-emulationカテゴリーにはプラットフォームをエミュレートしたゲームが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De games-emulation categorie bevat emulators voor verschillende spelcomputers.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm games-emulation chứa các bộ mô phỏng nền chơi game.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria games-emulation contiene emulatori di piattaforme di gioco.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria games-emulation contém emuladores de plataformas de jogos.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria games-emulation zawiera emulatory rozmaitych platform dla gier.
+ </longdescription>
+</catmetadata>
diff --git a/games-emulation/mgba-0.6.1 b/games-emulation/mgba-0.6.1
deleted file mode 100644
index f670a5cc0c91..000000000000
--- a/games-emulation/mgba-0.6.1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test
-DEPEND=dev-db/sqlite:3 media-libs/libpng:0= sys-libs/zlib[minizip] ffmpeg? ( virtual/ffmpeg ) imagemagick? ( media-gfx/imagemagick:= ) opengl? ( virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] ) sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4
-DESCRIPTION=A new Game Boy Advance emulator written in C.
-EAPI=6
-HOMEPAGE=https://mgba.io
-IUSE=debug ffmpeg imagemagick opengl qt5 +sdl
-KEYWORDS=amd64 x86
-LICENSE=MPL-2.0
-RDEPEND=dev-db/sqlite:3 media-libs/libpng:0= sys-libs/zlib[minizip] ffmpeg? ( virtual/ffmpeg ) imagemagick? ( media-gfx/imagemagick:= ) opengl? ( virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
-REQUIRED_USE=|| ( qt5 sdl ) qt5? ( opengl )
-SLOT=0
-SRC_URI=https://github.com/mgba-emu/mgba/archive/0.6.1.tar.gz -> mgba-0.6.1.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=bb51b11aad2a0c3ee662457844b6e596
diff --git a/games-emulation/mgba-0.6.2 b/games-emulation/mgba-0.6.2
deleted file mode 100644
index 414397cbb376..000000000000
--- a/games-emulation/mgba-0.6.2
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test
-DEPEND=dev-db/sqlite:3 media-libs/libpng:0= sys-libs/zlib[minizip] ffmpeg? ( virtual/ffmpeg ) imagemagick? ( media-gfx/imagemagick:= ) opengl? ( virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] ) sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4
-DESCRIPTION=Game Boy Advance emulator written in C
-EAPI=6
-HOMEPAGE=https://mgba.io
-IUSE=debug ffmpeg imagemagick opengl qt5 +sdl
-KEYWORDS=~amd64 ~x86
-LICENSE=MPL-2.0
-RDEPEND=dev-db/sqlite:3 media-libs/libpng:0= sys-libs/zlib[minizip] ffmpeg? ( virtual/ffmpeg ) imagemagick? ( media-gfx/imagemagick:= ) opengl? ( virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
-REQUIRED_USE=|| ( qt5 sdl ) qt5? ( opengl )
-SLOT=0
-SRC_URI=https://github.com/mgba-emu/mgba/archive/0.6.2.tar.gz -> mgba-0.6.2.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=aee0ccda218d041500929ee673c699f9
diff --git a/games-emulation/mgba-0.6.3 b/games-emulation/mgba-0.6.3
deleted file mode 100644
index 173a74f883a7..000000000000
--- a/games-emulation/mgba-0.6.3
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test
-DEPEND=dev-db/sqlite:3 media-libs/libpng:0= sys-libs/zlib[minizip] ffmpeg? ( libav? ( media-video/libav:= ) !libav? ( media-video/ffmpeg:= ) ) imagemagick? ( media-gfx/imagemagick:= ) opengl? ( virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] ) sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4
-DESCRIPTION=Game Boy Advance emulator written in C
-EAPI=6
-HOMEPAGE=https://mgba.io
-IUSE=debug ffmpeg imagemagick libav opengl qt5 +sdl
-KEYWORDS=~amd64 ~x86
-LICENSE=MPL-2.0
-RDEPEND=dev-db/sqlite:3 media-libs/libpng:0= sys-libs/zlib[minizip] ffmpeg? ( libav? ( media-video/libav:= ) !libav? ( media-video/ffmpeg:= ) ) imagemagick? ( media-gfx/imagemagick:= ) opengl? ( virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
-REQUIRED_USE=|| ( qt5 sdl ) qt5? ( opengl )
-SLOT=0
-SRC_URI=https://github.com/mgba-emu/mgba/archive/0.6.3.tar.gz -> mgba-0.6.3.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=2ecf6303963c42b6d16a59507db045fd
diff --git a/games-emulation/mgba/Manifest b/games-emulation/mgba/Manifest
new file mode 100644
index 000000000000..279d284a9a53
--- /dev/null
+++ b/games-emulation/mgba/Manifest
@@ -0,0 +1,8 @@
+AUX mgba-0.6.3-qt511.patch 975 BLAKE2B 3fdafdd9a10cd643fbf29a76baf4e49db50142a2f1b096f8c8b962e38166756016bf663b53dd6cf3a2e33f2f28313d477463d8807d4ecb3139bf7a0943ae0274 SHA512 41e0ea8568d8ffddac2b9020933fd4a21562049b82bfd95bb0ae372702b3312c7ee3f03e03a36fcaec723d999f7820a785a730354825cee1a737d6c2accbfb29
+DIST mgba-0.6.1.tar.gz 7437240 BLAKE2B d00ed8a517b6e82f477537702d757bd9d86d007ee7bea022b67751b0423a2f386706e410c5e41b984ae8e7e66efabbf41356b846fdcba438cb5a64c89bc2379c SHA512 fb4d2bd490afa052c32d263e4d7b65ff83ccdcad01f5df6572d73c81de3c4e0c268b102ac36cff4a85ab20fc190d2f1a4959a3058e559a528be5e49c4808ce57
+DIST mgba-0.6.2.tar.gz 7441969 BLAKE2B f807a3a26667f50cbf3b87ac6e7887ec7fb99516895e1168855fafee417025a1d1e5605ca3f87a171fde563fd69878d5d164e068247643401c2696164d7460c1 SHA512 8afe4fb331f4163f4cd96cc73a51136bdb9008178b74c0ecb827c1f06dee79eba3cf753e1c35657972d8593ab97d294c15287ebf2c5ffa6a135527d5611d3574
+DIST mgba-0.6.3.tar.gz 7442154 BLAKE2B 2b46cf36174ef0a186b1bc71784820e6ddd7754a7cae695a95dcdae96efff58af70dd14faa2f1f6194a23450943d82aed2394f7bf2821ed91bf558eef6ae9c4d SHA512 d646af7869dbcf8df671a75ecfd8c270950c013b826b23b94bacae43a77243786f198725e1b9bf17827d1ffcf6a8eef70091d53ea878bfb2450472485f42f233
+EBUILD mgba-0.6.1.ebuild 2372 BLAKE2B a1044752dd33c7a2019f88d79cb247013a8de227ae5730cdfbc1ccc28409a9a767fa598a2000db5c962efe11e7f3031ed7b35353606885879838e147c9b20ef8 SHA512 33ebba4a7c94922750bbad82c1c06a1185f03336a2138ecd39bdc5d3dfbee9b7ac5f3b190cc693936790010e5cf86102ef1a4a25cc4ff28114c7710923e911e1
+EBUILD mgba-0.6.2.ebuild 2367 BLAKE2B d9b9d7779b6bcdcb82d883a0f1a6156111037603b04e7e417b7808b30f16f9ab6564145d56fc9534f54d591cde9229adc4e3fc47a34ec7ef41b4b01eb2783ec6 SHA512 97daec41ddf7d211c8ffcca2f6c5f53e7adf44cc02d7f7d35717a7fdb1c2d7d3f448f7df194386b0c168f6d63cbf85443eccddcdcda52d9d6b2384c5af3b56cb
+EBUILD mgba-0.6.3.ebuild 2470 BLAKE2B a00e6509643d0eed1ea8b213f3503791477b55c059085a9ab314f374e1a6c24ddfa1dc313b331fa9779659f76aab8458c22b6b83a5455c2d4d5824c64434a379 SHA512 66ab4004d8d4a22874030438c1bf1b9a02fe95be18f9bbf668cdd3cd111ad335641e2812d2e85485f9cd701f7e7702b3295ed79a7e99342af794697429139e31
+MISC metadata.xml 339 BLAKE2B e8edd01de74aa69c33c51ca095668dd89c74b83bd0c1597baf75f34b839cba3e74a2723b96acad0aef00b7a84628d54f70526f336a2d9880c32403cca153ca1d SHA512 33798a7a9145daff0c4f0e31cbd6ac05e49632edbec02709f51952716af659a7f3e76f378e9432c15e5bda68619816318a1d2fbfa27b4a5ef136970241ebfa03
diff --git a/games-emulation/mgba/files/mgba-0.6.3-qt511.patch b/games-emulation/mgba/files/mgba-0.6.3-qt511.patch
new file mode 100644
index 000000000000..05368f6e30e7
--- /dev/null
+++ b/games-emulation/mgba/files/mgba-0.6.3-qt511.patch
@@ -0,0 +1,34 @@
+From a2b8c4ae807ae92103e14961fd34377b28cbe219 Mon Sep 17 00:00:00 2001
+From: Vicki Pfau <vi@endrift.com>
+Date: Fri, 25 May 2018 18:04:16 -0700
+Subject: [PATCH] Qt: Fix build with Qt 5.11
+
+---
+ src/platform/qt/LoadSaveState.cpp | 1 +
+ src/platform/qt/Window.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/platform/qt/LoadSaveState.cpp b/src/platform/qt/LoadSaveState.cpp
+index a381c3d22..41ddb842e 100644
+--- a/src/platform/qt/LoadSaveState.cpp
++++ b/src/platform/qt/LoadSaveState.cpp
+@@ -10,6 +10,7 @@
+ #include "GamepadButtonEvent.h"
+ #include "VFileDevice.h"
+
++#include <QAction>
+ #include <QDateTime>
+ #include <QKeyEvent>
+ #include <QPainter>
+diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h
+index c009c7ffa..8ee63907d 100644
+--- a/src/platform/qt/Window.h
++++ b/src/platform/qt/Window.h
+@@ -6,6 +6,7 @@
+ #ifndef QGBA_WINDOW
+ #define QGBA_WINDOW
+
++#include <QAction>
+ #include <QDateTime>
+ #include <QList>
+ #include <QMainWindow>
diff --git a/games-emulation/mgba/metadata.xml b/games-emulation/mgba/metadata.xml
new file mode 100644
index 000000000000..e4c99df19a2a
--- /dev/null
+++ b/games-emulation/mgba/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mgba-emu/mgba</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mgba/mgba-0.6.1.ebuild b/games-emulation/mgba/mgba-0.6.1.ebuild
new file mode 100644
index 000000000000..9bd4dc4f28c0
--- /dev/null
+++ b/games-emulation/mgba/mgba-0.6.1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils xdg-utils
+
+DESCRIPTION="A new Game Boy Advance emulator written in C."
+HOMEPAGE="https://mgba.io"
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MPL-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug ffmpeg imagemagick opengl qt5 +sdl"
+REQUIRED_USE="|| ( qt5 sdl )
+ qt5? ( opengl )"
+
+RDEPEND="
+ dev-db/sqlite:3
+ media-libs/libpng:0=
+ sys-libs/zlib[minizip]
+ ffmpeg? ( virtual/ffmpeg )
+ imagemagick? ( media-gfx/imagemagick:= )
+ opengl? ( virtual/opengl )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtmultimedia:5
+ dev-qt/qtwidgets:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # Get rid of any bundled stuff we don't want
+ for pkg in libpng lzma sqlite3 zlib ; do
+ rm -r "${S}"/src/third-party/${pkg} || die
+ done
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_GL="$(usex opengl)"
+ -DBUILD_GLES=OFF
+ -DBUILD_PYTHON=OFF
+ -DBUILD_QT="$(usex qt5)"
+ -DBUILD_SDL="$(usex sdl)"
+ -DBUILD_SHARED=ON
+ # test suite fails to build (0.6.0)
+ -DBUILD_SUITE=OFF
+ -DBUILD_TEST=OFF
+ -DM_CORE_GB=ON
+ -DM_CORE_GBA=ON
+ -DUSE_DEBUGGERS="$(usex debug)"
+ -DUSE_EDITLINE="$(usex debug)"
+ -DUSE_EPOXY=OFF
+ -DUSE_FFMPEG="$(usex ffmpeg)"
+ -DUSE_GDB_STUB="$(usex debug)"
+ -DUSE_LIBZIP=OFF
+ -DUSE_LZMA=OFF
+ -DUSE_MAGICK="$(usex imagemagick)"
+ -DUSE_MINIZIP=ON
+ -DUSE_PNG=ON
+ # build fails with sqlite being disabled (0.6.0)
+ -DUSE_SQLITE3=ON
+ -DUSE_ZLIB=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ if use qt5 ; then
+ for size in 16 24 32 48 64 96 128 256; do
+ newicon -s ${size} res/${PN}-${size}.png ${PN}.png
+ done
+ doman doc/${PN}-qt.6
+ domenu res/${PN}-qt.desktop
+ dobin ../${P}_build/qt/${PN}-qt
+ fi
+ if use sdl ; then
+ doman doc/${PN}.6
+ newbin ../${P}_build/sdl/${PN} ${PN}-sdl
+ fi
+
+ dolib.so ../${P}_build/lib${PN}.so*
+}
+
+pkg_preinst() {
+ if use qt5 ; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use qt5 ; then
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+ fi
+}
+
+pkg_postrm() {
+ if use qt5 ; then
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+ fi
+}
diff --git a/games-emulation/mgba/mgba-0.6.2.ebuild b/games-emulation/mgba/mgba-0.6.2.ebuild
new file mode 100644
index 000000000000..bae8265e6962
--- /dev/null
+++ b/games-emulation/mgba/mgba-0.6.2.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils xdg-utils
+
+DESCRIPTION="Game Boy Advance emulator written in C"
+HOMEPAGE="https://mgba.io"
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug ffmpeg imagemagick opengl qt5 +sdl"
+REQUIRED_USE="|| ( qt5 sdl )
+ qt5? ( opengl )"
+
+RDEPEND="
+ dev-db/sqlite:3
+ media-libs/libpng:0=
+ sys-libs/zlib[minizip]
+ ffmpeg? ( virtual/ffmpeg )
+ imagemagick? ( media-gfx/imagemagick:= )
+ opengl? ( virtual/opengl )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtmultimedia:5
+ dev-qt/qtwidgets:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # Get rid of any bundled stuff we don't want
+ for pkg in libpng lzma sqlite3 zlib ; do
+ rm -r "${S}"/src/third-party/${pkg} || die
+ done
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_GL="$(usex opengl)"
+ -DBUILD_GLES=OFF
+ -DBUILD_PYTHON=OFF
+ -DBUILD_QT="$(usex qt5)"
+ -DBUILD_SDL="$(usex sdl)"
+ -DBUILD_SHARED=ON
+ # test suite fails to build (0.6.0)
+ -DBUILD_SUITE=OFF
+ -DBUILD_TEST=OFF
+ -DM_CORE_GB=ON
+ -DM_CORE_GBA=ON
+ -DUSE_DEBUGGERS="$(usex debug)"
+ -DUSE_EDITLINE="$(usex debug)"
+ -DUSE_EPOXY=OFF
+ -DUSE_FFMPEG="$(usex ffmpeg)"
+ -DUSE_GDB_STUB="$(usex debug)"
+ -DUSE_LIBZIP=OFF
+ -DUSE_LZMA=OFF
+ -DUSE_MAGICK="$(usex imagemagick)"
+ -DUSE_MINIZIP=ON
+ -DUSE_PNG=ON
+ # build fails with sqlite being disabled (0.6.0)
+ -DUSE_SQLITE3=ON
+ -DUSE_ZLIB=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ if use qt5 ; then
+ dobin ../${P}_build/qt/${PN}-qt
+ doman doc/${PN}-qt.6
+ domenu res/${PN}-qt.desktop
+ for size in 16 24 32 48 64 96 128 256; do
+ newicon -s ${size} res/${PN}-${size}.png ${PN}.png
+ done
+ fi
+ if use sdl ; then
+ doman doc/${PN}.6
+ newbin ../${P}_build/sdl/${PN} ${PN}-sdl
+ fi
+
+ dolib.so ../${P}_build/lib${PN}.so*
+}
+
+pkg_preinst() {
+ if use qt5 ; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use qt5 ; then
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+ fi
+}
+
+pkg_postrm() {
+ if use qt5 ; then
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+ fi
+}
diff --git a/games-emulation/mgba/mgba-0.6.3.ebuild b/games-emulation/mgba/mgba-0.6.3.ebuild
new file mode 100644
index 000000000000..c4859e9bec53
--- /dev/null
+++ b/games-emulation/mgba/mgba-0.6.3.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils xdg-utils
+
+DESCRIPTION="Game Boy Advance emulator written in C"
+HOMEPAGE="https://mgba.io"
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug ffmpeg imagemagick libav opengl qt5 +sdl"
+REQUIRED_USE="|| ( qt5 sdl )
+ qt5? ( opengl )"
+
+RDEPEND="
+ dev-db/sqlite:3
+ media-libs/libpng:0=
+ sys-libs/zlib[minizip]
+ ffmpeg? (
+ libav? ( media-video/libav:= )
+ !libav? ( media-video/ffmpeg:= )
+ )
+ imagemagick? ( media-gfx/imagemagick:= )
+ opengl? ( virtual/opengl )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtmultimedia:5
+ dev-qt/qtwidgets:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-qt511.patch"
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # Get rid of any bundled stuff we don't want
+ for pkg in libpng lzma sqlite3 zlib ; do
+ rm -r src/third-party/${pkg} || die
+ done
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_SKIP_RPATH=ON
+ -DBUILD_GL="$(usex opengl)"
+ -DBUILD_PYTHON=OFF
+ -DBUILD_QT="$(usex qt5)"
+ -DBUILD_SDL="$(usex sdl)"
+ -DBUILD_SHARED=ON
+ # test suite fails to build (0.6.0)
+ -DBUILD_SUITE=OFF
+ -DBUILD_TEST=OFF
+ -DM_CORE_GB=ON
+ -DM_CORE_GBA=ON
+ -DUSE_DEBUGGERS="$(usex debug)"
+ -DUSE_EDITLINE="$(usex debug)"
+ -DUSE_EPOXY=OFF
+ -DUSE_FFMPEG="$(usex ffmpeg)"
+ -DUSE_GDB_STUB="$(usex debug)"
+ -DUSE_LIBZIP=OFF
+ -DUSE_LZMA=OFF
+ -DUSE_MAGICK="$(usex imagemagick)"
+ -DUSE_MINIZIP=ON
+ -DUSE_PNG=ON
+ # build fails with sqlite being disabled (0.6.3)
+ -DUSE_SQLITE3=ON
+ -DUSE_ZLIB=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ if use qt5 ; then
+ dobin ../${P}_build/qt/${PN}-qt
+ doman doc/${PN}-qt.6
+ domenu res/${PN}-qt.desktop
+ for size in 16 24 32 48 64 96 128 256; do
+ newicon -s ${size} res/${PN}-${size}.png ${PN}.png
+ done
+ fi
+ if use sdl ; then
+ doman doc/${PN}.6
+ newbin ../${P}_build/sdl/${PN} ${PN}-sdl
+ fi
+
+ dolib.so ../${P}_build/lib${PN}.so*
+}
+
+pkg_preinst() {
+ if use qt5 ; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use qt5 ; then
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+ fi
+}
+
+pkg_postrm() {
+ if use qt5 ; then
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+ fi
+}
diff --git a/games-emulation/mupen64plus-2.5 b/games-emulation/mupen64plus-2.5
deleted file mode 100644
index 9b236d71e2c4..000000000000
--- a/games-emulation/mupen64plus-2.5
+++ /dev/null
@@ -1,10 +0,0 @@
-DEFINED_PHASES=-
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, meta-package
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-IUSE=+audio-sdl +input-sdl +rsp-hle +ui-console +ui-m64py +video-glide64mk2 +video-rice
-KEYWORDS=~amd64 ~x86
-LICENSE=metapackage
-RDEPEND=>=games-emulation/mupen64plus-core-2.5 audio-sdl? ( >=games-emulation/mupen64plus-audio-sdl-2.5 ) input-sdl? ( >=games-emulation/mupen64plus-input-sdl-2.5 ) rsp-hle? ( >=games-emulation/mupen64plus-rsp-hle-2.5 ) ui-console? ( >=games-emulation/mupen64plus-ui-console-2.5 ) ui-m64py? ( >=games-emulation/m64py-0.2.3-r1 ) video-glide64mk2? ( >=games-emulation/mupen64plus-video-glide64mk2-2.5 ) video-rice? ( >=games-emulation/mupen64plus-video-rice-2.5 )
-SLOT=0
-_md5_=0bfe7134bd0273fe075686f4f710d741
diff --git a/games-emulation/mupen64plus-audio-sdl-2.5 b/games-emulation/mupen64plus-audio-sdl-2.5
deleted file mode 100644
index 53232231b149..000000000000
--- a/games-emulation/mupen64plus-audio-sdl-2.5
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=>=games-emulation/mupen64plus-core-2.5:0= media-libs/libsdl2:0=[sound] libsamplerate? ( media-libs/libsamplerate:0= ) speex? ( media-libs/speex:0= ) virtual/pkgconfig
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, SDL audio plugin
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-IUSE=libsamplerate oss speex
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=>=games-emulation/mupen64plus-core-2.5:0= media-libs/libsdl2:0=[sound] libsamplerate? ( media-libs/libsamplerate:0= ) speex? ( media-libs/speex:0= )
-SLOT=0
-SRC_URI=https://github.com/mupen64plus/mupen64plus-audio-sdl/releases/download/2.5/mupen64plus-audio-sdl-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=6f04acbba408347c72c3452d004cce82
diff --git a/games-emulation/mupen64plus-audio-sdl/Manifest b/games-emulation/mupen64plus-audio-sdl/Manifest
new file mode 100644
index 000000000000..5178a9a602a2
--- /dev/null
+++ b/games-emulation/mupen64plus-audio-sdl/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-audio-sdl-src-2.5.tar.gz 26147 BLAKE2B bcd0c76d1e4fffb55940889c329574760101177c7cc48bb6ea9a361be01515ec15261bf1254a8c605db2ebf8166d323b43620e8f7c978cc79603be3ad537a191 SHA512 0c63e16449c40f15abdeed968383a218ed9876a92b2c15cbeb6554b20008d6d12996c0fd3bc1c502084791596b8535340596e95a11fe5d27576342740e76db6a
+EBUILD mupen64plus-audio-sdl-2.5.ebuild 1959 BLAKE2B bbc720d2b448e7c9894d8decc0c47e4695cc3c8d6f655f8fc664d8672e8972cb1277a696c5875b02a0d21b8af4c3460f7b3a26b4788c7ce3425402c547a93bf2 SHA512 4dcc0513f5f40de0d0a0603b3c391b827f78fc217ea255c8c4378c41dfe82c8f6efc5c7533fc18c9c54489a8639211f95804c6f1c747e73aeafca8c758ac56fb
+MISC metadata.xml 345 BLAKE2B b5b03b304e1491135b6d30001afe6bd57e29873222bb41cbb4d9d47fd77be1581544139cf4800ad4f15afb4cbd0b9da167b2a6cb3242a2ce0e0689b7b88e6c1c SHA512 f6e02ffd8784ef686cea561d75bac4a5f231fa62e72a089380707663a738e3d10b1f134cce40cc8d60e36cf90ab9303971996b16797253f6509960873e787f2d
diff --git a/games-emulation/mupen64plus-audio-sdl/metadata.xml b/games-emulation/mupen64plus-audio-sdl/metadata.xml
new file mode 100644
index 000000000000..98ab28b06ff8
--- /dev/null
+++ b/games-emulation/mupen64plus-audio-sdl/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mupen64plus/mupen64plus-audio-sdl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-audio-sdl/mupen64plus-audio-sdl-2.5.ebuild b/games-emulation/mupen64plus-audio-sdl/mupen64plus-audio-sdl-2.5.ebuild
new file mode 100644
index 000000000000..9ddb524fc2d5
--- /dev/null
+++ b/games-emulation/mupen64plus-audio-sdl/mupen64plus-audio-sdl-2.5.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, SDL audio plugin"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="libsamplerate oss speex"
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.5:0=
+ media-libs/libsdl2:0=[sound]
+ libsamplerate? ( media-libs/libsamplerate:0= )
+ speex? ( media-libs/speex:0= )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+
+ # Package-specific stuff
+
+ # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
+ SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
+ SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
+
+ NO_SPEEX=$(usex speex 0 1)
+ NO_SRC=$(usex libsamplerate 0 1)
+ NO_OSS=$(usex oss 0 1)
+ # not packaged (https://github.com/nemomobile/libaudioresource)
+ USE_AUDIORESOURCE=0
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+}
diff --git a/games-emulation/mupen64plus-core-2.5-r1 b/games-emulation/mupen64plus-core-2.5-r1
deleted file mode 100644
index e29ce61a16ae..000000000000
--- a/games-emulation/mupen64plus-core-2.5-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=media-libs/libpng:0= media-libs/libsdl2:0=[joystick,opengl,video] sys-libs/zlib:0=[minizip] lirc? ( app-misc/lirc:0 ) osd? ( media-fonts/dejavu media-libs/freetype:2= virtual/opengl:0= virtual/glu:0= ) !<games-emulation/mupen64plus-2.0 virtual/pkgconfig
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, core library
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-IUSE=debugger gles2 lirc new-dynarec +osd cpu_flags_x86_sse
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=media-libs/libpng:0= media-libs/libsdl2:0=[joystick,opengl,video] sys-libs/zlib:0=[minizip] lirc? ( app-misc/lirc:0 ) osd? ( media-fonts/dejavu media-libs/freetype:2= virtual/opengl:0= virtual/glu:0= ) !<games-emulation/mupen64plus-2.0 !<games-emulation/m64py-0.2.3-r1 !<games-emulation/mupen64plus-audio-sdl-2.5 !<games-emulation/mupen64plus-input-sdl-2.5 !<games-emulation/mupen64plus-ui-console-2.5 !<games-emulation/mupen64plus-video-glide64mk2-2.5 !<games-emulation/mupen64plus-video-rice-2.5
-REQUIRED_USE=gles2? ( !osd )
-SLOT=0/2-sdl2
-SRC_URI=https://github.com/mupen64plus/mupen64plus-core/releases/download/2.5/mupen64plus-core-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=6bc928fa22b99c861fd86d854ae362de
diff --git a/games-emulation/mupen64plus-core/Manifest b/games-emulation/mupen64plus-core/Manifest
new file mode 100644
index 000000000000..05e71b1c2773
--- /dev/null
+++ b/games-emulation/mupen64plus-core/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-core-src-2.5.tar.gz 895890 BLAKE2B 08b55ff5b985838eed19b680635fec074d06aa20366bcc41c512173120b0f76b0cec691d0ee2b02b19eccce03f951c528df30ecbf440601629a5df92fa34db03 SHA512 1bf643798de4f17e2ce4f2a67dfd242a8b24d873c413b49cbcb280e4264131222e3f3bc02c46111868102b0b5174d117ababceab66551cb38b76b22b3a94f697
+EBUILD mupen64plus-core-2.5-r1.ebuild 2741 BLAKE2B 0e72eff2cd6936ad0e0078d8781fb92323acffe3dc54828dddfbeb941258a91096879bf0a4b3e9d29b5859030ba0297d1eee8b6a6080b751e98f031caca53c25 SHA512 b2afc35676acd02b99048331174ab8e8518d9f7c11f9e22b7794769685d31ed0c77d9e4e671cac70fc54cbd2ba291bd225c8837501f833e81e3bfb86cc8d2a3a
+MISC metadata.xml 958 BLAKE2B 33daa914e745751489e0b44160e14b6c9d065b0119872b0c4989b71d3ab7cdba9fdad1381f3248651542f7f31f14fdd9831726abc5c6b9255cf2ee4158c20527 SHA512 f6cc31a8d152fc50d9bbb285acc34e04f6ffb4f4b1ed9e0fe572183c68d382f757a18f6ed00b76ab90a5204afc1712d02f92194b714330548f73f1015541b7ae
diff --git a/games-emulation/mupen64plus-core/metadata.xml b/games-emulation/mupen64plus-core/metadata.xml
new file mode 100644
index 000000000000..b4eccd857610
--- /dev/null
+++ b/games-emulation/mupen64plus-core/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="debugger">Build the debugger</flag>
+ <flag name="gles2">Use GLES2 instead of OpenGL</flag>
+ <flag name="new-dynarec">Enable new experimental dynamic recompiler implementation (only for x86 and arm)</flag>
+ <flag name="osd">Overlay emulator messages using on-screen-display</flag>
+ </use>
+ <longdescription>Mupen64Plus is a plugin-based N64 emulator for Linux which is capable of accurately playing many games.
+Included are four MIPS R4300 CPU emulators, with dynamic recompilers for 32-bit x86 and 64-bit amd64 systems.</longdescription>
+ <upstream>
+ <remote-id type="google-code">mupen64plus</remote-id>
+ <remote-id type="github">mupen64plus/mupen64plus-core</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-core/mupen64plus-core-2.5-r1.ebuild b/games-emulation/mupen64plus-core/mupen64plus-core-2.5-r1.ebuild
new file mode 100644
index 000000000000..8efaa9ff810e
--- /dev/null
+++ b/games-emulation/mupen64plus-core/mupen64plus-core-2.5-r1.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, core library"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0/2-sdl2"
+KEYWORDS="~amd64 ~x86"
+IUSE="debugger gles2 lirc new-dynarec +osd cpu_flags_x86_sse"
+
+RDEPEND="media-libs/libpng:0=
+ media-libs/libsdl2:0=[joystick,opengl,video]
+ sys-libs/zlib:0=[minizip]
+ lirc? ( app-misc/lirc:0 )
+ osd? (
+ media-fonts/dejavu
+ media-libs/freetype:2=
+ virtual/opengl:0=
+ virtual/glu:0=
+ )
+ !<games-emulation/mupen64plus-2.0"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+# block versions using SDL1
+RDEPEND="${RDEPEND}
+ !<games-emulation/m64py-0.2.3-r1
+ !<games-emulation/mupen64plus-audio-sdl-2.5
+ !<games-emulation/mupen64plus-input-sdl-2.5
+ !<games-emulation/mupen64plus-ui-console-2.5
+ !<games-emulation/mupen64plus-video-glide64mk2-2.5
+ !<games-emulation/mupen64plus-video-rice-2.5"
+
+REQUIRED_USE="gles2? ( !osd )"
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+
+ # Package-specific stuff
+
+ # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
+ SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
+ SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
+
+ OSD=$(usex osd 1 0)
+ NO_ASM=$(usex cpu_flags_x86_sse 0 1)
+ LIRC=$(usex lirc 1 0)
+ DEBUGGER=$(usex debugger 1 0)
+ NEW_DYNAREC=$(usex new-dynarec 1 0)
+ USE_GLES=$(usex gles2 1 0)
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+ dodoc -r doc/{emuwiki-api-doc,new_dynarec.txt}
+
+ # replace bundled font with a symlink
+ # TODO: fix the code to not rely on it
+ local font_path=/usr/share/mupen64plus/font.ttf
+ rm "${D%/}/${font_path}" || die
+ if use osd; then
+ dosym /usr/share/fonts/dejavu/DejaVuSans.ttf "${font_path}"
+ fi
+}
diff --git a/games-emulation/mupen64plus-input-sdl-2.5 b/games-emulation/mupen64plus-input-sdl-2.5
deleted file mode 100644
index a125ad9ac447..000000000000
--- a/games-emulation/mupen64plus-input-sdl-2.5
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=>=games-emulation/mupen64plus-core-2.5:0= media-libs/libsdl2:0=[joystick] virtual/pkgconfig
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, SDL input plugin
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=>=games-emulation/mupen64plus-core-2.5:0= media-libs/libsdl2:0=[joystick]
-SLOT=0
-SRC_URI=https://github.com/mupen64plus/mupen64plus-input-sdl/releases/download/2.5/mupen64plus-input-sdl-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=93fcc1aa97d0e70b329472c88b93ea55
diff --git a/games-emulation/mupen64plus-input-sdl/Manifest b/games-emulation/mupen64plus-input-sdl/Manifest
new file mode 100644
index 000000000000..6def5f917f8a
--- /dev/null
+++ b/games-emulation/mupen64plus-input-sdl/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-input-sdl-src-2.5.tar.gz 50580 BLAKE2B ab75c6e200c2979c75d35082a426266e7f835e0731058f8013d8788802ab9d65363b8820326fbfedc0b384facfaeccf6e04da66e01f79aee3d420f3ebe385461 SHA512 014a5e21feb88b14bcee44a74556a257393b799745308421a611eb3b6c11a390a589fdd393f07e69a128ca60426d4dcf8847bcbabed77b0d570be282550148d6
+EBUILD mupen64plus-input-sdl-2.5.ebuild 1681 BLAKE2B 5eb74028c1914c4057e43fbb5a195111f22a9593db41519ebe7a189d4264791ccb8b3672c79b9f60f5923c50e6c8209c6dd9fb93b12c989058a395c649a5a0db SHA512 42ac79a06506801717db1692bc86813a5737ebafceebfa1e498cd0bef25abc58fe55b28897230a70cdf870ec01e80f079203f4ed2618055e2b820f8163177e46
+MISC metadata.xml 345 BLAKE2B ad9e66275eecd48b36aea9d14bea0b3651adcafdccc82542761d9c8bf2636f2c56f31b7d4e451bbdf0108de016d923b998f59a4ed774a2becb1cde66bf95dd01 SHA512 52f335099ec233825167226c8c15e6b270820eb111c8b89bcb91a4606f7b1d1d79ed12f41ac5ee69d973137c618f038ff55e395097fb1f1517692083ca86c294
diff --git a/games-emulation/mupen64plus-input-sdl/metadata.xml b/games-emulation/mupen64plus-input-sdl/metadata.xml
new file mode 100644
index 000000000000..92306ce86d63
--- /dev/null
+++ b/games-emulation/mupen64plus-input-sdl/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mupen64plus/mupen64plus-input-sdl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-input-sdl/mupen64plus-input-sdl-2.5.ebuild b/games-emulation/mupen64plus-input-sdl/mupen64plus-input-sdl-2.5.ebuild
new file mode 100644
index 000000000000..fe28b341357a
--- /dev/null
+++ b/games-emulation/mupen64plus-input-sdl/mupen64plus-input-sdl-2.5.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, SDL input plugin"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.5:0=
+ media-libs/libsdl2:0=[joystick]"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+
+ # Package-specific stuff
+
+ # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
+ SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
+ SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+}
diff --git a/games-emulation/mupen64plus-rsp-hle-2.5 b/games-emulation/mupen64plus-rsp-hle-2.5
deleted file mode 100644
index 7f2c8e5f460e..000000000000
--- a/games-emulation/mupen64plus-rsp-hle-2.5
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=>=games-emulation/mupen64plus-core-2.0-r1:0=
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, HLE RSP plugin
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=>=games-emulation/mupen64plus-core-2.0-r1:0=
-SLOT=0
-SRC_URI=https://github.com/mupen64plus/mupen64plus-rsp-hle/releases/download/2.5/mupen64plus-rsp-hle-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=5f473a5c30f5b7e2e0e7b0902364281a
diff --git a/games-emulation/mupen64plus-rsp-hle/Manifest b/games-emulation/mupen64plus-rsp-hle/Manifest
new file mode 100644
index 000000000000..e5c156f654bb
--- /dev/null
+++ b/games-emulation/mupen64plus-rsp-hle/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-rsp-hle-src-2.5.tar.gz 46998 BLAKE2B 3bb5ee627fa4c367e7dd1ef0ac0a1eae1267cf82ac66a35f4dcd972703b9cba832224cab1be20c75e9f61af2afae0c8eb7dd6ba806a47c57eef6e6c5da9e8a5a SHA512 564d96050890cc61df05163f99a0be8198e870f0d4071e87828bf58b283b2be8ca7de20ed03482ea8c45725bdd6f6baea618c068cced407892cf2add6ef373c6
+EBUILD mupen64plus-rsp-hle-2.5.ebuild 1435 BLAKE2B 5568b185559e3c6a5785f696fe81c612df394fef03322a365aca1d0f8d566ba8192d84fd7884cf423fefc66d45a026ead20ef834e6bff730f339e7f033c9672e SHA512 27e3c65ff9d57bf70dc9894f3e90962971d069aecc06f7c9db2dadae82af36f1fb0d2bbe10c70a8f8ce01378382ca8216ca05c7d9aab4ec9ded7ce919021eaba
+MISC metadata.xml 343 BLAKE2B 997f47a4d8c1fccab5b16dd49ab4e791ec1ae114b820ad75839f981e9a72f409951a22abfbb68788ade5dcb1be2dd91aba4fc9771c00519307ee28455ab7aa9d SHA512 7ffba7fdacc44215dba6cf994646ea38ebf94870accc3d6150ca609fcf5dc7b343a52fe6fc0511e5741f24afc20b11c2e1104d39215f7cffdeaf1098efaf709e
diff --git a/games-emulation/mupen64plus-rsp-hle/metadata.xml b/games-emulation/mupen64plus-rsp-hle/metadata.xml
new file mode 100644
index 000000000000..58ffff278779
--- /dev/null
+++ b/games-emulation/mupen64plus-rsp-hle/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mupen64plus/mupen64plus-rsp-hle</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-rsp-hle/mupen64plus-rsp-hle-2.5.ebuild b/games-emulation/mupen64plus-rsp-hle/mupen64plus-rsp-hle-2.5.ebuild
new file mode 100644
index 000000000000..b326e6251588
--- /dev/null
+++ b/games-emulation/mupen64plus-rsp-hle/mupen64plus-rsp-hle-2.5.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, HLE RSP plugin"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.0-r1:0="
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+}
diff --git a/games-emulation/mupen64plus-ui-console-2.5-r1 b/games-emulation/mupen64plus-ui-console-2.5-r1
deleted file mode 100644
index 53c544344be6..000000000000
--- a/games-emulation/mupen64plus-ui-console-2.5-r1
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install postinst postrm prepare
-DEPEND=>=games-emulation/mupen64plus-core-2.0-r1:0= media-libs/libsdl2:0= !<games-emulation/mupen64plus-2.0 virtual/pkgconfig >=sys-apps/sed-4
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, console UI
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=>=games-emulation/mupen64plus-core-2.0-r1:0= media-libs/libsdl2:0= !<games-emulation/mupen64plus-2.0
-SLOT=0
-SRC_URI=https://github.com/mupen64plus/mupen64plus-ui-console/releases/download/2.5/mupen64plus-ui-console-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=ab30292f029625c7da94c297694edf70
diff --git a/games-emulation/mupen64plus-ui-console/Manifest b/games-emulation/mupen64plus-ui-console/Manifest
new file mode 100644
index 000000000000..4e31b84ce720
--- /dev/null
+++ b/games-emulation/mupen64plus-ui-console/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-ui-console-src-2.5.tar.gz 47852 BLAKE2B 060d93c82b63c5870feffd665513d3a9046c3583103ccd16014865b621f33e2eafc93af5813332ab9416c4b01b6f767ed8b4ff4d08939abee60193638ce9cdb5 SHA512 70293a768c2bc5f80a2f71db229021d497d675536f5dc5eb098f91b62081f993f308d410adebce208a89880f57b037d5b42fa2f95c42ce94ffe2fca326a53046
+EBUILD mupen64plus-ui-console-2.5-r1.ebuild 1972 BLAKE2B fbac239e530710cc18c847be2464b13ff491b00cfb585276058f9a5b81b2817ee3e2603f5aa1ed8cdbd4e4da9cc30c7aed50732b4b463a26fce35c5f3bed8e20 SHA512 bdcc0d134c8bc1651443e671ffe99ad2de7ad2ad6a32643b560fd260522602045e386ead435bc3d927f3864129a7efb7a5f83e404bc29e88c0cf9b484d9b092a
+MISC metadata.xml 346 BLAKE2B 823a53023d0e1834cac987cde3eebf3164767e2793ef0805c28c90a04f040b6d34d8acb8d1f28a528f74b0c269a99bfe8b7d648c5c38c6a89df59846096b79fe SHA512 2e43f2c7bd5fdfffbf8c9ece665093b942d1e3c76b27f851fff7de030ecfc0f38e82e730740e1688413b47e0ba1b752f96ebcd1d1c2a6107bcbd8185630db4c8
diff --git a/games-emulation/mupen64plus-ui-console/metadata.xml b/games-emulation/mupen64plus-ui-console/metadata.xml
new file mode 100644
index 000000000000..1e1acf03361b
--- /dev/null
+++ b/games-emulation/mupen64plus-ui-console/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mupen64plus/mupen64plus-ui-console</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-ui-console/mupen64plus-ui-console-2.5-r1.ebuild b/games-emulation/mupen64plus-ui-console/mupen64plus-ui-console-2.5-r1.ebuild
new file mode 100644
index 000000000000..d937a15d77d5
--- /dev/null
+++ b/games-emulation/mupen64plus-ui-console/mupen64plus-ui-console-2.5-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils gnome2-utils multilib toolchain-funcs xdg-utils
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, console UI"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.0-r1:0=
+ media-libs/libsdl2:0=
+ !<games-emulation/mupen64plus-2.0"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+
+ # avoid appending -fPIE/-fno-PIE
+ sed -i -e '/^if.*PIE/,/endif/d' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+
+ # Package-specific stuff
+
+ # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
+ SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
+ SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/mupen64plus-video-glide64mk2-2.5 b/games-emulation/mupen64plus-video-glide64mk2-2.5
deleted file mode 100644
index fc80109a281b..000000000000
--- a/games-emulation/mupen64plus-video-glide64mk2-2.5
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=>=games-emulation/mupen64plus-core-2.5:0=[gles2=] media-libs/libpng:0= media-libs/libsdl2:0= media-libs/libtxc_dxtn sys-libs/zlib:0= virtual/opengl:0= hires? ( dev-libs/boost:0= ) virtual/pkgconfig
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, glide64mk2 video plugin
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-IUSE=gles2 hires cpu_flags_x86_sse
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=>=games-emulation/mupen64plus-core-2.5:0=[gles2=] media-libs/libpng:0= media-libs/libsdl2:0= media-libs/libtxc_dxtn sys-libs/zlib:0= virtual/opengl:0= hires? ( dev-libs/boost:0= )
-SLOT=0
-SRC_URI=https://github.com/mupen64plus/mupen64plus-video-glide64mk2/releases/download/2.5/mupen64plus-video-glide64mk2-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=055799d71257a33e6fdbe8f2b2b7c882
diff --git a/games-emulation/mupen64plus-video-glide64mk2/Manifest b/games-emulation/mupen64plus-video-glide64mk2/Manifest
new file mode 100644
index 000000000000..0d69e8187de0
--- /dev/null
+++ b/games-emulation/mupen64plus-video-glide64mk2/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-video-glide64mk2-src-2.5.tar.gz 488988 BLAKE2B 7d88125032190906bb39b93ae4c5b92e124a6e151d06e2e0d9650e86ffd3b2c455e30c9d801bbdb46cb3182078dd77fb624e3c80180e83b15f1feb57299ecb7a SHA512 b62620a364ca9e6bf729e5dd07fb84a73745c6533b95468d3f5411c0556824282f760efefea0968b0a9282f77c315bbed8b0b8a59d771893b7fd0f5f24ad725d
+EBUILD mupen64plus-video-glide64mk2-2.5.ebuild 1976 BLAKE2B faabe3e36cfd298620115f2fb72cd87816bc8e8330eb6898ea4f338bb411de54a8ea0c14354dbd32cdbae9bc11bbd8e89e251fe04d7ad1fcd8fa78c08aec545c SHA512 36a21322c9a3c0c92affca2caece4fb9a7f668fd9aa1100415f11e03dee4ee83d35afd85fb6e8eb0a073a70e479310bb710aecb950b713f3fd4ec6087ab2811c
+MISC metadata.xml 519 BLAKE2B 813c2f38ed09e91141b852fa42ac0b979878f7cc3496a9156c422efaac15503e5f5e0bf35f0583cc4011e041a09048add83655da0e96fb35129ae9b0004f03fd SHA512 6b8cf03f4eca8e66800437e90dc66febe000fb6d1710bbac2c6f4b9d83da4c6757baecda7b49bb5b44a524c7d9f48d61b593f88ade68269587a0068ca724415e
diff --git a/games-emulation/mupen64plus-video-glide64mk2/metadata.xml b/games-emulation/mupen64plus-video-glide64mk2/metadata.xml
new file mode 100644
index 000000000000..5bca97be8c20
--- /dev/null
+++ b/games-emulation/mupen64plus-video-glide64mk2/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="gles2">Use GLES2 instead of OpenGL</flag>
+ <flag name="hires">Support hi-resolution textures (requires <pkg>dev-libs/boost</pkg>)</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mupen64plus/mupen64plus-video-glide64mk2</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-video-glide64mk2/mupen64plus-video-glide64mk2-2.5.ebuild b/games-emulation/mupen64plus-video-glide64mk2/mupen64plus-video-glide64mk2-2.5.ebuild
new file mode 100644
index 000000000000..47744ad551a9
--- /dev/null
+++ b/games-emulation/mupen64plus-video-glide64mk2/mupen64plus-video-glide64mk2-2.5.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, glide64mk2 video plugin"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="gles2 hires cpu_flags_x86_sse"
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.5:0=[gles2=]
+ media-libs/libpng:0=
+ media-libs/libsdl2:0=
+ media-libs/libtxc_dxtn
+ sys-libs/zlib:0=
+ virtual/opengl:0=
+ hires? ( dev-libs/boost:0= )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+
+ # Package-specific stuff
+
+ # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
+ SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
+ SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
+
+ NOSSE=$(usex cpu_flags_x86_sse 0 1)
+ HIRES=$(usex hires 1 0)
+ USE_FRAMESKIPPER=1
+ USE_GLES=$(usex gles2 1 0)
+ # use external lib
+ TXCDXTN=1
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+}
diff --git a/games-emulation/mupen64plus-video-rice-2.5 b/games-emulation/mupen64plus-video-rice-2.5
deleted file mode 100644
index 4b5952ee8db0..000000000000
--- a/games-emulation/mupen64plus-video-rice-2.5
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=>=games-emulation/mupen64plus-core-2.5:0=[gles2=] media-libs/libpng:0= media-libs/libsdl2:0=[video] virtual/opengl:0= virtual/pkgconfig
-DESCRIPTION=A fork of Mupen64 Nintendo 64 emulator, rice video plugin
-EAPI=5
-HOMEPAGE=http://www.mupen64plus.org/
-IUSE=gles2 cpu_flags_x86_sse
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2 LGPL-2.1
-RDEPEND=>=games-emulation/mupen64plus-core-2.5:0=[gles2=] media-libs/libpng:0= media-libs/libsdl2:0=[video] virtual/opengl:0=
-SLOT=0
-SRC_URI=https://github.com/mupen64plus/mupen64plus-video-rice/releases/download/2.5/mupen64plus-video-rice-src-2.5.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=7adc3a37f116b57447a3c821507be4b7
diff --git a/games-emulation/mupen64plus-video-rice/Manifest b/games-emulation/mupen64plus-video-rice/Manifest
new file mode 100644
index 000000000000..f306995e878f
--- /dev/null
+++ b/games-emulation/mupen64plus-video-rice/Manifest
@@ -0,0 +1,3 @@
+DIST mupen64plus-video-rice-src-2.5.tar.gz 339012 BLAKE2B 861f350376e92c24a31955cc39ba33abef9930d4fd598619fd0a6b7ff746b1bb71e1644dfed3aebab902b09c4fcbd1a1755475b11676c6070fe92ea4f30b4802 SHA512 d3e9c3b3097ca9b9d896498bb34374a14ec1948fce8b795e755bb13a88f3066289fe2500666b4057e719bf3f1b38b840f8a60eaeccdcdddfab69b1986c953d61
+EBUILD mupen64plus-video-rice-2.5.ebuild 1820 BLAKE2B dff3baf352a73257784d60429f87ccb840c974dc553d6d1094d1108aa2b6393cccf46422735d468f892b63e1fd3fe28bd2ca6c6536c6f01778e9567e087848d6 SHA512 52ae832baee4ef50de0f9c7584b3dacfa46230f8eba9bcb1b81ee5782ccb22abc4afb9c7119702d0ef4cf4861b7528ad4f358380e93139de98489b13f82141f4
+MISC metadata.xml 417 BLAKE2B 8510b7d913205c08c30afab179d14342bef943520adc195a25dba626d2e24406cb7108c0fcf6c0f0648612d8f9c458661aee4cef60b7b44fb30eccfc10926615 SHA512 620411630a55162b14abef6e6b62a5621de4d53e8bf467faa07f4aa114d7e4be4123f5ef9033cbbe04635e71255ad63f16303eb7b511a3ce151627e54d7d3bb6
diff --git a/games-emulation/mupen64plus-video-rice/metadata.xml b/games-emulation/mupen64plus-video-rice/metadata.xml
new file mode 100644
index 000000000000..6df8a44e7777
--- /dev/null
+++ b/games-emulation/mupen64plus-video-rice/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="gles2">Use GLES2 instead of OpenGL</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mupen64plus/mupen64plus-video-rice</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus-video-rice/mupen64plus-video-rice-2.5.ebuild b/games-emulation/mupen64plus-video-rice/mupen64plus-video-rice-2.5.ebuild
new file mode 100644
index 000000000000..a616be06c375
--- /dev/null
+++ b/games-emulation/mupen64plus-video-rice/mupen64plus-video-rice-2.5.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P=${PN}-src-${PV}
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, rice video plugin"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="gles2 cpu_flags_x86_sse"
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.5:0=[gles2=]
+ media-libs/libpng:0=
+ media-libs/libsdl2:0=[video]
+ virtual/opengl:0="
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch_user
+
+ # avoid implicitly appending CPU flags
+ sed -i -e 's:-mmmx::g' -e 's:-msse::g' projects/unix/Makefile || die
+}
+
+src_compile() {
+ MAKEARGS=(
+ # Note: please keep this in sync in all of mupen64plus-* packages
+
+ -C projects/unix
+
+ # this basically means: GNU userspace
+ UNAME=Linux
+
+ # verbose output
+ V=1
+
+ CROSS_COMPILE="${CHOST}-"
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ # usual CFLAGS, CXXFLAGS and LDFLAGS are respected
+ # so we can leave OPTFLAGS empty
+ OPTFLAGS=
+
+ # paths, some of them are used at compile time
+ PREFIX=/usr
+ LIBDIR=/usr/$(get_libdir)
+
+ # disable unwanted magic
+ LDCONFIG=:
+ INSTALL_STRIP_FLAG=
+
+ # Package-specific stuff
+
+ # CROSS_COMPILE causes it to look for ${CHOST}-sdl2-config...
+ SDL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags sdl2)"
+ SDL_LDLIBS="$($(tc-getPKG_CONFIG) --libs sdl2)"
+
+ NO_ASM=$(usex cpu_flags_x86_sse 0 1)
+ USE_GLES=$(usex gles2 1 0)
+ )
+
+ use amd64 && MAKEARGS+=( HOST_CPU=x86_64 )
+ use x86 && MAKEARGS+=( HOST_CPU=i386 )
+
+ emake "${MAKEARGS[@]}" all
+}
+
+src_install() {
+ emake "${MAKEARGS[@]}" DESTDIR="${D}" install
+ einstalldocs
+}
diff --git a/games-emulation/mupen64plus/Manifest b/games-emulation/mupen64plus/Manifest
new file mode 100644
index 000000000000..296c18f18523
--- /dev/null
+++ b/games-emulation/mupen64plus/Manifest
@@ -0,0 +1,2 @@
+EBUILD mupen64plus-2.5.ebuild 850 BLAKE2B c1079b7f95589a9d06483223ff372c2c48a2bf1324b961b537bef75b38339c40969b29f5c252e81c5bd5d7dfebba25c94a73eda1ff535e02e52a5c06c5193e22 SHA512 db172c94bc00f77f37ec07ef03b02f44185c6cd9506d989851a1a7decabe560187eaf460968f60482ec7e8a82e5e7f9ebf4aebf7fec4fdc17d3c360773d8d820
+MISC metadata.xml 1214 BLAKE2B 620c4867d48518b47582ae9ca358e96f73560cae3546ff9903833b0a8f03ad07f2823327a40437bbfd47327420162fabd03c0506cf2e96a2c0b4a813d3eb37d1 SHA512 d52568e17fa4514918c819979277d268a6668ae6962c3d1fe3d0f9287c5189fdff35c63d46d4f86c4a7f2b11ac46c38801d583b939ce8857cd7b43a6572adaed
diff --git a/games-emulation/mupen64plus/metadata.xml b/games-emulation/mupen64plus/metadata.xml
new file mode 100644
index 000000000000..4c302cc76984
--- /dev/null
+++ b/games-emulation/mupen64plus/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="audio-sdl">Enable SDL audio plugin.</flag>
+ <flag name="input-sdl">Enable SDL input plugin.</flag>
+ <flag name="rsp-hle">Enable HLE RSP plugin.</flag>
+ <flag name="ui-console">Enable default console UI.</flag>
+ <flag name="ui-m64py">Enable PyQt5 UI using <pkg>games-emulation/m64py</pkg>.</flag>
+ <flag name="video-glide64mk2">Enable Glide64mk2 video plugin.</flag>
+ <flag name="video-rice">Enable Rice video plugin.</flag>
+ </use>
+ <longdescription>Mupen64Plus is a plugin-based N64 emulator for Linux which is capable of accurately playing many games.
+Included are four MIPS R4300 CPU emulators, with dynamic recompilers for 32-bit x86 and 64-bit amd64 systems,
+and necessary plugins for audio, graphical rendering (RDP), signal co-processor (RSP), and input.
+There are 3 OpenGL video plugins included: glN64, RiceVideoLinux, and Glide64.</longdescription>
+ <upstream>
+ <remote-id type="google-code">mupen64plus</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/mupen64plus/mupen64plus-2.5.ebuild b/games-emulation/mupen64plus/mupen64plus-2.5.ebuild
new file mode 100644
index 000000000000..f52987e83a17
--- /dev/null
+++ b/games-emulation/mupen64plus/mupen64plus-2.5.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, meta-package"
+HOMEPAGE="http://www.mupen64plus.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+audio-sdl +input-sdl +rsp-hle +ui-console +ui-m64py +video-glide64mk2 +video-rice"
+
+RDEPEND=">=games-emulation/mupen64plus-core-2.5
+ audio-sdl? ( >=games-emulation/mupen64plus-audio-sdl-2.5 )
+ input-sdl? ( >=games-emulation/mupen64plus-input-sdl-2.5 )
+ rsp-hle? ( >=games-emulation/mupen64plus-rsp-hle-2.5 )
+ ui-console? ( >=games-emulation/mupen64plus-ui-console-2.5 )
+ ui-m64py? ( >=games-emulation/m64py-0.2.3-r1 )
+ video-glide64mk2? ( >=games-emulation/mupen64plus-video-glide64mk2-2.5 )
+ video-rice? ( >=games-emulation/mupen64plus-video-rice-2.5 )"
diff --git a/games-emulation/nestopia-1.47_p20170105 b/games-emulation/nestopia-1.47_p20170105
deleted file mode 100644
index 68b99586b086..000000000000
--- a/games-emulation/nestopia-1.47_p20170105
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test unpack
-DEPEND=app-arch/libarchive:= media-libs/libao media-libs/libepoxy media-libs/libsdl2[sound,joystick,video] sys-libs/zlib gui? ( x11-libs/gtk+:3 ) virtual/pkgconfig sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4
-DESCRIPTION=A portable Nintendo Entertainment System emulator written in C++
-EAPI=6
-HOMEPAGE=http://0ldsk00l.ca/nestopia/
-IUSE=doc gui
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2+
-RDEPEND=app-arch/libarchive:= media-libs/libao media-libs/libepoxy media-libs/libsdl2[sound,joystick,video] sys-libs/zlib gui? ( x11-libs/gtk+:3 )
-SLOT=0
-SRC_URI=https://github.com/rdanbrook/nestopia/archive/d7fae2aff1a93eac997d2b480652a1d068a2b6cf.tar.gz -> nestopia-1.47_p20170105.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf vcs-snapshot 3be1ab44131e8c0bbdaa75823008444b xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=8aca9eda0fdf2b88359f654cc66861b4
diff --git a/games-emulation/nestopia-9999 b/games-emulation/nestopia-9999
deleted file mode 100644
index 5f7949591ec3..000000000000
--- a/games-emulation/nestopia-9999
+++ /dev/null
@@ -1,11 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test unpack
-DEPEND=app-arch/libarchive:= media-libs/libao media-libs/libepoxy media-libs/libsdl2[sound,joystick,video] sys-libs/zlib gui? ( x11-libs/gtk+:3 ) virtual/pkgconfig sys-devel/make >=dev-util/cmake-3.9.6 >=sys-apps/sed-4 >=dev-vcs/git-1.8.2.1[curl]
-DESCRIPTION=A portable Nintendo Entertainment System emulator written in C++
-EAPI=6
-HOMEPAGE=http://0ldsk00l.ca/nestopia/
-IUSE=doc gui
-LICENSE=GPL-2+
-RDEPEND=app-arch/libarchive:= media-libs/libao media-libs/libepoxy media-libs/libsdl2[sound,joystick,video] sys-libs/zlib gui? ( x11-libs/gtk+:3 )
-SLOT=0
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 git-r3 8f6de46b0aa318aea0e8cac62ece098b gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=8aca9eda0fdf2b88359f654cc66861b4
diff --git a/games-emulation/nestopia/Manifest b/games-emulation/nestopia/Manifest
new file mode 100644
index 000000000000..247412e32beb
--- /dev/null
+++ b/games-emulation/nestopia/Manifest
@@ -0,0 +1,4 @@
+DIST nestopia-1.47_p20170105.tar.gz 1283456 BLAKE2B 50e70f6f952e3b11b056e398b1b83ffd9458e89a877a8a05c4f9360f047c3a8e1edff2a1316a5d3967db050705dee066bae3452743985b7ce438294fe31d6b78 SHA512 58d1a932a6b90589c66503b2013b1a8162072e77e0416851a1430fa146e7fd85ff7363b70292c69d4c4513e3750aa53436a312c0240a843e42fbb89b554e7a70
+EBUILD nestopia-1.47_p20170105.ebuild 1082 BLAKE2B 6e30ba349b4995b866a9f4fde1b5fe497e5031e6e61556310baa68cdf91cc5acd40c173fb62377d5f9e0dc18f17c344c80c1fdd3517c709c680555ad5fa925a1 SHA512 4b15b0fa719b37017cd6cb06bea788ab3a573d2c6ff94c1b63f753d1cff0ce37d8adae034c387dcb76cbefd65234fda5d4da9fdc9c3eff0d896a663b47e3c91f
+EBUILD nestopia-9999.ebuild 1082 BLAKE2B 6e30ba349b4995b866a9f4fde1b5fe497e5031e6e61556310baa68cdf91cc5acd40c173fb62377d5f9e0dc18f17c344c80c1fdd3517c709c680555ad5fa925a1 SHA512 4b15b0fa719b37017cd6cb06bea788ab3a573d2c6ff94c1b63f753d1cff0ce37d8adae034c387dcb76cbefd65234fda5d4da9fdc9c3eff0d896a663b47e3c91f
+MISC metadata.xml 443 BLAKE2B 260d80735b1430b2c650ae8fceb8c3ab778df8a824c35cc57c1e1b9b3df9ea6feb5185e63af15ec6deca7a39df24b429b7bbb767cc225e115b62c78d9e1471c9 SHA512 287e7bddf8af98427bbebf4e3ed59aa60f314f12cd8c5ffbd95c101a13b4d63b6017f750ecc554df4034d22845a6d0c18aca85a21ed2c04316a53426e054268b
diff --git a/games-emulation/nestopia/metadata.xml b/games-emulation/nestopia/metadata.xml
new file mode 100644
index 000000000000..42c366120ded
--- /dev/null
+++ b/games-emulation/nestopia/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">rdanbrook/nestopia</remote-id>
+ <remote-id type="sourceforge">nestopiaue</remote-id>
+ </upstream>
+ <use>
+ <flag name="gui">Enable GUI</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-emulation/nestopia/nestopia-1.47_p20170105.ebuild b/games-emulation/nestopia/nestopia-1.47_p20170105.ebuild
new file mode 100644
index 000000000000..932f8edc7412
--- /dev/null
+++ b/games-emulation/nestopia/nestopia-1.47_p20170105.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils
+
+DESCRIPTION="A portable Nintendo Entertainment System emulator written in C++"
+HOMEPAGE="http://0ldsk00l.ca/nestopia/"
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/rdanbrook/nestopia.git"
+else
+ inherit vcs-snapshot
+ SRC_URI="https://github.com/rdanbrook/${PN}/archive/d7fae2aff1a93eac997d2b480652a1d068a2b6cf.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="doc gui"
+
+RDEPEND="
+ app-arch/libarchive:=
+ media-libs/libao
+ media-libs/libepoxy
+ media-libs/libsdl2[sound,joystick,video]
+ sys-libs/zlib
+ gui? ( x11-libs/gtk+:3 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_GTK=$(usex gui)
+ -DENABLE_DOC=$(usex doc)
+ -DCMAKE_INSTALL_DOCDIR=share/doc/${PF}
+ )
+ cmake-utils_src_configure
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/nestopia/nestopia-9999.ebuild b/games-emulation/nestopia/nestopia-9999.ebuild
new file mode 100644
index 000000000000..932f8edc7412
--- /dev/null
+++ b/games-emulation/nestopia/nestopia-9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils
+
+DESCRIPTION="A portable Nintendo Entertainment System emulator written in C++"
+HOMEPAGE="http://0ldsk00l.ca/nestopia/"
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/rdanbrook/nestopia.git"
+else
+ inherit vcs-snapshot
+ SRC_URI="https://github.com/rdanbrook/${PN}/archive/d7fae2aff1a93eac997d2b480652a1d068a2b6cf.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="doc gui"
+
+RDEPEND="
+ app-arch/libarchive:=
+ media-libs/libao
+ media-libs/libepoxy
+ media-libs/libsdl2[sound,joystick,video]
+ sys-libs/zlib
+ gui? ( x11-libs/gtk+:3 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_GTK=$(usex gui)
+ -DENABLE_DOC=$(usex doc)
+ -DCMAKE_INSTALL_DOCDIR=share/doc/${PF}
+ )
+ cmake-utils_src_configure
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/nestra-0.66-r3 b/games-emulation/nestra-0.66-r3
deleted file mode 100644
index 03a040b7758b..000000000000
--- a/games-emulation/nestra-0.66-r3
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install prepare
-DEPEND=x11-libs/libX11[abi_x86_32(-)]
-DESCRIPTION=NES emulation for Linux/x86
-EAPI=6
-HOMEPAGE=http://nestra.linuxgames.com/
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=x11-libs/libX11[abi_x86_32(-)]
-SLOT=0
-SRC_URI=http://nestra.linuxgames.com/nestra-0.66.tar.gz mirror://debian/pool/contrib/n/nestra/nestra_0.66-10.diff.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=d2d1980cd5f2f58d5900e775f5de4910
diff --git a/games-emulation/nestra/Manifest b/games-emulation/nestra/Manifest
new file mode 100644
index 000000000000..f9cdd9ebcf3e
--- /dev/null
+++ b/games-emulation/nestra/Manifest
@@ -0,0 +1,6 @@
+AUX nestra-0.66-exec-stack.patch 239 BLAKE2B 47255490442da874ddea390664928aa77734c67d2dbe84cfe8be82e5fe6042408ca5650164f3c1e8aa396db71be9234933cc18a423b2c08f3c311f589675ec95 SHA512 a65ca4225707a496fcb3fbc968ba301b654c9357b33a6153cb19905080cf1f5ee76bbf6b5510e1886de8a2cfb2c5ebaed3a166d518db50aecfb5953c36ee9a43
+AUX nestra-0.66-include.patch 1297 BLAKE2B 98a52017fc1919fde5125771b267f0ef2b0c73ef29f81f3e2bac3672c6bab5be005028310d031486d143568efbd8ccf7c2d58c4d9bee9d5532e3ac872465fe83 SHA512 f95568a3433094555067a89c59a38519ee2bef6cdce8a0ba962976c5df6be3332fa18c0c4b6635c807ed2b22a40a75e22b9a26282b5e8190659f59c64f212389
+DIST nestra-0.66.tar.gz 49757 BLAKE2B 0ec8603cd9afc33a1b194e1c39cdc8d3173d1ad4c7c76e6e00214883cdfcd8f2cf35bfb4b74e131822aaf8c7864a50980d642bc87aca26372f06b8fab145a7cf SHA512 25f9d0c0359b46ddcd451552e7737b0f955a18e7a4ebd30d5494b12f787b9c45a49579207328c06c10efc7f8283bc688eb2061c538523ed257825b2394d978ce
+DIST nestra_0.66-10.diff.gz 2414 BLAKE2B 5b83ac9eee4d8c141dc473000b5f713ab4eb0a38707334d4fd044b9617f01b83c4a19670ef27874f6511f1f9b1d578ba35d5ba9ac244621b19ca3b9c00d5a30d SHA512 4ea1ad97f6c2eca0434dee4031e0486cc1c7c25237a467d4bf33bd0656b52441143855e07b29e1bdcf95514e19fe68ecb8f73d0972d17d9e3b6fd7a92d2db8c6
+EBUILD nestra-0.66-r3.ebuild 1046 BLAKE2B f36be92637c5125c5019b8c95ab8c8eb28a91999725c2a4de24ea76a46bfca945600dc0eab1b3ed4e8aa126ae7375192858f5d33d782fb087055043a1c77a0a4 SHA512 ae7ec1c29eb73c5cd9f478f84b517fae99dd0e7c3bc421e6850236577c260d35204fa37d6b78963012f1045b1ab30a3db1622feb1be156d93a159856093a4330
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/nestra/files/nestra-0.66-exec-stack.patch b/games-emulation/nestra/files/nestra-0.66-exec-stack.patch
new file mode 100644
index 000000000000..d9e9b3c61147
--- /dev/null
+++ b/games-emulation/nestra/files/nestra-0.66-exec-stack.patch
@@ -0,0 +1,10 @@
+--- a/x86.S.orig 2006-01-09 20:02:58.000000000 -0500
++++ b/x86.S 2006-01-09 20:03:38.000000000 -0500
+@@ -1458,3 +1458,7 @@
+ leal 0x1(%eax),%ebx
+ popl %eax
+ jmp i_next
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",@progbits
++#endif
diff --git a/games-emulation/nestra/files/nestra-0.66-include.patch b/games-emulation/nestra/files/nestra-0.66-include.patch
new file mode 100644
index 000000000000..096fd18af47f
--- /dev/null
+++ b/games-emulation/nestra/files/nestra-0.66-include.patch
@@ -0,0 +1,73 @@
+--- a/comptbl.c
++++ b/comptbl.c
+@@ -9,6 +9,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
++#include <stdlib.h>
+
+ #define ALLOC_SIZE 0x400000 /* 4MB */
+ #define TBL_BASE ((unsigned char *)0x10000000)
+--- a/d6502.c
++++ b/d6502.c
+@@ -1,6 +1,7 @@
+ /* 6502 disassembler */
+ /* Public Domain */
+
++#include <stdio.h>
+ #include "globals.h"
+
+ char Opcodes_6502[256][4]={
+--- a/emu.c
++++ b/emu.c
+@@ -12,6 +12,7 @@
+ #include <sys/mman.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+
+ #include "mapper.h"
+ #include "io.h"
+--- a/fb.c
++++ b/fb.c
+@@ -2,6 +2,8 @@
+ /* Framebuffer/pixmap rendering */
+ /* Public Domain */
+
++#include <stdlib.h>
++#include <string.h>
+ #include <stdio.h>
+ #include "mapper.h"
+ #include "globals.h"
+--- a/io.c
++++ b/io.c
+@@ -5,6 +5,7 @@
+ to do I/O operations. */
+
+ #include <stdio.h>
++#include <string.h>
+ #include "mapper.h"
+ #include "io.h"
+ #include "globals.h"
+--- a/mapper.c
++++ b/mapper.c
+@@ -1,6 +1,7 @@
+ /* Nestra mapper.c */
+ /* Public Domain */
+
++#include <string.h>
+ #include "mapper.h"
+ #include "consts.h"
+
+--- a/x11.c
++++ b/x11.c
+@@ -1,6 +1,9 @@
+ /* Nestra x11.c */
+ /* Public Domain */
+
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
+ #include <X11/Xlib.h>
+ #include <X11/keysym.h>
+ #include <X11/Xutil.h>
diff --git a/games-emulation/nestra/metadata.xml b/games-emulation/nestra/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/nestra/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/nestra/nestra-0.66-r3.ebuild b/games-emulation/nestra/nestra-0.66-r3.ebuild
new file mode 100644
index 000000000000..44ca1daa1d33
--- /dev/null
+++ b/games-emulation/nestra/nestra-0.66-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit epatch toolchain-funcs flag-o-matic
+
+PATCH="${P/-/_}-10.diff"
+DESCRIPTION="NES emulation for Linux/x86"
+HOMEPAGE="http://nestra.linuxgames.com/"
+SRC_URI="http://nestra.linuxgames.com/${P}.tar.gz
+ mirror://debian/pool/contrib/n/nestra/${PATCH}.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="x11-libs/libX11[abi_x86_32(-)]"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ default
+ epatch "${WORKDIR}"/${PATCH}
+ eapply "${FILESDIR}"/${P}-exec-stack.patch
+ eapply "${FILESDIR}"/${P}-include.patch
+
+ append-ldflags -Wl,-z,noexecstack
+ use amd64 && multilib_toolchain_setup x86
+
+ sed -i \
+ -e "s:-L/usr/X11R6/lib:${LDFLAGS}:" \
+ -e 's:-O2 ::' \
+ -e "s:gcc:$(tc-getCC) ${CFLAGS}:" \
+ -e "s:ld:$(tc-getLD) -m elf_i386 $(raw-ldflags):" \
+ Makefile || die
+}
+
+src_compile() {
+ use amd64 && multilib_toolchain_setup x86
+ default
+}
+
+src_install() {
+ dobin nestra
+ einstalldocs
+ doman nestra.6
+}
diff --git a/games-emulation/openmsx-0.14.0 b/games-emulation/openmsx-0.14.0
deleted file mode 100644
index 92824cdeaddb..000000000000
--- a/games-emulation/openmsx-0.14.0
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install postinst prepare
-DEPEND=dev-lang/tcl:0= dev-libs/libxml2 media-libs/libpng:0= media-libs/libsdl[sound,video] >=media-libs/glew-1.3.2:0= media-libs/sdl-image[png] media-libs/sdl-ttf virtual/opengl
-DESCRIPTION=MSX emulator that aims for perfection
-EAPI=6
-HOMEPAGE=http://openmsx.org/
-KEYWORDS=~amd64 ~ppc64 ~x86
-LICENSE=GPL-2
-RDEPEND=dev-lang/tcl:0= dev-libs/libxml2 media-libs/libpng:0= media-libs/libsdl[sound,video] >=media-libs/glew-1.3.2:0= media-libs/sdl-image[png] media-libs/sdl-ttf virtual/opengl
-SLOT=0
-SRC_URI=https://github.com/openMSX/openMSX/releases/download/RELEASE_0_14_0/openmsx-0.14.0.tar.gz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 readme.gentoo-r1 54aecea034d5e90bdb0684b80da5c9f3
-_md5_=c8f8caacb00798694e71ac90a1cd4c68
diff --git a/games-emulation/openmsx/Manifest b/games-emulation/openmsx/Manifest
new file mode 100644
index 000000000000..a2465372542c
--- /dev/null
+++ b/games-emulation/openmsx/Manifest
@@ -0,0 +1,3 @@
+DIST openmsx-0.14.0.tar.gz 3338719 BLAKE2B e9c09d29bb994f4f40e22271c090580688724cb7024910f0f829a59d0e65e6e70e1c037b943582aac644ee51a00b7e439e751bd84e5828168486b74ee09e8b78 SHA512 74a30de89b4a7cb4d8d5a0ad0c16ab6b58244251ebcbe470cc3cccec6a636492fa8779d1667d76646eabcf8d7d67c53094d5e0a313d452a4a679d797e9394a9b
+EBUILD openmsx-0.14.0.ebuild 1647 BLAKE2B 97b6ed516383c7162051dbf19ec1805b28b3df9a5845f44fd01a30a898b3078827a1a78026b3b113dd45f472f408d1d165e266b0bf2fa4746aa33e187f9cf27a SHA512 47f3bb94878edc3303c467a552262fed6c3aa0d539ef4a6981e9705b4e4166200126f6da93e1e1e6bcf78b38e102d5ebe22c2c5e9f93a0557cb21b2370e9fed9
+MISC metadata.xml 330 BLAKE2B 0557bfe5901a6eb7331ad400d19b438dd3125b0af9426dd7c5bc369e3e5769677e645529b71c19797a57b4e3a43440a94664e80fa941e414a2b29e209382190d SHA512 0e2cbbe9308c1a43be6617797af0abe91bfa1dbb604ef9bc96dfb7c6c7310799c689ff7450afd9eb5b66d7aaeda878e0d046b404a0220b69b5dcf38be346e422
diff --git a/games-emulation/openmsx/metadata.xml b/games-emulation/openmsx/metadata.xml
new file mode 100644
index 000000000000..c4d0622638ee
--- /dev/null
+++ b/games-emulation/openmsx/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">openmsx</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/openmsx/openmsx-0.14.0.ebuild b/games-emulation/openmsx/openmsx-0.14.0.ebuild
new file mode 100644
index 000000000000..8b39565b4be2
--- /dev/null
+++ b/games-emulation/openmsx/openmsx-0.14.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop readme.gentoo-r1
+
+DESCRIPTION="MSX emulator that aims for perfection"
+HOMEPAGE="http://openmsx.org/"
+SRC_URI="https://github.com/openMSX/openMSX/releases/download/RELEASE_0_14_0/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/tcl:0=
+ dev-libs/libxml2
+ media-libs/libpng:0=
+ media-libs/libsdl[sound,video]
+ >=media-libs/glew-1.3.2:0=
+ media-libs/sdl-image[png]
+ media-libs/sdl-ttf
+ virtual/opengl
+"
+DEPEND="${RDEPEND}"
+
+DOC_CONTENTS="
+If you want to if you want to emulate real MSX systems and not
+only the free C-BIOS machines, put the system ROMs in one of
+the following directories: /usr/share/${PN}/systemroms
+or ~/.openMSX/share/systemroms
+"
+
+src_prepare() {
+ default
+ sed -i \
+ -e '/^LDFLAGS:=/d' \
+ -e '/LINK_FLAGS_PREFIX/d' \
+ -e '/LINK_FLAGS+=/s/-s//' \
+ -e '/LINK_FLAGS+=\$(TARGET_FLAGS)/s/$/ $(LDFLAGS)/' \
+ build/main.mk \
+ || die
+ sed -i -e '/SYMLINK/s:true:false:' build/custom.mk || die
+ sed -i -e 's/GPL.txt//' doc/node.mk || die
+}
+
+src_compile() {
+ emake \
+ CXXFLAGS="${CXXFLAGS}" \
+ INSTALL_SHARE_DIR=/usr/share/${PN} \
+ V=1
+}
+
+src_install() {
+ emake \
+ V=1 \
+ INSTALL_BINARY_DIR="${ED}/usr/bin" \
+ INSTALL_SHARE_DIR="${ED}/usr/share/${PN}" \
+ INSTALL_DOC_DIR="${D}"/usr/share/doc/${PF} \
+ install
+
+ einstalldocs
+ readme.gentoo_create_doc
+
+ for i in 16 32 48 64 128 256 ; do
+ newicon -s "${i}" "share/icons/openMSX-logo-${i}.png" "${PN}.png"
+ done
+ make_desktop_entry "${PN}" "openMSX"
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/games-emulation/pcsx2-1.4.0 b/games-emulation/pcsx2-1.4.0
deleted file mode 100644
index 31e2b23ce4db..000000000000
--- a/games-emulation/pcsx2-1.4.0
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install prepare setup test
-DEPEND=app-arch/bzip2[abi_x86_32(-)] app-arch/xz-utils[abi_x86_32(-)] dev-libs/libaio[abi_x86_32(-)] media-libs/alsa-lib[abi_x86_32(-)] media-libs/libpng:=[abi_x86_32(-)] media-libs/libsdl[abi_x86_32(-),joystick,sound] media-libs/libsoundtouch[abi_x86_32(-)] media-libs/portaudio[abi_x86_32(-)] >=sys-libs/zlib-1.2.4[abi_x86_32(-)] virtual/jpeg:62[abi_x86_32(-)] virtual/opengl[abi_x86_32(-)] x11-libs/gtk+:2[abi_x86_32(-)] x11-libs/libICE[abi_x86_32(-)] x11-libs/libX11[abi_x86_32(-)] x11-libs/libXext[abi_x86_32(-)] x11-libs/wxGTK:3.0[abi_x86_32(-),X] >=app-eselect/eselect-opengl-1.3.1 dev-cpp/pngpp >=dev-cpp/sparsehash-1.5 sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=A PlayStation 2 emulator
-EAPI=5
-HOMEPAGE=https://www.pcsx2.net
-KEYWORDS=-* amd64 x86
-LICENSE=GPL-3
-RDEPEND=app-arch/bzip2[abi_x86_32(-)] app-arch/xz-utils[abi_x86_32(-)] dev-libs/libaio[abi_x86_32(-)] media-libs/alsa-lib[abi_x86_32(-)] media-libs/libpng:=[abi_x86_32(-)] media-libs/libsdl[abi_x86_32(-),joystick,sound] media-libs/libsoundtouch[abi_x86_32(-)] media-libs/portaudio[abi_x86_32(-)] >=sys-libs/zlib-1.2.4[abi_x86_32(-)] virtual/jpeg:62[abi_x86_32(-)] virtual/opengl[abi_x86_32(-)] x11-libs/gtk+:2[abi_x86_32(-)] x11-libs/libICE[abi_x86_32(-)] x11-libs/libX11[abi_x86_32(-)] x11-libs/libXext[abi_x86_32(-)] x11-libs/wxGTK:3.0[abi_x86_32(-),X]
-SLOT=0
-SRC_URI=https://github.com/PCSX2/pcsx2/archive/v1.4.0.tar.gz -> pcsx2-1.4.0.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 l10n 97f2753e3f1f3753d53d856c7c0bbb0b ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=dadc0cc6df6dadfbc5fdaff6c700d688
diff --git a/games-emulation/pcsx2-9999 b/games-emulation/pcsx2-9999
deleted file mode 100644
index 7422d103b1ea..000000000000
--- a/games-emulation/pcsx2-9999
+++ /dev/null
@@ -1,10 +0,0 @@
-DEFINED_PHASES=compile configure install prepare setup test unpack
-DEPEND=app-arch/bzip2[abi_x86_32(-)] app-arch/xz-utils[abi_x86_32(-)] dev-libs/libaio[abi_x86_32(-)] media-libs/alsa-lib[abi_x86_32(-)] media-libs/libpng:=[abi_x86_32(-)] media-libs/libsdl2[abi_x86_32(-),haptic,joystick,sound] media-libs/libsoundtouch[abi_x86_32(-)] media-libs/portaudio[abi_x86_32(-)] >=sys-libs/zlib-1.2.4[abi_x86_32(-)] virtual/jpeg:62[abi_x86_32(-)] virtual/opengl[abi_x86_32(-)] x11-libs/gtk+:2[abi_x86_32(-)] x11-libs/libICE[abi_x86_32(-)] x11-libs/libX11[abi_x86_32(-)] x11-libs/libXext[abi_x86_32(-)] x11-libs/wxGTK:3.0[abi_x86_32(-),-sdl,X] >=app-eselect/eselect-opengl-1.3.1 dev-cpp/pngpp >=dev-cpp/sparsehash-1.5 sys-devel/make >=dev-util/cmake-3.9.6 >=dev-vcs/git-1.8.2.1[curl]
-DESCRIPTION=A PlayStation 2 emulator
-EAPI=5
-HOMEPAGE=https://www.pcsx2.net
-LICENSE=GPL-3
-RDEPEND=app-arch/bzip2[abi_x86_32(-)] app-arch/xz-utils[abi_x86_32(-)] dev-libs/libaio[abi_x86_32(-)] media-libs/alsa-lib[abi_x86_32(-)] media-libs/libpng:=[abi_x86_32(-)] media-libs/libsdl2[abi_x86_32(-),haptic,joystick,sound] media-libs/libsoundtouch[abi_x86_32(-)] media-libs/portaudio[abi_x86_32(-)] >=sys-libs/zlib-1.2.4[abi_x86_32(-)] virtual/jpeg:62[abi_x86_32(-)] virtual/opengl[abi_x86_32(-)] x11-libs/gtk+:2[abi_x86_32(-)] x11-libs/libICE[abi_x86_32(-)] x11-libs/libX11[abi_x86_32(-)] x11-libs/libXext[abi_x86_32(-)] x11-libs/wxGTK:3.0[abi_x86_32(-),-sdl,X]
-SLOT=0
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 git-r3 8f6de46b0aa318aea0e8cac62ece098b l10n 97f2753e3f1f3753d53d856c7c0bbb0b ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=7911707de31ef9fd54d1df2327229e79
diff --git a/games-emulation/pcsx2/Manifest b/games-emulation/pcsx2/Manifest
new file mode 100644
index 000000000000..ed229fa815d8
--- /dev/null
+++ b/games-emulation/pcsx2/Manifest
@@ -0,0 +1,5 @@
+AUX pcsx2-1.4.0-gcc5.patch 694 BLAKE2B d523ed4b60730d38febceda5a4ddea3aad96788184cbc19e1d983a37524d63618ce45009fba555f31f75c8a325156ae0cbfff74531c469add6c867ffc73f47e8 SHA512 c95b5abd255f4d0a1d9efa8b45126fea2c57ed2110358687a14d44c5ccc8f670f33a5e9b56bd9e3ea4806ad2429a84b70d796bec9c909262379bba5914e7d51d
+DIST pcsx2-1.4.0.tar.gz 15108326 BLAKE2B 6601019f9bd038d8cb3ed5ebd47daa5b645e537d028581c1235f9ab03f59d281639913ef037be3ef380a76bd48ea4f8728b0339fafcd331b4cfa41681dbcabd0 SHA512 87ae8bdebcaf015ba03c23056bcab32b13d6726a6c3f05e62ef54f472114399debfcfcda4208b066519c2d20345a1bb8c55582eb342dccc168f410687f3766fb
+EBUILD pcsx2-1.4.0.ebuild 2863 BLAKE2B 8f3db9fbbf1062dc9f0c8e795c6030bb1e2408e37f26e0d4fc08d3a68f53fea3cce300d3097ab2ae870bc5038023618f9ff9345d8bc4af6b56259c35ddc322cf SHA512 4d1e1c48d64b8c2e538adf546ac8f9767224d3fdf4d326b72546602e464b6ceced4b0defcd140e6934b5df69ac29a38179ebe12476b6278c60916aafaab7da0a
+EBUILD pcsx2-9999.ebuild 2748 BLAKE2B 7269d9dfe2be80399909b3399ca0a2918e6711cea0a95400e338b6ea1bb2ca688a91d67ec222969487ca17298540496caa33a65a3779d459ac244644b62a98fa SHA512 9f05e4bab5761623335212e94d73a1f12135309c78d846d7d8b13090d3ee365e98fb4dcc305463e82e635485b1e9a75e240e6e7d63fad2224366984bfd7d0f01
+MISC metadata.xml 502 BLAKE2B 26415faa56f60d794446f9354475331a0006a25cfa380fc69aabd3adc01622c425b934ebd94bbc283d749f7a06ef9ddcc123371aefc33b4b6ae0ce5b14c907d3 SHA512 1b095d48c5f126e53f865b982fa337dc25ce736ffda219c0812d86d9120c928d577b588a4587b9eea4c0315bfec67fbd4b281b224182ef2cb8ffb0c231dd83d3
diff --git a/games-emulation/pcsx2/files/pcsx2-1.4.0-gcc5.patch b/games-emulation/pcsx2/files/pcsx2-1.4.0-gcc5.patch
new file mode 100644
index 000000000000..cfc941f28244
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-1.4.0-gcc5.patch
@@ -0,0 +1,26 @@
+From 71991f24ef75b7da678d8de8d593bf82677d2708 Mon Sep 17 00:00:00 2001
+From: Yuri Konotopov <ykonotopov@gnome.org>
+Date: Mon, 9 Jan 2017 18:37:44 +0400
+Subject: [PATCH] x86emitter: gcc 5 compilation fix
+
+---
+ common/src/x86emitter/cpudetect.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/common/src/x86emitter/cpudetect.cpp b/common/src/x86emitter/cpudetect.cpp
+index 717ca89..cf94d7f 100644
+--- a/common/src/x86emitter/cpudetect.cpp
++++ b/common/src/x86emitter/cpudetect.cpp
+@@ -16,6 +16,9 @@
+ #include "PrecompiledHeader.h"
+ #include "cpudetect_internal.h"
+ #include "internal.h"
++#if defined(__GNUC__)
++#include "x86intrin.h"
++#endif
+
+ using namespace x86Emitter;
+
+--
+2.10.2
+
diff --git a/games-emulation/pcsx2/metadata.xml b/games-emulation/pcsx2/metadata.xml
new file mode 100644
index 000000000000..16221929ad22
--- /dev/null
+++ b/games-emulation/pcsx2/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ykonotopov@gnome.org</email>
+ <name>Yuri Konotopov</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://github.com/PCSX2/pcsx2/issues</bugs-to>
+ <remote-id type="github">PCSX2/pcsx2</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/pcsx2/pcsx2-1.4.0.ebuild b/games-emulation/pcsx2/pcsx2-1.4.0.ebuild
new file mode 100644
index 000000000000..cfd1606f91af
--- /dev/null
+++ b/games-emulation/pcsx2/pcsx2-1.4.0.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PLOCALES="ar_SA ca_ES cs_CZ de_DE es_ES fi_FI fr_FR hr_HR hu_HU id_ID it_IT ja_JP ko_KR ms_MY nb_NO pl_PL pt_BR ru_RU sv_SE th_TH tr_TR zh_CN zh_TW"
+MY_PV="${PV/_/-}"
+
+inherit cmake-utils l10n multilib toolchain-funcs wxwidgets
+
+DESCRIPTION="A PlayStation 2 emulator"
+HOMEPAGE="https://www.pcsx2.net"
+SRC_URI="https://github.com/PCSX2/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="
+ app-arch/bzip2[abi_x86_32(-)]
+ app-arch/xz-utils[abi_x86_32(-)]
+ dev-libs/libaio[abi_x86_32(-)]
+ media-libs/alsa-lib[abi_x86_32(-)]
+ media-libs/libpng:=[abi_x86_32(-)]
+ media-libs/libsdl[abi_x86_32(-),joystick,sound]
+ media-libs/libsoundtouch[abi_x86_32(-)]
+ media-libs/portaudio[abi_x86_32(-)]
+ >=sys-libs/zlib-1.2.4[abi_x86_32(-)]
+ virtual/jpeg:62[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ x11-libs/gtk+:2[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/wxGTK:3.0[abi_x86_32(-),X]
+"
+# Ensure no incompatible headers from eselect-opengl are installed, bug #510730
+DEPEND="${RDEPEND}
+ >=app-eselect/eselect-opengl-1.3.1
+ dev-cpp/pngpp
+ >=dev-cpp/sparsehash-1.5
+"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+PATCHES=( "${FILESDIR}"/${P}-gcc5.patch )
+
+clean_locale() {
+ rm -R "${S}"/locales/"${1}" || die
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary && $(tc-getCC) == *gcc* ]]; then
+ if [[ $(gcc-major-version) -lt 4 || $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 8 ]] ; then
+ die "${PN} does not compile with gcc less than 4.8"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+ l10n_for_each_disabled_locale_do clean_locale
+}
+
+src_configure() {
+ multilib_toolchain_setup x86
+
+ # pcsx2 build scripts will force CMAKE_BUILD_TYPE=Devel
+ # if it something other than "Devel|Debug|Release"
+ local CMAKE_BUILD_TYPE="Release"
+
+ if use amd64; then
+ # Passing correct CMAKE_TOOLCHAIN_FILE for amd64
+ # https://github.com/PCSX2/pcsx2/pull/422
+ local MYCMAKEARGS=(-DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake)
+ fi
+
+ local mycmakeargs=(
+ -DARCH_FLAG=
+ -DDISABLE_BUILD_DATE=TRUE
+ -DDISABLE_PCSX2_WRAPPER=TRUE
+ -DEXTRA_PLUGINS=FALSE
+ -DOPTIMIZATION_FLAG=
+ -DPACKAGE_MODE=TRUE
+ -DXDG_STD=TRUE
+
+ -DCMAKE_INSTALL_PREFIX=/usr
+ -DCMAKE_LIBRARY_PATH="/usr/$(get_libdir)/${PN}"
+ -DDOC_DIR=/usr/share/doc/"${PF}"
+ -DEGL_API=FALSE
+ -DGTK3_API=FALSE
+ -DPLUGIN_DIR="/usr/$(get_libdir)/${PN}"
+ # wxGTK must be built against same sdl version
+ -DSDL2_API=FALSE
+ -DWX28_API=FALSE
+ )
+
+ WX_GTK_VER="3.0" need-wxwidgets unicode
+ cmake-utils_src_configure
+}
+
+src_install() {
+ # Upstream issue: https://github.com/PCSX2/pcsx2/issues/417
+ QA_TEXTRELS="usr/$(get_libdir)/pcsx2/*"
+
+ cmake-utils_src_install
+}
diff --git a/games-emulation/pcsx2/pcsx2-9999.ebuild b/games-emulation/pcsx2/pcsx2-9999.ebuild
new file mode 100644
index 000000000000..1ab14376a933
--- /dev/null
+++ b/games-emulation/pcsx2/pcsx2-9999.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PLOCALES="ar_SA ca_ES cs_CZ de_DE es_ES fi_FI fr_FR hr_HR hu_HU id_ID it_IT ja_JP ko_KR ms_MY nb_NO pl_PL pt_BR ru_RU sv_SE th_TH tr_TR zh_CN zh_TW"
+
+inherit cmake-utils git-r3 l10n multilib toolchain-funcs wxwidgets
+
+DESCRIPTION="A PlayStation 2 emulator"
+HOMEPAGE="https://www.pcsx2.net"
+EGIT_REPO_URI="https://github.com/PCSX2/${PN}.git"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="
+ app-arch/bzip2[abi_x86_32(-)]
+ app-arch/xz-utils[abi_x86_32(-)]
+ dev-libs/libaio[abi_x86_32(-)]
+ media-libs/alsa-lib[abi_x86_32(-)]
+ media-libs/libpng:=[abi_x86_32(-)]
+ media-libs/libsdl2[abi_x86_32(-),haptic,joystick,sound]
+ media-libs/libsoundtouch[abi_x86_32(-)]
+ media-libs/portaudio[abi_x86_32(-)]
+ >=sys-libs/zlib-1.2.4[abi_x86_32(-)]
+ virtual/jpeg:62[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ x11-libs/gtk+:2[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/wxGTK:3.0[abi_x86_32(-),-sdl,X]
+"
+# Ensure no incompatible headers from eselect-opengl are installed, bug #510730
+DEPEND="${RDEPEND}
+ >=app-eselect/eselect-opengl-1.3.1
+ dev-cpp/pngpp
+ >=dev-cpp/sparsehash-1.5
+"
+
+clean_locale() {
+ rm -R "${S}"/locales/"${1}" || die
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary && $(tc-getCC) == *gcc* ]]; then
+ if [[ $(gcc-major-version) -lt 4 || $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 8 ]] ; then
+ die "${PN} does not compile with gcc less than 4.8"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+ l10n_for_each_disabled_locale_do clean_locale
+}
+
+src_configure() {
+ multilib_toolchain_setup x86
+
+ # pcsx2 build scripts will force CMAKE_BUILD_TYPE=Devel
+ # if it something other than "Devel|Debug|Release"
+ local CMAKE_BUILD_TYPE="Release"
+
+ if use amd64; then
+ # Passing correct CMAKE_TOOLCHAIN_FILE for amd64
+ # https://github.com/PCSX2/pcsx2/pull/422
+ local MYCMAKEARGS=(-DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake)
+ fi
+
+ local mycmakeargs=(
+ -DARCH_FLAG=
+ -DDISABLE_BUILD_DATE=TRUE
+ -DDISABLE_PCSX2_WRAPPER=TRUE
+ -DEXTRA_PLUGINS=FALSE
+ -DOPTIMIZATION_FLAG=
+ -DPACKAGE_MODE=TRUE
+ -DXDG_STD=TRUE
+
+ -DCMAKE_INSTALL_PREFIX=/usr
+ -DCMAKE_LIBRARY_PATH="/usr/$(get_libdir)/${PN}"
+ -DDOC_DIR=/usr/share/doc/"${PF}"
+ -DEGL_API=FALSE
+ -DGTK3_API=FALSE
+ -DPLUGIN_DIR="/usr/$(get_libdir)/${PN}"
+ # wxGTK must be built against same sdl version
+ -DSDL2_API=TRUE
+ -DWX28_API=FALSE
+ )
+
+ WX_GTK_VER="3.0" need-wxwidgets unicode
+ cmake-utils_src_configure
+}
+
+src_install() {
+ # Upstream issue: https://github.com/PCSX2/pcsx2/issues/417
+ QA_TEXTRELS="usr/$(get_libdir)/pcsx2/*"
+
+ cmake-utils_src_install
+}
diff --git a/games-emulation/pcsxr-1.9.94-r2 b/games-emulation/pcsxr-1.9.94-r2
deleted file mode 100644
index 302ba209a4c2..000000000000
--- a/games-emulation/pcsxr-1.9.94-r2
+++ /dev/null
@@ -1,15 +0,0 @@
-DEFINED_PHASES=configure install postinst prepare
-DEPEND=dev-libs/glib:2= media-libs/libsdl:0=[joystick] sys-libs/zlib:0= x11-libs/gtk+:3= x11-libs/libX11:0= x11-libs/libXext:0= x11-libs/libXtst:0= x11-libs/libXv:0= alsa? ( media-libs/alsa-lib:0= ) cdio? ( dev-libs/libcdio:0= ) ffmpeg? ( !libav? ( >=media-video/ffmpeg-3:0= ) libav? ( media-video/libav:0= ) ) nls? ( virtual/libintl:0= ) openal? ( media-libs/openal:0= ) opengl? ( virtual/opengl:0= x11-libs/libXxf86vm:0= ) pulseaudio? ( media-sound/pulseaudio:0= ) sdl? ( media-libs/libsdl:0=[sound] ) app-arch/unzip dev-util/intltool x11-base/xorg-proto nls? ( sys-devel/gettext:0 ) x86? ( dev-lang/nasm ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=PCSX-Reloaded: a fork of PCSX, the discontinued Playstation emulator
-EAPI=6
-HOMEPAGE=http://pcsxr.codeplex.com
-IUSE=alsa cdio ffmpeg libav nls openal opengl oss pulseaudio +sdl
-KEYWORDS=~amd64
-LICENSE=GPL-2 public-domain
-RDEPEND=dev-libs/glib:2= media-libs/libsdl:0=[joystick] sys-libs/zlib:0= x11-libs/gtk+:3= x11-libs/libX11:0= x11-libs/libXext:0= x11-libs/libXtst:0= x11-libs/libXv:0= alsa? ( media-libs/alsa-lib:0= ) cdio? ( dev-libs/libcdio:0= ) ffmpeg? ( !libav? ( >=media-video/ffmpeg-3:0= ) libav? ( media-video/libav:0= ) ) nls? ( virtual/libintl:0= ) openal? ( media-libs/openal:0= ) opengl? ( virtual/opengl:0= x11-libs/libXxf86vm:0= ) pulseaudio? ( media-sound/pulseaudio:0= ) sdl? ( media-libs/libsdl:0=[sound] )
-REQUIRED_USE=?? ( alsa openal oss pulseaudio sdl )
-RESTRICT=test
-SLOT=0
-SRC_URI=https://dev.gentoo.org/~mgorny/dist/pcsxr-1.9.94.zip
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 estack 43ddf5aaffa7a8d0482df54d25a66a1f libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 versionator 26ca8a8bd95d6a74122c08ba98a4ee72
-_md5_=0f423103e1fffbfd1680e6f7462931b7
diff --git a/games-emulation/pcsxr/Manifest b/games-emulation/pcsxr/Manifest
new file mode 100644
index 000000000000..e8f69e37dbc2
--- /dev/null
+++ b/games-emulation/pcsxr/Manifest
@@ -0,0 +1,6 @@
+AUX pcsxr-1.9.94-disable-sdl2.patch 1059 BLAKE2B 6421cbf6f2df49c2c61cc83602c13b4189781b30ecf3a1f605e537ad0b1c97205c65cd1c51fd58c1b6c0fa4027b7163e9d82228136ccd7bcc508f5917ab46248 SHA512 aa010d8203a45ddd7f93fcc74d3ec9010dcdf6a79d36bb72aa434caccac650c2dee5a74e52e11e40b35356ca30d9a37a52b5e76dcacba64634988b9e57c74171
+AUX pcsxr-1.9.94-ffmpeg3.patch 1890 BLAKE2B 74bd342c5ffb1cd8cc280add5b89aee448d180356e5cf7eb8252414d933c83ee5e0045146e3953f219b4330c2df2e5a4f68c0e07c4d5c1060d1708c2229455ad SHA512 091c435337468aa958c5b6e87a0ce5730675d9f8d109474c92d5e1d61830a8b4c525f8e3208e86654baca5ae602a39bc234a0c54b24b4f51a1297fb123852dc3
+AUX pcsxr-1.9.94-zlib-uncompress2.patch 1522 BLAKE2B c872121a676d42f6855359eafa50be57e42a573ae2b470463fb25322cc5e7004c443de7bb214a55bfb9a99c4f88026892313301fe1c4960e823c842889f28966 SHA512 28350e042810a8f1c3829891d68b028b4c464b75e614f8451f8708bbff0ee47e94146a05cf5e6e3fdfe6ca7eae2e839fc8cbf95df8458e28e3d025feb728c310
+DIST pcsxr-1.9.94.zip 2631125 BLAKE2B 686503faffccc820bcac73bc69056ffe05176779ee49b834ce0da84c40a047b7882ca7b91a7b7f95ab153329ca6368ae545bbe567cac6a9bdba1a434c397862c SHA512 c49471c27692fbf22da32d2f5697a1dfed3dbdbfdb86cb789b0ea6cddb2a7da4f3390e4568f4e9385bf30d6baff0f2a591a80f424cf0c640cae0035ba81dce39
+EBUILD pcsxr-1.9.94-r2.ebuild 2675 BLAKE2B 475bdfe5e53828f78b434cb6c1ea7b86deb7bfbfe83b470f4f6e54fc4ce6f0308e4329883d8564734fc1d1e178179e8e47aeeb8f6a4280078131149b59599f90 SHA512 1210b0fac40c7f310efefaea9342ac4a9a89e6eb366ac7de4db87385627a297947e2cc0d3cbfc3b00104f0c58c41f3aebb2bc6222a7d10f489969f3efcc6960c
+MISC metadata.xml 410 BLAKE2B 43f3920798ece05509e24b693d5b8de55a87337e637bc9b1c6f57ebd79d7c67e3d47c2d8c695cfc3386c733396a7c59e2fcb1f4087fd8b926b30c8962b698d99 SHA512 4c7e8a04412bd0851f4422bd646423558cc7e67ad956b518104285eb537a7a3cbf492239a11a582be65c45229299d0309823f3a6064717704d2fab4c15d2ee52
diff --git a/games-emulation/pcsxr/files/pcsxr-1.9.94-disable-sdl2.patch b/games-emulation/pcsxr/files/pcsxr-1.9.94-disable-sdl2.patch
new file mode 100644
index 000000000000..483ea56660e6
--- /dev/null
+++ b/games-emulation/pcsxr/files/pcsxr-1.9.94-disable-sdl2.patch
@@ -0,0 +1,28 @@
+From b7864d1b8db75eda19a7601f3e2402a885bb251d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 11 Dec 2013 17:19:09 +0100
+Subject: [PATCH] Disable SDL2 check for Gentoo.
+
+The SDL2 support seems immature at the moment, so we'd prefer pcsxr
+using SDL1 even if SDL2 is installed.
+---
+ configure.ac | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f79cee0..0c79cff 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,8 +26,7 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"], [gettext domain])
+ PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 2.20, [], AC_MSG_ERROR([*** glib2 >= 2.20 not found!]))
+ PKG_CHECK_MODULES(GTK3, gtk+-3.0 , [], AC_MSG_ERROR([*** libgtk3 >= 3.0 not found!]))
+
+-PKG_CHECK_MODULES([SDL2], [sdl2 >= 2.0.0],
+- [AC_DEFINE([HAVE_SDL2], [1], [Use SDL2])],
++AS_IF([true],
+ [PKG_CHECK_MODULES([SDL], [sdl >= 1.2.12],
+ [AC_DEFINE([HAVE_SDL], [1], [Use SDL])
+ ], AC_MSG_ERROR([*** SDL >= 1.2.12 not found!]))
+--
+1.8.5.1
+
diff --git a/games-emulation/pcsxr/files/pcsxr-1.9.94-ffmpeg3.patch b/games-emulation/pcsxr/files/pcsxr-1.9.94-ffmpeg3.patch
new file mode 100644
index 000000000000..345ed9993ea4
--- /dev/null
+++ b/games-emulation/pcsxr/files/pcsxr-1.9.94-ffmpeg3.patch
@@ -0,0 +1,62 @@
+--- a/libpcsxcore/cdriso.c 2013-11-09 16:24:14.000000000 +0100
++++ b/libpcsxcore/cdriso.c 2016-12-12 01:02:25.652521029 +0100
+@@ -266,14 +266,14 @@
+ }
+
+ if (!decoded_frame) {
+- if (!(decoded_frame = avcodec_alloc_frame())) {
++ if (!(decoded_frame = av_frame_alloc())) {
+ SysMessage(_(" -> Error allocating audio frame buffer. This track will not be available."));
+ avformat_close_input(&inAudioFormat);
+- avcodec_free_frame(&decoded_frame);
++ av_frame_free(&decoded_frame);
+ return 1; // error decoding frame
+ }
+ } else {
+- avcodec_get_frame_defaults(decoded_frame);
++ av_frame_unref(decoded_frame);
+ }
+ len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
+ if (len > 0 && got_frame) {
+@@ -285,7 +285,7 @@
+ fwrite(decoded_frame->data[0], 1, data_size, outfile);
+ }
+ av_free_packet(&avpkt);
+- //avcodec_free_frame(&decoded_frame);
++ //av_frame_free(&decoded_frame);
+ } while (moreFrames >= 0); // TODO: check for possible leaks
+
+ // file will be closed later on, now just flush it
+@@ -294,7 +294,7 @@
+ avformat_close_input(&inAudioFormat);
+ //avcodec_close(c);
+ //av_free(c);
+- avcodec_free_frame(&decoded_frame);
++ av_frame_free(&decoded_frame);
+ return 0;
+ }
+ #endif
+@@ -340,12 +340,12 @@
+ while (avpkt.size > 0) {
+ int got_frame = 0;
+ if (!decoded_frame) {
+- if (!(decoded_frame = avcodec_alloc_frame())) {
++ if (!(decoded_frame = av_frame_alloc())) {
+ SysPrintf(" -> Error allocating audio frame buffer. Track will not be available.");
+ return 1; // error decoding frame
+ }
+ } else {
+- avcodec_get_frame_defaults(decoded_frame);
++ av_frame_unref(decoded_frame);
+ }
+
+ len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
+@@ -383,7 +383,7 @@
+
+ avcodec_close(c);
+ av_free(c);
+- avcodec_free_frame(&decoded_frame);
++ av_frame_free(&decoded_frame);
+ return 0;
+ }
+ #endif
diff --git a/games-emulation/pcsxr/files/pcsxr-1.9.94-zlib-uncompress2.patch b/games-emulation/pcsxr/files/pcsxr-1.9.94-zlib-uncompress2.patch
new file mode 100644
index 000000000000..616084b797cd
--- /dev/null
+++ b/games-emulation/pcsxr/files/pcsxr-1.9.94-zlib-uncompress2.patch
@@ -0,0 +1,47 @@
+From dabb671947ae26942c7ef8a71fef9831e0c1884d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 26 Jan 2017 18:14:01 +0100
+Subject: [PATCH] Fix build against zlib-1.2.9+ (having uncompress2)
+
+---
+ pcsxr/configure.ac | 3 +++
+ pcsxr/libpcsxcore/cdriso.c | 2 ++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/pcsxr/configure.ac b/pcsxr/configure.ac
+index 300bb185..128b4f97 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -113,6 +113,9 @@ if test "x$have_xtest" = xno; then
+ AC_MSG_ERROR([unable to find xtest headers])
+ fi
+
++AC_CHECK_LIB(z, uncompress2,
++[ AC_DEFINE([HAVE_UNCOMPRESS2], [1], [Define if libz supports uncompress2]) ])
++
+ AM_CONDITIONAL(USE_LIBCDIO, false)
+
+ AC_ARG_ENABLE(libcdio, [ --enable-libcdio use GNU libcdio for CD-ROM support (default=no)],
+diff --git a/pcsxr/libpcsxcore/cdriso.c b/pcsxr/libpcsxcore/cdriso.c
+index 04e866d9..fb7f28a5 100644
+--- a/libpcsxcore/cdriso.c
++++ b/libpcsxcore/cdriso.c
+@@ -1219,6 +1219,7 @@ static int cdread_sub_mixed(FILE *f, unsigned int base, void *dest, int sector)
+ return ret;
+ }
+
++#ifndef HAVE_UNCOMPRESS2
+ static int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size)
+ {
+ static z_stream z;
+@@ -1249,6 +1250,7 @@ static int uncompress2(void *out, unsigned long *out_size, void *in, unsigned lo
+ *out_size -= z.avail_out;
+ return ret == 1 ? 0 : ret;
+ }
++#endif
+
+ static int cdread_compressed(FILE *f, unsigned int base, void *dest, int sector)
+ {
+--
+2.11.0
+
diff --git a/games-emulation/pcsxr/metadata.xml b/games-emulation/pcsxr/metadata.xml
new file mode 100644
index 000000000000..04c9bdf246b4
--- /dev/null
+++ b/games-emulation/pcsxr/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="cdio">Use libcdio for CD support</flag>
+ <flag name="sdl">Use SDL sound backend (other parts of SDL are used unconditionally)</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-emulation/pcsxr/pcsxr-1.9.94-r2.ebuild b/games-emulation/pcsxr/pcsxr-1.9.94-r2.ebuild
new file mode 100644
index 000000000000..b58d16a4d360
--- /dev/null
+++ b/games-emulation/pcsxr/pcsxr-1.9.94-r2.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools ltprune versionator
+
+DESCRIPTION="PCSX-Reloaded: a fork of PCSX, the discontinued Playstation emulator"
+HOMEPAGE="http://pcsxr.codeplex.com"
+# codeplex doesn't support direct downloads but GPL-2 doesn't mind me
+# mirroring it.
+SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.zip"
+
+LICENSE="GPL-2 public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="alsa cdio ffmpeg libav nls openal opengl oss pulseaudio +sdl"
+REQUIRED_USE="?? ( alsa openal oss pulseaudio sdl )"
+
+# pcsxr supports both SDL1 and SDL2 but uses the newer version installed
+# since SDL is not properly slotted in Gentoo, just fix it on SDL2
+
+RDEPEND="
+ dev-libs/glib:2=
+ media-libs/libsdl:0=[joystick]
+ sys-libs/zlib:0=
+ x11-libs/gtk+:3=
+ x11-libs/libX11:0=
+ x11-libs/libXext:0=
+ x11-libs/libXtst:0=
+ x11-libs/libXv:0=
+ alsa? ( media-libs/alsa-lib:0= )
+ cdio? ( dev-libs/libcdio:0= )
+ ffmpeg? (
+ !libav? ( >=media-video/ffmpeg-3:0= )
+ libav? ( media-video/libav:0= ) )
+ nls? ( virtual/libintl:0= )
+ openal? ( media-libs/openal:0= )
+ opengl? ( virtual/opengl:0=
+ x11-libs/libXxf86vm:0= )
+ pulseaudio? ( media-sound/pulseaudio:0= )
+ sdl? ( media-libs/libsdl:0=[sound] )
+"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ dev-util/intltool
+ x11-base/xorg-proto
+ nls? ( sys-devel/gettext:0 )
+ x86? ( dev-lang/nasm )
+"
+
+# it's only the .po file check that fails :)
+RESTRICT=test
+
+PATCHES=(
+ "${FILESDIR}"/${P}-disable-sdl2.patch
+ "${FILESDIR}"/${P}-zlib-uncompress2.patch
+ "${FILESDIR}"/${P}-ffmpeg3.patch
+)
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local sound_backend
+
+ if use alsa; then
+ sound_backend=alsa
+ elif use oss; then
+ sound_backend=oss
+ elif use pulseaudio; then
+ sound_backend=pulseaudio
+ elif use sdl; then
+ sound_backend=sdl
+ elif use openal; then
+ sound_backend=openal
+ else
+ sound_backend=null
+ fi
+
+ local myconf=(
+ $(use_enable nls)
+ $(use_enable cdio libcdio)
+ $(use_enable opengl)
+ $(use_enable ffmpeg ccdda)
+ --enable-sound=${sound_backend}
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+
+ dodoc doc/{keys,tweaks}.txt
+}
+
+pkg_postinst() {
+ local vr
+ for vr in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 1.9.94-r1 ${vr}; then
+ ewarn "Starting with pcsxr-1.9.94-r1, the plugin install path has changed."
+ ewarn "In order for pcsxr to find plugins, you will need to remove stale"
+ ewarn "symlinks from ~/.pcsxr/plugins. You can do this using the following"
+ ewarn "command (as your regular user):"
+ ewarn
+ ewarn " $ find ~/.pcsxr/plugins/ -type l -delete"
+ fi
+ done
+}
diff --git a/games-emulation/ppsspp-1.4.2 b/games-emulation/ppsspp-1.4.2
deleted file mode 100644
index 355fb988d3e6..000000000000
--- a/games-emulation/ppsspp-1.4.2
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst prepare test unpack
-DEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl media-libs/libsdl2 ) qt5? ( dev-db/sqlite dev-qt/assistant:5 dev-qt/qtcore:5 dev-qt/qtdeclarative:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtopengl:5 dev-qt/qtsvg:5 dev-qt/qtwebkit:5 dev-qt/qtwidgets:5 ) sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=A PSP emulator written in C++.
-EAPI=6
-HOMEPAGE=https://www.ppsspp.org/
-IUSE=+qt5 sdl headless libav +system-ffmpeg
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl media-libs/libsdl2 ) qt5? ( dev-db/sqlite dev-qt/assistant:5 dev-qt/qtcore:5 dev-qt/qtdeclarative:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtopengl:5 dev-qt/qtsvg:5 dev-qt/qtwebkit:5 dev-qt/qtwidgets:5 )
-REQUIRED_USE=!headless? ( || ( qt5 sdl ) ) ?? ( qt5 sdl )
-SLOT=0
-SRC_URI=https://github.com/hrydgard/ppsspp/archive/v1.4.2.tar.gz -> ppsspp-1.4.2.tar.gz !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ppsspp-1.4.2-ffmpeg.tar.gz ) https://github.com/hrydgard/ppsspp-lang/archive/f32328a88cbf368af90eb79bc7ad5420795d6585.tar.gz -> ppsspp-1.4.2-assets_lang.tar.gz https://github.com/hrydgard/pspautotests/archive/e18cface3db64ccb96738dc128fe769b28fff65c.tar.gz -> ppsspp-1.4.2-pspautotests.tar.gz https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ppsspp-1.4.2-dx9sdk.tar.gz https://github.com/hrydgard/glslang/archive/b16f7e6819267e57c3c244808d1981f0ce34acbc.tar.gz -> ppsspp-1.4.2-ext_glslang.tar.gz https://github.com/Kingcom/armips/archive/770365d44df35d6e675c58bb2a774ca412278ef5.tar.gz -> ppsspp-1.4.2-ext_armips.tar.gz https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ppsspp-1.4.2-ext_armips_ext_tinyformat.tar.gz https://github.com/KhronosGroup/SPIRV-Cross/archive/6381b2ff9c0d975af8fd2974c97aa12a69ab6cc6.tar.gz -> ppsspp-1.4.2-ext_SPIRV-Cross.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=51f56903f7d727d96be60e4e4d54c802
diff --git a/games-emulation/ppsspp-1.4.2-r1 b/games-emulation/ppsspp-1.4.2-r1
deleted file mode 100644
index 98071e103e50..000000000000
--- a/games-emulation/ppsspp-1.4.2-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst prepare test unpack
-DEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl2 ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtopengl:5 dev-qt/qtwidgets:5 ) sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=A PSP emulator written in C++.
-EAPI=6
-HOMEPAGE=https://www.ppsspp.org/
-IUSE=+qt5 sdl headless libav +system-ffmpeg
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl2 ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtopengl:5 dev-qt/qtwidgets:5 )
-REQUIRED_USE=!headless? ( || ( qt5 sdl ) ) ?? ( qt5 sdl )
-SLOT=0
-SRC_URI=https://github.com/hrydgard/ppsspp/archive/v1.4.2.tar.gz -> ppsspp-1.4.2.tar.gz !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ppsspp-1.4.2-ffmpeg.tar.gz ) https://github.com/hrydgard/ppsspp-lang/archive/f32328a88cbf368af90eb79bc7ad5420795d6585.tar.gz -> ppsspp-1.4.2-assets_lang.tar.gz https://github.com/hrydgard/pspautotests/archive/e18cface3db64ccb96738dc128fe769b28fff65c.tar.gz -> ppsspp-1.4.2-pspautotests.tar.gz https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ppsspp-1.4.2-dx9sdk.tar.gz https://github.com/hrydgard/glslang/archive/b16f7e6819267e57c3c244808d1981f0ce34acbc.tar.gz -> ppsspp-1.4.2-ext_glslang.tar.gz https://github.com/Kingcom/armips/archive/770365d44df35d6e675c58bb2a774ca412278ef5.tar.gz -> ppsspp-1.4.2-ext_armips.tar.gz https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ppsspp-1.4.2-ext_armips_ext_tinyformat.tar.gz https://github.com/KhronosGroup/SPIRV-Cross/archive/6381b2ff9c0d975af8fd2974c97aa12a69ab6cc6.tar.gz -> ppsspp-1.4.2-ext_SPIRV-Cross.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=546c20d0b1dd4083a7fd78edb42197d9
diff --git a/games-emulation/ppsspp-1.5.4 b/games-emulation/ppsspp-1.5.4
deleted file mode 100644
index 94fae98acbd5..000000000000
--- a/games-emulation/ppsspp-1.5.4
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst prepare test unpack
-DEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl media-libs/libsdl2 ) qt5? ( dev-db/sqlite dev-qt/assistant:5 dev-qt/qtcore:5 dev-qt/qtdeclarative:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtopengl:5 dev-qt/qtsvg:5 dev-qt/qtwebkit:5 dev-qt/qtwidgets:5 ) sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=A PSP emulator written in C++.
-EAPI=6
-HOMEPAGE=https://www.ppsspp.org/
-IUSE=+qt5 sdl headless libav +system-ffmpeg
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl media-libs/libsdl2 ) qt5? ( dev-db/sqlite dev-qt/assistant:5 dev-qt/qtcore:5 dev-qt/qtdeclarative:5 dev-qt/qtgui:5 dev-qt/qtmultimedia:5 dev-qt/qtopengl:5 dev-qt/qtsvg:5 dev-qt/qtwebkit:5 dev-qt/qtwidgets:5 )
-REQUIRED_USE=!headless? ( || ( qt5 sdl ) ) ?? ( qt5 sdl )
-SLOT=0
-SRC_URI=https://github.com/hrydgard/ppsspp/archive/v1.5.4.tar.gz -> ppsspp-1.5.4.tar.gz !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ppsspp-1.5.4-ffmpeg.tar.gz ) https://github.com/hrydgard/ppsspp-lang/archive/1e3e4a0ba0ca8c0a092e027dfb7c1c4778366db5.tar.gz -> ppsspp-1.5.4-assets_lang.tar.gz https://github.com/hrydgard/pspautotests/archive/d02ba7407050f445edf9e908374ad4bf3b2f237b.tar.gz -> ppsspp-1.5.4-pspautotests.tar.gz https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ppsspp-1.5.4-dx9sdk.tar.gz https://github.com/hrydgard/glslang/archive/2edde6665d9a56ead5ea0e55b4e64d9a803e6164.tar.gz -> ppsspp-1.5.4-ext_glslang.tar.gz https://github.com/Kingcom/armips/archive/8b4cadaf62d7de42d374056fc6aafc555f2bc7dc.tar.gz -> ppsspp-1.5.4-ext_armips.tar.gz https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ppsspp-1.5.4-ext_armips_ext_tinyformat.tar.gz https://github.com/KhronosGroup/SPIRV-Cross/archive/90966d50f57608587bafd95b4e345b02b814754a.tar.gz -> ppsspp-1.5.4-ext_SPIRV-Cross.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=7e83f16af199173f7b186f84a3e193d2
diff --git a/games-emulation/ppsspp-1.5.4-r1 b/games-emulation/ppsspp-1.5.4-r1
deleted file mode 100644
index 91d8ff37ed86..000000000000
--- a/games-emulation/ppsspp-1.5.4-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst prepare test unpack
-DEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl2 ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtopengl:5 dev-qt/qtwidgets:5 ) sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=A PSP emulator written in C++.
-EAPI=6
-HOMEPAGE=https://www.ppsspp.org/
-IUSE=+qt5 sdl headless libav +system-ffmpeg
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl2 ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtopengl:5 dev-qt/qtwidgets:5 )
-REQUIRED_USE=!headless? ( || ( qt5 sdl ) ) ?? ( qt5 sdl )
-SLOT=0
-SRC_URI=https://github.com/hrydgard/ppsspp/archive/v1.5.4.tar.gz -> ppsspp-1.5.4.tar.gz !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ppsspp-1.5.4-ffmpeg.tar.gz ) https://github.com/hrydgard/ppsspp-lang/archive/1e3e4a0ba0ca8c0a092e027dfb7c1c4778366db5.tar.gz -> ppsspp-1.5.4-assets_lang.tar.gz https://github.com/hrydgard/pspautotests/archive/d02ba7407050f445edf9e908374ad4bf3b2f237b.tar.gz -> ppsspp-1.5.4-pspautotests.tar.gz https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ppsspp-1.5.4-dx9sdk.tar.gz https://github.com/hrydgard/glslang/archive/2edde6665d9a56ead5ea0e55b4e64d9a803e6164.tar.gz -> ppsspp-1.5.4-ext_glslang.tar.gz https://github.com/Kingcom/armips/archive/8b4cadaf62d7de42d374056fc6aafc555f2bc7dc.tar.gz -> ppsspp-1.5.4-ext_armips.tar.gz https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ppsspp-1.5.4-ext_armips_ext_tinyformat.tar.gz https://github.com/KhronosGroup/SPIRV-Cross/archive/90966d50f57608587bafd95b4e345b02b814754a.tar.gz -> ppsspp-1.5.4-ext_SPIRV-Cross.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=4f496940ba5301f7e2df3b209e5f176c
diff --git a/games-emulation/ppsspp-9999 b/games-emulation/ppsspp-9999
deleted file mode 100644
index 143e037e36e4..000000000000
--- a/games-emulation/ppsspp-9999
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install postinst prepare test unpack
-DEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl2 ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtopengl:5 dev-qt/qtwidgets:5 ) sys-devel/make >=dev-util/cmake-3.9.6 >=dev-vcs/git-1.8.2.1[curl]
-DESCRIPTION=A PSP emulator written in C++.
-EAPI=6
-HOMEPAGE=https://www.ppsspp.org/
-IUSE=+qt5 sdl headless libav +system-ffmpeg
-LICENSE=GPL-2
-RDEPEND=sys-libs/zlib system-ffmpeg? ( !libav? ( media-video/ffmpeg:= ) libav? ( media-video/libav:= ) ) sdl? ( media-libs/libsdl2 ) qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtopengl:5 dev-qt/qtwidgets:5 )
-REQUIRED_USE=!headless? ( || ( qt5 sdl ) ) ?? ( qt5 sdl )
-SLOT=0
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 git-r3 8f6de46b0aa318aea0e8cac62ece098b ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=d620ec088a59075e4a49876970159b1a
diff --git a/games-emulation/ppsspp/Manifest b/games-emulation/ppsspp/Manifest
new file mode 100644
index 000000000000..0fbf1c279269
--- /dev/null
+++ b/games-emulation/ppsspp/Manifest
@@ -0,0 +1,26 @@
+AUX ppsspp-1.4-O2.patch 1576 BLAKE2B 5831befac76d1a674c0bf453043c1ac36435c76f04ec5bd95885582c9f44c283232a9dbbea629433629d9fbfd5cc1415f5e0f47c50dbbdb9e834891280e98a49 SHA512 39f18c074e56aa823b223a78b099771257b4a5672a41c6d271cee5b817a2a63d17f57ad9f936da41185dae5b4bf2a94cc62cf92596d94b6e0660f1b05bf9ac2f
+AUX ppsspp-1.4.2-assets-lookup.patch 525 BLAKE2B e0614d010e1708cfdfeba376ece25c6bb121e79dae7243988706a80d6ef022ba52286878c9e7c868bbe23aca6c5182ca1e0c6b5baaa6e4b32e2c79eb4febd10f SHA512 9963aad44ce72e9625cdf816bf58743ab8936d8f1fd3c75ac9ddbda5e179cd71fa4d23321c42ba4d56bd472cc016a62430a0c6d8b84792e2851977a5155cbdb1
+DIST ppsspp-1.4.2-assets_lang.tar.gz 273563 BLAKE2B 54ab5cabe00ec8bd24fef62bc17894e8c663141283207eaa8ec79313d4d6131c3bb32f1d07f7e191592e973831e3852eff96d9e682d294d2cdf5967f95e0cae3 SHA512 b252e3335c84bedd24764caab15909f31dd8de60578b2c32ceab200a53de5689d8e82e1853c921d8835b780cefda10ea2ebe5e98e2afb4ba44204cc2b5209a5a
+DIST ppsspp-1.4.2-dx9sdk.tar.gz 14582591 BLAKE2B 12a370e262d045bab6f85237160189921e0bc9992726bb60d241c20a5714128995cf110bb5889c530f8cc3497a34645a96ff31b7b61fb3004279f26b15287435 SHA512 2c54b441b0a31f63ecab1bd2ab14254fb2047d35d2765262d43277330a8428fbf4c8848d5f730456a033cf84258f6b60a467213f8339289b3ab83ed7e94c65b7
+DIST ppsspp-1.4.2-ext_SPIRV-Cross.tar.gz 193267 BLAKE2B d7eb87441b78f95a6d37cec9d787728a8381fc0b1368a4856f8cf34ec813f891c16b35634630714239c661508143042909df6432922d5e703967941d28ead3a9 SHA512 0b24d28c9e98b170dc4ae51269dce04c100f9116e5fb66268b23878eab4ee7bfc28d257208e094fedf23be89a488e9497bb246d369711b72bf5e39332225d7bf
+DIST ppsspp-1.4.2-ext_armips.tar.gz 163666 BLAKE2B e9ec7d5e30027315d2f8b8b634ad99854ab9609f823e250a5cc63272cb938bc9e43c2c3ed53ceceee97fff93bbf42c150103b7c24a679c2af9eb14821df2a244 SHA512 9423bdbc1428700979c13276a427975733a07908fdf021dc6ab88cec0d37e9523aacd4a2a03eef23638070293dde3f1641647c47095ef2751982b9f9893c1baa
+DIST ppsspp-1.4.2-ext_armips_ext_tinyformat.tar.gz 22284 BLAKE2B d37c35efeb42e3998603127f8758cec29103b5f7700ff465d5234e032822965e9249b6d183dba9962a76bed06abeaf0c40ab701425d1fb4d64ffd83c9987fe8d SHA512 fb063ea9b632c8a9a0203c181830cb2feed9142fcf4d69c11cc0a3e8dcbb3cea51dde6bb351df567b3f105a4da99fd2e72ba3572d3fc0e9a45364f4115d6c3d1
+DIST ppsspp-1.4.2-ext_glslang.tar.gz 1685246 BLAKE2B c5a58a40587bd93d3b3d50a636714b599eb7eab3d7f798ffbd694b00a31f00b365ec88d47a94536fb6fac77b29377bdc46092fdd3c0d67631d2a8cd4af9ed34d SHA512 3605fb8a3c5dafcab97578030be4af3703f1475c8e9fd58412a514dcaa0ea6c7bf3a279510759496ab34b979a3d260d3da3d6f00d504c9c5e0f9a7b5a61399bc
+DIST ppsspp-1.4.2-ffmpeg.tar.gz 311610961 BLAKE2B e01b203ff1f230a27b02dab0596dedbc26e049190fa1607903b70023865c50de4fb7361de33c1bd1c5de305124ea02f2ba9ac854bf2f40f3e79259663cdfa4ec SHA512 d4bdb3c5a13bc64d7b22e38b416355d302a4401a1d8f6bd57a4d8502823dc9a2987df92b8e781ddab6de8ded9b59b268ef1b33f8f43a0be7b1c57d4ffbee6871
+DIST ppsspp-1.4.2-pspautotests.tar.gz 35084214 BLAKE2B b4c1b40cd016ac6a6547fbf6421bb9cdb35dfb0705c275d07c1fdb4f26a148cece3f125b32f0b15212148570179378cb845c0f56ff5529fe76ccbefab8384d8d SHA512 d42050bbbff976c2e09815e736b416a2b29baaed8516537429e47933738ae93c8bbe762088d150fed3fb2b781b79041834c6fdab362f667b16a5697423c78449
+DIST ppsspp-1.4.2.tar.gz 18922775 BLAKE2B ce680f53f8d1e8e34b79b7af6e53b20be4c331722c3b213c0b08478035d12b379e902c7ba58f45305410fbb491a28fb324c436cb310be66904d5cf3acd076a4b SHA512 fb36e211afa83363d036fac757010c6be9d1bcb4c0984f18ddf17871b04bc2b9b89f94341f6c0ada3a2709426cda863e2da5c66d60b72220dcceba7a5deca7e5
+DIST ppsspp-1.5.4-assets_lang.tar.gz 347859 BLAKE2B 648915773856a64dafb5d159e0917b4345ff99dba7b7dae4f343ecd81e1d835cb958766ab8928118ae4768564414e3dcceba474e05e99be23d56c9447c59786b SHA512 72983f01c51900fa133ca83d226a5daec78153c9d70fc1ca6233b531f3c5d5da5e307e377560789cecccad7a98ba8f66da104cc4375f51576f90c535dc980b98
+DIST ppsspp-1.5.4-dx9sdk.tar.gz 14582591 BLAKE2B 12a370e262d045bab6f85237160189921e0bc9992726bb60d241c20a5714128995cf110bb5889c530f8cc3497a34645a96ff31b7b61fb3004279f26b15287435 SHA512 2c54b441b0a31f63ecab1bd2ab14254fb2047d35d2765262d43277330a8428fbf4c8848d5f730456a033cf84258f6b60a467213f8339289b3ab83ed7e94c65b7
+DIST ppsspp-1.5.4-ext_SPIRV-Cross.tar.gz 228943 BLAKE2B 0b4ed8a751737bf6fce9fa766f0b8dc0671b49a6adf026c369ebd3776d9d8c23acd08b6d3f41666a6e23410ffb243917a844d9de85e3eca5ce04935421aaca98 SHA512 5fe2f772b571da0627fb9d9c424bea2b4ea1c0563e36ff455ddaf1b92ea3d5ee636e039a0619e0971478ce10e163b45258e9b03d2610c573f74d1cfd08549bb8
+DIST ppsspp-1.5.4-ext_armips.tar.gz 191245 BLAKE2B 8bfeb8828bc2496c0222b22547820f00c5a695dc9469a2ce6b8fe7bc15e72af862a957e632af1829bfdd4cf663a586baa10495896971b9b138780ddc387aae9b SHA512 9ab376b928fadcbff7256ff10d6581e4960e00e48a93f47f7e90b1998022a8d03cadef20880aa020fe6b62e4fa43cf28fc68dc5b10e93b1212fd6788ae493dba
+DIST ppsspp-1.5.4-ext_armips_ext_tinyformat.tar.gz 22284 BLAKE2B d37c35efeb42e3998603127f8758cec29103b5f7700ff465d5234e032822965e9249b6d183dba9962a76bed06abeaf0c40ab701425d1fb4d64ffd83c9987fe8d SHA512 fb063ea9b632c8a9a0203c181830cb2feed9142fcf4d69c11cc0a3e8dcbb3cea51dde6bb351df567b3f105a4da99fd2e72ba3572d3fc0e9a45364f4115d6c3d1
+DIST ppsspp-1.5.4-ext_glslang.tar.gz 1944927 BLAKE2B a9bfae046335f8cba72fc92208fd0370d1808d242c00964c5507ce7d6aab2ad10ef839e8f46c46ba9ac039e11469e26877f89a51843ad035f33b434212a18317 SHA512 333a93707e067ac1d98c69533c2d206675d75aa54195326accf33e8401ac2fb412d2e2525b0ee1313f141872aa6ea430ae5424e8712483c59f77dc3adbcb4f59
+DIST ppsspp-1.5.4-ffmpeg.tar.gz 311610961 BLAKE2B e01b203ff1f230a27b02dab0596dedbc26e049190fa1607903b70023865c50de4fb7361de33c1bd1c5de305124ea02f2ba9ac854bf2f40f3e79259663cdfa4ec SHA512 d4bdb3c5a13bc64d7b22e38b416355d302a4401a1d8f6bd57a4d8502823dc9a2987df92b8e781ddab6de8ded9b59b268ef1b33f8f43a0be7b1c57d4ffbee6871
+DIST ppsspp-1.5.4-pspautotests.tar.gz 36005395 BLAKE2B fa92d1acb0adfecb23f55132c4e85843c3c04c73e4bc8cfb054cfa8e0b67fe1c03c4a83032892bc534a78a64bf190da00db91fd49df4c3838e5b8d0396cce15b SHA512 1485eace5526f53f6c41200e63d6d5d0ff217f22ec4788d58b33a33c64e344609f95bf2b73a8f35fd395914b33910b38a0348b35b488dadbdd43e24ac0bfed9f
+DIST ppsspp-1.5.4.tar.gz 19008538 BLAKE2B 10ca63a3f05757bd091a66b6563e34b3ca3c9c4df12a0b7796e42776d54997bec581582ee16706d5fb3630ebb8c0bcd1a5c0040856d94330865932b3d1ada2db SHA512 dbf4d2e9cc94a64908d5006ad562da72860fd12dadac66b0bdc6903d4cad4c81436963e24017517aa261440fd15efff6e5cab6ed7801928e107d7982d1604714
+EBUILD ppsspp-1.4.2-r1.ebuild 3149 BLAKE2B 6e5793b47694b730e8c54abf6656d32f06230dc52a12de21570d9250494fafcf91fbf0a4926180dfb5d81344dab940e18c456d19c10282a41f4c28d5d303039a SHA512 bb496040f78fe330c714ffde35cf364c961b2fddc7b20a53f857050f33529eb8a2b3d1f3e837a010d3d8ecd002723ee45a6051a8aa4853c8255e4e358a2eab38
+EBUILD ppsspp-1.4.2.ebuild 3294 BLAKE2B 70e77c3a3560aef03626b1398c4b4b37d45d57eb546e4e85b87d8e7560b0a30a2a779b24725f1329a167d8e496346d2273fa98ff32bbed1a0c56ccaf45687888 SHA512 a886a1b98c06ded0c52d2052a7f75c5cc313ef87b64997508a95c45db86df20c069aa38961ce385a127debf0757d8f3baf6ecc75482fadd5005faab8d80f7feb
+EBUILD ppsspp-1.5.4-r1.ebuild 3156 BLAKE2B daa114667318aede5fbfc1b8a02a6b8920c81dd2fda241b57a4c6011974b97d4e48c5da511eb40d5c8c661045a9189170d16e3057f1cf229acc95486a2ad09cc SHA512 8697cb9a5ba55f6ef84ac9a2896cc16ac23ab106e619324e95ff0cf2b2711cb4f24d7042977d1b7881f8f3bb6abbdac0a53654b12b6d4eb743169c2369d89e28
+EBUILD ppsspp-1.5.4.ebuild 3301 BLAKE2B 900cfb98f21129adb7fee7eac4a2b1b5dcae11e6f5f5eb6a9af8373cf428771d0ee7fe44de2732afe9fcb250ddce65f5092503849c8105e1e507120cd4eef4a8 SHA512 37281cec1fff6577fd102e449eb070d15e035ae735cba4c0e91f4d4b963af02d6c057947211cf8402537403990abc9f15650654bd282073b8f23dbedfa7a8b68
+EBUILD ppsspp-9999.ebuild 2164 BLAKE2B fbdc48fdfb6a2c963f15b13b1c0eb39ce8dca8101105ac5ac260c56007f8af1dbd8821ffad1495d1bcb79e05e42f0917b6c7145a2976e0be54b8948ae7eaa63c SHA512 538bec64d920089826856c6c19c2db352d211d2c8dd6dd74ef00f7fa082a65d5f119c0beaaca8acd49e4da48c28b59340fd78640022d9d3bebb2e883980d0bb5
+MISC metadata.xml 677 BLAKE2B b19f83bb3fa7ff9a1b6d8c9ea4caf75d6a32cd2bb78e43bae9e07c217d69108b8c6f8b00f7f81f9f2a2823cac8414b9b2022f443cdfe3e4132273617fab3f806 SHA512 57b8a912c8a000574da72dd02db7b91a3d0f9bd4d5a833afb93afe24fcd4b0e6a1f382a827f9c53e575368b8747ec62dc050da092eb1368875cb77326f2e9e74
diff --git a/games-emulation/ppsspp/files/ppsspp-1.4-O2.patch b/games-emulation/ppsspp/files/ppsspp-1.4-O2.patch
new file mode 100644
index 000000000000..55954c7c7389
--- /dev/null
+++ b/games-emulation/ppsspp/files/ppsspp-1.4-O2.patch
@@ -0,0 +1,32 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 19038c88a436..bf50f5cf52fb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -195,11 +195,11 @@ if(NOT MSVC)
+
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -D_DEBUG")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -D_NDEBUG")
++ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -D_NDEBUG")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -D_NDEBUG")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -D_DEBUG")
+ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
+- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -D_NDEBUG")
++ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -D_NDEBUG")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O2 -g -D_NDEBUG")
+ #TODO: Remove this and include the file properly everywhere it makes sense
+ # First step is too use the macros everywhere
+@@ -509,10 +509,10 @@ include_directories(ext/cityhash)
+
+ if (NOT MSVC)
+ # These can be fast even for debug.
+- set_target_properties(udis86 PROPERTIES COMPILE_FLAGS "-O3")
+- set_target_properties(cityhash PROPERTIES COMPILE_FLAGS "-O3")
++ set_target_properties(udis86 PROPERTIES COMPILE_FLAGS "-O2")
++ set_target_properties(cityhash PROPERTIES COMPILE_FLAGS "-O2")
+ if(NOT ZLIB_FOUND)
+- set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-O3")
++ set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-O2")
+ endif()
+ endif()
+
diff --git a/games-emulation/ppsspp/files/ppsspp-1.4.2-assets-lookup.patch b/games-emulation/ppsspp/files/ppsspp-1.4.2-assets-lookup.patch
new file mode 100644
index 000000000000..2a136a39e8de
--- /dev/null
+++ b/games-emulation/ppsspp/files/ppsspp-1.4.2-assets-lookup.patch
@@ -0,0 +1,13 @@
+diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp
+index 717177ef81ff..22239782210d 100644
+--- a/UI/NativeApp.cpp
++++ b/UI/NativeApp.cpp
+@@ -317,7 +317,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
+
+ // We want this to be FIRST.
+ #ifdef USING_QT_UI
+- VFSRegister("", new AssetsAssetReader());
++ VFSRegister("", new DirectoryAssetReader("/usr/share/ppsspp/assets/"));
+ #elif defined(IOS)
+ // Packed assets are included in app
+ VFSRegister("", new DirectoryAssetReader(external_dir));
diff --git a/games-emulation/ppsspp/metadata.xml b/games-emulation/ppsspp/metadata.xml
new file mode 100644
index 000000000000..69ffc51152a5
--- /dev/null
+++ b/games-emulation/ppsspp/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>fdsfgs@krutt.org</email>
+ <name>soredake</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="headless">Build headless version of the PPSSPP</flag>
+ <flag name="system-ffmpeg">Use the system-wide media-video/ffmpeg instead of bundled</flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/hrydgard/ppsspp/issues</bugs-to>
+ <remote-id type="github">hrydgard/ppsspp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/ppsspp/ppsspp-1.4.2-r1.ebuild b/games-emulation/ppsspp/ppsspp-1.4.2-r1.ebuild
new file mode 100644
index 000000000000..b50b2c98db5c
--- /dev/null
+++ b/games-emulation/ppsspp/ppsspp-1.4.2-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit desktop cmake-utils
+
+DESCRIPTION="A PSP emulator written in C++."
+HOMEPAGE="https://www.ppsspp.org/"
+SRC_URI="
+ https://github.com/hrydgard/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ${P}-ffmpeg.tar.gz )
+ https://github.com/hrydgard/ppsspp-lang/archive/f32328a88cbf368af90eb79bc7ad5420795d6585.tar.gz -> ${P}-assets_lang.tar.gz
+ https://github.com/hrydgard/pspautotests/archive/e18cface3db64ccb96738dc128fe769b28fff65c.tar.gz -> ${P}-pspautotests.tar.gz
+ https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ${P}-dx9sdk.tar.gz
+ https://github.com/hrydgard/glslang/archive/b16f7e6819267e57c3c244808d1981f0ce34acbc.tar.gz -> ${P}-ext_glslang.tar.gz
+ https://github.com/Kingcom/armips/archive/770365d44df35d6e675c58bb2a774ca412278ef5.tar.gz -> ${P}-ext_armips.tar.gz
+ https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ${P}-ext_armips_ext_tinyformat.tar.gz
+ https://github.com/KhronosGroup/SPIRV-Cross/archive/6381b2ff9c0d975af8fd2974c97aa12a69ab6cc6.tar.gz -> ${P}-ext_SPIRV-Cross.tar.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+qt5 sdl headless libav +system-ffmpeg"
+REQUIRED_USE="
+ !headless? ( || ( qt5 sdl ) )
+ ?? ( qt5 sdl )
+"
+
+RDEPEND="sys-libs/zlib
+ system-ffmpeg? (
+ !libav? ( media-video/ffmpeg:= )
+ libav? ( media-video/libav:= )
+ )
+ sdl? ( media-libs/libsdl2 )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtopengl:5
+ dev-qt/qtwidgets:5
+ )"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-assets-lookup.patch
+ "${FILESDIR}"/${PN}-1.4-O2.patch
+)
+
+src_unpack() {
+ unpack "${P}.tar.gz"
+ cd "${S}" || die
+ local i list=( assets_lang pspautotests dx9sdk ext_glslang ext_armips ext_SPIRV-Cross ext_armips_ext_tinyformat )
+ if ! use system-ffmpeg; then
+ list+=( ffmpeg )
+ fi
+ for i in "${list[@]}"; do
+ tar xf "${DISTDIR}/${P}-${i}.tar.gz" --strip-components 1 -C "${i//_//}" || die "Failed to unpack ${P}-${i}.tar.gz"
+ done
+}
+
+src_prepare() {
+ if ! use system-ffmpeg; then
+ sed -i -e "s#-O3#-O2#g;" "${S}"/ffmpeg/linux_*.sh || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSING_QT_UI=$(usex qt5)
+ -DUSE_SYSTEM_FFMPEG=$(usex system-ffmpeg)
+ -DHEADLESS=$(usex headless)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use headless && dobin "${BUILD_DIR}/PPSSPPHeadless"
+ insinto /usr/share/"${PN}"
+ doins -r "${BUILD_DIR}/assets"
+ if use qt5 || use sdl ; then
+ dobin "${BUILD_DIR}/PPSSPP$(usex qt5 Qt SDL)"
+ local i
+ for i in 16 24 32 48 64 96 128 256 512 ; do
+ doicon -s ${i} "icons/hicolor/${i}x${i}/apps/${PN}.png"
+ done
+ make_desktop_entry "PPSSPP$(usex qt5 Qt SDL)" "PPSSPP ($(usex qt5 Qt SDL))" "${PN}" "Game"
+ fi
+}
+
+pkg_postinst() {
+ if use system-ffmpeg; then
+ ewarn "system-ffmpeg USE flag is enabled, some bugs might arise due to it."
+ ewarn "See https://github.com/hrydgard/ppsspp/issues/9026 for more informations."
+ fi
+}
diff --git a/games-emulation/ppsspp/ppsspp-1.4.2.ebuild b/games-emulation/ppsspp/ppsspp-1.4.2.ebuild
new file mode 100644
index 000000000000..7a5ad73a8935
--- /dev/null
+++ b/games-emulation/ppsspp/ppsspp-1.4.2.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils cmake-utils
+
+DESCRIPTION="A PSP emulator written in C++."
+HOMEPAGE="https://www.ppsspp.org/"
+SRC_URI="
+ https://github.com/hrydgard/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ${P}-ffmpeg.tar.gz )
+ https://github.com/hrydgard/ppsspp-lang/archive/f32328a88cbf368af90eb79bc7ad5420795d6585.tar.gz -> ${P}-assets_lang.tar.gz
+ https://github.com/hrydgard/pspautotests/archive/e18cface3db64ccb96738dc128fe769b28fff65c.tar.gz -> ${P}-pspautotests.tar.gz
+ https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ${P}-dx9sdk.tar.gz
+ https://github.com/hrydgard/glslang/archive/b16f7e6819267e57c3c244808d1981f0ce34acbc.tar.gz -> ${P}-ext_glslang.tar.gz
+ https://github.com/Kingcom/armips/archive/770365d44df35d6e675c58bb2a774ca412278ef5.tar.gz -> ${P}-ext_armips.tar.gz
+ https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ${P}-ext_armips_ext_tinyformat.tar.gz
+ https://github.com/KhronosGroup/SPIRV-Cross/archive/6381b2ff9c0d975af8fd2974c97aa12a69ab6cc6.tar.gz -> ${P}-ext_SPIRV-Cross.tar.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+qt5 sdl headless libav +system-ffmpeg"
+REQUIRED_USE="
+ !headless? ( || ( qt5 sdl ) )
+ ?? ( qt5 sdl )
+"
+
+RDEPEND="sys-libs/zlib
+ system-ffmpeg? (
+ !libav? ( media-video/ffmpeg:= )
+ libav? ( media-video/libav:= )
+ )
+ sdl? (
+ media-libs/libsdl
+ media-libs/libsdl2
+ )
+ qt5? (
+ dev-db/sqlite
+ dev-qt/assistant:5
+ dev-qt/qtcore:5
+ dev-qt/qtdeclarative:5
+ dev-qt/qtgui:5
+ dev-qt/qtmultimedia:5
+ dev-qt/qtopengl:5
+ dev-qt/qtsvg:5
+ dev-qt/qtwebkit:5
+ dev-qt/qtwidgets:5
+ )"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-assets-lookup.patch
+ "${FILESDIR}"/${PN}-1.4-O2.patch
+)
+
+src_unpack() {
+ unpack "${P}.tar.gz"
+ cd "${S}" || die
+ local i list=( assets_lang pspautotests dx9sdk ext_glslang ext_armips ext_SPIRV-Cross ext_armips_ext_tinyformat )
+ if ! use system-ffmpeg; then
+ list+=( ffmpeg )
+ fi
+ for i in "${list[@]}"; do
+ tar xf "${DISTDIR}/${P}-${i}.tar.gz" --strip-components 1 -C "${i//_//}" || die "Failed to unpack ${P}-${i}.tar.gz"
+ done
+}
+
+src_prepare() {
+ if ! use system-ffmpeg; then
+ sed -i -e "s#-O3#-O2#g;" "${S}"/ffmpeg/linux_*.sh || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSING_QT_UI=$(usex qt5)
+ -DUSE_SYSTEM_FFMPEG=$(usex system-ffmpeg)
+ -DHEADLESS=$(usex headless)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use headless && dobin "${BUILD_DIR}/PPSSPPHeadless"
+ insinto /usr/share/"${PN}"
+ doins -r "${BUILD_DIR}/assets"
+ if use qt5 || use sdl ; then
+ dobin "${BUILD_DIR}/PPSSPP$(usex qt5 Qt SDL)"
+ local i
+ for i in 16 24 32 48 64 96 128 256 512 ; do
+ doicon -s ${i} "icons/hicolor/${i}x${i}/apps/${PN}.png"
+ done
+ make_desktop_entry "PPSSPP$(usex qt5 Qt SDL)" "PPSSPP ($(usex qt5 Qt SDL))" "${PN}" "Game"
+ fi
+}
+
+pkg_postinst() {
+ if use system-ffmpeg; then
+ ewarn "system-ffmpeg USE flag is enabled, some bugs might arise due to it."
+ ewarn "See https://github.com/hrydgard/ppsspp/issues/9026 for more informations."
+ fi
+}
diff --git a/games-emulation/ppsspp/ppsspp-1.5.4-r1.ebuild b/games-emulation/ppsspp/ppsspp-1.5.4-r1.ebuild
new file mode 100644
index 000000000000..023b9217fe85
--- /dev/null
+++ b/games-emulation/ppsspp/ppsspp-1.5.4-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit desktop cmake-utils
+
+DESCRIPTION="A PSP emulator written in C++."
+HOMEPAGE="https://www.ppsspp.org/"
+SRC_URI="
+ https://github.com/hrydgard/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ${P}-ffmpeg.tar.gz )
+ https://github.com/hrydgard/ppsspp-lang/archive/1e3e4a0ba0ca8c0a092e027dfb7c1c4778366db5.tar.gz -> ${P}-assets_lang.tar.gz
+ https://github.com/hrydgard/pspautotests/archive/d02ba7407050f445edf9e908374ad4bf3b2f237b.tar.gz -> ${P}-pspautotests.tar.gz
+ https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ${P}-dx9sdk.tar.gz
+ https://github.com/hrydgard/glslang/archive/2edde6665d9a56ead5ea0e55b4e64d9a803e6164.tar.gz -> ${P}-ext_glslang.tar.gz
+ https://github.com/Kingcom/armips/archive/8b4cadaf62d7de42d374056fc6aafc555f2bc7dc.tar.gz -> ${P}-ext_armips.tar.gz
+ https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ${P}-ext_armips_ext_tinyformat.tar.gz
+ https://github.com/KhronosGroup/SPIRV-Cross/archive/90966d50f57608587bafd95b4e345b02b814754a.tar.gz -> ${P}-ext_SPIRV-Cross.tar.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+qt5 sdl headless libav +system-ffmpeg"
+REQUIRED_USE="
+ !headless? ( || ( qt5 sdl ) )
+ ?? ( qt5 sdl )
+"
+
+RDEPEND="sys-libs/zlib
+ system-ffmpeg? (
+ !libav? ( media-video/ffmpeg:= )
+ libav? ( media-video/libav:= )
+ )
+ sdl? ( media-libs/libsdl2 )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtopengl:5
+ dev-qt/qtwidgets:5
+ )"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.2-assets-lookup.patch
+ "${FILESDIR}"/${PN}-1.4-O2.patch
+)
+
+src_unpack() {
+ unpack "${P}.tar.gz"
+ cd "${S}" || die
+ local i list=( assets_lang pspautotests dx9sdk ext_glslang ext_armips ext_SPIRV-Cross ext_armips_ext_tinyformat )
+ if ! use system-ffmpeg; then
+ list+=( ffmpeg )
+ fi
+ for i in "${list[@]}"; do
+ tar xf "${DISTDIR}/${P}-${i}.tar.gz" --strip-components 1 -C "${i//_//}" || die "Failed to unpack ${P}-${i}.tar.gz"
+ done
+}
+
+src_prepare() {
+ if ! use system-ffmpeg; then
+ sed -i -e "s#-O3#-O2#g;" "${S}"/ffmpeg/linux_*.sh || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSING_QT_UI=$(usex qt5)
+ -DUSE_SYSTEM_FFMPEG=$(usex system-ffmpeg)
+ -DHEADLESS=$(usex headless)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use headless && dobin "${BUILD_DIR}/PPSSPPHeadless"
+ insinto /usr/share/"${PN}"
+ doins -r "${BUILD_DIR}/assets"
+ if use qt5 || use sdl ; then
+ dobin "${BUILD_DIR}/PPSSPP$(usex qt5 Qt SDL)"
+ local i
+ for i in 16 24 32 48 64 96 128 256 512 ; do
+ doicon -s ${i} "icons/hicolor/${i}x${i}/apps/${PN}.png"
+ done
+ make_desktop_entry "PPSSPP$(usex qt5 Qt SDL)" "PPSSPP ($(usex qt5 Qt SDL))" "${PN}" "Game"
+ fi
+}
+
+pkg_postinst() {
+ if use system-ffmpeg; then
+ ewarn "system-ffmpeg USE flag is enabled, some bugs might arise due to it."
+ ewarn "See https://github.com/hrydgard/ppsspp/issues/9026 for more informations."
+ fi
+}
diff --git a/games-emulation/ppsspp/ppsspp-1.5.4.ebuild b/games-emulation/ppsspp/ppsspp-1.5.4.ebuild
new file mode 100644
index 000000000000..3204b52eb098
--- /dev/null
+++ b/games-emulation/ppsspp/ppsspp-1.5.4.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils cmake-utils
+
+DESCRIPTION="A PSP emulator written in C++."
+HOMEPAGE="https://www.ppsspp.org/"
+SRC_URI="
+ https://github.com/hrydgard/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ !system-ffmpeg? ( https://github.com/hrydgard/ppsspp-ffmpeg/archive/a2e98d7ba4c7c5cac08608732c3058cb46e3e0ef.tar.gz -> ${P}-ffmpeg.tar.gz )
+ https://github.com/hrydgard/ppsspp-lang/archive/1e3e4a0ba0ca8c0a092e027dfb7c1c4778366db5.tar.gz -> ${P}-assets_lang.tar.gz
+ https://github.com/hrydgard/pspautotests/archive/d02ba7407050f445edf9e908374ad4bf3b2f237b.tar.gz -> ${P}-pspautotests.tar.gz
+ https://github.com/hrydgard/minidx9/archive/7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93.tar.gz -> ${P}-dx9sdk.tar.gz
+ https://github.com/hrydgard/glslang/archive/2edde6665d9a56ead5ea0e55b4e64d9a803e6164.tar.gz -> ${P}-ext_glslang.tar.gz
+ https://github.com/Kingcom/armips/archive/8b4cadaf62d7de42d374056fc6aafc555f2bc7dc.tar.gz -> ${P}-ext_armips.tar.gz
+ https://github.com/Kingcom/tinyformat/archive/b7f5a22753c81d834ab5133d655f1fd525280765.tar.gz -> ${P}-ext_armips_ext_tinyformat.tar.gz
+ https://github.com/KhronosGroup/SPIRV-Cross/archive/90966d50f57608587bafd95b4e345b02b814754a.tar.gz -> ${P}-ext_SPIRV-Cross.tar.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+qt5 sdl headless libav +system-ffmpeg"
+REQUIRED_USE="
+ !headless? ( || ( qt5 sdl ) )
+ ?? ( qt5 sdl )
+"
+
+RDEPEND="sys-libs/zlib
+ system-ffmpeg? (
+ !libav? ( media-video/ffmpeg:= )
+ libav? ( media-video/libav:= )
+ )
+ sdl? (
+ media-libs/libsdl
+ media-libs/libsdl2
+ )
+ qt5? (
+ dev-db/sqlite
+ dev-qt/assistant:5
+ dev-qt/qtcore:5
+ dev-qt/qtdeclarative:5
+ dev-qt/qtgui:5
+ dev-qt/qtmultimedia:5
+ dev-qt/qtopengl:5
+ dev-qt/qtsvg:5
+ dev-qt/qtwebkit:5
+ dev-qt/qtwidgets:5
+ )"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.2-assets-lookup.patch
+ "${FILESDIR}"/${PN}-1.4-O2.patch
+)
+
+src_unpack() {
+ unpack "${P}.tar.gz"
+ cd "${S}" || die
+ local i list=( assets_lang pspautotests dx9sdk ext_glslang ext_armips ext_SPIRV-Cross ext_armips_ext_tinyformat )
+ if ! use system-ffmpeg; then
+ list+=( ffmpeg )
+ fi
+ for i in "${list[@]}"; do
+ tar xf "${DISTDIR}/${P}-${i}.tar.gz" --strip-components 1 -C "${i//_//}" || die "Failed to unpack ${P}-${i}.tar.gz"
+ done
+}
+
+src_prepare() {
+ if ! use system-ffmpeg; then
+ sed -i -e "s#-O3#-O2#g;" "${S}"/ffmpeg/linux_*.sh || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSING_QT_UI=$(usex qt5)
+ -DUSE_SYSTEM_FFMPEG=$(usex system-ffmpeg)
+ -DHEADLESS=$(usex headless)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use headless && dobin "${BUILD_DIR}/PPSSPPHeadless"
+ insinto /usr/share/"${PN}"
+ doins -r "${BUILD_DIR}/assets"
+ if use qt5 || use sdl ; then
+ dobin "${BUILD_DIR}/PPSSPP$(usex qt5 Qt SDL)"
+ local i
+ for i in 16 24 32 48 64 96 128 256 512 ; do
+ doicon -s ${i} "icons/hicolor/${i}x${i}/apps/${PN}.png"
+ done
+ make_desktop_entry "PPSSPP$(usex qt5 Qt SDL)" "PPSSPP ($(usex qt5 Qt SDL))" "${PN}" "Game"
+ fi
+}
+
+pkg_postinst() {
+ if use system-ffmpeg; then
+ ewarn "system-ffmpeg USE flag is enabled, some bugs might arise due to it."
+ ewarn "See https://github.com/hrydgard/ppsspp/issues/9026 for more informations."
+ fi
+}
diff --git a/games-emulation/ppsspp/ppsspp-9999.ebuild b/games-emulation/ppsspp/ppsspp-9999.ebuild
new file mode 100644
index 000000000000..5ece82adfcce
--- /dev/null
+++ b/games-emulation/ppsspp/ppsspp-9999.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils cmake-utils git-r3
+
+DESCRIPTION="A PSP emulator written in C++."
+HOMEPAGE="https://www.ppsspp.org/"
+EGIT_REPO_URI="https://github.com/hrydgard/${PN}.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+qt5 sdl headless libav +system-ffmpeg"
+REQUIRED_USE="
+ !headless? ( || ( qt5 sdl ) )
+ ?? ( qt5 sdl )
+"
+EGIT_SUBMODULES=( '*' )
+
+RDEPEND="sys-libs/zlib
+ system-ffmpeg? (
+ !libav? ( media-video/ffmpeg:= )
+ libav? ( media-video/libav:= )
+ )
+ sdl? ( media-libs/libsdl2 )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtopengl:5
+ dev-qt/qtwidgets:5
+ )"
+
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ use system-ffmpeg && EGIT_SUBMODULES+=( '-ffmpeg' )
+ git-r3_src_unpack
+}
+
+src_prepare() {
+ # https://github.com/hrydgard/ppsspp/blob/150619c5a341f372266bec86fd874ac5a1343a43/UI/NativeApp.cpp#L318
+ # patch ppsspp to use /usr/share instead of working dir to find the assets
+ sed -i 's|VFSRegister("", new AssetsAssetReader());|VFSRegister("", new DirectoryAssetReader("/usr/share/ppsspp/assets/"));|g' UI/NativeApp.cpp || die "Patching qt assets path failed"
+
+ sed -i -e "s#-O3#-O2#g;" "${S}"/CMakeLists.txt || die
+ if ! use system-ffmpeg; then
+ sed -i -e "s#-O3#-O2#g;" "${S}"/ffmpeg/linux_*.sh || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSING_QT_UI=$(usex qt5)
+ -DUSE_SYSTEM_FFMPEG=$(usex system-ffmpeg)
+ -DHEADLESS=$(usex headless)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ use headless && dobin "${BUILD_DIR}/PPSSPPHeadless"
+ insinto /usr/share/"${PN}"
+ doins -r "${BUILD_DIR}/assets"
+ if use qt5 || use sdl ; then
+ dobin "${BUILD_DIR}/PPSSPP$(usex qt5 Qt SDL)"
+ local i
+ for i in 16 24 32 48 64 96 128 256 512 ; do
+ doicon -s ${i} "icons/hicolor/${i}x${i}/apps/${PN}.png"
+ done
+ make_desktop_entry "PPSSPP$(usex qt5 Qt SDL)" "PPSSPP ($(usex qt5 Qt SDL))" "${PN}" "Game"
+ fi
+}
+
+pkg_postinst() {
+ if use system-ffmpeg; then
+ ewarn "system-ffmpeg USE flag is enabled, some bugs might arise due to it."
+ ewarn "See https://github.com/hrydgard/ppsspp/issues/9026 for more informations."
+ fi
+}
diff --git a/games-emulation/raine-0.51.9 b/games-emulation/raine-0.51.9
deleted file mode 100644
index 47a48b4d556a..000000000000
--- a/games-emulation/raine-0.51.9
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install postinst preinst prepare setup unpack
-DEPEND=dev-cpp/muParser media-libs/libsdl[sound,joystick,video] sys-libs/zlib media-libs/sdl-image[png] media-libs/sdl-ttf dev-lang/nasm app-arch/unzip
-DESCRIPTION=R A I N E M680x0 Arcade Emulation
-EAPI=5
-HOMEPAGE=http://rainemu.swishparty.co.uk/
-KEYWORDS=~x86
-LICENSE=Artistic
-RDEPEND=dev-cpp/muParser media-libs/libsdl[sound,joystick,video] sys-libs/zlib media-libs/sdl-image[png] media-libs/sdl-ttf games-misc/games-envd
-SLOT=0
-SRC_URI=http://rainemu.swishparty.co.uk/html/archive/raines-0.51.9.tar.bz2
-_eclasses_=base 983774947da124fb7d542ce25a218bb1 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 games 2bb3ede665927a68ffdb7c41eec7efde ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=822c65977d750743004d75560728acf7
diff --git a/games-emulation/raine/Manifest b/games-emulation/raine/Manifest
new file mode 100644
index 000000000000..458c32e8cc7e
--- /dev/null
+++ b/games-emulation/raine/Manifest
@@ -0,0 +1,6 @@
+AUX raine-0.51.9-ldflags.patch 436 BLAKE2B c74bce3d761358d4ff0e469b197e4eb8b1632d59ae2508ff54061b8fd14daba8547079866b91dd7149ad581222672ffdee028955fe26ee006d75f75079e9e993 SHA512 d4b6e1ce4a6ede3c17f0b6aac5a556e52eada51c75381bca7c0fbb48ec105d0a332392837de0182ab361f6e7a44258a2bf87c0010301ef201a22980f055d9e6e
+AUX raine-0.51.9-libpng15.patch 296 BLAKE2B 464b855426c405ba7d98e17c9df2cf89d395aa61ddb179252da300de378e6fd6c2d6b8e5223ed796d9680d6bcf7bb8cc2339c7e8912f464d17c7dbb1b04ba377 SHA512 6e15b001a2a113605ae5c7d026865b8aaef38cbfe57b471624687de1f904fd26618ef1b1156d3d50ad5f39710d2122a4f90ae9f30358f3d955a4a9ea223db1b2
+AUX raine-0.51.9-underlink.patch 483 BLAKE2B cf6759591fe406a65a6466b9cbf1bcb4bf3ab7fc1236dcbe0c7a729e0047e51302abd528b8fdecdf2d8704d24a80f35eb1d4200cb3ba3c298bc92964858d6cb4 SHA512 72ded715c9e1c7b92d6cb8e3e6ccc339de050a36fe777681db39e8910e6f7734ba6f6e80708f93f6f8f078f268412b4f27fcd877c7b012ed3a630ee0d94ba023
+DIST raines-0.51.9.tar.bz2 2095980 BLAKE2B df83e0869229fc832e356d5cd122c737bfafe3b4ee8b8914cb14e30b9f48b97145123f989e36a2a01243bc62d2f49f50e5e43f2da2a433751410f72a23edd315 SHA512 e21346d72c63d8ba1bc6832bd885fa9ec0865c788742e572ef9941d3a4fd3f23710d076253d7a50878ef512ff3024e57098c0ba28c0c794bdefa994b8b7780bf
+EBUILD raine-0.51.9.ebuild 1331 BLAKE2B 7093b566c9c3a38360ba8909ca3f58f74121599bb55fa6aa65133451894d51a5c3421492711ff4a3ffa13d618d8f63b782d1682b3135d82356b05812b776e5a5 SHA512 9f6224b331a030825873736c2952e754b7732117339d973f4a950d387f3a4b6918332b380dfbcb6cc9eba570c1dd6d47356a87941a7a0d4cd46d93724d598130
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/raine/files/raine-0.51.9-ldflags.patch b/games-emulation/raine/files/raine-0.51.9-ldflags.patch
new file mode 100644
index 000000000000..f011cd6a1e5c
--- /dev/null
+++ b/games-emulation/raine/files/raine-0.51.9-ldflags.patch
@@ -0,0 +1,11 @@
+--- makefile.old 2010-10-08 10:04:46.000000000 +0200
++++ makefile 2010-10-08 10:05:25.000000000 +0200
+@@ -995,7 +995,7 @@
+ else
+ @echo Linking Raine...
+ endif
+- $(LDV) $(LFLAGS) -g -Wall -Wno-write-strings -o $(RAINE_EXE) $(OBJS) $(LIBS) -lstdc++
++ $(LDV) $(LDFLAGS) $(LFLAGS) -g -Wall -Wno-write-strings -o $(RAINE_EXE) $(OBJS) $(LIBS) -lstdc++
+
+ converter: source/bonus/converter.c
+ $(CCV) $(CFLAGS) -c $< -o $(OBJDIR)/converter.o
diff --git a/games-emulation/raine/files/raine-0.51.9-libpng15.patch b/games-emulation/raine/files/raine-0.51.9-libpng15.patch
new file mode 100644
index 000000000000..675df24801dc
--- /dev/null
+++ b/games-emulation/raine/files/raine-0.51.9-libpng15.patch
@@ -0,0 +1,13 @@
+http://bugs.gentoo.org/388255
+
+--- source/savepng.c
++++ source/savepng.c
+@@ -203,7 +203,7 @@
+ goto Error;
+
+ /* Set error handling. */
+- if (setjmp(png_ptr->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ /* If we get here, we had a problem reading the file. */
+ goto Error;
+ }
diff --git a/games-emulation/raine/files/raine-0.51.9-underlink.patch b/games-emulation/raine/files/raine-0.51.9-underlink.patch
new file mode 100644
index 000000000000..e9eb42bedbb3
--- /dev/null
+++ b/games-emulation/raine/files/raine-0.51.9-underlink.patch
@@ -0,0 +1,11 @@
+--- makefile.old 2011-06-16 08:25:35.000000000 +0200
++++ makefile 2011-06-16 08:25:57.000000000 +0200
+@@ -294,7 +294,7 @@
+ LIBS_DEBUG = -lz `allegro-config --libs ` `libpng-config --ldflags`
+ LIBS_STATIC = -lz `allegro-config --static` `libpng-config --static --ldflags`
+ else
+- LIBS = -lz `libpng-config --ldflags`
++ LIBS = -lz -lm `libpng-config --ldflags`
+ LIBS_DEBUG = -lz `libpng-config --ldflags`
+ LIBS_STATIC = -lz `libpng-config --static --ldflags`
+ endif
diff --git a/games-emulation/raine/metadata.xml b/games-emulation/raine/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/raine/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/raine/raine-0.51.9.ebuild b/games-emulation/raine/raine-0.51.9.ebuild
new file mode 100644
index 000000000000..5aaef97c6506
--- /dev/null
+++ b/games-emulation/raine/raine-0.51.9.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit flag-o-matic eutils games
+
+DESCRIPTION="R A I N E M680x0 Arcade Emulation"
+HOMEPAGE="http://rainemu.swishparty.co.uk/"
+SRC_URI="http://rainemu.swishparty.co.uk/html/archive/raines-${PV}.tar.bz2"
+
+LICENSE="Artistic"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND="dev-cpp/muParser
+ media-libs/libsdl[sound,joystick,video]
+ sys-libs/zlib
+ media-libs/sdl-image[png]
+ media-libs/sdl-ttf"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ app-arch/unzip"
+
+src_prepare() {
+ echo > detect-cpu
+ echo > cpuinfo
+ sed -i \
+ -e "/^NEO/s:^:#:" \
+ -e "s:nasmw:nasm:" \
+ -e "/bindir/s:=.*:=\$(DESTDIR)${GAMES_BINDIR}:" \
+ -e "/sharedir =/s:=.*:=\$(DESTDIR)${GAMES_DATADIR}:" \
+ -e "/mandir/s:=.*:=\$(DESTDIR)/usr/share/man/man6:" \
+ makefile || die
+ epatch "${FILESDIR}"/${P}-ldflags.patch \
+ "${FILESDIR}"/${P}-underlink.patch \
+ "${FILESDIR}"/${P}-libpng15.patch
+ has_version '>=sys-libs/zlib-1.2.5.1-r1' && \
+ sed -i -e '1i#define OF(x) x' source/mini-unzip/ioapi.h
+ append-ldflags -Wl,-z,noexecstack
+}
+
+src_compile() {
+ local myopts
+
+ emake \
+ _MARCH="${CFLAGS}" \
+ VERBOSE=1 \
+ ${myopts}
+}
+
+src_install() {
+ default
+ keepdir "${GAMES_DATADIR}"/${PN}/{roms,artwork,emudx,scripts/raine}
+ dodoc docs/readme.txt
+ prepgamesdirs
+}
diff --git a/games-emulation/snes9x-1.55 b/games-emulation/snes9x-1.55
deleted file mode 100644
index 0f743d6f02fd..000000000000
--- a/games-emulation/snes9x-1.55
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare
-DEPEND=sys-libs/zlib:=[minizip] x11-libs/libX11 x11-libs/libXext png? ( media-libs/libpng:0= ) gtk? ( >=x11-libs/gtk+-2.10:2 x11-misc/xdg-utils portaudio? ( >=media-libs/portaudio-19_pre ) joystick? ( >=media-libs/libsdl-1.2.12[joystick] ) opengl? ( virtual/opengl ) xv? ( x11-libs/libXv ) xrandr? ( x11-libs/libXrandr ) alsa? ( media-libs/alsa-lib ) pulseaudio? ( media-sound/pulseaudio ) ) virtual/pkgconfig x11-base/xorg-proto nls? ( dev-util/intltool ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 >=sys-apps/sed-4
-DESCRIPTION=Super Nintendo Entertainment System (SNES) emulator
-EAPI=6
-HOMEPAGE=https://github.com/snes9xgit/snes9x
-IUSE=alsa debug gtk joystick multilib netplay nls opengl oss png pulseaudio portaudio +xv +xrandr
-KEYWORDS=~amd64 ~ppc64 ~x86 ~x86-fbsd
-LICENSE=Snes9x GPL-2 GPL-2+ LGPL-2.1 LGPL-2.1+ ISC MIT ZLIB Info-ZIP
-RDEPEND=sys-libs/zlib:=[minizip] x11-libs/libX11 x11-libs/libXext png? ( media-libs/libpng:0= ) gtk? ( >=x11-libs/gtk+-2.10:2 x11-misc/xdg-utils portaudio? ( >=media-libs/portaudio-19_pre ) joystick? ( >=media-libs/libsdl-1.2.12[joystick] ) opengl? ( virtual/opengl ) xv? ( x11-libs/libXv ) xrandr? ( x11-libs/libXrandr ) alsa? ( media-libs/alsa-lib ) pulseaudio? ( media-sound/pulseaudio ) )
-RESTRICT=bindist
-SLOT=0
-SRC_URI=https://github.com/snes9xgit/snes9x/archive/1.55.tar.gz -> snes9x-1.55.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=172f6dfac51cb05cb4cc37872ecfcc22
diff --git a/games-emulation/snes9x-1.56 b/games-emulation/snes9x-1.56
deleted file mode 100644
index 9503b650bd63..000000000000
--- a/games-emulation/snes9x-1.56
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare
-DEPEND=sys-libs/zlib:=[minizip] x11-libs/libX11 x11-libs/libXext png? ( media-libs/libpng:0= ) gtk? ( dev-libs/glib:2 dev-libs/libxml2 >=x11-libs/gtk+-3.0:3 x11-libs/libXrandr x11-misc/xdg-utils alsa? ( media-libs/alsa-lib ) joystick? ( media-libs/libsdl2[joystick] ) opengl? ( media-libs/libepoxy virtual/opengl ) portaudio? ( >=media-libs/portaudio-19_pre ) pulseaudio? ( media-sound/pulseaudio ) xv? ( x11-libs/libXv ) ) xinerama? ( x11-libs/libXinerama ) virtual/pkgconfig x11-base/xorg-proto nls? ( dev-util/intltool ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 >=sys-apps/sed-4
-DESCRIPTION=Super Nintendo Entertainment System (SNES) emulator
-EAPI=6
-HOMEPAGE=https://github.com/snes9xgit/snes9x
-IUSE=alsa debug gtk joystick multilib netplay nls opengl oss png pulseaudio portaudio xinerama +xv
-KEYWORDS=~amd64 ~ppc64 ~x86 ~x86-fbsd
-LICENSE=Snes9x GPL-2 GPL-2+ LGPL-2.1 LGPL-2.1+ ISC MIT ZLIB Info-ZIP
-RDEPEND=sys-libs/zlib:=[minizip] x11-libs/libX11 x11-libs/libXext png? ( media-libs/libpng:0= ) gtk? ( dev-libs/glib:2 dev-libs/libxml2 >=x11-libs/gtk+-3.0:3 x11-libs/libXrandr x11-misc/xdg-utils alsa? ( media-libs/alsa-lib ) joystick? ( media-libs/libsdl2[joystick] ) opengl? ( media-libs/libepoxy virtual/opengl ) portaudio? ( >=media-libs/portaudio-19_pre ) pulseaudio? ( media-sound/pulseaudio ) xv? ( x11-libs/libXv ) ) xinerama? ( x11-libs/libXinerama )
-RESTRICT=bindist
-SLOT=0
-SRC_URI=https://github.com/snes9xgit/snes9x/archive/1.56.tar.gz -> snes9x-1.56.tar.gz
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=2bf84a626998bc309b649f57afdfdace
diff --git a/games-emulation/snes9x/Manifest b/games-emulation/snes9x/Manifest
new file mode 100644
index 000000000000..7e0cf5fad416
--- /dev/null
+++ b/games-emulation/snes9x/Manifest
@@ -0,0 +1,8 @@
+AUX snes9x-1.53-cross-compile.patch 892 BLAKE2B 9fb806ad16d48d5f07f1ab84feb5f7eafa52a1157eb25675650f08c8fbab8a42318d3277efbdd45f03250df2e9187c76df43312f7ffb2f226423e757b5f6e91c SHA512 4867b9a3e3f2a65684157b26e4b0b63971d37ad5abb16125567e89bc4116482488416ca51d30f639ef63886b05431c56b75978fe073a4755c48988f5ea9eaee5
+AUX snes9x-1.55-build-system.patch 1825 BLAKE2B eb9bf6da1d9728c3bd657701d66da72caf185facbfc51030baf532f4757a8562319bf0b4daf9ac79068c63ef9d4fbb0df5681a71ea081effd826dceae6d32448 SHA512 afbd2b70eff128f89d231b7e623775746ad52d29a3f9b9a8dbbb38aff3f5ca7dbef1f938535c69ff9578a6467a25b441215dfab275dd22f2fbd5b22ebfa19731
+AUX snes9x-1.56-build-system.patch 1633 BLAKE2B 4a0ae3a90a15e29aea8d937f874aed9aa8b29c25eb03a90c9a0bf2b50f8c6271fcc43c7d61c2898e5d99128c0ab663d31de0e3498a5e16ba865d9c5572f12e6e SHA512 3ddc7272dab74ba3125409dbbf427160d08330cfc84c7f3393fbb68884f6129849efe042943899fbf3dca65ac326e15579722e757c3e30ebd4b452b784f1bf59
+DIST snes9x-1.55.tar.gz 2252841 BLAKE2B 52b2e3d5539d95df63ef6f90c974895bc3a3dbe1e89b3a9513a8504eab308d4827f116ebc13fd89ac9c01f7394067eeddf7fd6f640fd071ee8558a6a79f2b56c SHA512 61d1d6f9c1fc4fbf6253ac7a7d214c771563d7d60238197b2f1525a58f8f9011446f400767d39ec464c69d80574a7dcd78557c8f47605df992af28cb107c0f6e
+DIST snes9x-1.56.tar.gz 2876904 BLAKE2B b58dd5c31627cbb374183adb5fe0328739bbebda8c6907ab7f9153085c45d612e51c91ad3223cc10694c9c36a00f69c303c5865d3b022f2769353884056a91b2 SHA512 b8c9438a451ed9a52a66dc04e2bea841aaa9403a2fd266e7042555f93a159ced76061233220eb6fac0f106cea08835c13ef008b2432f6d658689e0fa8ee563e6
+EBUILD snes9x-1.55.ebuild 2628 BLAKE2B 48b8a8c0e9388c0f11e3ffa5d919c0bb731ebb33a7f456012c7d508aca5096de7f919d168d5f2eac04a5b9190c9f8bba568ce1a4fd041abcb0f2c4b5f0b36a35 SHA512 e3f14efadcd4915991a97d90e26dccf159ebc47e25b9070c358670e1231a1fe831977042c08d7bc80ca9b84163a5fb0a560936f36a11dbf54c7ba45c34bc57eb
+EBUILD snes9x-1.56.ebuild 2789 BLAKE2B 23180ff3ded88ad924eff4e9bebf5745c6e479e91552738b0afb5389d8dadc2bb22edd814d33f9d3fb01eeac2bf344d85dc159812b982b2e1b93e64c60efd991 SHA512 e121f01eba1b46e3b22cf5f2cf8878863a279aa4516ac71a46a30a5380f6fb75ad7979ac96a848f4e399191ac4ebdbed7844d4ee2c509c0baa8b359a1c72b017
+MISC metadata.xml 560 BLAKE2B ed9f05b3f484347825048ae3d45e9a880e5b7405b229b7e15f350dbc43bfec51691c21e558ae87f630ed392e19ddfa5eaf3d9d15ddb551476d13d9fbf224f97b SHA512 3922d16510b8818739e582c8faf84287dc265f810df5957dc923efab912e20f95b7fb9fc84023d481b44ce6c653f2bc00e83d6a150d9294feeb60dc8c3a2eeca
diff --git a/games-emulation/snes9x/files/snes9x-1.53-cross-compile.patch b/games-emulation/snes9x/files/snes9x-1.53-cross-compile.patch
new file mode 100644
index 000000000000..7a0fe8a8bde8
--- /dev/null
+++ b/games-emulation/snes9x/files/snes9x-1.53-cross-compile.patch
@@ -0,0 +1,38 @@
+--- a/unix/configure.ac
++++ b/unix/configure.ac
+@@ -4,7 +4,7 @@ AC_REVISION([$Revision: 1.1 $])
+
+ AC_CONFIG_SRCDIR([unix.cpp])
+
+-AC_CANONICAL_TARGET
++AC_CANONICAL_HOST
+
+ AC_PROG_CC
+ AC_PROG_CXX
+@@ -38,7 +38,7 @@ AC_DEFUN([AC_S9X_COMPILER_FLAG],
+ return (argc);
+ }
+ ],
+- [snes9x_cv_option_$2="yes"], [snes9x_cv_option_$2="no"])
++ [snes9x_cv_option_$2="yes"], [snes9x_cv_option_$2="no"], [snes9x_cv_option_$2="yes"])
+ ])
+
+ CXXFLAGS="[$]OLD_CXXFLAGS"
+@@ -94,7 +94,7 @@ AC_MSG_CHECKING([whether the OS is Linux])
+
+ AC_CACHE_VAL([snes9x_cv_linux_os],
+ [
+- case "$target" in
++ case "$host" in
+ *-*-linux*)
+ snes9x_cv_linux_os="yes"
+ ;;
+@@ -332,7 +332,7 @@ AC_DEFUN([AC_S9X_CHECK_SAR],
+ return (i < 0 ? 0 : 1);
+ }
+ ],
+- [snes9x_sar_$1="yes"], [snes9x_sar_$1="no"])
++ [snes9x_sar_$1="yes"], [snes9x_sar_$1="no"], [snes9x_sar_$1=$GCC])
+
+ CXXFLAGS="[$]OLD_CXXFLAGS"
+
diff --git a/games-emulation/snes9x/files/snes9x-1.55-build-system.patch b/games-emulation/snes9x/files/snes9x-1.55-build-system.patch
new file mode 100644
index 000000000000..30811ef421e0
--- /dev/null
+++ b/games-emulation/snes9x/files/snes9x-1.55-build-system.patch
@@ -0,0 +1,63 @@
+--- a/gtk/configure.ac
++++ b/gtk/configure.ac
+@@ -33,7 +33,7 @@
+
+ AM_GLIB_GNU_GETTEXT
+
+-snes9xlocaledir='${prefix}/${DATADIRNAME}/locale'
++snes9xlocaledir='$(localedir)'
+ AC_SUBST(snes9xlocaledir)
+
+ AC_ARG_WITH(debug,
+--- a/unix/configure.ac
++++ b/unix/configure.ac
+@@ -56,49 +56,6 @@
+ # *** Execution begins here ***
+ # *****************************
+
+-# Remove -g and -O2 flags manually.
+-
+-if test "x$CFLAGS" != "x"; then
+- CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-g//'`"
+- CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-O2//'`"
+-fi
+-
+-if test "x$CXXFLAGS" != "x"; then
+- CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-g//'`"
+- CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-O2//'`"
+-fi
+-
+-# Test what compiler flags we should use.
+-
+-AC_ARG_ENABLE([debug],
+- [AS_HELP_STRING([--enable-debug],
+- [leave debug information in the final binary (default: no)])],
+- [], [enable_debug="no"])
+-
+-if test "x$enable_debug" = "xyes"; then
+- AC_S9X_COMPILER_FLAG([-g], [g])
+- AC_S9X_COMPILER_FLAG([-O0], [o0])
+-else
+- AC_S9X_COMPILER_FLAG([-O3], [o3], [
+- AC_S9X_COMPILER_FLAG([-O2], [o2], [
+- AC_S9X_COMPILER_FLAG([-O1], [o1])])])
+- AC_S9X_COMPILER_FLAG([-fomit-frame-pointer], [omit_frame_pointer])
+-fi
+-
+-AC_ARG_ENABLE([mtune],
+- [AS_HELP_STRING([--enable-mtune],
+- [use the specified value for the -mtune/-mcpu flag (default: no)])],
+- [], [enable_mtune="no"])
+-
+-if test "x$enable_mtune" != "xno"; then
+- AC_S9X_COMPILER_FLAG([-mtune="$enable_mtune"], [mtune],
+- [
+- AC_MSG_WARN([-mtune failed, trying -mcpu...])
+- AC_S9X_COMPILER_FLAG([-mcpu="$enable_mtune"], [mcpu],
+- [AC_MSG_ERROR([Please specify a working value for --enable-mtune.])])
+- ])
+-fi
+-
+ AC_S9X_COMPILER_FLAG([-fno-exceptions], [no_exceptions])
+ AC_S9X_COMPILER_FLAG([-fno-rtti], [no_rtti])
+ AC_S9X_COMPILER_FLAG([-pedantic], [pedantic])
diff --git a/games-emulation/snes9x/files/snes9x-1.56-build-system.patch b/games-emulation/snes9x/files/snes9x-1.56-build-system.patch
new file mode 100644
index 000000000000..d2ee182cb7cd
--- /dev/null
+++ b/games-emulation/snes9x/files/snes9x-1.56-build-system.patch
@@ -0,0 +1,53 @@
+--- snes9x-1.56/gtk/configure.ac
++++ snes9x-1.56/gtk/configure.ac
+@@ -33,8 +33,8 @@
+
+ AM_GLIB_GNU_GETTEXT
+
+-snes9xlocaledir='${prefix}/${DATADIRNAME}/locale'
+-snes9xdatadir='${prefix}/${DATADIRNAME}/snes9x'
++snes9xlocaledir='$(localedir)'
++snes9xdatadir='$(datadir)/snes9x'
+
+ AC_SUBST(snes9xlocaledir)
+ AC_SUBST(snes9xdatadir)
+--- snes9x-1.56/unix/configure.ac
++++ snes9x-1.56/unix/configure.ac
+@@ -56,37 +56,6 @@
+ # *** Execution begins here ***
+ # *****************************
+
+-# Test what compiler flags we should use.
+-
+-AC_ARG_ENABLE([debug],
+- [AS_HELP_STRING([--enable-debug],
+- [leave debug information in the final binary (default: no)])],
+- [], [enable_debug="no"])
+-
+-if test "x$enable_debug" = "xyes"; then
+- AC_S9X_COMPILER_FLAG([-g], [g])
+- AC_S9X_COMPILER_FLAG([-O0], [o0])
+-else
+- AC_S9X_COMPILER_FLAG([-O3], [o3], [
+- AC_S9X_COMPILER_FLAG([-O2], [o2], [
+- AC_S9X_COMPILER_FLAG([-O1], [o1])])])
+- AC_S9X_COMPILER_FLAG([-fomit-frame-pointer], [omit_frame_pointer])
+-fi
+-
+-AC_ARG_ENABLE([mtune],
+- [AS_HELP_STRING([--enable-mtune],
+- [use the specified value for the -mtune/-mcpu flag (default: no)])],
+- [], [enable_mtune="no"])
+-
+-if test "x$enable_mtune" != "xno"; then
+- AC_S9X_COMPILER_FLAG([-mtune="$enable_mtune"], [mtune],
+- [
+- AC_MSG_WARN([-mtune failed, trying -mcpu...])
+- AC_S9X_COMPILER_FLAG([-mcpu="$enable_mtune"], [mcpu],
+- [AC_MSG_ERROR([Please specify a working value for --enable-mtune.])])
+- ])
+-fi
+-
+ AC_S9X_COMPILER_FLAG([-fno-exceptions], [no_exceptions])
+ AC_S9X_COMPILER_FLAG([-fno-rtti], [no_rtti])
+ AC_S9X_COMPILER_FLAG([-pedantic], [pedantic])
diff --git a/games-emulation/snes9x/metadata.xml b/games-emulation/snes9x/metadata.xml
new file mode 100644
index 000000000000..197a5fc2e9d4
--- /dev/null
+++ b/games-emulation/snes9x/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="netplay">Enable playing ROMs over the network (not recommended)</flag>
+ <flag name="xrandr">Enable support for the X xrandr extension</flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">snes9x-gtk</remote-id>
+ <remote-id type="github">snes9xgit/snes9x</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/snes9x/snes9x-1.55.ebuild b/games-emulation/snes9x/snes9x-1.55.ebuild
new file mode 100644
index 000000000000..639a39ffc5c6
--- /dev/null
+++ b/games-emulation/snes9x/snes9x-1.55.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic gnome2-utils xdg-utils
+
+DESCRIPTION="Super Nintendo Entertainment System (SNES) emulator"
+HOMEPAGE="https://github.com/snes9xgit/snes9x"
+SRC_URI="https://github.com/snes9xgit/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Snes9x GPL-2 GPL-2+ LGPL-2.1 LGPL-2.1+ ISC MIT ZLIB Info-ZIP"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~x86-fbsd"
+IUSE="alsa debug gtk joystick multilib netplay nls opengl oss png pulseaudio portaudio +xv +xrandr"
+RESTRICT="bindist"
+
+RDEPEND="
+ sys-libs/zlib:=[minizip]
+ x11-libs/libX11
+ x11-libs/libXext
+ png? ( media-libs/libpng:0= )
+ gtk? (
+ >=x11-libs/gtk+-2.10:2
+ x11-misc/xdg-utils
+ portaudio? ( >=media-libs/portaudio-19_pre )
+ joystick? ( >=media-libs/libsdl-1.2.12[joystick] )
+ opengl? ( virtual/opengl )
+ xv? ( x11-libs/libXv )
+ xrandr? ( x11-libs/libXrandr )
+ alsa? ( media-libs/alsa-lib )
+ pulseaudio? ( media-sound/pulseaudio )
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ x11-base/xorg-proto
+ nls? ( dev-util/intltool )"
+
+S="${WORKDIR}/${P}/unix"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.53-cross-compile.patch
+ "${FILESDIR}"/${PN}-1.55-build-system.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/${P} || die
+ rm -r unzip || die
+ default
+ cd unix || die
+ eautoreconf
+ if use gtk; then
+ cd ../gtk || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ append-ldflags -Wl,-z,noexecstack
+
+ # build breaks when zlib/zip support is disabled
+ econf \
+ --enable-gzip \
+ --enable-zip \
+ --with-system-zip \
+ $(use_enable joystick gamepad) \
+ $(use_enable debug debugger) \
+ $(use_enable netplay) \
+ $(use_enable png screenshot)
+
+ if use gtk; then
+ cd ../gtk || die
+ econf \
+ --with-zlib \
+ --with-system-zip \
+ $(use_enable nls) \
+ $(use_with opengl) \
+ $(use_with joystick) \
+ $(use_with xv) \
+ $(use_with xrandr) \
+ $(use_with netplay) \
+ $(use_with alsa) \
+ $(use_with oss) \
+ $(use_with pulseaudio) \
+ $(use_with portaudio) \
+ $(use_with png screenshot)
+ fi
+}
+
+src_compile() {
+ emake
+ use gtk && emake -C ../gtk
+}
+
+src_install() {
+ dobin ${PN}
+
+ dodoc ../docs/{snes9x.conf.default,{changes,control-inputs,controls,snapshots}.txt}
+
+ if use gtk; then
+ emake -C ../gtk DESTDIR="${D}" install
+ dodoc ../gtk/{AUTHORS,doc/README}
+ fi
+
+ docinto html
+ dodoc {.,..}/docs/*.html
+}
+
+pkg_preinst() {
+ use gtk && gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ if use gtk ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gtk ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
diff --git a/games-emulation/snes9x/snes9x-1.56.ebuild b/games-emulation/snes9x/snes9x-1.56.ebuild
new file mode 100644
index 000000000000..652a1c859215
--- /dev/null
+++ b/games-emulation/snes9x/snes9x-1.56.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic gnome2-utils xdg-utils
+
+DESCRIPTION="Super Nintendo Entertainment System (SNES) emulator"
+HOMEPAGE="https://github.com/snes9xgit/snes9x"
+SRC_URI="https://github.com/snes9xgit/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Snes9x GPL-2 GPL-2+ LGPL-2.1 LGPL-2.1+ ISC MIT ZLIB Info-ZIP"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~x86-fbsd"
+IUSE="alsa debug gtk joystick multilib netplay nls opengl oss png pulseaudio portaudio xinerama +xv"
+RESTRICT="bindist"
+
+RDEPEND="
+ sys-libs/zlib:=[minizip]
+ x11-libs/libX11
+ x11-libs/libXext
+ png? ( media-libs/libpng:0= )
+ gtk? (
+ dev-libs/glib:2
+ dev-libs/libxml2
+ >=x11-libs/gtk+-3.0:3
+ x11-libs/libXrandr
+ x11-misc/xdg-utils
+ alsa? ( media-libs/alsa-lib )
+ joystick? ( media-libs/libsdl2[joystick] )
+ opengl? (
+ media-libs/libepoxy
+ virtual/opengl
+ )
+ portaudio? ( >=media-libs/portaudio-19_pre )
+ pulseaudio? ( media-sound/pulseaudio )
+ xv? ( x11-libs/libXv )
+ )
+ xinerama? ( x11-libs/libXinerama )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ x11-base/xorg-proto
+ nls? ( dev-util/intltool )"
+
+S="${WORKDIR}/${P}/unix"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.53-cross-compile.patch
+ "${FILESDIR}"/${PN}-1.56-build-system.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/${P} || die
+ rm -r unzip || die
+ default
+ cd unix || die
+ eautoreconf
+ if use gtk; then
+ cd ../gtk || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ append-ldflags -Wl,-z,noexecstack
+
+ # build breaks when zlib/zip support is disabled
+ local myeconfargs=(
+ --enable-gzip
+ --enable-zip
+ --with-system-zip
+ $(use_enable joystick gamepad)
+ $(use_enable debug debugger)
+ $(use_enable netplay)
+ $(use_enable png screenshot)
+ $(use_enable xinerama)
+ )
+ econf "${myeconfargs[@]}"
+
+ if use gtk; then
+ cd ../gtk || die
+ myeconfargs=(
+ --with-gtk3
+ --with-zlib
+ --with-system-zip
+ --without-gtk2
+ $(use_enable nls)
+ $(use_with opengl)
+ $(use_with joystick)
+ $(use_with xv)
+ $(use_with netplay)
+ $(use_with alsa)
+ $(use_with oss)
+ $(use_with pulseaudio)
+ $(use_with portaudio)
+ $(use_with png screenshot)
+ )
+ econf "${myeconfargs[@]}"
+ fi
+}
+
+src_compile() {
+ emake
+ use gtk && emake -C ../gtk
+}
+
+src_install() {
+ dobin ${PN}
+
+ dodoc ../docs/{snes9x.conf.default,{changes,control-inputs,controls,snapshots}.txt}
+
+ if use gtk; then
+ emake -C ../gtk DESTDIR="${D}" install
+ dodoc ../gtk/{AUTHORS,doc/README}
+ fi
+
+ docinto html
+ dodoc {.,..}/docs/*.html
+}
+
+pkg_preinst() {
+ use gtk && gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ if use gtk ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gtk ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
diff --git a/games-emulation/stella-4.7.2-r1 b/games-emulation/stella-4.7.2-r1
deleted file mode 100644
index 186938b29534..000000000000
--- a/games-emulation/stella-4.7.2-r1
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install postinst postrm preinst prepare
-DEPEND=media-libs/libsdl2[joystick?,opengl,video] media-libs/libpng:0= sys-libs/zlib >=sys-apps/sed-4
-DESCRIPTION=Stella Atari 2600 VCS Emulator
-EAPI=6
-HOMEPAGE=http://stella.sourceforge.net/
-IUSE=joystick
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2+ BSD
-RDEPEND=media-libs/libsdl2[joystick?,opengl,video] media-libs/libpng:0= sys-libs/zlib
-SLOT=0
-SRC_URI=mirror://sourceforge/stella/stella-4.7.2-src.tar.xz
-_eclasses_=desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=989c694d9b49512c87b8e0e42802933a
diff --git a/games-emulation/stella/Manifest b/games-emulation/stella/Manifest
new file mode 100644
index 000000000000..e504b14973d3
--- /dev/null
+++ b/games-emulation/stella/Manifest
@@ -0,0 +1,3 @@
+DIST stella-4.7.2-src.tar.xz 1715332 BLAKE2B 7b397a4e662f8db247a67ddedb314c9b11ee4e99d55768b1cd8e2587b452fab9c5d45c840bf1577833712a2c96d42985d39437d1fac16e93c35762e015ddf445 SHA512 dcfaba9b554ab08c9ba79c8e95551bc688fae4ab0ab368df11c05f3dc7c9431d32068d5dd658ec4d1aa8cb826c7205fc4f301145a149d32369833409992455e2
+EBUILD stella-4.7.2-r1.ebuild 1327 BLAKE2B 5932b462fe8a66386fe6dcd5d1d91b46c584b943b3081e47bc0e33d34e409773cbb63034fbc55609c19649d760050833062fc7813f109677423e3b7775817baa SHA512 cc81a37cc9362b1c2e07fd4f7e6216523a45659c6395da0627089e6a5a17a47eb71432a718e32aa2911fa3f4279c2b15b948f49d742ce3776942e02930cc27cd
+MISC metadata.xml 329 BLAKE2B 3ee498d6ed1bda6ccdd1e6e6a7eae732766c005ae6bf4c02b09f8f5de417d9f4c20ae925a2d7d148204f0c43a4c4ef1310cd6d925dee4beb2ede0c74ae34b636 SHA512 80e6880e6edea2eab64504d6cdf4496f94f9bfb6a4ea63da347b9fb05ca3fa999d646406e22563799d8ba40c1d3d095094ea8d86a500bb490ce2034c3ff38182
diff --git a/games-emulation/stella/metadata.xml b/games-emulation/stella/metadata.xml
new file mode 100644
index 000000000000..2fd0b9ad7a0a
--- /dev/null
+++ b/games-emulation/stella/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">stella</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/stella/stella-4.7.2-r1.ebuild b/games-emulation/stella/stella-4.7.2-r1.ebuild
new file mode 100644
index 000000000000..1412860717cd
--- /dev/null
+++ b/games-emulation/stella/stella-4.7.2-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop gnome2-utils
+
+DESCRIPTION="Stella Atari 2600 VCS Emulator"
+HOMEPAGE="http://stella.sourceforge.net/"
+SRC_URI="mirror://sourceforge/stella/${P}-src.tar.xz"
+
+LICENSE="GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="joystick"
+
+RDEPEND="
+ media-libs/libsdl2[joystick?,opengl,video]
+ media-libs/libpng:0=
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ sed -i \
+ -e '/INSTALL/s/-s //' \
+ -e '/STRIP/d' \
+ -e "/icons/d" \
+ -e '/INSTALL.*DOCDIR/d' \
+ -e '/INSTALL.*\/applications/d' \
+ -e '/CXXFLAGS+=/s/-fomit-frame-pointer//' \
+ Makefile || die
+}
+
+src_configure() {
+ # not an autoconf script
+ ./configure \
+ --prefix="/usr" \
+ --bindir="/usr/bin" \
+ --docdir="/usr/share/doc/${PF}" \
+ --datadir="/usr/share" \
+ $(use_enable joystick) \
+ || die
+}
+
+src_install() {
+ local i
+
+ DOCS="Announce.txt Changes.txt Copyright.txt README-SDL.txt Readme.txt Todo.txt" \
+ default
+
+ for i in 16 22 24 32 48 64 128 ; do
+ newicon -s ${i} src/common/stella-${i}x${i}.png stella.png
+ done
+ domenu src/unix/stella.desktop
+ HTML_DOCS="docs/*" einstalldocs
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/games-emulation/vbam-2.0.1-r1 b/games-emulation/vbam-2.0.1-r1
deleted file mode 100644
index 478cc21d3d48..000000000000
--- a/games-emulation/vbam-2.0.1-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test
-DEPEND=>=media-libs/libpng-1.4:0= media-libs/libsdl2[joystick] link? ( >=media-libs/libsfml-2.0:= ) sys-libs/zlib:= virtual/glu virtual/opengl ffmpeg? ( media-video/ffmpeg:= ) lirc? ( app-misc/lirc ) nls? ( virtual/libintl ) wxwidgets? ( openal? ( media-libs/openal ) x11-libs/wxGTK:3.0-gtk3[X,opengl] ) app-arch/zip wxwidgets? ( virtual/imagemagick-tools ) x86? ( || ( dev-lang/nasm dev-lang/yasm ) ) nls? ( sys-devel/gettext ) virtual/pkgconfig >=sys-apps/sed-4 sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=Game Boy, GBC, and GBA emulator forked from VisualBoyAdvance
-EAPI=6
-HOMEPAGE=https://github.com/visualboyadvance-m/visualboyadvance-m
-IUSE=ffmpeg link lirc nls openal +sdl wxwidgets
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=>=media-libs/libpng-1.4:0= media-libs/libsdl2[joystick] link? ( >=media-libs/libsfml-2.0:= ) sys-libs/zlib:= virtual/glu virtual/opengl ffmpeg? ( media-video/ffmpeg:= ) lirc? ( app-misc/lirc ) nls? ( virtual/libintl ) wxwidgets? ( openal? ( media-libs/openal ) x11-libs/wxGTK:3.0-gtk3[X,opengl] )
-REQUIRED_USE=openal? ( wxwidgets ) || ( sdl wxwidgets )
-SLOT=0
-SRC_URI=https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v2.0.1.tar.gz -> vbam-2.0.1.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=ce84f2772dd535b7055af94c15669886
diff --git a/games-emulation/vbam-2.0.2 b/games-emulation/vbam-2.0.2
deleted file mode 100644
index 747f721daca5..000000000000
--- a/games-emulation/vbam-2.0.2
+++ /dev/null
@@ -1,14 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test
-DEPEND=>=media-libs/libpng-1.4:0= media-libs/libsdl2[joystick] link? ( >=media-libs/libsfml-2.0:= ) sys-libs/zlib:= virtual/glu virtual/opengl ffmpeg? ( media-video/ffmpeg:= ) lirc? ( app-misc/lirc ) nls? ( virtual/libintl ) wxwidgets? ( openal? ( media-libs/openal ) x11-libs/wxGTK:3.0-gtk3[X,opengl] ) app-arch/zip wxwidgets? ( virtual/imagemagick-tools ) x86? ( || ( dev-lang/nasm dev-lang/yasm ) ) nls? ( sys-devel/gettext ) virtual/pkgconfig >=sys-apps/sed-4 sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=Game Boy, GBC, and GBA emulator forked from VisualBoyAdvance
-EAPI=6
-HOMEPAGE=https://github.com/visualboyadvance-m/visualboyadvance-m
-IUSE=ffmpeg link lirc nls openal +sdl wxwidgets
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=>=media-libs/libpng-1.4:0= media-libs/libsdl2[joystick] link? ( >=media-libs/libsfml-2.0:= ) sys-libs/zlib:= virtual/glu virtual/opengl ffmpeg? ( media-video/ffmpeg:= ) lirc? ( app-misc/lirc ) nls? ( virtual/libintl ) wxwidgets? ( openal? ( media-libs/openal ) x11-libs/wxGTK:3.0-gtk3[X,opengl] )
-REQUIRED_USE=openal? ( wxwidgets ) || ( sdl wxwidgets )
-SLOT=0
-SRC_URI=https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v2.0.2.tar.gz -> vbam-2.0.2.tar.gz
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=be0801b987eefd0652738e3267e518ac
diff --git a/games-emulation/vbam-9999 b/games-emulation/vbam-9999
deleted file mode 100644
index 9679f8408566..000000000000
--- a/games-emulation/vbam-9999
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile configure install postinst postrm preinst prepare test unpack
-DEPEND=>=media-libs/libpng-1.4:0= media-libs/libsdl2[joystick] link? ( >=media-libs/libsfml-2.0:= ) sys-libs/zlib:= virtual/glu virtual/opengl ffmpeg? ( media-video/ffmpeg:= ) lirc? ( app-misc/lirc ) nls? ( virtual/libintl ) wxwidgets? ( openal? ( media-libs/openal ) x11-libs/wxGTK:3.0-gtk3[X,opengl] ) app-arch/zip wxwidgets? ( virtual/imagemagick-tools ) x86? ( || ( dev-lang/nasm dev-lang/yasm ) ) nls? ( sys-devel/gettext ) virtual/pkgconfig >=sys-apps/sed-4 sys-devel/make >=dev-util/cmake-3.9.6 >=dev-vcs/git-1.8.2.1[curl]
-DESCRIPTION=Game Boy, GBC, and GBA emulator forked from VisualBoyAdvance
-EAPI=6
-HOMEPAGE=https://github.com/visualboyadvance-m/visualboyadvance-m
-IUSE=ffmpeg link lirc nls openal +sdl wxwidgets
-LICENSE=GPL-2
-RDEPEND=>=media-libs/libpng-1.4:0= media-libs/libsdl2[joystick] link? ( >=media-libs/libsfml-2.0:= ) sys-libs/zlib:= virtual/glu virtual/opengl ffmpeg? ( media-video/ffmpeg:= ) lirc? ( app-misc/lirc ) nls? ( virtual/libintl ) wxwidgets? ( openal? ( media-libs/openal ) x11-libs/wxGTK:3.0-gtk3[X,opengl] )
-REQUIRED_USE=openal? ( wxwidgets ) || ( sdl wxwidgets )
-SLOT=0
-_eclasses_=cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 git-r3 8f6de46b0aa318aea0e8cac62ece098b gnome2-utils 29bb8f7881c95139e532a2d5e47ff834 ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf wxwidgets 04e063b0eff26daaea83d859dd9d6e05 xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=be0801b987eefd0652738e3267e518ac
diff --git a/games-emulation/vbam/Manifest b/games-emulation/vbam/Manifest
new file mode 100644
index 000000000000..b1f7690180f9
--- /dev/null
+++ b/games-emulation/vbam/Manifest
@@ -0,0 +1,8 @@
+AUX vbam-2.0.1-changelog-update.patch 3547 BLAKE2B cd9c3aaab79e4342d7bdbc903331ef0d7fd54b63422715e8d0dfe27cbbfcc729804ec018beb434faa9b89ca5bce417f382debfc74b111a5dae4e8974e2cec38f SHA512 792ad5848a373a0a5040132417e7a9eb4cccf3155e31beda61b6236edc80ce74018ad8d7bd67829c981b60a8940904629c64b3d392ca25d0bb58461d64e228e3
+AUX vbam-2.0.1-read-version-from-changelog.patch 2701 BLAKE2B cf9c826bc75fb956becb99decadc36e41a1944b64095729826e732341c36aef1df9ef73b424501e9d0dcb9e8146d50c0b91641237b2b3c83e13d2bb2ab375311 SHA512 2a1793c8c4f0dff020337eccc9ff94c357b8f1ce2dde8aab612c4a06b5adbfbf3261b91643bfdab958ddf77f2e5f751997840cdcd89dd4d77744de8caf1f4285
+DIST vbam-2.0.1.tar.gz 2926632 BLAKE2B 3a2d44b76a9b03eadcce530a955e6b2ebde48340d8462e1ad339f4a02b1d19b8f8fbd0d9671f12eb5ed14ee600dba6e6bb6d167f9ca1cfb192ffb734ace72752 SHA512 d6cdc1ab1fbc20f81483fb4dc316d65dc9d7c0f378d5c85c1c5ca1251fbd1e7aad9f2f6bd5ecc2ff0b832e42c010cc82b9b1ec68bbb0a49aa8e00683fb5264bb
+DIST vbam-2.0.2.tar.gz 2959204 BLAKE2B 79b288e59a843d2065eac63e74984bf134d9f5dadbc687da245030ad16b138125baab0fe1fb19acac9c117e30b95e57f1880b43817f75361600fb62efd1d5272 SHA512 9aafb8ef307fbbfbc5ae6dc35bc3042934e25a30069a71949e4c8e777fd862d94ec60c189823f4acdea4cb1338098fa85a55e090fa6023c07368cbb7638dd910
+EBUILD vbam-2.0.1-r1.ebuild 2243 BLAKE2B b76bb006b86d23077c09481277340c18dd06275cd8ceb0ae374d0fa4075cdce036950013787f74babd8730539faca14afd83e0878503a9901f2552d473df3387 SHA512 c49c9d5c71cef41b194a5ed229c2ec6405b2268a83e86ff654e183e598c6170f74628a1f187bc89faf06a258738f7109df4a956718a9e830caea8648cc86299c
+EBUILD vbam-2.0.2.ebuild 2133 BLAKE2B 7cb6802db60dfb7e6686d6daa6c52d9bfa477ffd78b77b78a8c3bd955a6563950eab13ba762d99c4f7a1f466cfe224927c884fceb5144afd6a44e7c7edf8e269 SHA512 2026cbe925ea3159a82b47c1be373ef37e5236661fe15bd1f4d191073da3fab04e23cf7fac5d6540f03f3b29066119787c5d95270baad23ab9b260087c288e6c
+EBUILD vbam-9999.ebuild 2133 BLAKE2B 7cb6802db60dfb7e6686d6daa6c52d9bfa477ffd78b77b78a8c3bd955a6563950eab13ba762d99c4f7a1f466cfe224927c884fceb5144afd6a44e7c7edf8e269 SHA512 2026cbe925ea3159a82b47c1be373ef37e5236661fe15bd1f4d191073da3fab04e23cf7fac5d6540f03f3b29066119787c5d95270baad23ab9b260087c288e6c
+MISC metadata.xml 479 BLAKE2B e5a7706e8db6c8c05cf4cf691d294c4bd54f3cc7aee5af270cce39c2d924cc81cc97a1b3d3612c1cf95d0b4b485181717d0f0daeef11a21b0c7ce0cf4d9eafda SHA512 6bd2212bd5ae35dd11f35322879f067981cac94c0c2d8f0c87e1e67170b5df245bd3616e5bb076d2892453c8b75537ee15aab49134029c0daa31d89d8aedf1d0
diff --git a/games-emulation/vbam/files/vbam-2.0.1-changelog-update.patch b/games-emulation/vbam/files/vbam-2.0.1-changelog-update.patch
new file mode 100644
index 000000000000..6d4f87f2d772
--- /dev/null
+++ b/games-emulation/vbam/files/vbam-2.0.1-changelog-update.patch
@@ -0,0 +1,98 @@
+From 30b6ecf1a5c0eac73aaf3dabd98e41c908daa94a Mon Sep 17 00:00:00 2001
+From: Zach Bacon <zachbacon@budgiemedia.rocks>
+Date: Thu, 12 Oct 2017 00:49:05 +0000
+Subject: [PATCH] Add a changelog
+
+Gonna try and keep this up to date as often as possible.
+---
+ CHANGELOG.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 81 insertions(+)
+ create mode 100644 CHANGELOG.md
+
+diff --git a/CHANGELOG.md b/CHANGELOG.md
+new file mode 100644
+index 00000000..c24ac560
+--- /dev/null
++++ b/CHANGELOG.md
+@@ -0,0 +1,81 @@
++# Changelog
++All notable changes to this project will be documented in this file.
++
++The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
++and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
++
++## [Unreleased]
++
++## [2.0.1] - 10/11/2017
++### Added
++- initial installer script
++- gitter.im badge in readme
++- 32bit cross compiling support on 64bit linux
++- added support for GNUInstallDirs to cmake
++- Include new translations from transifex
++- Added WxWidgets ABI compiler check
++- Add linux Joystick reference to issue template
++- Add #ubckyde <cmath> fir std::cell()
++-
++
++### Changed
++- Fix 2xSaImmx.asm linking issue
++- cmake: default to ENABLE_ASM_CORE=OFF
++- libretro merging from upstream libretro fork.
++- better fix for clipped video in GL Fullscreen.
++- Fix flibc crash: add log message on fopen failure
++- fix gameboy header-detection in libretro interface
++- hotfix for potential buffer-overflow
++- delete memory in common/array.h on destruction
++- SDL: improve error msg for unwritable config
++- SDL: fix deflt bat saving, improve dir checking
++- fix portability issue with strerror_r()
++- Windows doesn't have sterror_r
++- wx/wxvbam: fix GetAbsolutePath
++- fix a memory leak due to wrong syntax
++- regenerate translation files
++- fix errors reported by SUSE's post build linter
++- SUSE Lint: fix a few classes of warnings
++- let cmake escape -D preproc. definitions
++- fix memory viewer xrc on wx 3.1+
++- Improving README
++- SoundSDL: lock conditional code cleanup
++- remove the default F11 keybinding for save state
++- hopefully fix resize artifacts on game panel
++- soundSDL: write silence when paused
++- cleanup SoundSDL #139 #130 #97 #67 #65 #46 #47
++- document how to provice symbolic backtraces
++- "no throttle" fixes/cleanup
++- only use -mtune=generic on x86/amd64
++- installdeps: use -j$(nproc) not -j8 in info
++- use -fabi-version=2 for GCC turn off LTO
++- installdeps: minor refactoring/cleanup
++- improve Wx GCC ABI check
++- minor improvements for Wx Compile tests
++- fix wx ABI check for Win32/MinGW
++- installdeps: fedora fixes, including m32
++- cmake: wx and cross compiling fixes
++- restore wx 2.7 compat, improve string processing
++- rename CMakeScripts/ to cmake/
++- work around gcc lto wrappers bug with gcc 7.x
++- update README.md
++- remove doctoc title from README.md TOC
++- improve win32 dependencies git submodule handling
++- use num cpu cores to parallelize LTO link with gcc
++- fix huge app icon in Win volume settings
++- fix deadlock in SoundSDL:deinit()
++- added executable extension for sdl binary
++- default LTO to off on 64bit MinGW
++- minor code cleanup
++- deps: dont check result of apt-get update
++- read version and subversion info from Git
++- fix error and version info in shallow git clones
++- refactor/cleanup GitTagVersion.cmake
++
++### Removed
++- Cairo Renderer: it never performed well to begin with
++
++
++
++[2.0.1]: https://github.com/olivierlacan/keep-a-changelog/compare/throttle...v2.0.1
++
diff --git a/games-emulation/vbam/files/vbam-2.0.1-read-version-from-changelog.patch b/games-emulation/vbam/files/vbam-2.0.1-read-version-from-changelog.patch
new file mode 100644
index 000000000000..5dce58395343
--- /dev/null
+++ b/games-emulation/vbam/files/vbam-2.0.1-read-version-from-changelog.patch
@@ -0,0 +1,76 @@
+From 46486381f0c18110002ec62108969be957b419be Mon Sep 17 00:00:00 2001
+From: Rafael Kitover <rkitover@gmail.com>
+Date: Wed, 11 Oct 2017 19:17:25 -0700
+Subject: [PATCH] read version info from CHANGELOG.md if no git
+
+If git tags are not available, set the version and revision by finding
+the first version tag in `CHANGELOG.md` of the form
+
+```
+```
+
+Where N.N.N is the number version (number of components can vary) and
+the revision (as speicified by -REV) is optional.
+
+TODO: support named revision without a version number of the form
+`[REV]`.
+---
+ CMakeLists.txt | 9 +++------
+ cmake/ChangeLogVersion.cmake | 25 +++++++++++++++++++++++++
+ 2 files changed, 28 insertions(+), 6 deletions(-)
+ create mode 100644 cmake/ChangeLogVersion.cmake
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bd09527d..4ad859b2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -112,15 +112,12 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
+ # of files that depend on version.h
+ include(GetGitRevisionDescription)
+ get_git_head_revision(REFSPEC COMMITHASH)
+-else()
+- message(WARNING "Git not found, cannot set version info")
+ endif()
+
+-# no git or no tags
++# no git or no tags, use ChangeLog
+ if(NOT VERSION)
+- set(VERSION 2.0.0)
+- set(REVISION "unknown")
+- set(VERSION_RELEASE 0)
++ include(ChangeLogVersion)
++ changelog_version(VERSION REVISION VERSION_RELEASE)
+ endif()
+
+ # generate version.h
+diff --git a/cmake/ChangeLogVersion.cmake b/cmake/ChangeLogVersion.cmake
+new file mode 100644
+index 00000000..101d23bd
+--- /dev/null
++++ b/cmake/ChangeLogVersion.cmake
+@@ -0,0 +1,25 @@
++function(changelog_version version revision version_release)
++ set(${version} "" CACHE STRING "Latest ChangeLog Version" FORCE)
++ set(${revision} "" CACHE STRING "Latest ChangeLog Revision" FORCE)
++ set(${version_release} 0 CACHE STRING "Is this a versioned release without revision" FORCE)
++
++ file(READ CHANGELOG.md changelog_file)
++
++ if(NOT changelog_file)
++ return()
++ endif()
++
++ string(REGEX MATCH "\n## +\\[([0-9.]+)(-([^] ]+))?\\] +- +[0-9][0-9]?/" match_out "${changelog_file}")
++
++ set(changelog_version "${CMAKE_MATCH_1}")
++
++ set(is_version_release 0)
++ set(changelog_revision "${CMAKE_MATCH_3}")
++ if(NOT changelog_revision)
++ set(is_version_release 1)
++ endif()
++
++ set(${version} "${changelog_version}" CACHE STRING "Latest ChangeLog Version" FORCE)
++ set(${revision} "${changelog_revision}" CACHE STRING "Latest ChangeLog Revision" FORCE)
++ set(${version_release} "${is_version_release}" CACHE STRING "Is this a versioned release without revision" FORCE)
++endfunction()
diff --git a/games-emulation/vbam/metadata.xml b/games-emulation/vbam/metadata.xml
new file mode 100644
index 000000000000..599894ffa29b
--- /dev/null
+++ b/games-emulation/vbam/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="link">Enable GBA linking functionality</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">visualboyadvance-m/visualboyadvance-m</remote-id>
+ <remote-id type="sourceforge">vbam</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/vbam/vbam-2.0.1-r1.ebuild b/games-emulation/vbam/vbam-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..7895e9c087d2
--- /dev/null
+++ b/games-emulation/vbam/vbam-2.0.1-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+WX_GTK_VER="3.0-gtk3"
+inherit gnome2-utils wxwidgets xdg-utils cmake-utils
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/visualboyadvance-m/visualboyadvance-m.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/visualboyadvance-m-${PV}"
+fi
+
+DESCRIPTION="Game Boy, GBC, and GBA emulator forked from VisualBoyAdvance"
+HOMEPAGE="https://github.com/visualboyadvance-m/visualboyadvance-m"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ffmpeg link lirc nls openal +sdl wxwidgets"
+REQUIRED_USE="openal? ( wxwidgets ) || ( sdl wxwidgets )"
+
+RDEPEND="
+ >=media-libs/libpng-1.4:0=
+ media-libs/libsdl2[joystick]
+ link? ( >=media-libs/libsfml-2.0:= )
+ sys-libs/zlib:=
+ virtual/glu
+ virtual/opengl
+ ffmpeg? ( media-video/ffmpeg:= )
+ lirc? ( app-misc/lirc )
+ nls? ( virtual/libintl )
+ wxwidgets? (
+ openal? ( media-libs/openal )
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+ )"
+DEPEND="${RDEPEND}
+ app-arch/zip
+ wxwidgets? ( virtual/imagemagick-tools )
+ x86? ( || ( dev-lang/nasm dev-lang/yasm ) )
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-changelog-update.patch
+ "${FILESDIR}"/${P}-read-version-from-changelog.patch
+)
+
+src_configure() {
+ use wxwidgets && setup-wxwidgets
+ local mycmakeargs=(
+ -DENABLE_FFMPEG=$(usex ffmpeg)
+ -DENABLE_LINK=$(usex link)
+ -DENABLE_LIRC=$(usex lirc)
+ -DENABLE_NLS=$(usex nls)
+ -DENABLE_OPENAL=$(usex openal)
+ -DENABLE_SDL=$(usex sdl)
+ -DENABLE_WX=$(usex wxwidgets)
+ -DENABLE_ASM_CORE=$(usex x86)
+ -DENABLE_ASM_SCALERS=$(usex x86)
+ -DCMAKE_SKIP_RPATH=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ if use sdl ; then
+ dodoc doc/ReadMe.SDL.txt
+ doman src/debian/vbam.6
+ fi
+ use wxwidgets && doman src/debian/visualboyadvance-m.6
+}
+
+pkg_preinst() {
+ if use wxwidgets ; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use wxwidgets ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use wxwidgets ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
diff --git a/games-emulation/vbam/vbam-2.0.2.ebuild b/games-emulation/vbam/vbam-2.0.2.ebuild
new file mode 100644
index 000000000000..53f480e326ee
--- /dev/null
+++ b/games-emulation/vbam/vbam-2.0.2.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+WX_GTK_VER="3.0-gtk3"
+inherit gnome2-utils wxwidgets xdg-utils cmake-utils
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/visualboyadvance-m/visualboyadvance-m.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/visualboyadvance-m-${PV}"
+fi
+
+DESCRIPTION="Game Boy, GBC, and GBA emulator forked from VisualBoyAdvance"
+HOMEPAGE="https://github.com/visualboyadvance-m/visualboyadvance-m"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ffmpeg link lirc nls openal +sdl wxwidgets"
+REQUIRED_USE="openal? ( wxwidgets ) || ( sdl wxwidgets )"
+
+RDEPEND="
+ >=media-libs/libpng-1.4:0=
+ media-libs/libsdl2[joystick]
+ link? ( >=media-libs/libsfml-2.0:= )
+ sys-libs/zlib:=
+ virtual/glu
+ virtual/opengl
+ ffmpeg? ( media-video/ffmpeg:= )
+ lirc? ( app-misc/lirc )
+ nls? ( virtual/libintl )
+ wxwidgets? (
+ openal? ( media-libs/openal )
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+ )"
+DEPEND="${RDEPEND}
+ app-arch/zip
+ wxwidgets? ( virtual/imagemagick-tools )
+ x86? ( || ( dev-lang/nasm dev-lang/yasm ) )
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+src_configure() {
+ use wxwidgets && setup-wxwidgets
+ local mycmakeargs=(
+ -DENABLE_FFMPEG=$(usex ffmpeg)
+ -DENABLE_LINK=$(usex link)
+ -DENABLE_LIRC=$(usex lirc)
+ -DENABLE_NLS=$(usex nls)
+ -DENABLE_OPENAL=$(usex openal)
+ -DENABLE_SDL=$(usex sdl)
+ -DENABLE_WX=$(usex wxwidgets)
+ -DENABLE_ASM_CORE=$(usex x86)
+ -DENABLE_ASM_SCALERS=$(usex x86)
+ -DCMAKE_SKIP_RPATH=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ if use sdl ; then
+ dodoc doc/ReadMe.SDL.txt
+ doman src/debian/vbam.6
+ fi
+ use wxwidgets && doman src/debian/visualboyadvance-m.6
+}
+
+pkg_preinst() {
+ if use wxwidgets ; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use wxwidgets ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use wxwidgets ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
diff --git a/games-emulation/vbam/vbam-9999.ebuild b/games-emulation/vbam/vbam-9999.ebuild
new file mode 100644
index 000000000000..53f480e326ee
--- /dev/null
+++ b/games-emulation/vbam/vbam-9999.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+WX_GTK_VER="3.0-gtk3"
+inherit gnome2-utils wxwidgets xdg-utils cmake-utils
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/visualboyadvance-m/visualboyadvance-m.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/visualboyadvance-m-${PV}"
+fi
+
+DESCRIPTION="Game Boy, GBC, and GBA emulator forked from VisualBoyAdvance"
+HOMEPAGE="https://github.com/visualboyadvance-m/visualboyadvance-m"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ffmpeg link lirc nls openal +sdl wxwidgets"
+REQUIRED_USE="openal? ( wxwidgets ) || ( sdl wxwidgets )"
+
+RDEPEND="
+ >=media-libs/libpng-1.4:0=
+ media-libs/libsdl2[joystick]
+ link? ( >=media-libs/libsfml-2.0:= )
+ sys-libs/zlib:=
+ virtual/glu
+ virtual/opengl
+ ffmpeg? ( media-video/ffmpeg:= )
+ lirc? ( app-misc/lirc )
+ nls? ( virtual/libintl )
+ wxwidgets? (
+ openal? ( media-libs/openal )
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+ )"
+DEPEND="${RDEPEND}
+ app-arch/zip
+ wxwidgets? ( virtual/imagemagick-tools )
+ x86? ( || ( dev-lang/nasm dev-lang/yasm ) )
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+src_configure() {
+ use wxwidgets && setup-wxwidgets
+ local mycmakeargs=(
+ -DENABLE_FFMPEG=$(usex ffmpeg)
+ -DENABLE_LINK=$(usex link)
+ -DENABLE_LIRC=$(usex lirc)
+ -DENABLE_NLS=$(usex nls)
+ -DENABLE_OPENAL=$(usex openal)
+ -DENABLE_SDL=$(usex sdl)
+ -DENABLE_WX=$(usex wxwidgets)
+ -DENABLE_ASM_CORE=$(usex x86)
+ -DENABLE_ASM_SCALERS=$(usex x86)
+ -DCMAKE_SKIP_RPATH=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ if use sdl ; then
+ dodoc doc/ReadMe.SDL.txt
+ doman src/debian/vbam.6
+ fi
+ use wxwidgets && doman src/debian/visualboyadvance-m.6
+}
+
+pkg_preinst() {
+ if use wxwidgets ; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use wxwidgets ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use wxwidgets ; then
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
diff --git a/games-emulation/vgba-4.8-r1 b/games-emulation/vgba-4.8-r1
deleted file mode 100644
index 996d5c6081f1..000000000000
--- a/games-emulation/vgba-4.8-r1
+++ /dev/null
@@ -1,11 +0,0 @@
-DEFINED_PHASES=install
-DESCRIPTION=Gameboy Advance (GBA) emulator for Linux
-EAPI=6
-HOMEPAGE=http://www.komkon.org/fms/VGBA/
-KEYWORDS=-* ~amd64 ~x86
-LICENSE=VGBA
-RDEPEND=x11-libs/libXext sys-libs/zlib
-RESTRICT=strip
-SLOT=0
-SRC_URI=http://fms.komkon.org/VGBA/VGBA48-Linux-Ubuntu-bin.tgz
-_md5_=0cf8b7f16a9363ec6441ddfa9edf70b4
diff --git a/games-emulation/vgba/Manifest b/games-emulation/vgba/Manifest
new file mode 100644
index 000000000000..b0343e38d6c9
--- /dev/null
+++ b/games-emulation/vgba/Manifest
@@ -0,0 +1,3 @@
+DIST VGBA48-Linux-Ubuntu-bin.tgz 219565 BLAKE2B 3c00fae6b807e5a63ee719581e1e8a14ad123fa819e1f05008169435b4e2f06187f544e42d6a8b94ef1eec7f914ad3c3dd1282cf8186c67e69c2ac53c2d6ac53 SHA512 02362bad94ef93c8aa34bd18d8e6588aadd7d4218ce1c6307468877ac1ddadec073bca001c3d392db2554d937bee51541a76a8b2b15ea35a3c6db5822d6191bc
+EBUILD vgba-4.8-r1.ebuild 529 BLAKE2B 0f2787b236d2f207233a2ec7ac786c7530a007af7639d0cbc9870e0404b66fe755b362de183ee43e9b085af731ab2c007af160b3624272fd3ae6d018a2ff26b5 SHA512 b62c015b2a51d6380a284031ab69d4a2f71fd0d7c25d3d61558ce3db648d8a956af0a99400bf153b71aa7e66215f843781c98757def6ca82ac66a345550a2df1
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/vgba/metadata.xml b/games-emulation/vgba/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/vgba/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/vgba/vgba-4.8-r1.ebuild b/games-emulation/vgba/vgba-4.8-r1.ebuild
new file mode 100644
index 000000000000..b3a974dbfd82
--- /dev/null
+++ b/games-emulation/vgba/vgba-4.8-r1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Gameboy Advance (GBA) emulator for Linux"
+HOMEPAGE="http://www.komkon.org/fms/VGBA/"
+SRC_URI="http://fms.komkon.org/VGBA/VGBA${PV/.}-Linux-Ubuntu-bin.tgz"
+
+LICENSE="VGBA"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+RESTRICT="strip"
+IUSE=""
+
+RDEPEND="
+ x11-libs/libXext
+ sys-libs/zlib
+"
+
+QA_PREBUILT="/opt/bin/vgba"
+
+S="${WORKDIR}"
+
+src_install() {
+ into /opt
+ dobin vgba
+ HTML_DOCS="VGBA.html" einstalldocs
+}
diff --git a/games-emulation/yabause-0.9.14 b/games-emulation/yabause-0.9.14
deleted file mode 100644
index ac43c1b77c01..000000000000
--- a/games-emulation/yabause-0.9.14
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install postinst preinst prepare setup test unpack
-DEPEND=x11-libs/libXrandr openal? ( media-libs/openal ) opengl? ( media-libs/freeglut virtual/glu virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) !qt5? ( dev-libs/glib:2 x11-libs/gtk+:2 x11-libs/gtkglext ) sdl? ( media-libs/libsdl2[opengl?,video] ) virtual/pkgconfig sys-devel/make >=dev-util/cmake-3.9.6
-DESCRIPTION=A Sega Saturn emulator
-EAPI=5
-HOMEPAGE=http://yabause.org/
-IUSE=openal opengl pic qt5 sdl
-KEYWORDS=~amd64 ~x86
-LICENSE=GPL-2
-RDEPEND=x11-libs/libXrandr openal? ( media-libs/openal ) opengl? ( media-libs/freeglut virtual/glu virtual/opengl ) qt5? ( dev-qt/qtcore:5 dev-qt/qtwidgets:5 opengl? ( dev-qt/qtopengl:5 ) ) !qt5? ( dev-libs/glib:2 x11-libs/gtk+:2 x11-libs/gtkglext ) sdl? ( media-libs/libsdl2[opengl?,video] ) games-misc/games-envd
-SLOT=0
-SRC_URI=mirror://sourceforge/yabause/yabause-0.9.14.tar.gz
-_eclasses_=base 983774947da124fb7d542ce25a218bb1 cmake-utils 57384a259cf0c7985ce651b2c0865405 desktop 1b286a7e7143d8c4ec89cd0d2743a097 eapi7-ver d97a56a62c7df8614afddcb25f5ff00f epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 games 2bb3ede665927a68ffdb7c41eec7efde ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e multiprocessing cac3169468f893670dac3e7cb940e045 ninja-utils d2e7e7d290428bb25c56dcf2502badc1 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 user 8bc2845510e2109af75e3eeac607ec81 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf xdg-utils f2c8335407f0b935b0a96d4adf23ef25
-_md5_=7c8934ec4dfff5846feda6ff9e72ec25
diff --git a/games-emulation/yabause/Manifest b/games-emulation/yabause/Manifest
new file mode 100644
index 000000000000..25365c78d8f0
--- /dev/null
+++ b/games-emulation/yabause/Manifest
@@ -0,0 +1,5 @@
+AUX yabause-0.9.14-RWX.patch 688 BLAKE2B eb74169adfdee83d68458ebf4e6e274cb94f7e1866f0d7489b9d1ba067df1110213edb80c1cfd53a00c84723249bd7d0e0529afe0d48541bbe6310b055ade06a SHA512 9da2ca641bcd0df8c05d9d5727158952ff41a8d88f685b9263661bf0fe71eca8b338c37fbcdfce252131c5fe6e4a73fa27ae51d161495f8596feeebc3f2d6d63
+AUX yabause-0.9.14-cmake.patch 1905 BLAKE2B 59a479173d555262877626dedad50ea2cde8cecc5d2127cd8e36af4fdb4ec3d438917294d10378d7442086eaad8740a02f88086516cf7e7aed29a6dc65adbf1f SHA512 13e6c72113e06a0baee7051122c1d2cc56a13ecacd383e76aad0d6784b2bcb7593d8ff27184231e9356a2aa0bff98a74d0af2860dea62075d3d2992e8a56eec2
+DIST yabause-0.9.14.tar.gz 1662762 BLAKE2B 83f3bcdf8d513a87ed596171cfc1768cdb1cd2f3329766b92ef2e94f176fbafe16ac4970c5515e5d12537b20bd6473b209b1ec6090a07d6d1521b7d2094957ed SHA512 8b14d9146cf12d104fcf43369cd949f1f47e7891a54241914f6141facf871bcc158f4e80a8c5b61fdeefe6f1b8d425ff301ba653df134a030c323c9e3ccf3a58
+EBUILD yabause-0.9.14.ebuild 1515 BLAKE2B f439c4a4b1a72e9034b68238ef19855347ea8cf4441f704b907a3e440e1fb146f6adc77ee5a0a7fe2df1886a4b786b24fb2c86cca8a7836c1b3673a98a48284b SHA512 9ac2f7400a883c732edf2e0b5204a825ae32c468a621daacfc57eb9f329e768a83ab4ba412b7517b41391b6120c48a182222b3e3eae725f6f9445dc46cbe27cb
+MISC metadata.xml 428 BLAKE2B 7707db2fbcc0dd98e8bc2721abef693d8c06625ce607beaf419e0a60c21f96bea529780f912764f90dae2a6ac66650893d3d2ea7751ac33242a5eb804ef174f0 SHA512 1695012927826ba97b0457e9d1051396a1da0b582cebf64269fe02431c019dbf4ca20a42368b825a28ba24b0a781126be82727428e3ab92adffc667bb6c575ef
diff --git a/games-emulation/yabause/files/yabause-0.9.14-RWX.patch b/games-emulation/yabause/files/yabause-0.9.14-RWX.patch
new file mode 100644
index 000000000000..8022be90f852
--- /dev/null
+++ b/games-emulation/yabause/files/yabause-0.9.14-RWX.patch
@@ -0,0 +1,24 @@
+--- yabause-0.9.13.orig/src/sh2_dynarec/linkage_x64.s
++++ yabause-0.9.13/src/sh2_dynarec/linkage_x64.s
+@@ -747,3 +747,11 @@
+ ret
+ /* Set breakpoint here for debugging */
+ .size breakpoint, .-breakpoint
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+--- yabause-0.9.13.orig/src/sh2_dynarec/linkage_x86.s
++++ yabause-0.9.13/src/sh2_dynarec/linkage_x86.s
+@@ -743,3 +743,7 @@
+ ret
+ /* Set breakpoint here for debugging */
+ .size breakpoint, .-breakpoint
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/games-emulation/yabause/files/yabause-0.9.14-cmake.patch b/games-emulation/yabause/files/yabause-0.9.14-cmake.patch
new file mode 100644
index 000000000000..a126c010bb7a
--- /dev/null
+++ b/games-emulation/yabause/files/yabause-0.9.14-cmake.patch
@@ -0,0 +1,51 @@
+--- yabause-0.9.13.orig/l10n/CMakeLists.txt
++++ yabause-0.9.13/l10n/CMakeLists.txt
+@@ -2,9 +2,12 @@
+
+ set(LANGS de es fr it lt nl pt pt_BR sv)
+
++# paths
++set(TRANSDIR "share/yabause/yts" CACHE STRING "dir to translation files")
++
+ if (UNIX AND NOT APPLE)
+ foreach(LANG ${LANGS})
+- install(FILES "yabause_${LANG}.yts" DESTINATION "share/yabause/yts" RENAME "${LANG}.yts")
++ install(FILES "yabause_${LANG}.yts" DESTINATION ${TRANSDIR} RENAME "${LANG}.yts")
+ endforeach()
+ elseif (WIN32)
+ foreach(LANG ${LANGS})
+--- yabause-0.9.13.orig/src/gtk/CMakeLists.txt
++++ yabause-0.9.13/src/gtk/CMakeLists.txt
+@@ -59,7 +59,10 @@
+ yab_port_success(yabause-gtk)
+ configure_file(yabause.desktop.in ${YAB_PORT_NAME}.desktop)
+
+-install(TARGETS yabause-gtk DESTINATION "bin")
++# paths
++set(BINDIR "bin" CACHE STRING "dir to binary")
++
++install(TARGETS yabause-gtk DESTINATION ${BINDIR})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${YAB_PORT_NAME}.desktop DESTINATION "share/applications")
+ install(FILES "doc/yabause.1" DESTINATION "${YAB_MAN_DIR}/man1" RENAME "${YAB_PORT_NAME}.1")
+ install(FILES "yabause.png" DESTINATION "share/pixmaps")
+--- yabause-0.9.13.orig/src/qt/CMakeLists.txt
++++ yabause-0.9.13/src/qt/CMakeLists.txt
+@@ -237,6 +237,9 @@
+ yab_port_success(yabause-qt)
+ configure_file(yabause.desktop.in ${YAB_PORT_NAME}.desktop)
+
++# paths
++set(BINDIR "bin" CACHE STRING "dir to binary")
++
+ if (WIN32)
+ install(TARGETS yabause-qt DESTINATION ".")
+ if (GLUT_FOUND)
+@@ -277,7 +280,7 @@
+ endif()
+ endif ()
+ else ()
+- install(TARGETS yabause-qt DESTINATION "bin")
++ install(TARGETS yabause-qt DESTINATION ${BINDIR})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${YAB_PORT_NAME}.desktop DESTINATION "share/applications")
+ install(FILES "doc/yabause.1" DESTINATION "${YAB_MAN_DIR}/man1" RENAME "${YAB_PORT_NAME}.1")
+ install(FILES "resources/icons/yabause.png" DESTINATION "share/pixmaps")
diff --git a/games-emulation/yabause/metadata.xml b/games-emulation/yabause/metadata.xml
new file mode 100644
index 000000000000..518c975f9d26
--- /dev/null
+++ b/games-emulation/yabause/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="pic">disable optimized assembly code that is not PIC friendly</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">yabause</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/yabause/yabause-0.9.14.ebuild b/games-emulation/yabause/yabause-0.9.14.ebuild
new file mode 100644
index 000000000000..b13959e8a4a0
--- /dev/null
+++ b/games-emulation/yabause/yabause-0.9.14.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils games
+
+DESCRIPTION="A Sega Saturn emulator"
+HOMEPAGE="http://yabause.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="openal opengl pic qt5 sdl"
+
+# x11-libs/libXrandr is an automagic dep
+# qt5 over qt4 and libsdl2 over libsdl is
+# also done automatically. Send patches
+# upstream to make the choices explicit.
+RDEPEND="
+ x11-libs/libXrandr
+ openal? ( media-libs/openal )
+ opengl? (
+ media-libs/freeglut
+ virtual/glu
+ virtual/opengl
+ )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtwidgets:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ !qt5? (
+ dev-libs/glib:2
+ x11-libs/gtk+:2
+ x11-libs/gtkglext
+ )
+ sdl? ( media-libs/libsdl2[opengl?,video] )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-RWX.patch
+ "${FILESDIR}"/${P}-cmake.patch
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBINDIR="${GAMES_BINDIR}"
+ -DTRANSDIR="${GAMES_DATADIR}"/${PN}/yts
+ -DYAB_OPTIMIZATION=""
+ $(cmake-utils_use sdl YAB_WANT_SDL)
+ $(cmake-utils_use openal YAB_WANT_OPENAL)
+ $(cmake-utils_use opengl YAB_WANT_OPENGL)
+ $(cmake-utils_use !pic SH2_DYNAREC)
+ -DYAB_PORTS=$(usex qt5 "qt" "gtk")
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc AUTHORS ChangeLog GOALS README README.LIN
+ prepgamesdirs
+}
diff --git a/games-emulation/zinc-1.1-r1 b/games-emulation/zinc-1.1-r1
deleted file mode 100644
index 78655aeb9db6..000000000000
--- a/games-emulation/zinc-1.1-r1
+++ /dev/null
@@ -1,11 +0,0 @@
-DEFINED_PHASES=install
-DESCRIPTION=An x86 binary-only emulator for Sony ZN-1, ZN-2, and Namco System 11 arcades
-EAPI=6
-HOMEPAGE=http://caesar.logiqx.com/php/emulator.php?id=zinc_linux
-KEYWORDS=-* ~amd64 ~x86
-LICENSE=freedist
-RDEPEND=x11-libs/libXext[abi_x86_32(-)] virtual/opengl[abi_x86_32(-)]
-RESTRICT=strip
-SLOT=0
-SRC_URI=http://caesar.logiqx.com/zips/emus/linux/zinc_linux/zinc11-lnx.tar.bz2
-_md5_=aa975e33c2aea099ec2a2d8a26464e5a
diff --git a/games-emulation/zinc/Manifest b/games-emulation/zinc/Manifest
new file mode 100644
index 000000000000..abb9d51aa400
--- /dev/null
+++ b/games-emulation/zinc/Manifest
@@ -0,0 +1,3 @@
+DIST zinc11-lnx.tar.bz2 305824 BLAKE2B d0328f1cdb1000eed54259bdd7801244b61d8936af8b95d8658c66241bdaacd7292095b4b86465f7617807870f2485b4ed11a8c203be917afcce6279d9d5e19a SHA512 8511ebb867347adfc00448a74548b4a22a2d854a14c663a626d33738e89d2cabd3248837a26d5ed099ef4dc40a0f451df639663774926e797ddc846a7270af4b
+EBUILD zinc-1.1-r1.ebuild 720 BLAKE2B c2086d73effa22b485389aaabd826078b364a3bb6f161113c4ec1f0de4b149c34799da0f5b18a37e79aebf88fc7cc9950ea20ffc5dc321e171c8cd8f9949cc51 SHA512 19e5d82276e64769f857a85097435177bd50af5ef8da6bd90355f689ac58b2acd059922e8977d644c18b50d4065f04d93a844c3e593c249065c8f3819bf030c7
+MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
diff --git a/games-emulation/zinc/metadata.xml b/games-emulation/zinc/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-emulation/zinc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/games-emulation/zinc/zinc-1.1-r1.ebuild b/games-emulation/zinc/zinc-1.1-r1.ebuild
new file mode 100644
index 000000000000..69f75f4b58ff
--- /dev/null
+++ b/games-emulation/zinc/zinc-1.1-r1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="An x86 binary-only emulator for Sony ZN-1, ZN-2, and Namco System 11 arcades"
+HOMEPAGE="http://caesar.logiqx.com/php/emulator.php?id=zinc_linux"
+SRC_URI="http://caesar.logiqx.com/zips/emus/linux/zinc_linux/${P//[-.]/}-lnx.tar.bz2"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+RESTRICT="strip"
+QA_PREBUILT="/opt/bin/zinc /usr/lib*/*.so"
+
+RDEPEND="
+ x11-libs/libXext[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+"
+
+S="${WORKDIR}/zinc"
+
+src_install() {
+ exeinto /opt/bin
+ doexe zinc
+ dolib.so libcontrolznc.so librendererznc.so libsoundznc.so libs11player.so
+ einstalldocs
+}
diff --git a/games-emulation/zsnes-1.51-r6 b/games-emulation/zsnes-1.51-r6
deleted file mode 100644
index 9101453551fb..000000000000
--- a/games-emulation/zsnes-1.51-r6
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare
-DEPEND=media-libs/libsdl[sound,video,abi_x86_32(-)] >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)] ao? ( media-libs/libao[abi_x86_32(-)] ) debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] ) opengl? ( virtual/opengl[abi_x86_32(-)] ) png? ( media-libs/libpng:0=[abi_x86_32(-)] ) dev-lang/nasm debug? ( virtual/pkgconfig ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=SNES (Super Nintendo) emulator that uses x86 assembly
-EAPI=6
-HOMEPAGE=http://www.zsnes.com/ http://ipherswipsite.com/zsnes/
-IUSE=ao custom-cflags +debug opengl pax_kernel png
-KEYWORDS=-* ~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux
-LICENSE=GPL-2
-RDEPEND=media-libs/libsdl[sound,video,abi_x86_32(-)] >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)] ao? ( media-libs/libao[abi_x86_32(-)] ) debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] ) opengl? ( virtual/opengl[abi_x86_32(-)] ) png? ( media-libs/libpng:0=[abi_x86_32(-)] )
-SLOT=0
-SRC_URI=mirror://sourceforge/zsnes/zsnes151src.tar.bz2
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e pax-utils b963274a93e76570a88168c1f1db4cd7 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=b6e0776e067ebdc897d6a959cfc26bfa
diff --git a/games-emulation/zsnes-1.51-r7 b/games-emulation/zsnes-1.51-r7
deleted file mode 100644
index fa53b55d7ea7..000000000000
--- a/games-emulation/zsnes-1.51-r7
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare
-DEPEND=media-libs/libsdl[sound,video,abi_x86_32(-)] >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)] ao? ( media-libs/libao[abi_x86_32(-)] ) debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] ) opengl? ( virtual/opengl[abi_x86_32(-)] ) png? ( media-libs/libpng:0=[abi_x86_32(-)] ) dev-lang/nasm debug? ( virtual/pkgconfig ) >=app-portage/elt-patches-20170422 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=SNES (Super Nintendo) emulator that uses x86 assembly
-EAPI=6
-HOMEPAGE=http://www.zsnes.com/ http://ipherswipsite.com/zsnes/
-IUSE=ao custom-cflags +debug opengl pax_kernel png
-KEYWORDS=-* ~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux
-LICENSE=GPL-2
-RDEPEND=media-libs/libsdl[sound,video,abi_x86_32(-)] >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)] ao? ( media-libs/libao[abi_x86_32(-)] ) debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] ) opengl? ( virtual/opengl[abi_x86_32(-)] ) png? ( media-libs/libpng:0=[abi_x86_32(-)] )
-SLOT=0
-SRC_URI=mirror://sourceforge/zsnes/zsnes151src.tar.bz2
-_eclasses_=autotools d0e5375d47f4c809f406eb892e531513 desktop 1b286a7e7143d8c4ec89cd0d2743a097 epatch 9a5f039771f143195164a15a4faa41a1 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 5b8ce72259e08104b337fe28c6de5dbc flag-o-matic 5128c4729303400bd8d4b0b966530955 libtool 0081a71a261724730ec4c248494f044d ltprune 607e058da37aa6dabfa408b7d61da72e multilib 97f470f374f2e94ccab04a2fb21d811e pax-utils b963274a93e76570a88168c1f1db4cd7 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs 1e35303c63cd707f6c3422b4493d5607 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
-_md5_=e9c85e87d34287a1f7ee5a167affc8ab
diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest
new file mode 100644
index 000000000000..c24684152b52
--- /dev/null
+++ b/games-emulation/zsnes/Manifest
@@ -0,0 +1,17 @@
+AUX zsnes-1.51-CC-quotes.patch 740 BLAKE2B f41e66a5d2f9b54c8ed4f17fafc7afdd73e35202c083d1db375b26b89f03b991d36d279d10c7c17076f31b87d1fbad276e5c5c4ce333d2cb0f0fc7641b562845 SHA512 2347910158934a7c8b90a6739f923d7a1f94e963515dca42d45eb97e6165c5f80c30d28fd151537a7a80bba16d2462568ff1c1dac93a855990f0418aaf059776
+AUX zsnes-1.51-arch.patch 2484 BLAKE2B 036f749d832efc976a7225e47d6b7ac5e1b69af235a4196e9706fe46d447793a1e3f88e49fe34229cd71353b987b7ef123bbebf7c822ca32025c60b0c9813b57 SHA512 cc75584780e442d7fbcd4e26a9395d8e85570883f93f63b1fcb604d601acde88295861e15a6cee1d50bca836fc52efd4f5df9c84fb73fbe04fa76ec34ae3b4a1
+AUX zsnes-1.51-archopt-july-23-update.patch 12672 BLAKE2B d12246a4913d2355a7c2c26686714e61ff3791c29f93f473619225b9bd180d329c48d07123141d657faf3fe75de4e49d31b80b4577f9a646a531774abba24b4a SHA512 ac30370957721ccc4bc8681dc00110bd68dee6d65a2c3daa39df2fe45a4fa7106f9c3097b2bd9cc3dbc83e3c6344811e8719f48ba6e4896768c17357730c5719
+AUX zsnes-1.51-buffer.patch 3091 BLAKE2B a87e0b6547aeaa9f585d76a8ee080895573015fe42b0df2161268754ff01c046fd234997000ef484f66710dfd30e145d9d4db2f373a568e99deec2a8637db285 SHA512 0faf34338ff3fd85985dc16d2a58aa9e2ac1887db8d26bc210fc6965f6cc743c6c56b8b58bea72341d8ee1fed59c438db801000be5ae6bf4e26789e9bed89d25
+AUX zsnes-1.51-cross-compile.patch 934 BLAKE2B be18829454407c99aba00cb8126573f5f3e3ed8e18b2bb50811b855ba81137a16b90601c28cab9fce8d865e522cb66bb797d46a22090dd994c71aef672be99f2 SHA512 ece4a9f51314c7318babaf689fb44c1502ec5bc32808613211865daf1368cc1069b70ad4c1c4ec7b127cf707a0b093c356a8b50e5357099894656c78cf28738f
+AUX zsnes-1.51-depbuild.patch 559 BLAKE2B 38309177599aee8dafcbded6a027d66b991e85aac4c77fda0485b7777467c056386797041223a556b3cfff4b926e5a0b4004baae4264a765354a6dc2cb39ac75 SHA512 46955153ec6d2ecd5a295117c3ecc911a566de69f29f4d29decc98867d03e4a53a980a3c75d8ff19bbd1655eb291069fbbd598e002a73ebdbdc94c135f852c6e
+AUX zsnes-1.51-gcc43.patch 913 BLAKE2B 7ac3d5b8f556d577c1a1065bbe4e275742fdde0486411cc82f2dc552e8d90b82eb7dceefcdd87252633154b8249213f9dfe6724f4f0ee4eef3f8f691081355c7 SHA512 8684b9b8c01d2d9f27bf27a86e4705b3408a2891347045266040397b649eb162962e8384746930c9837ac9b21bfd626d6e241d8a6c73b46a0e348274dd8688d3
+AUX zsnes-1.51-gcc47.patch 312 BLAKE2B 927c6179fbbcd3fb161b5b18e025090acce178eae0586b7c20e48cdba091572d30c224aa80bb8a49c16d29fb9045c0207b26692651a15a53c2b4b90780c3f0c2 SHA512 aa9f111359e96118729e684562618d72231c5c475e736c53862cfe9d21b8c4db29056ec0476dcc7e50dd501a77619671fb8834be093086c7e752100c917060fc
+AUX zsnes-1.51-libao-thread.patch 667 BLAKE2B 76bc0abf16f68c9752a727817cff209daa2c0c29f31e6045441e202083f47559cb50c1a6a998c12621a298fa3901bc1d52701b176b8fd594ca116f990d3c5208 SHA512 43c28d4539df5c8ea4d3d0415c65afec3eb9215971a5ff0532b3b147b2fa3f870aadf07eb1e643e986c39d56760c0292447d467418865826ddc8c7aea64cc005
+AUX zsnes-1.51-libpng.patch 858 BLAKE2B f0ad46176cf5729d0a5be9e4307a28628e38c3d18043f0ff897dfd1cf901f0f9fb7ff80d25095fdaa9b6b1be52fe3c95f4e28b65042b4c4aad33a27125c7eb02 SHA512 2c25fb3294357a38ed8e119d4b4d60f7bd6f28724b2274a620465962e96e008f2a29273f46d4813e91b9128879218f401bb91b1a6df4c156b9ff7856b26657b0
+AUX zsnes-1.51-libpng15.patch 510 BLAKE2B 6281a27c6029ee94947b282fe5c06a67e7670d3168d5f4ae90573d12e8e6d5c467a9691cdd161158f117e341466bc7a3e99d516b95624534773027279aba4f7a SHA512 4191987cad2f8dd7d7fd1d4f8f0c60de07059f18a60cb9bb94f1e5c35c06122032de9887762ebcf2d255f24c3e90aa5b4f6a7540a8e4dbdc4ce5f7d3b3e3b532
+AUX zsnes-1.51-stack-align-v2.patch 1451 BLAKE2B b4570fa9d614d516375f1b7d2a9b3b7c9bf432f453425d2ee3035e78d8d946355551044d712528907c3a1f29b3531034b5949224398801e04270df85ada5ab00 SHA512 c3be01f36973615c55c643d1d916742f8e3a34e9957b42d1d7224a99790713025bb154e5e8c2833fd1e8d26240c6251a70c8a9f36fefe661480077b1b06871c8
+AUX zsnes-1.51-stack-align.patch 283 BLAKE2B 2ae8aaf28975f0f88ed77eafb3977706bd662215a7e286c32ce6a138993bda00c05012bc92bd106b6607d524990ccccf094e647c44a350babf3755c2dc6bf3a6 SHA512 543876c459d7448bb7707677de432dd0140320ab77752f1d9fbee4f58ea34158f1e223f46d5aa9e2858b902513a915517f27e86e51f2263f667a6baea608fb55
+DIST zsnes151src.tar.bz2 1071712 BLAKE2B e942c699bd227942563deb23b105339aa9ffd8a5623200ca142a777508b4ebaf47859170016490f53a3af2bfb15293c17a99a7658e1f3f0afd7df8cd63200b9a SHA512 2cec9ad7762fc7a257c6b1d3e190b0ed53565dbafe42e1dee9eb182644392b7dd2c57faa846f63cd30ac079e5c05354d26ce0612d20481a1f54d760d62d95353
+EBUILD zsnes-1.51-r6.ebuild 3198 BLAKE2B cf8d5505e5eef6c3d864cddc82dfd9af86ce32780c651536547994218e55658450ce8fb507126850ff16541fa342a6a99d13bf25d550d46072f07c338f8c14e0 SHA512 4a9a696fdfbc4f31c95fe5e81fd6a27b569771d8fe36b24a088594f0a36fbf13a6c30dc562e57a7e4842569b9b4a15a459f17bd24101f685160650232ccaddb6
+EBUILD zsnes-1.51-r7.ebuild 3173 BLAKE2B c0ae44e8340ddce0d6a7cd4e5f7ce56e7b6b0b142194874f0f3f1681fbb3eb9a92fa149f2ce7edbbebe6136b5940b2601c4be4be360f574c83644a1af97ad094 SHA512 e5acf4bce2632ff23550c37e0f27c602240e1f9ac3ef0287d81b4a35f80a33557728f9d4721d62985c19e64d9b392f8283edb58c22131c0ee74e6d78bbd94aac
+MISC metadata.xml 484 BLAKE2B ad2da7cec97ca32be7ae42000312cdebd1c5dc5fce4ccc6f99fd16e69208350a5e714201e0bc258e8d4eb980357fe2517cc9b177e3ad74507b44d31ecdc8fe27 SHA512 02318871d54bfa7d9c4ba2a64f3ed7c83bf45b04a5c66dda5659d935b943a2415e6eaad124ac34e3c4235ba57f21c1189b03fec4f622c19eec1873531727a622
diff --git a/games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch b/games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch
new file mode 100644
index 000000000000..d3230d6d70d5
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch
@@ -0,0 +1,20 @@
+--- src/Makefile.in.orig
++++ src/Makefile.in
+@@ -95,7 +95,7 @@
+ %.o: %.cpp
+ @CXX@ @CXXFLAGS@ -o $@ -c $<
+ %.o %.h: %.psr $(PSR)
+- ./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
++ ./$(PSR) @PSRFLAGS@ -gcc "@CC@" -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
+
+ default: main
+ all: main tools--- zsnes_1_51/src/Makefile.in.orig 2009-02-25 18:02:07.000000000 +0100
+@@ -133,7 +133,7 @@
+
+ include makefile.dep
+ makefile.dep: $(TOOL_D)/depbuild Makefile
+- $(TOOL_D)/depbuild @CC@ "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
++ $(TOOL_D)/depbuild "@CC@" "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
+
+ Makefile: Makefile.in config.status
+ ./config.status
diff --git a/games-emulation/zsnes/files/zsnes-1.51-arch.patch b/games-emulation/zsnes/files/zsnes-1.51-arch.patch
new file mode 100644
index 000000000000..b39549871b7f
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-arch.patch
@@ -0,0 +1,77 @@
+--- a/configure.in.orig
++++ b/configure.in
+@@ -233,72 +233,8 @@
+ debug=no)
+ AC_MSG_CHECKING(if you want gdb friendly executable)
+ AC_MSG_RESULT($debug)
+-if test x$debug = xyes; then
+-dnl - It is easier to debug zsnes with no optimization enabled.
+- ZSNESEXE="zsnesd"
+- PSR_TEMP=""
+- CFLAGS="$CFLAGS -Wall -W -DDEBUG -O0 -fno-omit-frame-pointer -gstabs3"
+- NFLAGS="$NFLAGS -DDEBUG -g -F stabs -s -O0"
+-else
+- ZSNESEXE="zsnes"
+- PSR_TEMP=" rm -f t_\$*.c"
+-
+- CFLAGSBAK="$CFLAGS"
+- AC_ARG_VAR(force_arch, [Force architecture to optimize GCC/G++ for])
+- AC_MSG_CHECKING(which cpu architecture to optimize for)
+- if test x$force_arch != x; then
+- CFLAGS="$CFLAGS -march=$force_arch"
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]])],
+- [AC_MSG_RESULT(forcing $force_arch)],
+- [AC_MSG_RESULT($force_arch ??)
+- AC_MSG_WARN(incorrect force_arch parameter)
+- force_arch=""
+- CFLAGS="$CFLAGSBAK"
+- AC_MSG_CHECKING(for autodetected architecture)])
+- else
+- if test x$ARCH_INFO = x; then
+- case x$target in
+- i686-*-*)
+- AC_MSG_RESULT(guessing i686)
+- CFLAGS="$CFLAGS -march=i686"
+- ;;
+- i586-*-*)
+- AC_MSG_RESULT(guessing i586)
+- CFLAGS="$CFLAGS -march=i586"
+- ;;
+- i486-*-*)
+- AC_MSG_RESULT(guessing i486)
+- CFLAGS="$CFLAGS -march=i486"
+- ;;
+- *)
+- AC_MSG_RESULT(guessing i386)
+- CFLAGS="$CFLAGS -march=i386"
+- AC_MSG_WARN([This is not what you want, use --target or force-arch])
+- ;;
+- esac
+- else
+- AC_MSG_RESULT($ARCH_INFO)
+- CFLAGS="$CFLAGS -march=$ARCH_INFO"
+- fi
+- fi
+-
+- AC_ARG_ENABLE(release,
+- [ --enable-release Build ultra-optimized release binary (zsnes)],
+- release=$enableval,
+- release=no)
+- AC_MSG_CHECKING(if you want crazy optimizations)
+- AC_MSG_RESULT($release)
+- if test x$release = xyes; then
+- if test x$force_arch = x; then
+- AC_MSG_WARN([If you intend to distribute this binary, make sure you use force_arch and set to i586 (or whichever CPU Arch you intend for)])
+- fi
+- CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr $STRIP -D__RELEASE__"
+- NFLAGS="$NFLAGS -O99999999 -D__RELEASE__"
+- else
+- CFLAGS="$CFLAGS -O3 -fomit-frame-pointer $STRIP"
+- NFLAGS="$NFLAGS -O1"
+- fi
+-fi
++ZSNESEXE="zsnes"
++PSR_TEMP=" rm -f t_\$*.c"
+ CXXFLAGS="$CFLAGS -fno-rtti"
+
+ if test x$enable_jma != xno; then
diff --git a/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch b/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch
new file mode 100644
index 000000000000..b3e466036f22
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch
@@ -0,0 +1,502 @@
+--- a/tools/archopt.c.old
++++ b/tools/archopt.c
+@@ -1,8 +1,30 @@
++/*
++Copyright (C) 2005-2007 Nach, grinvader ( http://www.zsnes.com )
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++version 2 as published by the Free Software Foundation.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++*/
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
+
++#ifdef _M_X64
++#define __x86_64__
++#endif
++
++#ifdef __GNUC__
+ #ifdef __x86_64__
+ #define cpuid(in, a, b, c, d) asm volatile("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
+ #else
+@@ -13,6 +35,22 @@
+ movl %%ebx,%%edi;\
+ popl %%ebx": "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (in));
+ #endif
++#else
++char cpubuf[256];
++int z_in, z_a, z_b, z_c, z_d;
++void cpuid_run()
++{
++ _asm {
++ mov eax,z_in
++ cpuid
++ mov z_a,eax
++ mov z_b,ebx
++ mov z_c,ecx
++ mov z_d,edx
++ };
++}
++#define cpuid(in, a, b, c, d) z_in = in; cpuid_run(); a = z_a; b = z_b; c = z_c; d = z_d;
++#endif
+
+ char *x86_flags[] =
+ { "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
+@@ -62,6 +100,7 @@
+ {
+ int have = 0x200000;
+ #ifndef __x86_64__
++ #ifdef __GNUC__
+ asm volatile
+ (
+ " pushfl;"
+@@ -76,6 +115,23 @@
+ : "=a" (have)
+ : "c" (have)
+ );
++ #else
++ z_c = have;
++ _asm {
++ mov ecx,z_c
++ pushfd
++ pop eax
++ mov edx,eax
++ xor eax,ecx
++ push eax
++ popfd
++ pushfd
++ pop eax
++ xor eax,edx
++ mov z_a,eax
++ };
++ have = z_a;
++ #endif
+ #endif
+ return(have);
+ }
+@@ -196,238 +252,268 @@
+ cpu = "native";
+ #endif
+ #endif
+-
+- if (!cpu && *cpu_family && *vendor_id)
++ if (!cpu)
+ {
+- if (!strcmp(vendor_id, "AuthenticAMD") || strstr(model_name, "AMD"))
++ if (!cpu && *cpu_family && *vendor_id)
+ {
+- if (strstr(flags, " mmx "))
++ #ifdef __GNUC__
++ if (!strcmp(vendor_id, "AuthenticAMD") || strstr(model_name, "AMD"))
+ {
+- #if __GNUC__ > 2
+- if (strstr(flags, " 3dnow "))
++ if (strstr(flags, " mmx "))
+ {
+- if (strstr(flags, " 3dnowext ") && (atoi(cpu_family) > 5))
++ #if __GNUC__ > 2
++ if (strstr(flags, " 3dnow "))
+ {
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 0
+- if (strstr(flags, " sse "))
++ if (strstr(flags, " 3dnowext ") && (atoi(cpu_family) > 5))
+ {
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
+- if (strstr(flags, " sse2 ") && strstr(flags, " lm ")) //Need two checks to protect Semprons
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 0
++ if (strstr(flags, " sse "))
+ {
+- if (strstr(model_name, "Opteron"))
+- {
+- cpu = "opteron";
+- }
+- else if (strstr(model_name, "Athlon(tm) 64")) //Also athlon-fx
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
++ if (strstr(flags, " sse2 ") && strstr(flags, " lm ")) //Need two checks to protect Semprons
+ {
+- cpu = "athlon64";
++ if (strstr(model_name, "Opteron"))
++ {
++ cpu = "opteron";
++ }
++ else if (strstr(model_name, "Athlon(tm) 64")) //Also athlon-fx
++ {
++ cpu = "athlon64";
++ }
++ else
++ {
++ cpu = "k8";
++ }
+ }
+- else
++ #endif
++ if (!cpu)
+ {
+- cpu = "k8";
++ if (strstr(model_name, "Athlon(tm) 4"))
++ {
++ cpu = "athlon-4";
++ }
++ else if (strstr(model_name, "Athlon(tm) MP"))
++ {
++ cpu = "athlon-mp";
++ }
++ else
++ {
++ cpu = "athlon-xp";
++ }
+ }
+ }
++
++ if (!cpu && (atoi(model) > 3))
++ {
++ cpu = "athlon-tbird";
++ }
+ #endif
++
+ if (!cpu)
+ {
+- if (strstr(model_name, "Athlon(tm) 4"))
+- {
+- cpu = "athlon-4";
+- }
+- else if (strstr(model_name, "Athlon(tm) MP"))
+- {
+- cpu = "athlon-mp";
+- }
+- else
+- {
+- cpu = "athlon-xp";
+- }
++ cpu = "athlon";
+ }
+ }
+
+- if (!cpu && (atoi(model) > 3))
+- {
+- cpu = "athlon-tbird";
+- }
+- #endif
+-
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 0
+ if (!cpu)
+ {
+- cpu = "athlon";
++ int model_num = atoi(model);
++ if ((model_num == 9) || (model_num >= 13))
++ {
++ cpu = "k6-3";
++ }
++ else
++ {
++ cpu = "k6-2";
++ }
+ }
++ #endif
+ }
++ #endif
+
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 0
+ if (!cpu)
+ {
+- int model_num = atoi(model);
+- if ((model_num == 9) || (model_num >= 13))
+- {
+- cpu = "k6-3";
+- }
+- else
+- {
+- cpu = "k6-2";
+- }
++ cpu = "k6";
+ }
+- #endif
+- }
+- #endif
+-
+- if (!cpu)
+- {
+- cpu = "k6";
+ }
+ }
+- }
+- else if (!strcmp(vendor_id, "GenuineIntel") || strstr(model_name, "Intel"))
+- {
+- #if __GNUC__ > 2
+- if (strstr(flags, " mmx "))
++ else if (!strcmp(vendor_id, "GenuineIntel") || strstr(model_name, "Intel"))
+ {
+- if (strstr(flags, " sse "))
++ #if __GNUC__ > 2
++ if (strstr(flags, " mmx "))
+ {
+- if (strstr(flags, " sse2 "))
++ if (strstr(flags, " sse "))
+ {
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 2
+- if (strstr(flags, " pni ") && strcmp(cpu_family, "6"))
++ if (strstr(flags, " sse2 "))
+ {
+- if (strstr(flags, " lm "))
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 2
++ if (strstr(flags, " pni ") && strcmp(cpu_family, "6"))
+ {
+- cpu = "nocona";
++ if (strstr(flags, " lm "))
++ {
++ cpu = "nocona";
++ }
++ else
++ {
++ cpu = "prescott";
++ }
+ }
+- else
++ #endif
++
++ if (!cpu)
+ {
+- cpu = "prescott";
++ if (!strcmp(cpu_family, "6"))
++ {
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
++ cpu = "pentium-m";
++ #else
++ cpu = "pentium3";
++ #endif
++ }
++ else
++ {
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
++ if (strstr(model_name, "Mobile"))
++ {
++ cpu = "pentium4m";
++ }
++ #endif
++
++ if (!cpu)
++ {
++ cpu = "pentium4";
++ }
++ }
+ }
+ }
+- #endif
+-
+- if (!cpu)
++ else
+ {
+- if (!strcmp(cpu_family, "6"))
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
++ if (strstr(model_name, "Mobile"))
+ {
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
+- cpu = "pentium-m";
+- #else
+- cpu = "pentium3";
+- #endif
++ cpu = "pentium3m";
+ }
+- else
+- {
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
+- if (strstr(model_name, "Mobile"))
+- {
+- cpu = "pentium4m";
+- }
+- #endif
++ #endif
+
+- if (!cpu)
+- {
+- cpu = "pentium4";
+- }
++ if (!cpu)
++ {
++ cpu = "pentium3";
+ }
+ }
+ }
+ else
+ {
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
+- if (strstr(model_name, "Mobile"))
++ if (!strcmp(cpu_family, "6"))
+ {
+- cpu = "pentium3m";
++ cpu = "pentium2";
+ }
+- #endif
+-
+- if (!cpu)
++ else
+ {
+- cpu = "pentium3";
++ cpu = "pentium-mmx";
+ }
+ }
+ }
+- else
++ #endif
++
++ if (!cpu)
++ {
++ int family = atoi(cpu_family);
++ if (family > 5)
++ {
++ cpu = "pentiumpro";
++ }
++ else if (family == 5)
++ {
++ cpu = "pentium";
++ }
++ }
++ }
++ #if __GNUC__ > 2
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 2
++ else if (!strcmp(vendor_id, "CentaurHauls") && strstr(flags, " mmx "))
++ {
++ if (strstr(flags, " 3dnow "))
+ {
+- if (!strcmp(cpu_family, "6"))
++ if (atoi(cpu_family) > 5)
+ {
+- cpu = "pentium2";
++ cpu = "c3";
+ }
+ else
+ {
+- cpu = "pentium-mmx";
++ cpu = "winchip2";
+ }
+ }
++ #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
++ else if (strstr(flags, " sse "))
++ {
++ cpu = "c3-2";
++ }
++ #endif
++
++ if (!cpu)
++ {
++ cpu = "winchip-c6";
++ }
+ }
+ #endif
++ #endif
+
+ if (!cpu)
+ {
+ int family = atoi(cpu_family);
+ if (family > 5)
+ {
+- cpu = "pentiumpro";
++ cpu = "i686";
+ }
+ else if (family == 5)
+ {
+- cpu = "pentium";
++ cpu = "i586";
+ }
+- }
+- }
+- #if __GNUC__ > 2
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 2
+- else if (!strcmp(vendor_id, "CentaurHauls") && strstr(flags, " mmx "))
+- {
+- if (strstr(flags, " 3dnow "))
+- {
+- if (atoi(cpu_family) > 5)
++ else if (family == 4)
+ {
+- cpu = "c3";
++ cpu = "i486";
+ }
+ else
+ {
+- cpu = "winchip2";
++ cpu = "i386";
+ }
+ }
+- #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
++ #else //MSVC
++ cpu = cpubuf;
++ *cpu = 0;
++
++ if (strstr(flags, " sse2 "))
++ {
++ strcat(cpu, " /arch:SSE2");
++ }
+ else if (strstr(flags, " sse "))
+ {
+- cpu = "c3-2";
++ strcat(cpu, " /arch:SSE");
+ }
+- #endif
+
+- if (!cpu)
++ #ifdef __x86_64__
++ if (strstr(flags, " lm ")) //64 bit
+ {
+- cpu = "winchip-c6";
++ if (!strcmp(vendor_id, "AuthenticAMD") || strstr(model_name, "AMD"))
++ {
++ strcat(cpu, " /favor:AMD64");
++ }
++ else if (!strcmp(vendor_id, "GenuineIntel") || strstr(model_name, "Intel"))
++ {
++ strcat(cpu, " /favor:EM64T");
++ }
+ }
++ #endif
++ #endif
+ }
+- #endif
+- #endif
+-
+- if (!cpu)
++ else
+ {
+- int family = atoi(cpu_family);
+- if (family > 5)
+- {
+- cpu = "i686";
+- }
+- else if (family == 5)
+- {
+- cpu = "i586";
+- }
+- else if (family == 4)
+- {
+- cpu = "i486";
+- }
+- else
+- {
+- cpu = "i386";
+- }
++ puts("Could not open /proc/cpuinfo, and CPUID instruction not available.");
++ return(1);
+ }
+- puts(cpu);
+- }
+- else
+- {
+- puts("Could not open /proc/cpuinfo, and CPUID instruction not available.");
+- return(1);
+ }
++ puts(cpu);
+
+ return(0);
+ }
diff --git a/games-emulation/zsnes/files/zsnes-1.51-buffer.patch b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch
new file mode 100644
index 000000000000..eb463682196d
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch
@@ -0,0 +1,85 @@
+--- src/initc.c.fortify
++++ src/initc.c
+@@ -1464,8 +1464,8 @@
+ clearmem2();
+ }
+
+-extern unsigned char BRRBuffer[32];
+-extern unsigned char echoon0;
++extern unsigned char BRRBuffer[];
++extern unsigned char echoon0[];
+ extern unsigned int PHdspsave;
+ extern unsigned int PHdspsave2;
+ unsigned char echobuf[90000];
+@@ -1479,7 +1479,7 @@
+ memset(vidmemch4, 0, 4096);
+ memset(vidmemch8, 0, 4096);
+ memset(BRRBuffer, 0, PHdspsave);
+- memset(&echoon0, 0, PHdspsave2);
++ memset(echoon0, 0, PHdspsave2);
+ memset(echobuf, 0, 90000);
+ memset(spcBuffera, 0, 65536*4+4096);
+ memset(DSPMem, 0, 256);
+@@ -1822,7 +1822,7 @@
+
+ extern unsigned int nmiprevaddrl, nmiprevaddrh, nmirept, nmiprevline, nmistatus;
+ extern unsigned char spcnumread, yesoutofmemory;
+-extern unsigned char NextLineCache, sramsavedis, sndrot, regsbackup[3019];
++extern unsigned char NextLineCache, sramsavedis, sndrot[], regsbackup[3019];
+ extern unsigned int Voice0Freq, Voice1Freq, Voice2Freq, Voice3Freq;
+ extern unsigned int Voice4Freq, Voice5Freq, Voice6Freq, Voice7Freq;
+ extern unsigned int dspPAdj;
+@@ -2621,7 +2621,7 @@
+ }
+
+ sramsavedis = 0;
+- memcpy(&sndrot, regsbackup, 3019);
++ memcpy(sndrot, regsbackup, 3019);
+
+ if (yesoutofmemory) { asm_call(outofmemfix); }
+ asm_call(GUIDoReset);
+--- src/zstate.c.fortify
++++ src/zstate.c
+@@ -99,15 +99,15 @@
+ copy_func(buffer, &cycpbl, 4);
+ copy_func(buffer, &cycpblt, 4);
+ //SNES PPU Register status
+- copy_func(buffer, &sndrot, 3019);
++ copy_func(buffer, sndrot, 3019);
+ }
+
+ static void copy_spc_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
+ {
+ //SPC stuff, DSP stuff
+ copy_func(buffer, SPCRAM, PHspcsave);
+- copy_func(buffer, &BRRBuffer, PHdspsave);
+- copy_func(buffer, &DSPMem, sizeof(DSPMem));
++ copy_func(buffer, BRRBuffer, PHdspsave);
++ copy_func(buffer, DSPMem, sizeof(DSPMem));
+ }
+
+ static void copy_extra_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
+@@ -156,7 +156,7 @@
+ /*
+ if (buffer) //Rewind stuff
+ {
+- copy_func(&buffer, &echoon0, PHdspsave2);
++ copy_func(&buffer, echoon0, PHdspsave2);
+ }
+ */
+ }
+--- src/gblvars.h.fortify
++++ src/gblvars.h
+@@ -33,9 +33,9 @@
+ extern unsigned int SfxR0, *setaramdata, ramsize, *sram, nmiprevaddrh;
+ extern unsigned int tempesi, tempedi, tempedx, tempebp;
+ extern unsigned int SPCMultA, PHnum2writespc7110reg, PHdspsave2;
+-extern unsigned char sndrot, SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
+-extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[32], *romdata;
+-extern unsigned char curcyc, echoon0, spcnumread, NextLineCache, HIRQNextExe;
++extern unsigned char sndrot[], SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
++extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[], *romdata;
++extern unsigned char curcyc, echoon0[], spcnumread, NextLineCache, HIRQNextExe;
+ extern unsigned char vidmemch4[4096], vidmemch8[4096], vidmemch2[4096];
+
+ extern bool C4Enable, SFXEnable, SA1Enable, SPC7110Enable, SETAEnable, DSP4Enable, spcon;
diff --git a/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch b/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch
new file mode 100644
index 000000000000..5c412e3e649b
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch
@@ -0,0 +1,34 @@
+--- src/acinclude.m4
++++ src/acinclude.m4
+@@ -107,7 +107,7 @@ int main (int argc, char *argv[])
+ with_zlib=yes,
+ with_zlib=no,
+ [AC_MSG_RESULT(cross-compiling)
+- with_zlib=""
++ with_zlib="cross"
+ AC_MSG_WARN(Assuming zlib is available)])
+
+ if test x$with_zlib != x; then
+@@ -116,7 +116,7 @@ fi
+ if test x$with_zlib = xyes; then
+ ZLIB_VERSION=$(<conf.zlibtest)
+ ifelse([$2], , :, [$2])
+-else
++elif test x$with_zlib != xcross; then
+ ZLIB_CFLAGS=""
+ ZLIB_LIBS=""
+ ZLIB_VERSION=""
+--- src/Makefile.in
++++ src/Makefile.in
+@@ -103,8 +103,10 @@ main: makefile.dep $(Z_OBJS)
+ @ZC@ -o @ZSNESEXE@ $(Z_OBJS) @ZCFLAGS@ @LDFLAGS@
+ rm -f version.o
+
++BUILD_CXX ?= g++
++BUILD_CXXFLAGS ?= -O2 -pipe
+ $(PSR): parsegen.cpp
+- @CXX@ @CXXFLAGS@ -o $@ $< -lz
++ $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $< -lz
+
+ TOOLSEXE=$(TOOL_D)/archopt $(TOOL_D)/cutrtype $(TOOL_D)/extraext\
+ $(TOOL_D)/macroll $(TOOL_D)/minwhite $(TOOL_D)/nreplace\
diff --git a/games-emulation/zsnes/files/zsnes-1.51-depbuild.patch b/games-emulation/zsnes/files/zsnes-1.51-depbuild.patch
new file mode 100644
index 000000000000..2dbb5f558a46
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-depbuild.patch
@@ -0,0 +1,24 @@
+--- src/tools/depbuild.cpp.orig
++++ src/tools/depbuild.cpp
+@@ -130,7 +130,20 @@
+ void dependency_calculate_asm(const char *filename)
+ {
+ string command = nasm + " " + nflags + " -M " + filename;
+- system(command.c_str());
++ FILE *fp = popen(command.c_str(), "r");
++ if (fp)
++ {
++ char line[256];
++ while (fgets(line, sizeof(line), fp)) //Process all lines of output
++ {
++ cout << line;
++ }
++ pclose(fp);
++ }
++ else
++ {
++ cerr << "Failed on: " << filename << "\n";
++ }
+ }
+
+ void dependency_calculate_psr(const char *filename)
diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc43.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc43.patch
new file mode 100644
index 000000000000..4650bc12a7d1
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-gcc43.patch
@@ -0,0 +1,48 @@
+--- src/parsegen.cpp
++++ src/parsegen.cpp
+@@ -31,6 +31,7 @@
+ #include <sstream>
+ #include <set>
+ #include <stack>
++#include <cstring>
+ using namespace std;
+
+ #include <errno.h>
+@@ -1828,7 +1829,7 @@
+ }
+ }
+
+-int main(size_t argc, const char **argv)
++int main(int argc, const char **argv)
+ {
+ const char *cheader_file = 0;
+ bool compile = false;
+--- src/tools/depbuild.cpp
++++ src/tools/depbuild.cpp
+@@ -24,6 +24,7 @@
+ #include <iostream>
+ #include <string>
+ #include <cstdio>
++#include <cstdlib>
+ using namespace std;
+
+ #include "fileutil.h"
+@@ -183,7 +184,7 @@
+ }
+ }
+
+-int main(size_t argc, const char *const *const argv)
++int main(int argc, const char *const *const argv)
+ {
+ if (argc < 5)
+ {
+--- src/tools/strutil.h
++++ src/tools/strutil.h
+@@ -25,6 +25,7 @@
+ #include <string>
+ #include <vector>
+ #include <cctype>
++#include <cstring>
+
+ struct ci_char_traits : public std::char_traits<char>
+ {
diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch
new file mode 100644
index 000000000000..b3250fee679b
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch
@@ -0,0 +1,15 @@
+Fix compile with gcc47
+Bug #419635
+https://bugs.gentoo.org/show_bug.cgi?id=419635
+Submitted by Nikos Chantziaras
+
+--- src/tools/depbuild.cpp
++++ src/tools/depbuild.cpp
+@@ -25,6 +25,7 @@
+ #include <string>
+ #include <cstdio>
+ #include <cstdlib>
++#include <unistd.h>
+ using namespace std;
+
+ #include "fileutil.h"
diff --git a/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch b/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch
new file mode 100644
index 000000000000..1ae0a1467b3e
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch
@@ -0,0 +1,25 @@
+--- a/linux/audio.c.old 2007-01-09 20:19:12.000000000 -0500
++++ b/linux/audio.c 2007-12-30 20:33:07.000000000 -0500
+@@ -177,11 +177,7 @@
+ }
+ else
+ {
+- if (pthread_create(&audio_thread, 0, SoundThread_ao, 0))
+- {
+- puts("pthread_create() failed.");
+- }
+- else if (pthread_mutex_init(&audio_mutex, 0))
++ if (pthread_mutex_init(&audio_mutex, 0))
+ {
+ puts("pthread_mutex_init() failed.");
+ }
+@@ -189,6 +185,10 @@
+ {
+ puts("pthread_cond_init() failed.");
+ }
++ else if (pthread_create(&audio_thread, 0, SoundThread_ao, 0))
++ {
++ puts("pthread_create() failed.");
++ }
+ InitSampleControl();
+ }
diff --git a/games-emulation/zsnes/files/zsnes-1.51-libpng.patch b/games-emulation/zsnes/files/zsnes-1.51-libpng.patch
new file mode 100644
index 000000000000..fd974e799e30
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-libpng.patch
@@ -0,0 +1,33 @@
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -163,21 +163,21 @@
+ libpng_prefix="")
+
+ min_libpng_version=ifelse([$1], ,1.2.0,$1)
+-tempLIBS="$LIBS"
+-tempCFLAGS="$CFLAGS"
+-if test x$libpng_prefix != x ; then
+- LIBPNG_LIBS="-L$libpng_prefix"
+- LIBPNG_CFLAGS="-I$libpng_prefix"
+-fi
+-LIBPNG_LIBS="$LIBPNG_LIBS -lpng -lm"
+-LIBS="$LIBS $LIBPNG_LIBS"
+-CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
+
+ AC_MSG_CHECKING(for libpng - version >= $min_libpng_version)
+
+ dnl <--- disable for no user choice part #2
+ if test x$enable_libpng != xno; then
+ dnl --->
++ tempLIBS="$LIBS"
++ tempCFLAGS="$CFLAGS"
++ if test x$libpng_prefix != x ; then
++ LIBPNG_LIBS="-L$libpng_prefix"
++ LIBPNG_CFLAGS="-I$libpng_prefix"
++ fi
++ LIBPNG_LIBS="$LIBPNG_LIBS -lpng -lm"
++ LIBS="$LIBS $LIBPNG_LIBS"
++ CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
+
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <png.h>
diff --git a/games-emulation/zsnes/files/zsnes-1.51-libpng15.patch b/games-emulation/zsnes/files/zsnes-1.51-libpng15.patch
new file mode 100644
index 000000000000..b32c30967547
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-libpng15.patch
@@ -0,0 +1,12 @@
+Use existing png_set_IHDR() and stop accessing PNG structure members directly
+
+--- src/zip/zpng.c
++++ src/zip/zpng.c
+@@ -129,7 +129,6 @@
+ png_set_IHDR(png_ptr, info_ptr, width, height, 8,
+ PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+
+ //Allocate an array of scanline pointers
+ row_pointers = (png_bytep*)malloc(height*sizeof(png_bytep));
diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch
new file mode 100644
index 000000000000..35613a953596
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch
@@ -0,0 +1,56 @@
+zsnes call C initialization code from assembler.
+
+Example backtrace:
+
+ Thread 1 "zsnes" received signal SIGSEGV, Segmentation fault.
+ => 0xf7550275 <+37>: vmovdqa (%esp),%xmm1
+ ...
+ #13 0x5699ef82 in InitSound () at linux/audio.c:336
+ #14 0x569a25af in initwinvideo () at linux/sdllink.c:1080
+ #15 0x5699fc13 in initvideo () at linux/sdllink.c:1298
+ #16 0x56f9d5bc in regptwa ()
+ #17 0x56a34b50 in SA1tableG ()
+ #18 0x56f84788 in selcB800 ()
+ ...
+
+Call to 'initwinvideo' (first C function) looks like that:
+ NEWSYM InitPreGame ; Executes before starting/continuing a game
+ mov byte[pressed+1],2
+ pushad
+ call Start60HZ
+ %ifdef __OPENGL__
+ call drawscreenwin
+ %endif
+ call initwinvideo
+
+Note: pushad / call does not 16-byte maintain stack alignment
+and breaks i386 ABI.
+
+We apply realignment attribute to all functions noticed by users.
+Bug: https://bugs.gentoo.org/503138
+--- src/linux/sdllink.c.old
++++ src/linux/sdllink.c
+@@ -773,11 +773,11 @@ BOOL InitInput()
+ {
+ InitJoystickInput();
+ return TRUE;
+ }
+
+-int startgame()
++int __attribute__((force_align_arg_pointer)) startgame()
+ {
+ static bool ranonce = false;
+ int status;
+
+ if (!ranonce)
+--- a/linux/sdllink.c
++++ b/linux/sdllink.c
+@@ -897,7 +897,7 @@ bool OGLModeCheck()
+ return(cvidmode > 4);
+ }
+
+-void initwinvideo(void)
++void __attribute__((force_align_arg_pointer)) initwinvideo(void)
+ {
+ DWORD newmode = 0;
+
diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch
new file mode 100644
index 000000000000..5dcbf3ad9ebc
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch
@@ -0,0 +1,15 @@
+--- src/linux/sdllink.c.old
++++ src/linux/sdllink.c
+@@ -773,11 +773,11 @@ BOOL InitInput()
+ {
+ InitJoystickInput();
+ return TRUE;
+ }
+
+-int startgame()
++int __attribute__((force_align_arg_pointer)) startgame()
+ {
+ static bool ranonce = false;
+ int status;
+
+ if (!ranonce)
diff --git a/games-emulation/zsnes/metadata.xml b/games-emulation/zsnes/metadata.xml
new file mode 100644
index 000000000000..8eb5529c51c4
--- /dev/null
+++ b/games-emulation/zsnes/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable the builtin debugger</flag>
+ <flag name="pax_kernel">Triggers a paxmarking of the binary</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">zsnes</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/zsnes/zsnes-1.51-r6.ebuild b/games-emulation/zsnes/zsnes-1.51-r6.ebuild
new file mode 100644
index 000000000000..bf1934226ab9
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-1.51-r6.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools desktop flag-o-matic toolchain-funcs pax-utils
+
+DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
+HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
+SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="ao custom-cflags +debug opengl pax_kernel png"
+
+RDEPEND="
+ media-libs/libsdl[sound,video,abi_x86_32(-)]
+ >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)]
+ ao? ( media-libs/libao[abi_x86_32(-)] )
+ debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] )
+ opengl? ( virtual/opengl[abi_x86_32(-)] )
+ png? ( media-libs/libpng:0=[abi_x86_32(-)] )
+"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ debug? ( virtual/pkgconfig )
+"
+
+S="${WORKDIR}/${PN}_${PV//./_}/src"
+
+src_prepare() {
+ default
+
+ # Fixing compilation without libpng installed
+ # Fix bug #186111
+ # Fix bug #214697
+ # Fix bug #170108
+ # Fix bug #260247
+ # Fix compability with libpng15 wrt #378735
+ # Fix buffer overwrite #257963
+ # Fix gcc47 compile #419635
+ # Fix stack alignment issue #503138
+ eapply \
+ "${FILESDIR}"/${P}-libpng.patch \
+ "${FILESDIR}"/${P}-archopt-july-23-update.patch \
+ "${FILESDIR}"/${P}-gcc43.patch \
+ "${FILESDIR}"/${P}-libao-thread.patch \
+ "${FILESDIR}"/${P}-depbuild.patch \
+ "${FILESDIR}"/${P}-CC-quotes.patch \
+ "${FILESDIR}"/${P}-libpng15.patch \
+ "${FILESDIR}"/${P}-buffer.patch \
+ "${FILESDIR}"/${P}-gcc47.patch \
+ "${FILESDIR}"/${P}-stack-align.patch \
+ "${FILESDIR}"/${P}-cross-compile.patch \
+ "${FILESDIR}"/${P}-arch.patch
+
+ # The sdl detection logic uses AC_PROG_PATH instead of
+ # AC_PROG_TOOL, so force the var to get set the way we
+ # need for things to work correctly.
+ tc-is-cross-compiler && export ac_cv_path_SDL_CONFIG=${CHOST}-sdl-config
+
+ sed -i -e '67i#define OF(x) x' zip/zunzip.h || die
+
+ # Remove hardcoded CFLAGS and LDFLAGS
+ sed -i \
+ -e '/^CFLAGS=.*local/s:-pipe.*:-Wall -I.":' \
+ -e '/^LDFLAGS=.*local/d' \
+ -e '/\w*CFLAGS=.*fomit/s:-O3.*$STRIP::' \
+ -e '/lncurses/s:-lncurses:`pkg-config ncurses --libs`:' \
+ -e '/lcurses/s:-lcurses:`pkg-config ncurses --libs`:' \
+ configure.in || die
+ sed -i \
+ -e 's/configure.in/configure.ac/' \
+ Makefile.in || die
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+ export BUILD_CXX=$(tc-getBUILD_CXX)
+ export NFLAGS=-O1
+ use amd64 && multilib_toolchain_setup x86
+ use custom-cflags || strip-flags
+
+ append-cppflags -U_FORTIFY_SOURCE #257963
+
+ econf \
+ $(use_enable ao libao) \
+ $(use_enable debug debugger) \
+ $(use_enable png libpng) \
+ $(use_enable opengl) \
+ --disable-debug \
+ --disable-cpucheck
+}
+
+src_compile() {
+ emake makefile.dep
+ emake
+}
+
+src_install() {
+ dobin zsnes
+ if use pax_kernel; then
+ pax-mark m "${D}""${GAMES_BINDIR}"/zsnes || die
+ fi
+
+ newman linux/zsnes.1 zsnes.6
+
+ dodoc \
+ ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \
+ ../docs/readme.txt/*
+ HTML_DOCS="../docs/readme.htm/*" einstalldocs
+
+ make_desktop_entry zsnes ZSNES
+ newicon icons/48x48x32.png ${PN}.png
+}
diff --git a/games-emulation/zsnes/zsnes-1.51-r7.ebuild b/games-emulation/zsnes/zsnes-1.51-r7.ebuild
new file mode 100644
index 000000000000..9613a4888e85
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-1.51-r7.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools desktop flag-o-matic toolchain-funcs pax-utils
+
+DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
+HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
+SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="ao custom-cflags +debug opengl pax_kernel png"
+
+RDEPEND="
+ media-libs/libsdl[sound,video,abi_x86_32(-)]
+ >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)]
+ ao? ( media-libs/libao[abi_x86_32(-)] )
+ debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] )
+ opengl? ( virtual/opengl[abi_x86_32(-)] )
+ png? ( media-libs/libpng:0=[abi_x86_32(-)] )
+"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ debug? ( virtual/pkgconfig )
+"
+
+S="${WORKDIR}/${PN}_${PV//./_}/src"
+
+PATCHES=(
+ # Fixing compilation without libpng installed
+ "${FILESDIR}"/${P}-libpng.patch
+
+ # Fix bug #186111
+ # Fix bug #214697
+ # Fix bug #170108
+ # Fix bug #260247
+ "${FILESDIR}"/${P}-archopt-july-23-update.patch
+ "${FILESDIR}"/${P}-gcc43.patch
+ "${FILESDIR}"/${P}-libao-thread.patch
+ "${FILESDIR}"/${P}-depbuild.patch
+ "${FILESDIR}"/${P}-CC-quotes.patch
+
+ # Fix compability with libpng15 wrt #378735
+ "${FILESDIR}"/${P}-libpng15.patch
+
+ # Fix buffer overwrite #257963
+ "${FILESDIR}"/${P}-buffer.patch
+ # Fix gcc47 compile #419635
+ "${FILESDIR}"/${P}-gcc47.patch
+ # Fix stack alignment issue #503138
+ "${FILESDIR}"/${P}-stack-align-v2.patch
+
+ "${FILESDIR}"/${P}-cross-compile.patch
+ "${FILESDIR}"/${P}-arch.patch
+)
+
+src_prepare() {
+ default
+
+ # The sdl detection logic uses AC_PROG_PATH instead of
+ # AC_PROG_TOOL, so force the var to get set the way we
+ # need for things to work correctly.
+ tc-is-cross-compiler && export ac_cv_path_SDL_CONFIG=${CHOST}-sdl-config
+
+ sed -i -e '67i#define OF(x) x' zip/zunzip.h || die
+
+ # Remove hardcoded CFLAGS and LDFLAGS
+ sed -i \
+ -e '/^CFLAGS=.*local/s:-pipe.*:-Wall -I.":' \
+ -e '/^LDFLAGS=.*local/d' \
+ -e '/\w*CFLAGS=.*fomit/s:-O3.*$STRIP::' \
+ -e '/lncurses/s:-lncurses:`pkg-config ncurses --libs`:' \
+ -e '/lcurses/s:-lcurses:`pkg-config ncurses --libs`:' \
+ configure.in || die
+ sed -i \
+ -e 's/configure.in/configure.ac/' \
+ Makefile.in || die
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+ export BUILD_CXX=$(tc-getBUILD_CXX)
+ export NFLAGS=-O1
+ use amd64 && multilib_toolchain_setup x86
+ use custom-cflags || strip-flags
+
+ append-cppflags -U_FORTIFY_SOURCE #257963
+
+ econf \
+ $(use_enable ao libao) \
+ $(use_enable debug debugger) \
+ $(use_enable png libpng) \
+ $(use_enable opengl) \
+ --disable-debug \
+ --disable-cpucheck
+}
+
+src_compile() {
+ emake makefile.dep
+ emake
+}
+
+src_install() {
+ dobin zsnes
+ if use pax_kernel; then
+ pax-mark m "${D}""${GAMES_BINDIR}"/zsnes || die
+ fi
+
+ newman linux/zsnes.1 zsnes.6
+
+ dodoc \
+ ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \
+ ../docs/readme.txt/*
+ HTML_DOCS="../docs/readme.htm/*" einstalldocs
+
+ make_desktop_entry zsnes ZSNES
+ newicon icons/48x48x32.png ${PN}.png
+}