Tue May 4 08:19:42 2021 UTC ()
games/trader: import trader-7.16.

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).


(fcambus)
diff -r0 -r1.1 pkgsrc/games/trader/DESCR
diff -r0 -r1.1 pkgsrc/games/trader/Makefile
diff -r0 -r1.1 pkgsrc/games/trader/PLIST
diff -r0 -r1.1 pkgsrc/games/trader/distinfo
diff -r0 -r1.1 pkgsrc/games/trader/patches/patch-src_utils.c

File Added: pkgsrc/games/trader/DESCR
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).

File Added: pkgsrc/games/trader/Makefile
# $NetBSD: Makefile,v 1.1 2021/05/04 08:19:42 fcambus Exp $

DISTNAME=	trader-7.16
CATEGORIES=	games
MASTER_SITES=	https://ftp.zap.org.au/pub/trader/unix/

MAINTAINER=	fcambus@NetBSD.org
HOMEPAGE=	https://www.zap.org.au/projects/trader/
COMMENT=	Simple text-based game of interstellar trading
LICENSE=	gnu-gpl-v3

GNU_CONFIGURE=		yes
USE_PKGLOCALEDIR=	yes

.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
.include "../../sysutils/desktop-file-utils/desktopdb.mk"
.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/games/trader/PLIST
@comment $NetBSD: PLIST,v 1.1 2021/05/04 08:19:42 fcambus Exp $
bin/trader
man/man6/trader.6
share/applications/trader.desktop
share/icons/hicolor/128x128/apps/trader.png
share/icons/hicolor/16x16/apps/trader.png
share/icons/hicolor/22x22/apps/trader.png
share/icons/hicolor/24x24/apps/trader.png
share/icons/hicolor/256x256/apps/trader.png
share/icons/hicolor/32x32/apps/trader.png
share/icons/hicolor/48x48/apps/trader.png
share/icons/hicolor/512x512/apps/trader.png
share/icons/hicolor/64x64/apps/trader.png
share/icons/hicolor/96x96/apps/trader.png
share/icons/hicolor/scalable/apps/trader.svg
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/LC_MESSAGES/trader.mo
share/locale/en_CA/LC_MESSAGES/trader.mo
share/locale/en_GB/LC_MESSAGES/trader.mo
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/pt_BR/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
share/metainfo/trader.appdata.xml

File Added: pkgsrc/games/trader/distinfo
$NetBSD: distinfo,v 1.1 2021/05/04 08:19:42 fcambus Exp $

SHA1 (trader-7.16.tar.gz) = c98d61bf884f0ddd76b87e82552c0e864890cf12
RMD160 (trader-7.16.tar.gz) = 460e358223a98c966ab109c9ddd1ed234de0407b
SHA512 (trader-7.16.tar.gz) = a5565f26844c8aa98e18c0e90c75f2e0c4cafb43123b7d6be6228d278912ca76048d41d4d6711a31c9f6e22d5f62b9ba18105366fc4a1ea1cedeac1ba3fec794
Size (trader-7.16.tar.gz) = 1259294 bytes
SHA1 (patch-src_utils.c) = 80d5e22f7c01359ba8d881c9c2b1b27fc0882599

File Added: pkgsrc/games/trader/patches/patch-src_utils.c
$NetBSD: patch-src_utils.c,v 1.1 2021/05/04 08:19:42 fcambus Exp $

- Do not use err_exit() to generate error messages when locale initialization
  fails as in this case curs_set() is called before initscr(), which causes
  trader to crash when built with NetBSD curses.

- Avoid using strfmon(3) on NetBSD, there are formatting issues when LANG is
  set to anything else than C.

--- src/utils.c.orig	2021-01-19 05:42:38.000000000 +0000
+++ src/utils.c
@@ -591,8 +591,9 @@ extern void init_locale (void)
 
     // Initialise the current locale
     if (setlocale(LC_ALL, "") == NULL) {
-	err_exit("could not set locale "
-		 "(check LANG, LC_ALL and LANGUAGE in environment)");
+	fprintf(stderr, "%s: %s\n", program_name, "could not set locale "
+		"(check LANG, LC_ALL and LANGUAGE in environment)");
+	exit(EXIT_FAILURE);
     }
 
     // Use correct message catalogs for the locale
@@ -682,7 +683,11 @@ ssize_t xwcsfmon (wchar_t *restrict buf,
        produce "12345" instead of something like "-$123.45"!  The
        following code overcomes these limitations by using snprintf(). */
 
+#if defined(__NetBSD__)
+    if (0) {
+#else
     if (! is_posix_locale) {
+#endif
 	n = strfmon(s, BUFSIZE, format, val);
     } else {
 	/* The current implementation assumes the monetary decimal point