Import games/trader.

Star Traders is a simple text-based game of interstellar trading, where
the objective is to create companies, buy and sell shares, borrow and
repay money, in order to become the wealthiest player (the winner).

OK bentley@
This commit is contained in:
fcambus 2018-09-10 20:50:56 +00:00
parent 7bdceb98fa
commit 7410c4eaea
9 changed files with 793 additions and 0 deletions

31
games/trader/Makefile Normal file
View File

@ -0,0 +1,31 @@
# $OpenBSD: Makefile,v 1.1.1.1 2018/09/10 20:50:56 fcambus Exp $
COMMENT = simple text-based game of interstellar trading
DISTNAME = trader-7.12
CATEGORIES = games
HOMEPAGE = https://www.zap.org.au/software/trader/
MAINTAINER = Frederic Cambus <fcambus@openbsd.org>
# GPLv3+
PERMIT_PACKAGE_CDROM = Yes
WANTLIB += c curses iconv intl
MASTER_SITES = https://ftp.zap.org.au/pub/trader/unix/
LIB_DEPENDS = converters/libiconv \
devel/gettext
CONFIGURE_STYLE = gnu
post-patch:
@cp ${FILESDIR}/strfmon* ${WRKSRC}/src
post-install:
@rm -rf ${PREFIX}/share/applications ${PREFIX}/share/icons
.include <bsd.port.mk>

2
games/trader/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (trader-7.12.tar.gz) = IqTNqVc691urtV5IoflKzIeehYkiuU7/XDJCbei2nwE=
SIZE (trader-7.12.tar.gz) = 1114584

View File

