aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpm <cpm@FreeBSD.org>2016-09-08 05:45:30 +0800
committercpm <cpm@FreeBSD.org>2016-09-08 05:45:30 +0800
commit630b40f713cae73d9be4433b665702cc976cc62e (patch)
tree06a99f2bf23abe2725e54a9d42478126f7c36ebd
parent5dc678f4e526af1bea552e5966d9e51ab618f341 (diff)
downloadfreebsd-ports-gnome-630b40f713cae73d9be4433b665702cc976cc62e.tar.gz
freebsd-ports-gnome-630b40f713cae73d9be4433b665702cc976cc62e.tar.zst
freebsd-ports-gnome-630b40f713cae73d9be4433b665702cc976cc62e.zip
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)
-rw-r--r--games/Makefile1
-rw-r--r--games/bunnysay/Makefile35
-rw-r--r--games/bunnysay/distinfo3
-rw-r--r--games/bunnysay/files/patch-src_BunnySay.cpp25
-rw-r--r--games/bunnysay/files/patch-src_BunnySay.h10
-rw-r--r--games/bunnysay/pkg-descr3
6 files changed, 77 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index d65229131b2c..2bc6b773b34e 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -117,6 +117,7 @@
SUBDIR += bugsquish
SUBDIR += bugsx
SUBDIR += bumprace
+ SUBDIR += bunnysay
SUBDIR += burgerspace
SUBDIR += burrtools
SUBDIR += bygfoot
diff --git a/games/bunnysay/Makefile b/games/bunnysay/Makefile
new file mode 100644
index 000000000000..38f2ae733e20
--- /dev/null
+++ b/games/bunnysay/Makefile
@@ -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>
diff --git a/games/bunnysay/distinfo b/games/bunnysay/distinfo
new file mode 100644
index 000000000000..bee071274dd7
--- /dev/null
+++ b/games/bunnysay/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1473266065
+SHA256 (co60ca-bunnysay-v1.0_GH0.tar.gz) = 81fe0b57fb307d6e6ae8ab660f0f7720a16f83b271c477812af84a3c23081e77
+SIZE (co60ca-bunnysay-v1.0_GH0.tar.gz) = 14703
diff --git a/games/bunnysay/files/patch-src_BunnySay.cpp b/games/bunnysay/files/patch-src_BunnySay.cpp
new file mode 100644
index 000000000000..752791f4dab8
--- /dev/null
+++ b/games/bunnysay/files/patch-src_BunnySay.cpp
@@ -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
diff --git a/games/bunnysay/files/patch-src_BunnySay.h b/games/bunnysay/files/patch-src_BunnySay.h
new file mode 100644
index 000000000000..6594b808cb99
--- /dev/null
+++ b/games/bunnysay/files/patch-src_BunnySay.h
@@ -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 {
diff --git a/games/bunnysay/pkg-descr b/games/bunnysay/pkg-descr
new file mode 100644
index 000000000000..7ea4b9010ed9
--- /dev/null
+++ b/games/bunnysay/pkg-descr
@@ -0,0 +1,3 @@
+Bunny Sign for terminals with wchar support.
+
+WWW: https://github.com/co60ca/bunnysay