View | Details | Raw Unified | Return to bug 217569
Collapse All | Expand All

(-)Makefile (-5 / +9 lines)
Lines 2-26 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	bunnysay
4
PORTNAME=	bunnysay
5
PORTVERSION=	1.0
5
PORTVERSION=	1.1
6
DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
7
CATEGORIES=	games
7
CATEGORIES=	games
8
8
9
MAINTAINER=	ben.lavery@hashbang0.com
9
MAINTAINER=	ben.lavery@hashbang0.com
10
COMMENT=	Bunny Sign for terminals
10
COMMENT=	Bunny Sign for terminals with UTF-8 support
11
11
12
LICENSE=	GPLv3+
12
LICENSE=	GPLv3+
13
LICENSE_FILE=	${WRKSRC}/LICENSE
13
LICENSE_FILE=	${WRKSRC}/LICENSE
14
14
15
USES=		cmake compiler:c++11-lang dos2unix
15
USES=		gmake
16
DOS2UNIX_FILES=	src/BunnySay.cpp src/BunnySay.h
17
16
17
ALL_TARGET=	bunnysay
18
18
USE_GITHUB=	yes
19
USE_GITHUB=	yes
19
GH_ACCOUNT=	co60ca
20
GH_ACCOUNT=	co60ca
20
21
21
PLIST_FILES=	bin/bunnysay
22
PLIST_FILES=	bin/bunnysay
22
23
24
post-extract:
25
	@${MV} ${WRKSRC}/makefile ${WRKSRC}/Makefile
26
23
do-install:
27
do-install:
24
	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
28
	${INSTALL_PROGRAM} ${WRKSRC}/bunnysay ${STAGEDIR}${PREFIX}/bin/${PORTNAME} 
25
29
26
.include <bsd.port.mk>
30
.include <bsd.port.mk>
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1473266065
1
TIMESTAMP = 1488747822
2
SHA256 (co60ca-bunnysay-v1.0_GH0.tar.gz) = 81fe0b57fb307d6e6ae8ab660f0f7720a16f83b271c477812af84a3c23081e77
2
SHA256 (co60ca-bunnysay-v1.1_GH0.tar.gz) = 556752ff31633c54b2a6984dbab21bd2a79a94022277c0c2dc2f1590c8f2dbfe
3
SIZE (co60ca-bunnysay-v1.0_GH0.tar.gz) = 14703
3
SIZE (co60ca-bunnysay-v1.1_GH0.tar.gz) = 17307
(-)files/patch-src_BunnySay.cpp (-25 lines)
Lines 1-25 Link Here
1
--- src/BunnySay.cpp.orig	2016-08-31 12:47:32 UTC
2
+++ src/BunnySay.cpp
3
@@ -34,8 +34,9 @@ L"/   づ";
4
 // Writes wstring input to the stdout after chunking it and converting
5
 // all characters to their wide counterparts in unicode
6
 void BunnySay::writeBunnySay(std::wstring input) {
7
+  std::wstring_convert<std::codecvt_utf8<wchar_t>,wchar_t> convert;
8
   input = replaceString(input);
9
-  std::wcout << bunny;
10
+  std::cout << convert.to_bytes(bunny);
11
   bool left = true;
12
   std::vector<std::wstring> vs;
13
   vs = splitAtWidth(input + L" ", width);
14
@@ -54,9 +55,9 @@ void BunnySay::writeBunnySay(std::wstrin
15
 
16
     // Add the pipes
17
     curstring = L"|" + curstring + L"|\n";
18
-    std::wcout << curstring;
19
+    std::cout << convert.to_bytes(curstring);
20
    } 
21
-    std::wcout << bunny2 << std::endl;
22
+    std::cout << convert.to_bytes(bunny2) << std::endl;
23
 }
24
 // Helper function to split a sentance delimited with fixed-width spaces
25
 // into strings 10 chars or less
(-)files/patch-src_BunnySay.h (-10 lines)
Lines 1-10 Link Here
1
--- src/BunnySay.h.orig	2016-08-31 12:47:32 UTC
2
+++ src/BunnySay.h
3
@@ -30,6 +30,7 @@
4
 #include <stack>
5
 #include <vector>
6
 #include <sstream>
7
+#include <codecvt>
8
 namespace bunnysay {
9
 
10
 class BunnySay {
(-)files/patch-src_bunnysay.cc (+19 lines)
Line 0 Link Here
1
--- src/bunnysay.cc.orig	2017-02-28 03:26:39 UTC
2
+++ src/bunnysay.cc
3
@@ -99,7 +99,7 @@ void fullWidth(std::vector<std::vector<R
4
 }
5
 
6
 void padTo(std::vector<std::vector<Rune>> *input, size_t width) {
7
-  bool left = false;
8
+  bool left = true;
9
   for (auto &rv: *input) {
10
     while(rv.size() < width) {
11
       if (left) {
12
@@ -109,6 +109,7 @@ void padTo(std::vector<std::vector<Rune>
13
       }
14
       left = !left;
15
     }
16
+    left = true;
17
   }
18
 }
19
 
(-)files/patch-src_runbunnysay.cc (+24 lines)
Line 0 Link Here
1
--- src/runbunnysay.cc.orig	2017-02-28 03:26:39 UTC
2
+++ src/runbunnysay.cc
3
@@ -20,7 +20,6 @@
4
 */
5
 #include "bunnysay.h"
6
 #include <iostream>
7
-#include <iterator>
8
 #include <string>
9
 
10
 void usage(char *prog) {
11
@@ -33,9 +32,10 @@ void usage(char *prog) {
12
 int main(int argc, char **argv) {
13
   std::string buff;
14
   if (argc >= 2 && std::string(argv[1]) == "--") {
15
-    std::istream_iterator<char> it(std::cin);
16
-    std::istream_iterator<char> end;
17
-    buff = std::string(it, end);
18
+    std::string line;
19
+    while (std::getline(std::cin, line)) {
20
+      buff += std::string(line);
21
+    }
22
   } else if (argc >= 2) {
23
     for (int i = 1; i < argc; i++) {
24
       if (i != 1) {
(-)pkg-descr (-1 / +1 lines)
Lines 1-3 Link Here
1
Bunny Sign for terminals with wchar support.
1
Bunny Sign for terminals with UTF-8 support
2
2
3
WWW: https://github.com/co60ca/bunnysay
3
WWW: https://github.com/co60ca/bunnysay

Return to bug 217569