@ -0,0 +1,619 @@
/*-
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "strfmon.h"
/* internal flags */
#define NEED_GROUPING 0x01 /* print digits grouped (default) */
#define SIGN_POSN_USED 0x02 /* '+' or '(' usage flag */
#define LOCALE_POSN 0x04 /* use locale defined +/- (default) */
#define PARENTH_POSN 0x08 /* enclose negative amount in () */
#define SUPRESS_CURR_SYMBOL 0x10 /* suppress the currency from output */
#define LEFT_JUSTIFY 0x20 /* left justify */
#define USE_INTL_CURRENCY 0x40 /* use international currency symbol */
#define IS_NEGATIVE 0x80 /* is argument value negative ? */
/* internal macros */
#define PRINT(CH) do { \
if (dst >= s + maxsize) \
goto e2big_error; \
*dst++ = CH; \
} while (0)
#define PRINTS(STR) do { \
char *tmps = STR; \
while (*tmps != '\0') \
PRINT(*tmps++); \
} while (0)
#define GET_NUMBER(VAR) do { \
VAR = 0; \
while (isdigit((unsigned char)*fmt)) { \
VAR *= 10; \
VAR += *fmt - '0'; \
fmt++; \
} \
} while (0)
#define GRPCPY(howmany) do { \
int i = howmany; \
while (i-- > 0) { \
avalue_size--; \
*--bufend = *(avalue+avalue_size+padded); \
} \
} while (0)
#define GRPSEP do { \
*--bufend = thousands_sep; \
groups++; \
} while (0)
static void __setup_vars(int, char *, char *, char *, char **);
static int __calc_left_pad(int, char *);
static char *__format_grouped_double(double, int *, int, int, int);
ssize_t
strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
...)
{
va_list ap;
char *dst; /* output destination pointer */
const char *fmt; /* current format position pointer */
struct lconv *lc; /* pointer to lconv structure */
char *asciivalue; /* formatted double pointer */
int flags; /* formatting options */
int pad_char; /* padding character */
int pad_size; /* pad size */
int width; /* field width */
int left_prec; /* left precision */
int right_prec; /* right precision */
double value; /* just value */
char space_char = ' '; /* space after currency */
char cs_precedes, /* values gathered from struct lconv */
sep_by_space,
sign_posn,
*signstr,
*currency_symbol;
char *tmpptr; /* temporary vars */
int sverrno;
va_start(ap, format);
lc = localeconv();
dst = s;
fmt = format;
asciivalue = NULL;
currency_symbol = NULL;
pad_size = 0;
while (*fmt) {
/* pass nonformating characters AS IS */
if (*fmt != '%')
goto literal;
/* '%' found ! */
/* "%%" mean just '%' */
if (*(fmt+1) == '%') {
fmt++;
literal:
PRINT(*fmt++);
continue;
}
/* set up initial values */
flags = (NEED_GROUPING|LOCALE_POSN);
pad_char = ' '; /* padding character is "space" */
left_prec = -1; /* no left precision specified */
right_prec = -1; /* no right precision specified */
width = -1; /* no width specified */
value = 0; /* we have no value to print now */
/* Flags */
while (1) {
switch (*++fmt) {
case '=': /* fill character */
pad_char = *++fmt;
if (pad_char == '\0')
goto format_error;
continue;
case '^': /* not group currency */
flags &= ~(NEED_GROUPING);
continue;
case '+': /* use locale defined signs */
if (flags & SIGN_POSN_USED)
goto format_error;
flags |= (SIGN_POSN_USED|LOCALE_POSN);
continue;
case '(': /* enclose negatives with () */
if (flags & SIGN_POSN_USED)
goto format_error;
flags |= (SIGN_POSN_USED|PARENTH_POSN);
continue;
case '!': /* suppress currency symbol */
flags |= SUPRESS_CURR_SYMBOL;
continue;
case '-': /* alignment (left) */
flags |= LEFT_JUSTIFY;
continue;
default:
break;
}
break;
}
/* field Width */
if (isdigit((unsigned char)*fmt)) {
GET_NUMBER(width);
/* Do we have enough space to put number with
* required width ?
*/
if (dst + width >= s + maxsize)
goto e2big_error;
}
/* Left precision */
if (*fmt == '#') {
if (!isdigit((unsigned char)*++fmt))
goto format_error;
GET_NUMBER(left_prec);
}
/* Right precision */
if (*fmt == '.') {
if (!isdigit((unsigned char)*++fmt))
goto format_error;
GET_NUMBER(right_prec);
}
/* Conversion Characters */
switch (*fmt++) {
case 'i': /* use international currency format */
flags |= USE_INTL_CURRENCY;
break;
case 'n': /* use national currency format */
flags &= ~(USE_INTL_CURRENCY);
break;
default: /* required character is missing or
premature EOS */
goto format_error;
}
if (flags & USE_INTL_CURRENCY) {
currency_symbol = strdup(lc->int_curr_symbol);
if (currency_symbol != NULL)
space_char = *(currency_symbol+3);
} else
currency_symbol = strdup(lc->currency_symbol);
if (currency_symbol == NULL)
goto end_error; /* ENOMEM. */
/* value itself */
value = va_arg(ap, double);
/* detect sign */
if (value < 0) {
flags |= IS_NEGATIVE;
value = -value;
}
/* fill left_prec with amount of padding chars */
if (left_prec >= 0) {
pad_size = __calc_left_pad((flags ^ IS_NEGATIVE),
currency_symbol) -
__calc_left_pad(flags, currency_symbol);
if (pad_size < 0)
pad_size = 0;
}
asciivalue = __format_grouped_double(value, &flags,
left_prec, right_prec, pad_char);
if (asciivalue == NULL)
goto end_error; /* errno already set */
/* to ENOMEM by malloc() */
/* set some variables for later use */
__setup_vars(flags, &cs_precedes, &sep_by_space,
&sign_posn, &signstr);
/*
* Description of some LC_MONETARY's values:
*
* p_cs_precedes & n_cs_precedes
*
* = 1 - $currency_symbol precedes the value
* for a monetary quantity with a non-negative value
* = 0 - symbol succeeds the value
*
* p_sep_by_space & n_sep_by_space
*
* = 0 - no space separates $currency_symbol
* from the value for a monetary quantity with a
* non-negative value
* = 1 - space separates the symbol from the value
* = 2 - space separates the symbol and the sign string,
* if adjacent.
*
* p_sign_posn & n_sign_posn
*
* = 0 - parentheses enclose the quantity and the
* $currency_symbol
* = 1 - the sign string precedes the quantity and the
* $currency_symbol
* = 2 - the sign string succeeds the quantity and the
* $currency_symbol
* = 3 - the sign string precedes the $currency_symbol
* = 4 - the sign string succeeds the $currency_symbol
*
*/
tmpptr = dst;
while (pad_size-- > 0)
PRINT(' ');
if (sign_posn == 0 && (flags & IS_NEGATIVE))
PRINT('(');
if (cs_precedes == 1) {
if (sign_posn == 1 || sign_posn == 3) {
PRINTS(signstr);
if (sep_by_space == 2) /* XXX: ? */
PRINT(' ');
}
if (!(flags & SUPRESS_CURR_SYMBOL)) {
PRINTS(currency_symbol);
if (sign_posn == 4) {
if (sep_by_space == 2)
PRINT(space_char);
PRINTS(signstr);
if (sep_by_space == 1)
PRINT(' ');
} else if (sep_by_space == 1)
PRINT(space_char);
}
} else if (sign_posn == 1)
PRINTS(signstr);
PRINTS(asciivalue);
if (cs_precedes == 0) {
if (sign_posn == 3) {
if (sep_by_space == 1)
PRINT(' ');
PRINTS(signstr);
}
if (!(flags & SUPRESS_CURR_SYMBOL)) {
if ((sign_posn == 3 && sep_by_space == 2)
|| (sep_by_space == 1
&& (sign_posn == 0
|| sign_posn == 1
|| sign_posn == 2
|| sign_posn == 4)))
PRINT(space_char);
PRINTS(currency_symbol); /* XXX: len */
if (sign_posn == 4) {
if (sep_by_space == 2)
PRINT(' ');
PRINTS(signstr);
}
}
}
if (sign_posn == 2) {
if (sep_by_space == 2)
PRINT(' ');
PRINTS(signstr);
}
if (sign_posn == 0 && (flags & IS_NEGATIVE))
PRINT(')');
if (dst - tmpptr < width) {
if (flags & LEFT_JUSTIFY) {
while (dst - tmpptr < width)
PRINT(' ');
} else {
pad_size = dst-tmpptr;
memmove(tmpptr + width-pad_size, tmpptr,
pad_size);
memset(tmpptr, ' ', width-pad_size);
dst += width-pad_size;
}
}
}
PRINT('\0');
va_end(ap);
free(asciivalue);
free(currency_symbol);
return (dst - s - 1); /* return size of put data except trailing '\0' */
e2big_error:
errno = E2BIG;
goto end_error;
format_error:
errno = EINVAL;
end_error:
sverrno = errno;
if (asciivalue != NULL)
free(asciivalue);
if (currency_symbol != NULL)
free(currency_symbol);
errno = sverrno;
va_end(ap);
return (-1);
}
static void
__setup_vars(int flags, char *cs_precedes, char *sep_by_space,
char *sign_posn, char **signstr) {
struct lconv *lc = localeconv();
#if defined _WIN32 && !defined __cygwin__
if (flags & IS_NEGATIVE) {
#else
if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) {
*cs_precedes = lc->int_n_cs_precedes;
*sep_by_space = lc->int_n_sep_by_space;
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn;
*signstr = (lc->negative_sign == '\0') ? "-"
: lc->negative_sign;
} else if (flags & USE_INTL_CURRENCY) {
*cs_precedes = lc->int_p_cs_precedes;
*sep_by_space = lc->int_p_sep_by_space;
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_p_sign_posn;
*signstr = lc->positive_sign;
} else if (flags & IS_NEGATIVE) {
#endif
*cs_precedes = lc->n_cs_precedes;
*sep_by_space = lc->n_sep_by_space;
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn;
*signstr = (lc->negative_sign == NULL) ? "-"
: lc->negative_sign;
} else {
*cs_precedes = lc->p_cs_precedes;
*sep_by_space = lc->p_sep_by_space;
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->p_sign_posn;
*signstr = lc->positive_sign;
}
/* Set default values for unspecified information. */
if (*cs_precedes != 0)
*cs_precedes = 1;
if (*sep_by_space == CHAR_MAX)
*sep_by_space = 0;
if (*sign_posn == CHAR_MAX)
*sign_posn = 0;
}
static int
__calc_left_pad(int flags, char *cur_symb) {
char cs_precedes, sep_by_space, sign_posn, *signstr;
int left_chars = 0;
__setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr);
if (cs_precedes != 0) {
left_chars += strlen(cur_symb);
if (sep_by_space != 0)
left_chars++;
}
switch (sign_posn) {
case 1:
left_chars += strlen(signstr);
break;
case 3:
case 4:
if (cs_precedes != 0)
left_chars += strlen(signstr);
}
return (left_chars);
}
static int
get_groups(int size, char *grouping) {
int chars = 0;
if (*grouping == CHAR_MAX || *grouping <= 0) /* no grouping ? */
return (0);
while (size > (int)*grouping) {
chars++;
size -= (int)*grouping++;
/* no more grouping ? */
if (*grouping == CHAR_MAX)
break;
/* rest grouping with same value ? */
if (*grouping == 0) {
chars += (size - 1) / *(grouping - 1);
break;
}
}
return (chars);
}
#define BUFFSIZE 255
/* convert double to ASCII */
static char *
__format_grouped_double(double value, int *flags,
int left_prec, int right_prec, int pad_char) {
char *rslt;
char *avalue;
int avalue_size;
char fmt[32];
size_t bufsize;
char *bufend;
int padded;
struct lconv *lc = localeconv();
char *grouping;
char decimal_point;
char thousands_sep;
int groups = 0;
grouping = lc->mon_grouping;
decimal_point = *lc->mon_decimal_point;
if (decimal_point == '\0')
decimal_point = *lc->decimal_point;
thousands_sep = *lc->mon_thousands_sep;
if (thousands_sep == '\0')
thousands_sep = *lc->thousands_sep;
/* fill left_prec with default value */
if (left_prec == -1)
left_prec = 0;
/* fill right_prec with default value */
if (right_prec == -1) {
if (*flags & USE_INTL_CURRENCY)
right_prec = lc->int_frac_digits;
else
right_prec = lc->frac_digits;
if (right_prec == CHAR_MAX) /* POSIX locale ? */
right_prec = 2;
}
if (*flags & NEED_GROUPING)
left_prec += get_groups(left_prec, grouping);
/* convert to string */
snprintf(fmt, sizeof(fmt), "%%%d.%df", left_prec + right_prec + 1,
right_prec);
avalue = malloc (BUFFSIZE);
if (!avalue)
return (NULL);
avalue_size = snprintf(avalue, BUFFSIZE, fmt, value);
if (BUFFSIZE < avalue_size)
{
avalue = realloc (avalue, avalue_size + 1);
if (!avalue)
return (NULL);
avalue_size = sprintf(avalue, fmt, value);
}
if (avalue_size < 0)
return (NULL);
/* make sure that we've enough space for result string */
bufsize = strlen(avalue)*2+1;
rslt = malloc(bufsize);
if (rslt == NULL) {
free(avalue);
return (NULL);
}
memset(rslt, 0, bufsize);
bufend = rslt + bufsize - 1; /* reserve space for trailing '\0' */
/* skip spaces at beginning */
padded = 0;
while (avalue[padded] == ' ') {
padded++;
avalue_size--;
}
if (right_prec > 0) {
bufend -= right_prec;
memcpy(bufend, avalue + avalue_size+padded-right_prec,
right_prec);
*--bufend = decimal_point;
avalue_size -= (right_prec + 1);
}
if ((*flags & NEED_GROUPING) &&
thousands_sep != '\0' && /* XXX: need investigation */
*grouping != CHAR_MAX &&
*grouping > 0) {
while (avalue_size > (int)*grouping) {
GRPCPY(*grouping);
GRPSEP;
grouping++;
/* no more grouping ? */
if (*grouping == CHAR_MAX)
break;
/* rest grouping with same value ? */
if (*grouping == 0) {
grouping--;
while (avalue_size > *grouping) {
GRPCPY(*grouping);
GRPSEP;
}
}
}
if (avalue_size != 0)
GRPCPY(avalue_size);
padded -= groups;
} else {
bufend -= avalue_size;
memcpy(bufend, avalue+padded, avalue_size);
if (right_prec == 0)
padded--; /* decrease assumed $decimal_point */
}
/* do padding with pad_char */
if (padded > 0) {
bufend -= padded;
memset(bufend, pad_char, padded);
}
bufsize = bufsize - (bufend - rslt) + 1;
memmove(rslt, bufend, bufsize);
free(avalue);
return (rslt);
}

