diff options
Diffstat (limited to 'games-emulation/zsnes')
-rw-r--r-- | games-emulation/zsnes/Manifest | 3 | ||||
-rw-r--r-- | games-emulation/zsnes/files/zsnes-2.0.12-initc.patch | 28 | ||||
-rw-r--r-- | games-emulation/zsnes/zsnes-2.0.12.ebuild | 66 |
3 files changed, 97 insertions, 0 deletions
diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest index 0a38e036308d..e9da18fe3e70 100644 --- a/games-emulation/zsnes/Manifest +++ b/games-emulation/zsnes/Manifest @@ -1,5 +1,8 @@ +AUX zsnes-2.0.12-initc.patch 806 BLAKE2B a39d003a40b15a573b0cc32137007d5cc3d3d51634ab33fa12403745e6a7ab96547b03004875276991e29ccfc2a50605f733b692902dbf4847e2a7b2cb23c05e SHA512 95a353eb912b721316fc698357f00bcb8a5017a4cb52da7bef1941361599c861c90b9aebb2ff7340e8ff0831c6e8510511affa464a9f6b2f865b79c66f418d2c AUX zsnes-2.0.9-cc-quotes.patch 375 BLAKE2B 8d9295648dbed975c36494f6d8f8253d40e03b21d41ee41d306439411fb989962ea787c231b00b0f61ddeef459b7cead357b01c49df281380cd8a10b3983fc32 SHA512 554b3634edb5a4d542b359e4a3bd248ecaa3888e273d04d846389716b637bb167e1b8eb19abcaf025051a31a1b459d3fb84a648f413f0654265d1ca30c0e5448 AUX zsnes-2.0.9-gentoo-zlib.patch 310 BLAKE2B de05b0595eb37fad0eebed9b4c667bc4f21c3b1445864c0c9e2142d457ee7adda87ff283ad183698bc60ceb4a40766804da21640ec600a9af5100796405ee9de SHA512 5f7852a818ae55e15f7d81df34be56f756e2c4a7c2c4084a417cdba847ea50a94f04a184c85305005400a285f05966d08e234c16c0ec3c7508e9c6741e84459e DIST zsnes-2.0.10.tar.gz 926347 BLAKE2B b9ab4701290ae802cb35045e0a3d4ff5268f96f7dc84614f39e950a6273a8477d5e2dca0598e3448744486de31caf692d44d36fe284f6f20697a5b4e92c908f8 SHA512 513e350198a944af47accedc6d3c14405898c753bb8168871d323c11f8c1253d8d7e247759a13e40a3b5eda195824e4862bb1fc093a3db9a75c8bb2e0bef728e +DIST zsnes-2.0.12.tar.gz 963569 BLAKE2B c11496cb5f08930dac23598ade337d9ab5d41f484b8f0ad68b1f01832d3d5ef078d65b3d639719b23eaaaf4406248eb47959b582ab7b96b142993ff532c1f3d2 SHA512 f321582a32a334cb32d9276c88c03db7d99c7ccce67a73a777bea6d66f3551a3013d1cfd38fda37867fb2424cde79ca4220894b27615f0f5c5a6de8ffaef037a EBUILD zsnes-2.0.10.ebuild 1826 BLAKE2B a4070075f430d25cf5e03aa6209d4a695cf903d6590dd7544403ae43dca1be5fb88a2df2daf8bb049a55400b21745feadf8d0125f909c986aebc17376b0087e1 SHA512 a590167075d01469287074e85f4daef2cab72bd9445d23764860cdbba72f921ed0329e5af280a2c5751ed393b81b153765e4aef26c7e9446b49960c12a8b605d +EBUILD zsnes-2.0.12.ebuild 1862 BLAKE2B f638a683cebab4bcfe4a1994ed0ce545bfb1ed9189851e334ae6261a9e4c0b6d9dc098eaed55ad2573da3a11dca752fbdef661bdb67860a831dd27cfde66892e SHA512 599eba04dba995b43a0c340334c97104dd0f2c8e8d81a80128e207b32d80f328709ef2ecbfac93e6879934d5b33c1251347e83239c6d3c30f6c882aa6234c524 MISC metadata.xml 382 BLAKE2B 7e932fa492112a2a6b697f1abe12fda2c22992e079211e561fa6c0ea0ae0949503251193975a10848c6ba464e82e3306edb594269bea681e2106872304d26614 SHA512 16503e242acdd3ac96aaffc2df7521f936e5eaebccac4b409ecd4780cf5fb823a3a851df387b0035db749a2cf4d2e05276ffe7075d5f4834b1cf63f39adb8988 diff --git a/games-emulation/zsnes/files/zsnes-2.0.12-initc.patch b/games-emulation/zsnes/files/zsnes-2.0.12-initc.patch new file mode 100644 index 000000000000..d6ce00b93db0 --- /dev/null +++ b/games-emulation/zsnes/files/zsnes-2.0.12-initc.patch @@ -0,0 +1,28 @@ +# https://github.com/xyproto/zsnes/issues/19#issuecomment-1710906677 +# https://github.com/TrashRaccoonSnuffy/zsnes/commit/f77ec1a0 + +Author: Sneed <127693805+TrashRaccoonSnuffy@users.noreply.github.com> +Date: Thu, 7 Sep 2023 21:06:10 -0300 + + Fix a buffer overflow + +--- a/initc.c ++++ b/initc.c +@@ -1364,7 +1364,7 @@ void clearmem(void) + } + + extern uint8_t BRRBuffer[]; +-extern uint8_t echoon0; ++extern uint8_t echoon0[]; + extern uint32_t PHdspsave; + extern uint32_t PHdspsave2; + s4 echobuf[22500]; +@@ -1373,7 +1373,7 @@ extern uint8_t DSPMem[256]; + void clearvidsound() + { + memset(BRRBuffer, 0, PHdspsave); +- memset(&echoon0, 0, PHdspsave2); ++ memset(echoon0, 0, PHdspsave2); + memset(&echobuf, 0, sizeof(echobuf)); + memset(spcBuffera, 0, 65536 * 4 + 4096); + memset(DSPMem, 0, 256); diff --git a/games-emulation/zsnes/zsnes-2.0.12.ebuild b/games-emulation/zsnes/zsnes-2.0.12.ebuild new file mode 100644 index 000000000000..db3d40f511b3 --- /dev/null +++ b/games-emulation/zsnes/zsnes-2.0.12.ebuild @@ -0,0 +1,66 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop flag-o-matic multilib toolchain-funcs xdg + +DESCRIPTION="Fork of the classic Super Nintendo emulator" +HOMEPAGE="https://github.com/xyproto/zsnes/ https://www.zsnes.com/" +SRC_URI="https://github.com/xyproto/zsnes/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="custom-cflags" + +RDEPEND=" + media-libs/libglvnd[X,abi_x86_32(-)] + media-libs/libpng:=[abi_x86_32(-)] + media-libs/libsdl[abi_x86_32(-),joystick,opengl,sound,video] + sys-libs/zlib:=[abi_x86_32(-)] + x11-libs/libX11[abi_x86_32(-)]" +DEPEND=" + ${RDEPEND} + x11-base/xorg-proto" +BDEPEND=" + dev-lang/nasm + sys-libs/zlib + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.9-cc-quotes.patch + "${FILESDIR}"/${PN}-2.0.9-gentoo-zlib.patch + "${FILESDIR}"/${P}-initc.patch +) + +src_compile() { + # Makefile forces many CFLAGS that are questionable, but zsnes' ancient x86 + # asm is fragile, not pic safe (bug #427104), broken by F_S=3 (formerly + # broken with =2 as well), and can be affected by -march=* and similar. + # Stick to upstream's choices, this is non-portable either way. + if use !custom-cflags; then + strip-flags + append-cppflags -U_FORTIFY_SOURCE # to disable =3, Makefile enables =2 + fi + + # used to build and run parsegen at build time (uses zlib wrt BDEPEND) + tc-export_build_env BUILD_CXX + local buildcxx="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS}" + + use amd64 && multilib_toolchain_setup x86 + tc-export CC CXX + append-cflags "${CPPFLAGS}" + append-cxxflags "${CPPFLAGS}" + + emake CXX_HOST="${buildcxx}" +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install + + dodoc README.md TODO.md + + newicon icons/64x64x32.png ${PN}.png + make_desktop_entry ${PN} ${PN^^} +} |