diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-11-18 03:03:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-11-18 03:03:03 +0000 |
commit | f9f6fa91738181ebe9aca71b75d157d8b5df5335 (patch) | |
tree | 556cf671790196d83709b89133064a855f1879f2 /games-simulation/pmars-sdl | |
parent | 3455c0a5153ae27d7c6c16ecd35fa3dec33f3dda (diff) |
gentoo auto-resync : 18:11:2024 - 03:03:03
Diffstat (limited to 'games-simulation/pmars-sdl')
4 files changed, 163 insertions, 0 deletions
diff --git a/games-simulation/pmars-sdl/Manifest b/games-simulation/pmars-sdl/Manifest index cd268197db8f..c13d5d3d897e 100644 --- a/games-simulation/pmars-sdl/Manifest +++ b/games-simulation/pmars-sdl/Manifest @@ -1,4 +1,7 @@ +AUX pmars-sdl-0.9.2e-c23.patch 370 BLAKE2B f75248b0694a48c5bcd70295d9ad5449759a46c9364d7dace6aeeced654e0fdf01f859e0c33b9cf6e83d6735a810e8c154c1ab8f4f0934a9a9e1e6506e5f835b SHA512 31a98199d48e3e68ecacd48b54598bb00afc81cca0844f0505f6c3aae6aa4d00b4a609fc18d59a5522e1bd8f3e646b07a5229492507270b6b58dcadc878efdcb AUX pmars-sdl-0.9.2e-format.patch 1988 BLAKE2B 57e96f71c6dfb6cea7286421acaa2a576ca26d9e5068a0c840b2d00dabd3ea87b2b482fe28253ef0d1b6c667bb13a2b9b8ad53f59cbb54a98f7d4da6ab1f66bf SHA512 1736220e86c762392e7074674d506fe161308a09c682a7c3cccfa7e58be880f6d44738854eae2c2c6dfc22d819c04c8fb5e9a5db632d00c35de09f4b44347014 +AUX pmars-sdl-0.9.2e-ncurses-opaque.patch 1618 BLAKE2B e26f38caf365597db845fee0be4a3b439343161e810abba4f4440475a46961bf5105ecac301259e79bb40a9514be8015ac4de1f5b05147aa27f6992bf28dad54 SHA512 b730dbab10480fe904b86906a2d00455c005c6056af6c9d2e53dca3e8ef6675e9b03b45a9643ebb671fe7cf6305bc2a442761b22e10feb9bf62e1ea511485ee5 DIST pmars-0.9.2-5.tar.gz 200966 BLAKE2B 398323191290a9e3d57cb371c2070585cf78f845ca4cbadfa09f03045abc80f7b3fb71a58c18bbfdf503a3239d25bd0734b10e784d6570766e6b5c0ec606aadf SHA512 197d1967507199ed5eb075fb232a2f15d9bdf4bec03fc6b1d6df5d6259d6627eb40338c5787852ea10d96858029144348128b08e86c7079d96f10fd09dafc315 EBUILD pmars-sdl-0.9.2e-r1.ebuild 1954 BLAKE2B 26a0987844eec75b756079acd705da8971fae09c74ba13d729f9149be6f3ebf0a74c2fff52bd3d077705cb8fce126b004ea76f44aa605f8679be38d2604c729f SHA512 d1e2c3e2b97a6713d6624b6589204fd82901373e88a70796e9181378ddb8d1eaa6a8fd6735351f324177a6e6537d3cb36221159513dcf00b02eba50e1487564b +EBUILD pmars-sdl-0.9.2e-r2.ebuild 2025 BLAKE2B fabd239d43ae23cbbce51f29f39e79feb46c80a4c9c223305c7bc4fa820698a115b5e152c819520ddd277c1990073c80b866f7bfd22181bbc07dd23b376f7b04 SHA512 3632652670195362656794b8288ea5585eee160a302618f68c94963af509feb4b0ba7c420cc5533f75d7d479b14d379342235321b0f9e2011a32787b63c3d378 MISC metadata.xml 250 BLAKE2B 8d44bd4c6e7d6491273e2015e36ddac74af7b94a124fd240ff030e16430f5c85e53ab812f0e3e94bb2e6d138f39b512bbe01ff98b0081cacc21a02d648ec7643 SHA512 80ac07a3cac10ad2e72e9989a130b7d2073934fe92914a9db2af4d0e769d4bf537770f8faba0654bbd64a7e85ee38cf1f9d03b4b9cd322864b1b2bb35087d610 diff --git a/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-c23.patch b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-c23.patch new file mode 100644 index 000000000000..b9a61a24a452 --- /dev/null +++ b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-c23.patch @@ -0,0 +1,11 @@ +sort_by_score appeared twice. +--- a/src/global.h ++++ b/src/global.h +@@ -411,7 +411,6 @@ extern int score(int warnum); + extern void sort_by_score(int *idxV, int *scrV); + extern int deaths(int warnum); + extern void results(FILE * outp); +-extern void sort_by_score(); + extern void Exit(int code); + extern void reset_regs(void); + extern void set_reg(char regChr, long val); diff --git a/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-ncurses-opaque.patch b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-ncurses-opaque.patch new file mode 100644 index 000000000000..543ece1d6ce5 --- /dev/null +++ b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-ncurses-opaque.patch @@ -0,0 +1,45 @@ +https://bugs.gentoo.org/932139 +https://github.com/mbarbon/pMARS/commit/a39970c724591c3c8625819cab7ca298ae71e12d +--- a/src/curdisp.c ++++ b/src/curdisp.c +@@ -428,18 +428,18 @@ agets5(str, maxchar, attr) + str--; + maxchar++; + leaveok(curwin, TRUE); +- if (ox = curwin->_curx) { ++ if (ox = getcurx(curwin)) { + #if 0 + #ifdef ATTRIBUTE +- mvwaddch(curwin, curwin->_cury, --ox, ' ' | attr); ++ mvwaddch(curwin, getcury(curwin), --ox, ' ' | attr); + #else +- mvwaddch(curwin, curwin->_cury, --ox, ' '); ++ mvwaddch(curwin, getcury(curwin), --ox, ' '); + #endif + #endif /* 0 */ +- mvwaddch(curwin, curwin->_cury, --ox, ' '); +- wmove(curwin, curwin->_cury, ox); ++ mvwaddch(curwin, getcury(curwin), --ox, ' '); ++ wmove(curwin, getcury(curwin), ox); + } else { +- oy = curwin->_cury - 1; ++ oy = getcury(curwin) - 1; + #if 0 + #ifdef ATTRIBUTE + mvwaddch(curwin, oy, COLS - 1, ' ' | attr); +@@ -470,12 +470,12 @@ agets5(str, maxchar, attr) + if (ox--) + #if 0 + #ifdef ATTRIBUTE +- mvwaddch(curwin, curwin->_cury, ox, ' ' | attr); ++ mvwaddch(curwin, getcury(curwin), ox, ' ' | attr); + #else +- mvwaddch(curwin, curwin->_cury, ox, ' '); ++ mvwaddch(curwin, getcury(curwin), ox, ' '); + #endif + #endif /* 0 */ +- mvwaddch(curwin, curwin->_cury, ox, ' '); ++ mvwaddch(curwin, getcury(curwin), ox, ' '); + else + #if 0 + #ifdef ATTRIBUTE diff --git a/games-simulation/pmars-sdl/pmars-sdl-0.9.2e-r2.ebuild b/games-simulation/pmars-sdl/pmars-sdl-0.9.2e-r2.ebuild new file mode 100644 index 000000000000..ee9eb60c147c --- /dev/null +++ b/games-simulation/pmars-sdl/pmars-sdl-0.9.2e-r2.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs readme.gentoo-r1 + +MY_PN="${PN/-sdl/}" +MY_PV="${PV/e/-5}" +MY_P="${MY_PN}-${MY_PV}" + +DESCRIPTION="Portable redcode simulator's sdl port for core war" +HOMEPAGE="https://corewar.co.uk/pihlaja/pmars-sdl/" +SRC_URI="https://corewar.co.uk/pihlaja/pmars-sdl/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="sdl X" + +RDEPEND=" + sdl? ( x11-libs/libX11 media-libs/libsdl[video] ) + X? ( x11-libs/libX11 ) + !sdl? ( !X? ( sys-libs/ncurses:0= ) ) +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${P}-format.patch + "${FILESDIR}"/${P}-ncurses-opaque.patch + "${FILESDIR}"/${P}-c23.patch +) + +DOC_CONTENTS=" + There are some macros in /usr/share/pmars/macros + which you should make accessible to pmars by typing + export PMARSHOME=/usr/share/pmars/macros\n +" + +src_compile() { + local LIB="" + export LFLAGS="-x" + + append-cppflags -DEXT94 -DPERMUTATE + + if use sdl ; then + append-cflags $(sdl-config --cflags) + append-cppflags -DSDLGRAPHX + + LIB="$(sdl-config --libs)" + elif use X ; then + append-cppflags -DXWINGRAPHX + + LIB="$($(tc-getPKG_CONFIG) --libs x11)" + else + append-cppflags -DCURSESGRAPHX + + LIB="$($(tc-getPKG_CONFIG) --libs ncurses)" + fi + + cd src || die + + local programs=( + asm.c + cdb.c + clparse.c + disasm.c + eval.c + global.c + pmars.c + sim.c + pos.c + str_eng.c + token.c + ) + + for program in "${programs[@]}" ; do + einfo "Compiling ${program}" + $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${program} -c || die + done + + einfo "Linking with LIB: ${LIB}" + $(tc-getCC) ${LDFLAGS} *.o ${LIB} -o ${MY_PN} || die +} + +src_install() { + dobin src/${MY_PN} + doman doc/${MY_PN}.6 + + dodoc AUTHORS CONTRIB ChangeLog README doc/redcode.ref + readme.gentoo_create_doc + + insinto /usr/share/${MY_PN}/warriors + doins warriors/* + + insinto /usr/share/${MY_PN}/macros + doins config/*.mac +} + +pkg_postinst() { + readme.gentoo_print_elog +} |