summaryrefslogtreecommitdiff
path: root/games-simulation/pmars-sdl
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-simulation/pmars-sdl
reinit the tree, so we can have metadata
Diffstat (limited to 'games-simulation/pmars-sdl')
-rw-r--r--games-simulation/pmars-sdl/Manifest6
-rw-r--r--games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch65
-rw-r--r--games-simulation/pmars-sdl/metadata.xml8
-rw-r--r--games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild91
4 files changed, 170 insertions, 0 deletions
diff --git a/games-simulation/pmars-sdl/Manifest b/games-simulation/pmars-sdl/Manifest
new file mode 100644
index 000000000000..69d3686936e7
--- /dev/null
+++ b/games-simulation/pmars-sdl/Manifest
@@ -0,0 +1,6 @@
+AUX pmars-sdl-0.9.2e-format.patch 1976 SHA256 59cd7357901560bb84b623522f97ae4f18a0147f65d98f9043f41861bbbed548 SHA512 dbf068f6fe9993c5917c1be5ace48c5def932365fe558f893a3bdb3e5d35e6ce25e8e46ef074d214da5c2ba65a4bc7e9e8cbf806370bb225d5ecba9a4133387f WHIRLPOOL 002b971c319e0d82ffa4f0e7c79fb6f411fe196689e5e3d6494cb0ee8d7bc3e311dde4ffe54e1ef485d8c63804a2c2d9555db035d995ea996bb30f75bf7bcb45
+DIST pmars-0.9.2-5.tar.gz 200966 SHA256 a8518ec8cc13728dc202c34fe73657123454b9fc76bcddf6b299201143e6fee3 SHA512 197d1967507199ed5eb075fb232a2f15d9bdf4bec03fc6b1d6df5d6259d6627eb40338c5787852ea10d96858029144348128b08e86c7079d96f10fd09dafc315 WHIRLPOOL b588f0381a201b5d3b440626adb8b72ec4b89f68951ce57fd9d4ede604ee2599b5db4443dab18d9dca6c958145515e2f911b9fcd48a8243a841d0276f1b0a581
+EBUILD pmars-sdl-0.9.2e.ebuild 1826 SHA256 bda76f7af603cebe512513c72906f6c6cabd40773858c7f16d293452de4346bb SHA512 78a3ffae78f9d80aa198df883a51ab2d65eb5bb0ea6b021f59609f01b70d1501060689d214706b5414c856256874be597014834c97b38b6425b1dc6cb4afaed5 WHIRLPOOL f16a36376c96d254ff439e4f4f457e06958f950430703fc903e34076f2374764e8a72755011637c2a48e125351f8f10bc7ca6a32f2bfc06ed3b02bb7b42218b1
+MISC ChangeLog 2921 SHA256 340546598702931b9002f004ab04914cc08b3662c81361a69c8aef874d76ea20 SHA512 ef1a075bb4c33ad55fa35978a5be9767b0af03b4b1f79acd721ef58704a03fded62319fe7cec5b2743ff75c31b0c65e42c62647aa29607417c865d1f298dc1d9 WHIRLPOOL 04d543e81f192dd6e7bbd87db860ebfd2c8bbef1cfc92e3de68dadbe6070f3ae144873ed4bc7d82253f823dfbd749b9d6bbc953b4c8d4b28158657c203bcca1c
+MISC ChangeLog-2015 1582 SHA256 954c88be9602d3923da7878bf22832a85fd3ad01fa5807957343cd0d5f2f73f9 SHA512 e40560893dfea911db8a4f341e5f81cb4010df08556dafa4bb38b12aafd625df0c68987948c7f15eeb4b3b2bdcfeaf9fbf70b98118b8c02bfde313794eb3e5da WHIRLPOOL 9fbd3995879cbd0d3f4cb9242da1de126160de50e631b280253349a3f94632fa2367e6434d63c415b68ffb90cdaa01729a8008db82264ed18bda017c3c093367
+MISC metadata.xml 249 SHA256 943b9ce0cd072229b43569ab668dd7ec741d9dfefd942c8921dabd4490b27b0c SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118 WHIRLPOOL b10e21575c78e201a652c8582cd16e3f7c86b13dd20a30f4cea44066fb139440b3c186147dbaae83478f11a20b6f457a99c8b29ee1239a4caaa21eee01250088
diff --git a/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch
new file mode 100644
index 000000000000..d8c588a32206
--- /dev/null
+++ b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch
@@ -0,0 +1,65 @@
+--- src/asm.c.old 2015-10-28 13:23:53.465014342 +0100
++++ src/asm.c 2015-10-28 13:23:10.502813377 +0100
+@@ -652,7 +652,7 @@
+ macputs(str);
+ #else
+ if (!inCdb)
+- fprintf(stderr, str);
++ fprintf(stderr, "%s", str);
+ #if defined DOSALLGRAPHX
+ else {
+ if (displayMode == TEXT)
+@@ -833,7 +833,7 @@
+ #ifdef __MAC__
+ textout(notEnoughMemErr);
+ #else
+- fprintf(stderr, notEnoughMemErr);
++ fprintf(stderr, "%s", notEnoughMemErr);
+ #endif
+ Exit(MEMERR);
+ break;
+@@ -916,7 +916,7 @@
+ }
+
+ if (ierr >= ERRMAX) {
+- sprintf(outs, tooManyMsgErr);
++ sprintf(outs, "%s", tooManyMsgErr);
+ #ifndef VMS
+ textout(outs);
+ #else
+--- src/cdb.c.old 2015-10-28 13:24:04.669805966 +0100
++++ src/cdb.c 2015-10-28 13:23:10.502813377 +0100
+@@ -2760,7 +2760,7 @@
+ fprintf(outp, nameByAuthorScores, warrior[idxV[i]].name, warrior[idxV[i]].authorName,
+ scrV[idxV[i]]);
+ if (warriors > 2) {
+- fprintf(outp, resultsAre);
++ fprintf(outp, "%s", resultsAre);
+ for (j = 0; j < warriors; ++j) {
+ fprintf(outp, " %d", warrior[idxV[i]].score[j]);
+ }
+--- src/clparse.c.old 2015-10-28 13:24:10.648694768 +0100
++++ src/clparse.c 2015-10-28 13:23:10.502813377 +0100
+@@ -289,7 +289,7 @@
+ if (next_input(filep, inputs)) {
+ if (!strcmp(inputs, "-")) {
+ newFile = stdin;
+- fprintf(stderr, readingStdin);
++ fprintf(stderr, "%s", readingStdin);
+ } else {
+ if ((newFile = fopen(inputs, "r")) == NULL) {
+ code = FILENAME; /* command file not found */
+@@ -430,11 +430,11 @@
+ errout(outs);
+ break;
+ case MEMORY:
+- sprintf(outs, outOfMemory);
++ sprintf(outs, "%s", outOfMemory);
+ errout(outs);
+ break;
+ case FILENAME:
+- sprintf(outs, cannotOpenParameterFile);
++ sprintf(outs, "%s", cannotOpenParameterFile);
+ errout(outs);
+ break;
+ }
diff --git a/games-simulation/pmars-sdl/metadata.xml b/games-simulation/pmars-sdl/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/games-simulation/pmars-sdl/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-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild b/games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild
new file mode 100644
index 000000000000..95d0aced75e8
--- /dev/null
+++ b/games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs eutils games
+
+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="http://corewar.co.uk/pihlaja/pmars-sdl/"
+SRC_URI="http://corewar.co.uk/pihlaja/pmars-sdl/${MY_P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="sdl X"
+
+DEPEND="sdl? ( x11-libs/libX11 media-libs/libsdl[video] )
+ X? ( x11-libs/libX11 )
+ !sdl? ( !X? ( sys-libs/ncurses:0 ) )"
+RDEPEND=${DEPEND}
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-format.patch
+}
+
+src_compile() {
+ CFLAGS="${CFLAGS} -DEXT94 -DPERMUTATE"
+ LFLAGS="-x"
+
+ if use sdl ; then
+ CFLAGS="${CFLAGS} -DSDLGRAPHX `sdl-config --cflags`"
+ LIB=`sdl-config --libs`
+ elif use X ; then
+ CFLAGS="${CFLAGS} -DXWINGRAPHX"
+ LIB="-L/usr/X11R6/lib -lX11"
+ else
+ CFLAGS="${CFLAGS} -DCURSESGRAPHX"
+ LIB="-lcurses"
+ fi
+
+ cd src
+
+ SRC="asm.c
+ cdb.c
+ clparse.c
+ disasm.c
+ eval.c
+ global.c
+ pmars.c
+ sim.c
+ pos.c
+ str_eng.c
+ token.c"
+
+ for x in ${SRC}; do
+ einfo "compiling ${x}"
+ $(tc-getCC) ${CFLAGS} ${x} -c || die
+ done
+
+ echo
+ einfo "linking with LIB: ${LIB}"
+ $(tc-getCC) ${LDFLAGS} *.o ${LIB} -o ${MY_PN} || die
+}
+
+src_install() {
+ dogamesbin src/${MY_PN}
+ doman doc/${MY_PN}.6
+
+ dodoc AUTHORS CONTRIB ChangeLog README doc/redcode.ref
+
+ insinto "${GAMES_DATADIR}/${MY_PN}/warriors"
+ doins warriors/*
+
+ insinto "${GAMES_DATADIR}/${MY_PN}/macros"
+ doins config/*.mac
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ echo
+ ewarn "There are some macros in ${GAMES_DATADIR}/${MY_PN}/macros"
+ ewarn "which you should make accessible to pmars by typing"
+ ewarn "export PMARSHOME=${GAMES_DATADIR}/${MY_PN}/macros\n"
+}