View File

@ -0,0 +1,40 @@
/*-
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef __STRFMON_H__
#define __STRFMON_H__
#ifndef HAVE_STRFMON
/*
* Version of "strfmon()", for the benefit of OSes that don't have it.
*/
ssize_t
strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
...);
#endif
#endif

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-src_Makefile_am,v 1.1.1.1 2018/09/10 20:50:56 fcambus Exp $
Index: src/Makefile.am
--- src/Makefile.am.orig
+++ src/Makefile.am
@@ -38,6 +38,7 @@ trader_SOURCES = \
fileio.c fileio.h \
help.c help.h \
intf.c intf.h \
+ strfmon.c strfmon.h \
utils.c utils.h \
system.h

View File

@ -0,0 +1,44 @@
$OpenBSD: patch-src_Makefile_in,v 1.1.1.1 2018/09/10 20:50:56 fcambus Exp $
Index: src/Makefile.in
--- src/Makefile.in.orig
+++ src/Makefile.in
@@ -173,7 +173,7 @@ am_trader_OBJECTS = trader-trader.$(OBJEXT) trader-glo
trader-game.$(OBJEXT) trader-move.$(OBJEXT) \
trader-exch.$(OBJEXT) trader-fileio.$(OBJEXT) \
trader-help.$(OBJEXT) trader-intf.$(OBJEXT) \
- trader-utils.$(OBJEXT)
+ trader-strfmon.$(OBJEXT) trader-utils.$(OBJEXT)
trader_OBJECTS = $(am_trader_OBJECTS)
trader_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
AM_V_P = $(am__v_P_@AM_V@)
@@ -1047,6 +1047,7 @@ trader_SOURCES = \
fileio.c fileio.h \
help.c help.h \
intf.c intf.h \
+ strfmon.c strfmon.h \
utils.c utils.h \
system.h
@@ -1149,6 +1150,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trader-intf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trader-move.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trader-trader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trader-strfmon.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trader-utils.Po@am__quote@
.c.o:
@@ -1276,6 +1278,13 @@ trader-intf.obj: intf.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='intf.c' object='trader-intf.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(trader_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o trader-intf.obj `if test -f 'intf.c'; then $(CYGPATH_W) 'intf.c'; else $(CYGPATH_W) '$(srcdir)/intf.c'; fi`
+
+trader-strfmon.o: strfmon.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(trader_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT trader-strfmon.o -MD -MP -MF $(DEPDIR)/trader-strfmon.Tpo -c -o trader-strfmon.o `test -f 'strfmon.c' || echo '$(srcdir)/'`strfmon.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trader-strfmon.Tpo $(DEPDIR)/trader-strfmon.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strfmon.c' object='trader-strfmon.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(trader_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o trader-strfmon.o `test -f 'strfmon.c' || echo '$(srcdir)/'`strfmon.c
trader-utils.o: utils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(trader_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT trader-utils.o -MD -MP -MF $(DEPDIR)/trader-utils.Tpo -c -o trader-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_system_h,v 1.1.1.1 2018/09/10 20:50:56 fcambus Exp $
Index: src/system.h
--- src/system.h.orig
+++ src/system.h
@@ -69,7 +69,7 @@
#include <signal.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <monetary.h>
+#include "strfmon.h"
#include <langinfo.h>

3
games/trader/pkg/DESCR Normal file
View File

@ -0,0 +1,3 @@
Star Traders is a simple text-based game of interstellar trading, where
the objective is to create companies, buy and sell shares, borrow and
repay money, in order to become the wealthiest player (the winner).

27
games/trader/pkg/PLIST Normal file
View File

@ -0,0 +1,27 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2018/09/10 20:50:56 fcambus Exp $
@bin bin/trader
@man man/man6/trader.6
share/locale/da/LC_MESSAGES/trader.mo
share/locale/de/LC_MESSAGES/trader.mo
share/locale/en@quot/LC_MESSAGES/trader.mo
share/locale/en_AU/
share/locale/en_AU/LC_MESSAGES/
share/locale/en_AU/LC_MESSAGES/trader.mo
share/locale/en_CA/
share/locale/en_CA/LC_MESSAGES/
share/locale/en_CA/LC_MESSAGES/trader.mo
share/locale/en_GB/
share/locale/en_GB/LC_MESSAGES/
share/locale/en_GB/LC_MESSAGES/trader.mo
share/locale/en_US/
share/locale/en_US/LC_MESSAGES/
share/locale/en_US/LC_MESSAGES/trader.mo
share/locale/eo/LC_MESSAGES/trader.mo
share/locale/fi/LC_MESSAGES/trader.mo
share/locale/fr/LC_MESSAGES/trader.mo
share/locale/hr/LC_MESSAGES/trader.mo
share/locale/hu/LC_MESSAGES/trader.mo
share/locale/nb/LC_MESSAGES/trader.mo
share/locale/ru/LC_MESSAGES/trader.mo
share/locale/sr/LC_MESSAGES/trader.mo
share/locale/sv/LC_MESSAGES/trader.mo