diff options
author | Pacho Ramos <pacho@gentoo.org> | 2018-08-09 13:26:42 +0200 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2018-08-09 13:26:42 +0200 |
commit | 8c87dd5ae9375deedbd89afc256c69746e4b4dc7 (patch) | |
tree | 837e09f5b4485e5011add7c193f16fb0fa2e351e | |
parent | games-action/abuse: Prevent segfault at start (diff) | |
download | gentoo-8c87dd5ae9375deedbd89afc256c69746e4b4dc7.tar.gz gentoo-8c87dd5ae9375deedbd89afc256c69746e4b4dc7.tar.bz2 gentoo-8c87dd5ae9375deedbd89afc256c69746e4b4dc7.zip |
games-arcade/methane: Drop games.eclass, apply Fedora fixes.
Package-Manager: Portage-2.3.43, Repoman-2.3.10
4 files changed, 183 insertions, 6 deletions
diff --git a/games-arcade/methane/files/methane-1.5.1-fullscreen.patch b/games-arcade/methane/files/methane-1.5.1-fullscreen.patch new file mode 100644 index 000000000000..8a12a6bc4891 --- /dev/null +++ b/games-arcade/methane/files/methane-1.5.1-fullscreen.patch @@ -0,0 +1,96 @@ +--- methane-1.5.1/sources/methane.cpp 2011-12-11 13:52:54.904083515 +0100 ++++ methane-1.5.1.new/sources/methane.cpp 2011-12-11 13:51:27.174080706 +0100 +@@ -37,6 +37,7 @@ + + RenderTarget GLOBAL_RenderTarget = opengl2; + bool GLOBAL_SoundEnable = true; ++bool GLOBAL_FullScreenEnable = true; + + //------------------------------------------------------------------------------ + // Keyboard stuff +@@ -60,6 +61,20 @@ + + int main(const std::vector<CL_String> &args) + { ++ unsigned int i; ++ ++ for (i = 1; i < args.size(); i++) ++ { ++ if (args[i].compare("-w") == 0) ++ GLOBAL_FullScreenEnable = false; ++ else ++ fprintf(stderr, ++ "Unknown commandline parameter: '%s', ignoring\n\n" ++ "Valid parameters:\n" ++ "'-w': start in windowed mode\n", ++ args[i].c_str()); ++ } ++ + try + { + CL_SetupGL target_opengl2; +@@ -105,8 +120,15 @@ + CL_DisplayWindowDescription desc; + desc.set_title("Super Methane Brothers"); + desc.set_size(CL_Size(SCR_WIDTH*2,SCR_HEIGHT*2), true); +- desc.set_allow_resize(true); ++ if (GLOBAL_FullScreenEnable) ++ { ++ desc.set_fullscreen(true); ++ } ++ else ++ desc.set_allow_resize(true); + CL_DisplayWindow window(desc); ++ if (GLOBAL_FullScreenEnable) ++ window.hide_cursor(); + + CMethDoc Game(window); + +@@ -131,8 +154,6 @@ + int last_time = CL_System::get_time(); + + int quit_flag = 0; +- int disable_scale_flag = 0; +- int full_screen_flag = 0; + int on_options_screen = 1; + int option_page = 0; + int game_speed = 60; +@@ -281,7 +302,8 @@ + + bool get_options() + { +- CL_DisplayWindow window("Methane Options", 640, 480); ++ CL_DisplayWindow window("Methane Options", 640, 480, ++ GLOBAL_FullScreenEnable); + + // Connect the Window close event + CL_Slot slot_quit = window.sig_window_close().connect(this, &SuperMethaneBrothers::on_window_close); +@@ -320,6 +342,12 @@ + GLOBAL_RenderTarget = swrender; + } + ++ if ( (LastKey == 'f') || (LastKey == 'F') ) ++ { ++ LastKey = 0; ++ GLOBAL_FullScreenEnable = !GLOBAL_FullScreenEnable; ++ } ++ + gc.clear(CL_Colorf(0.0f,0.0f,0.2f)); + + int ypos = 40; +@@ -360,6 +388,15 @@ + { + options_font.draw_text(gc, 10, ypos, "Audio - Disabled. Press 'A' to toggle"); + } ++ ypos += 50; ++ if (GLOBAL_FullScreenEnable) ++ { ++ options_font.draw_text(gc, 10, ypos, "Full screen - Enabled. Press 'F' to modify"); ++ } ++ else ++ { ++ options_font.draw_text(gc, 10, ypos, "Full screen - Disabled. Press 'F' to modify"); ++ } + + ypos += 100; + options_font.draw_text(gc, 10, ypos, "Press the spacebar to start"); diff --git a/games-arcade/methane/files/methane-1.5.1-gcc5.patch b/games-arcade/methane/files/methane-1.5.1-gcc5.patch new file mode 100644 index 000000000000..51a69041429b --- /dev/null +++ b/games-arcade/methane/files/methane-1.5.1-gcc5.patch @@ -0,0 +1,34 @@ +diff -up methane-1.5.1/sources/misc.cpp~ methane-1.5.1/sources/misc.cpp +--- methane-1.5.1/sources/misc.cpp~ 2009-04-28 16:42:43.000000000 +0200 ++++ methane-1.5.1/sources/misc.cpp 2015-06-19 13:40:13.695215411 +0200 +@@ -40,15 +40,15 @@ static PARTYOFFS party_08 = {SPR_ENDSPR_ + static PARTYOFFS party_09 = {SPR_ENDSPR_1+0x09,0x0048,0x0002}; + static PARTYOFFS party_0a = {SPR_ENDSPR_1+0x0a,0x0058,0x0002}; + static PARTYOFFS party_0b = {SPR_ENDSPR_1+0x0b,0x0000,0x0000}; +-static PARTYOFFS party_0c = {SPR_ENDSPR_1+0x0c,0x0020,0xFFFFFFD0}; ++static PARTYOFFS party_0c = {SPR_ENDSPR_1+0x0c,0x0020,(int)0xFFFFFFD0}; + static PARTYOFFS party_0d = {SPR_ENDSPR_1+0x0d,0x0040,0x0000}; + static PARTYOFFS party_0e = {SPR_ENDSPR_1+0x0e,0x0000,0x0000}; +-static PARTYOFFS party_0f = {SPR_ENDSPR_1+0x0f,0x005E,0xFFFFFFF2}; +-static PARTYOFFS party_10 = {SPR_ENDSPR_1+0x10,0x007E,0xFFFFFFFA}; +-static PARTYOFFS party_11 = {SPR_ENDSPR_1+0x11,0x008E,0xFFFFFFF9}; ++static PARTYOFFS party_0f = {SPR_ENDSPR_1+0x0f,0x005E,(int)0xFFFFFFF2}; ++static PARTYOFFS party_10 = {SPR_ENDSPR_1+0x10,0x007E,(int)0xFFFFFFFA}; ++static PARTYOFFS party_11 = {SPR_ENDSPR_1+0x11,0x008E,(int)0xFFFFFFF9}; + static PARTYOFFS party_12 = {SPR_ENDSPR_1+0x12,0x0092,0x000B}; +-static PARTYOFFS party_13 = {SPR_ENDSPR_1+0x13,0x00B2,0xFFFFFFFB}; +-static PARTYOFFS party_14 = {SPR_ENDSPR_1+0x14,0x00C2,0xFFFFFFFA}; ++static PARTYOFFS party_13 = {SPR_ENDSPR_1+0x13,0x00B2,(int)0xFFFFFFFB}; ++static PARTYOFFS party_14 = {SPR_ENDSPR_1+0x14,0x00C2,(int)0xFFFFFFFA}; + static PARTYOFFS party_15 = {SPR_ENDSPR_1+0x15,0x0000,0x0000}; + static PARTYOFFS party_16 = {SPR_ENDSPR_1+0x16,0x0020,0x0008}; + static PARTYOFFS party_17 = {SPR_ENDSPR_1+0x17,0x0020,0x0000}; +@@ -57,7 +57,7 @@ static PARTYOFFS party_19 = {SPR_ENDSPR_ + static PARTYOFFS party_1a = {SPR_ENDSPR_1+0x1a,0x0020,0x0000}; + static PARTYOFFS party_1b = {SPR_ENDSPR_1+0x1b,0x0000,0x0010}; + static PARTYOFFS party_1c = {SPR_ENDSPR_1+0x1c,0x0010,0x0}; +-static PARTYOFFS party_1d = {SPR_ENDSPR_1+0x1d,0x0030,0xFFFFFFF0}; ++static PARTYOFFS party_1d = {SPR_ENDSPR_1+0x1d,0x0030,(int)0xFFFFFFF0}; + + static PARTYOFFS *party_group1[] = { + &party_00,&party_01,&party_02,&party_00,&party_03,&party_04,0}; diff --git a/games-arcade/methane/files/methane-1.5.1-gentoo.patch b/games-arcade/methane/files/methane-1.5.1-gentoo.patch index 9e49ecdff25c..6d72a2ca7ed5 100644 --- a/games-arcade/methane/files/methane-1.5.1-gentoo.patch +++ b/games-arcade/methane/files/methane-1.5.1-gentoo.patch @@ -1,5 +1,5 @@ ---- Makefile.old 2012-11-26 18:58:48.201837870 +0100 -+++ Makefile 2012-11-27 12:30:16.038998128 +0100 +--- a/Makefile.old 2012-11-26 18:58:48.201837870 +0100 ++++ b/Makefile 2012-11-27 12:30:16.038998128 +0100 @@ -1,5 +1,5 @@ -METHANE_FLAGS = -DENABLE_SOUND `pkg-config --cflags clanCore-2.2 clanDisplay-2.2 clanApp-2.2 clanGL-2.2 clanGL1-2.2 clanSWRender-2.2 clanSound-2.2 clanMikMod-2.2` -METHANE_LIBS = `pkg-config --libs clanCore-2.2 clanDisplay-2.2 clanApp-2.2 clanGL-2.2 clanGL1-2.2 clanSWRender-2.2 clanSound-2.2 clanMikMod-2.2` @@ -25,8 +25,8 @@ + $(CXX) ${CXXFLAGS} ${METHANE_FLAGS} -c $< -o $@ ---- sources/methane.cpp.old 2012-11-27 13:49:22.993003266 +0100 -+++ sources/methane.cpp 2012-11-27 17:37:23.051913777 +0100 +--- a/sources/methane.cpp.old 2012-11-27 13:49:22.993003266 +0100 ++++ b/sources/methane.cpp 2012-11-27 17:37:23.051913777 +0100 @@ -80,15 +80,15 @@ return 0; } @@ -49,8 +49,8 @@ } // Set the video mode ---- sources/target.cpp.old 2012-11-28 21:34:32.666878913 +0100 -+++ sources/target.cpp 2012-11-28 21:35:16.371247221 +0100 +--- a/sources/target.cpp.old 2012-11-28 21:34:32.666878913 +0100 ++++ b/sources/target.cpp 2012-11-28 21:35:16.371247221 +0100 @@ -132,7 +132,7 @@ CL_GraphicContext gc = m_pWindow->get_gc(); diff --git a/games-arcade/methane/methane-1.5.1-r1.ebuild b/games-arcade/methane/methane-1.5.1-r1.ebuild new file mode 100644 index 000000000000..acf9163b76e7 --- /dev/null +++ b/games-arcade/methane/methane-1.5.1-r1.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +#inherit eutils flag-o-matic games +inherit desktop + +DESCRIPTION="Port from an old amiga game" +HOMEPAGE="http://methane.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tgz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="dev-games/clanlib:2.3[opengl,mikmod]" +DEPEND="${RDEPEND} + virtual/pkgconfig +" + +src_prepare() { + default + + eapply "${FILESDIR}"/${P}-gentoo.patch + + # From Fedora + eapply "${FILESDIR}"/${P}-gcc5.patch + eapply "${FILESDIR}"/${P}-fullscreen.patch + + sed -i \ + -e "s:@GENTOO_DATADIR@:/usr/share:" \ + sources/target.cpp || die + + # fix weird parallel make issue wrt #450422 + mkdir build || die + #append-cxxflags -Wno-narrowing # build with gcc5 (bug #573788) +} + +src_install() { + dobin methane + insinto /usr/share/${PN} + doins resources/* + newicon docs/puff.gif ${PN}.gif + make_desktop_entry ${PN} "Super Methane Brothers" /usr/share/pixmaps/${PN}.gif + HTML_DOCS="docs/*" dodoc authors.txt history.txt readme.txt +} |