New port: games/bunnysay

Bunny Sign for terminals with wchar support

WWW: https://github.com/co60ca/bunnysay

PR:	212278
Submitted by:	Ben Lavery <ben.lavery@hashbang0.com>
Reviewed by:	amdmi3 (mentor)
Approved by:	amdmi3 (mentor)
This commit is contained in:
Carlos J. Puga Medina 2016-09-07 21:45:30 +00:00
parent e60871787d
commit ebec7bb344
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=421522
6 changed files with 77 additions and 0 deletions

View file

@ -117,6 +117,7 @@
SUBDIR += bugsquish
SUBDIR += bugsx
SUBDIR += bumprace
SUBDIR += bunnysay
SUBDIR += burgerspace
SUBDIR += burrtools
SUBDIR += bygfoot

35
games/bunnysay/Makefile Normal file
View file

@ -0,0 +1,35 @@
# Created by: Ben Lavery <ben.lavery@hashbang0.com>
# $FreeBSD$
PORTNAME= bunnysay
PORTVERSION= 1.0
DISTVERSIONPREFIX= v
CATEGORIES= games
MAINTAINER= ben.lavery@hashbang0.com
COMMENT= Bunny Sign for terminals
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cmake compiler:c++11-lang dos2unix
DOS2UNIX_FILES= src/BunnySay.cpp src/BunnySay.h
USE_GITHUB= yes
GH_ACCOUNT= co60ca
PLIST_FILES= bin/bunnysay
.include <bsd.port.pre.mk>
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000
LIB_DEPENDS+= libc++.so.1:devel/libc++
CFLAGS+= -isystem${LOCALBASE}/include/c++/v1
CXXFLAGS+= -isystem${LOCALBASE}/include/c++/v1
LDFLAGS+= -L${LOCALBASE}/lib/c++
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
.include <bsd.port.post.mk>

3
games/bunnysay/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1473266065
SHA256 (co60ca-bunnysay-v1.0_GH0.tar.gz) = 81fe0b57fb307d6e6ae8ab660f0f7720a16f83b271c477812af84a3c23081e77
SIZE (co60ca-bunnysay-v1.0_GH0.tar.gz) = 14703

View file

@ -0,0 +1,25 @@
--- src/BunnySay.cpp.orig 2016-08-31 12:47:32 UTC
+++ src/BunnySay.cpp
@@ -34,8 +34,9 @@ L"/  ";
// Writes wstring input to the stdout after chunking it and converting
// all characters to their wide counterparts in unicode
void BunnySay::writeBunnySay(std::wstring input) {
+ std::wstring_convert<std::codecvt_utf8<wchar_t>,wchar_t> convert;
input = replaceString(input);
- std::wcout << bunny;
+ std::cout << convert.to_bytes(bunny);
bool left = true;
std::vector<std::wstring> vs;
vs = splitAtWidth(input + L" ", width);
@@ -54,9 +55,9 @@ void BunnySay::writeBunnySay(std::wstrin
// Add the pipes
curstring = L"" + curstring + L"\n";
- std::wcout << curstring;
+ std::cout << convert.to_bytes(curstring);
}
- std::wcout << bunny2 << std::endl;
+ std::cout << convert.to_bytes(bunny2) << std::endl;
}
// Helper function to split a sentance delimited with fixed-width spaces
// into strings 10 chars or less

View file

@ -0,0 +1,10 @@
--- src/BunnySay.h.orig 2016-08-31 12:47:32 UTC
+++ src/BunnySay.h
@@ -30,6 +30,7 @@
#include <stack>
#include <vector>
#include <sstream>
+#include <codecvt>
namespace bunnysay {
class BunnySay {

3
games/bunnysay/pkg-descr Normal file
View file

@ -0,0 +1,3 @@
Bunny Sign for terminals with wchar support.
WWW: https://github.com/co60ca/bunnysay