Bug 212278

Summary: [NEW PORT] games/bunnysay: Bunny Sign for terminals
Product: Ports & Packages Reporter: Ben Lavery-Griffiths <ben>
Component: Individual Port(s)Assignee: Carlos J. Puga Medina <cpm>
Status: Closed FIXED    
Severity: Affects Only Me CC: amdmi3, ben, cpm, feld, junovitch
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Shell archive of new port - bunnysay
none
Shell archive of new port - bunnysay
none
Shell archive of new port - bunnysay
none
Makefile
none
Shell archive of new port - bunnysay
none
bunnysay.shar ben: maintainer-approval+

Description Ben Lavery-Griffiths 2016-08-31 08:57:44 UTC
Created attachment 174243 [details]
Shell archive of new port - bunnysay

Bunny Sign for terminals with wchar support

Michael Dexter seemed dismayed this wasn't in ports alread:
https://twitter.com/michaeldexter/status/770753119072452610
Comment 1 Ben Lavery-Griffiths 2016-08-31 10:40:56 UTC
Not sure what I did the first time, but I can't get any output from bunnysay now.  Figuring out what I did between a successful test and submitting this.
Comment 2 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-08-31 10:45:49 UTC
(In reply to Ben Lavery from comment #1)

Yes, I noticed this too. Now I'm checking out why the bunnysay outputs are empty.
Comment 3 Ben Lavery-Griffiths 2016-08-31 11:51:12 UTC
Ah!  I didn't include the patch which alters the code to convert the output to bytes when output via cout rather then wcout.  The other files are at home so I'll reupload later :)
Comment 4 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-08-31 12:06:38 UTC
(In reply to Ben Lavery from comment #3)

OK! 

Be sure that you add USES=dos2unix in Makefile

https://www.freebsd.org/doc/en/books/porters-handbook/slow-patch.html#slow-patch-automatic-replacements
Comment 5 Ben Lavery-Griffiths 2016-08-31 13:17:00 UTC
Created attachment 174250 [details]
Shell archive of new port - bunnysay

Fixes output issue by applying two patches.
Comment 6 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-08-31 13:28:08 UTC
(In reply to Ben Lavery from comment #5)

Indeed it works fine. LGTM.

Waiting mentor approval to commit it into the ports tree.

Thanks for the port.
Comment 7 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-08-31 13:35:21 UTC
Minor fixes were applied in Makefile.
Comment 8 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-08-31 16:06:05 UTC
It fails to build on 9.3/i386 and 9.3/amd64.
Comment 9 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-08-31 17:06:59 UTC
I found 2 problems here:

First problem is that bunnysay needs a compiler understanding C++11 and. See /usr/ports/Mk/Uses/compiler.mk for more details.

Second it seems that codecvt is missing, so it needs libc++ support.
Comment 10 Ben Lavery-Griffiths 2016-09-01 05:26:17 UTC
(In reply to Carlos J. Puga Medina from comment #9)

Not forgotten about this, just busy tail end of last night. 

I've cracked he C++11 problem, still trying to work out how to get libc++ will likely be posting on IRC/mailing lists later.
Comment 11 Ben Lavery-Griffiths 2016-09-02 21:00:08 UTC
Created attachment 174324 [details]
Shell archive of new port - bunnysay

I've marked this as broken on ${OSVERSION} < 1000000 due to lack of proper c++11 support - after much trawling and testing I couldn't get this to work.  Looking at games/spring it also seems to have had problems.
Comment 12 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-05 11:17:18 UTC
(In reply to Ben Lavery from comment #10)

This will fix libc++ issue on 9.3ia

.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000
BUILD_DEPENDS+= ${LOCALBASE}/lib/c++/libstdc++.so:devel/libc++
CFLAGS+=        -isystem${LOCALBASE}/include/c++/v1
CXXFLAGS+=      -isystem${LOCALBASE}/include/c++/v1
LDFLAGS+=       -L${LOCALBASE}/lib/c++
.endif
Comment 13 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-05 11:18:38 UTC
Created attachment 174386 [details]
Makefile
Comment 14 Ben Lavery-Griffiths 2016-09-05 11:56:03 UTC
(In reply to Carlos J. Puga Medina from comment #13)

Ah that makes sense.  I'll test this evening and re-shar the directory.
Thanks!
Comment 15 Ben Lavery-Griffiths 2016-09-05 19:15:31 UTC
Created attachment 174392 [details]
Shell archive of new port - bunnysay

Incorporated fix by CPM, builds and runs on FreeBSD 9
Comment 16 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-06 18:46:08 UTC
Waiting for mentor approval to commit it :)
Comment 17 Dmitry Marakasov freebsd_committer freebsd_triage 2016-09-07 16:25:07 UTC
- You don't need DIST_SUBDIR
- You don't need cmake in BUILD_DEPENDS (the dependency is added by USES=cmake)
- License shouls be GPLv3+
- GH_PROJECT is not needed (defaults to PORTNAME)
- do-build is not needed, framework runs make for you
Comment 18 Dmitry Marakasov freebsd_committer freebsd_triage 2016-09-07 16:30:28 UTC
(In reply to Dmitry Marakasov from comment #17)

- ${STAGEDIR} does not need separator after it, e.g. it should be ${STAGEDIR}${PREFIX}
- You should depend on libc++ via LIB_DEPENDS (libc++.so.1:devel/libc++) as BUILD_DEPENDS do not add runtime dependency on a library
Comment 19 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-07 17:17:07 UTC
Created attachment 174480 [details]
bunnysay.shar

Fix bunnysay.shar
Comment 20 Ben Lavery-Griffiths 2016-09-07 20:45:31 UTC
Comment on attachment 174480 [details]
bunnysay.shar

Approved.  Thank you, Carlos and Dmitry.
Comment 21 commit-hook freebsd_committer freebsd_triage 2016-09-07 21:46:34 UTC
A commit references this bug:

Author: cpm
Date: Wed Sep  7 21:45:31 UTC 2016
New revision: 421522
URL: https://svnweb.freebsd.org/changeset/ports/421522

Log:
  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)

Changes:
  head/games/Makefile
  head/games/bunnysay/
  head/games/bunnysay/Makefile
  head/games/bunnysay/distinfo
  head/games/bunnysay/files/
  head/games/bunnysay/files/patch-src_BunnySay.cpp
  head/games/bunnysay/files/patch-src_BunnySay.h
  head/games/bunnysay/pkg-descr
Comment 22 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-07 21:47:25 UTC
Committed!

Thanks