diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /games-emulation/mgba | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'games-emulation/mgba')
-rw-r--r-- | games-emulation/mgba/Manifest | 2 | ||||
-rw-r--r-- | games-emulation/mgba/files/mgba-0.9.3-ffmpeg5.patch | 117 | ||||
-rw-r--r-- | games-emulation/mgba/mgba-0.9.3-r1.ebuild | 132 |
3 files changed, 251 insertions, 0 deletions
diff --git a/games-emulation/mgba/Manifest b/games-emulation/mgba/Manifest index 822691e9bd92..2ab4b7fa5b8e 100644 --- a/games-emulation/mgba/Manifest +++ b/games-emulation/mgba/Manifest @@ -1,6 +1,8 @@ +AUX mgba-0.9.3-ffmpeg5.patch 4952 BLAKE2B a6f03faafb0316516aba79bb5c6e7c474124ea4259c34456bc28cb4aa86543da7ddfed363256160294293f4882e3116076400c042caf7e1f31811739f8fd86dd SHA512 5badf11d8d24ed2cb13c45e7ff9d56159c63b2557076fe92ade4d0b7051bfcd0f8b9fc3c8bf95faf5612789c9aa6609fc8e0c11b6e9a00816f2a17b72a3c183c DIST mgba-0.9.2.tar.gz 12761919 BLAKE2B f0f3ca5f47d38c8018541426a229d52a2ebc9e47dc07fe4b739bde3f7ef2a4d75e6db5ca5f8dfaee01ae9648035f24c9d02556078b0b5eb51aefecfc9305432d SHA512 ea9868c104996c44a2fcfdf9d3f4d6177b853dec478ab7a2dd19a0f127b597a887150200bfbf14de593328217ff5493ca675bfcb4f0b2ee6a5097e0cdf0e2997 DIST mgba-0.9.3.tar.gz 12763090 BLAKE2B 7d9ff6fc7bdff5d734540b74893a888d400b4bb6e1ce5b3b2a856239db8798ac76b8535dc770330d0451e2568a6d402558eeef27d643c0d5d3454441f45cf09b SHA512 da65b3c7ec32d732163f129c4fd38949ae2da2980beb3257bf6def5e35534a27b6d30309bb3c9a8d651642f99e1a45db7a8577c8dbf5472153d4551167471b3a EBUILD mgba-0.9.2.ebuild 2659 BLAKE2B f5f2ab5f770ff8ba4ec4667ce7a40d262692cf2a52e2644591735ecd1f780478d4b3184d3ec453321950c7cd57a8817b1f8916c697d6f1382f9fd39da53d2d37 SHA512 92c02e4d249228bd4e3e5a3142877cdda4999e20db8b65f458af275f867d6f1e8d58af50f6f2b35d2bf2ebdce4f750d62704bdeffd5d8980ba64806d21f14112 +EBUILD mgba-0.9.3-r1.ebuild 2716 BLAKE2B 011b8c8779a085630be9c1b93be4318225de01e64e69799398917dc35a41a054fccbb67937eb76e4d43af5efd1a1b27545e7a410cd66b5f8af5749c88030258c SHA512 c005cd6346a2530aae1691608a436912e29ab4c5413662ae1d09a12f4e5fb76f225221e61385bf6226c51a88814294e0d5d2288ee57f6fafa8ce3384569ce2e1 EBUILD mgba-0.9.3.ebuild 2661 BLAKE2B 84e11e71873217013a106be1744dbf990d0e15167458457a1e6c86bf958ef752e02dae28b49f22faeff9971126683416a634b5f41ea894b9bf2d04a13bf9319c SHA512 904b060cd5198257b22b88593c20d4aa156f38ae88e15a78f5467dac34ec961c27fe0be579d35d8c0f180f9fda1cefd81ac5031d71664634216f5f50ff72d988 EBUILD mgba-9999.ebuild 2661 BLAKE2B 84e11e71873217013a106be1744dbf990d0e15167458457a1e6c86bf958ef752e02dae28b49f22faeff9971126683416a634b5f41ea894b9bf2d04a13bf9319c SHA512 904b060cd5198257b22b88593c20d4aa156f38ae88e15a78f5467dac34ec961c27fe0be579d35d8c0f180f9fda1cefd81ac5031d71664634216f5f50ff72d988 MISC metadata.xml 631 BLAKE2B f54017bc3de8d00be3405495cf08f4d9f9ba9bc723a205c783a3e71c239835ee68044cb88d22df6d6f33174e2b4a20c350363145df6c0e9f54ca9585ef3eee9d SHA512 c71bc82f75a7a68e59c46eaadcf173a9b8274167e2f3a3f69dd5cdc0e9822c93c442f75e6817168cfc1470c411bec0fcb5f9695913816326b719a81f915f75b8 diff --git a/games-emulation/mgba/files/mgba-0.9.3-ffmpeg5.patch b/games-emulation/mgba/files/mgba-0.9.3-ffmpeg5.patch new file mode 100644 index 000000000000..cf4f6f56a2d4 --- /dev/null +++ b/games-emulation/mgba/files/mgba-0.9.3-ffmpeg5.patch @@ -0,0 +1,117 @@ +From cdc753516798882a805db1d2042dbce8313382bf Mon Sep 17 00:00:00 2001 +From: Ryan Tandy <ryan@nardis.ca> +Date: Thu, 3 Feb 2022 19:02:52 -0800 +Subject: [PATCH] FFmpeg: Support FFmpeg 5.0 + +--- + src/feature/ffmpeg/ffmpeg-decoder.c | 3 ++- + src/feature/ffmpeg/ffmpeg-encoder.c | 25 ++++++++++++++----------- + 2 files changed, 16 insertions(+), 12 deletions(-) + +diff --git a/src/feature/ffmpeg/ffmpeg-decoder.c b/src/feature/ffmpeg/ffmpeg-decoder.c +index c3bb6d1c5c..daa47fbf2c 100644 +--- a/src/feature/ffmpeg/ffmpeg-decoder.c ++++ b/src/feature/ffmpeg/ffmpeg-decoder.c +@@ -5,6 +5,7 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + #include "ffmpeg-decoder.h" + ++#include <libavcodec/avcodec.h> + #include <libswscale/swscale.h> + + void FFmpegDecoderInit(struct FFmpegDecoder* decoder) { +@@ -38,7 +39,7 @@ bool FFmpegDecoderOpen(struct FFmpegDecoder* decoder, const char* infile) { + #else + enum AVMediaType type = decoder->context->streams[i]->codec->codec_type; + #endif +- struct AVCodec* codec; ++ const struct AVCodec* codec; + struct AVCodecContext* context = NULL; + if (type == AVMEDIA_TYPE_VIDEO && decoder->videoStream < 0) { + decoder->video = avcodec_alloc_context3(NULL); +diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c +index ad76ca57b2..be6bd3af5e 100644 +--- a/src/feature/ffmpeg/ffmpeg-encoder.c ++++ b/src/feature/ffmpeg/ffmpeg-encoder.c +@@ -12,6 +12,9 @@ + + #include <libavcodec/version.h> + #include <libavcodec/avcodec.h> ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++#include <libavcodec/bsf.h> ++#endif + + #include <libavfilter/buffersink.h> + #include <libavfilter/buffersrc.h> +@@ -121,7 +124,7 @@ bool FFmpegEncoderSetAudio(struct FFmpegEncoder* encoder, const char* acodec, un + return true; + } + +- AVCodec* codec = avcodec_find_encoder_by_name(acodec); ++ const AVCodec* codec = avcodec_find_encoder_by_name(acodec); + if (!codec) { + return false; + } +@@ -193,7 +196,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in + return true; + } + +- AVCodec* codec = avcodec_find_encoder_by_name(vcodec); ++ const AVCodec* codec = avcodec_find_encoder_by_name(vcodec); + if (!codec) { + return false; + } +@@ -213,7 +216,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in + if (encoder->pixFormat == AV_PIX_FMT_NONE) { + return false; + } +- if (vbr < 0 && !av_opt_find(&codec->priv_class, "crf", NULL, 0, 0)) { ++ if (vbr < 0 && !av_opt_find((void*) &codec->priv_class, "crf", NULL, 0, 0)) { + return false; + } + encoder->videoCodec = vcodec; +@@ -223,7 +226,7 @@ bool FFmpegEncoderSetVideo(struct FFmpegEncoder* encoder, const char* vcodec, in + } + + bool FFmpegEncoderSetContainer(struct FFmpegEncoder* encoder, const char* container) { +- AVOutputFormat* oformat = av_guess_format(container, 0, 0); ++ const AVOutputFormat* oformat = av_guess_format(container, 0, 0); + if (!oformat) { + return false; + } +@@ -241,9 +244,9 @@ void FFmpegEncoderSetLooping(struct FFmpegEncoder* encoder, bool loop) { + } + + bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) { +- AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0); +- AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec); +- AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec); ++ const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0); ++ const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec); ++ const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec); + if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !oformat || (!acodec && !vcodec)) { + return false; + } +@@ -257,8 +260,8 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder* encoder) { + } + + bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) { +- AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec); +- AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec); ++ const AVCodec* acodec = avcodec_find_encoder_by_name(encoder->audioCodec); ++ const AVCodec* vcodec = avcodec_find_encoder_by_name(encoder->videoCodec); + if ((encoder->audioCodec && !acodec) || (encoder->videoCodec && !vcodec) || !FFmpegEncoderVerifyContainer(encoder)) { + return false; + } +@@ -272,9 +275,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) { + encoder->currentVideoFrame = 0; + encoder->skipResidue = 0; + +- AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0); ++ const AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0); + #ifndef USE_LIBAV +- avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile); ++ avformat_alloc_output_context2(&encoder->context, (AVOutputFormat*) oformat, 0, outfile); + #else + encoder->context = avformat_alloc_context(); + strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1); diff --git a/games-emulation/mgba/mgba-0.9.3-r1.ebuild b/games-emulation/mgba/mgba-0.9.3-r1.ebuild new file mode 100644 index 000000000000..f2e1ddb6dd3b --- /dev/null +++ b/games-emulation/mgba/mgba-0.9.3-r1.ebuild @@ -0,0 +1,132 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake desktop xdg + +DESCRIPTION="Game Boy Advance emulator written in C" +HOMEPAGE="https://mgba.io" +if [[ "${PV}" == 9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/mgba-emu/mgba.git" +else + MY_PV="${PV/_beta/-b}" + SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" + [[ "${PV}" == *_beta* ]] || \ + KEYWORDS="~amd64 ~arm64 ~x86" + S="${WORKDIR}/${PN}-${MY_PV}" +fi +LICENSE="MPL-2.0" +SLOT="0" +IUSE="debug discord elf ffmpeg gles2 gles3 opengl qt5 +sdl sqlite" +REQUIRED_USE="|| ( qt5 sdl ) + qt5? ( opengl )" + +RDEPEND=" + media-libs/libpng:0= + sys-libs/zlib[minizip] + debug? ( dev-libs/libedit ) + elf? ( dev-libs/elfutils ) + ffmpeg? ( media-video/ffmpeg:= ) + opengl? ( media-libs/libglvnd ) + 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?] ) + sqlite? ( dev-db/sqlite:3 ) +" +DEPEND="${RDEPEND} + gles2? ( media-libs/libglvnd ) + gles3? ( media-libs/libglvnd ) +" + +PATCHES=( + "${FILESDIR}/${P}-ffmpeg5.patch" #834374 +) + +src_prepare() { + xdg_environment_reset + cmake_src_prepare + + # Get rid of any bundled stuff we don't want + local pkg + 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_GLES2="$(usex gles2)" + -DBUILD_GLES3="$(usex gles3)" + -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_DISCORD_RPC="$(usex discord)" + -DUSE_EDITLINE="$(usex debug)" + -DUSE_ELF="$(usex elf)" + -DUSE_EPOXY=OFF + -DUSE_FFMPEG="$(usex ffmpeg)" + -DUSE_GDB_STUB="$(usex debug)" + -DUSE_LIBZIP=OFF + -DUSE_LZMA=OFF + -DUSE_MINIZIP=ON + -DUSE_PNG=ON + -DUSE_SQLITE3="$(usex sqlite)" + -DUSE_ZLIB=ON + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile +} + +src_install() { + if use qt5 ; then + dobin ${BUILD_DIR}/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 ${BUILD_DIR}/sdl/${PN} ${PN}-sdl + fi + + dolib.so ${BUILD_DIR}/lib${PN}.so* +} + +pkg_preinst() { + if use qt5 ; then + xdg_pkg_preinst + fi +} + +pkg_postinst() { + if use qt5 ; then + xdg_pkg_postinst + fi +} + +pkg_postrm() { + if use qt5 ; then + xdg_pkg_postrm + fi +} |