Bug 264695 - games/neo-cowsay: Update to 2.0.4
Summary: games/neo-cowsay: Update to 2.0.4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Nuno Teixeira
URL: https://github.com/Code-Hex/Neo-cowsa...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-15 15:22 UTC by Nuno Teixeira
Modified: 2022-06-16 10:51 UTC (History)
1 user (show)

See Also:


Attachments
neo-cowsay-2.0.4.diff (1.31 KB, patch)
2022-06-15 15:22 UTC, Nuno Teixeira
no flags Details | Diff
neo-cowsay-2.0.4.diff v2 (1.65 KB, patch)
2022-06-15 22:20 UTC, Nuno Teixeira
no flags Details | Diff
neo-cowsay-2.0.4.diff v3 (1.94 KB, patch)
2022-06-16 00:50 UTC, Dmitri Goutnik
eduardo: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno Teixeira freebsd_committer freebsd_triage 2022-06-15 15:22:26 UTC
Created attachment 234707 [details]
neo-cowsay-2.0.4.diff

games/neo-cowsay: Update to 2.0.4

Earlier versions work with:
---
GO_TARGET=./cmd/cowsay:neo-cowsay ./cmd/cowthink:neo-cowthink
---

But since 2.0.2, upstream separated Go Modules between Neo-Cowsay Library (root directory) and cowsay commands (cmd directory) to reduce download dependant modules when using as a library.

---
Neo-cowsay/Makefile

Line 6 in d57bda7
 CGO_ENABLED=0 cd cmd && go build -o ../bin/cowsay -ldflags "-w -s" ./cowsay
---
Issue 48: https://github.com/Code-Hex/Neo-cowsay/issues/48

I've tried everything I could with several GO_TARGET combinations without success.

Help needed! :)

Thanks in advance,

Nuno Teixeira
Comment 1 Dmitri Goutnik freebsd_committer freebsd_triage 2022-06-15 21:00:35 UTC
Hi Nuno,

GO_MODULE needs to be updated to point to the new package where binaries are located, and GO_TARGET is relative to the module root, so

-GO_MODULE=     github.com/Code-Hex/Neo-cowsay/v2
+GO_MODULE=     github.com/Code-Hex/Neo-cowsay/cmd/v2

-GO_TARGET=     ./cmd/cowsay:neo-cowsay ./cmd/cowthink:neo-cowthink
+GO_TARGET=     ./cowsay:neo-cowsay ./cowthink:neo-cowthink
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2022-06-15 22:20:24 UTC
Created attachment 234710 [details]
neo-cowsay-2.0.4.diff v2

v2
- correct GO_MODULE URL
- adjust GO_TARGET
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2022-06-15 22:40:56 UTC
(In reply to Dmitri Goutnik from comment #1)
Hi!

I did understand perfectly your explanation and I investigate project source and in fact I found what you describe to me.

I found a glitch:

===> Tidying github.com/Code-Hex/Neo-cowsay/cmd/v2 dependencies
cd: ###/games/neo-cowsay/work/github.com/Code-Hex/Neo-cowsay/cmd/v2@v2.0.4: No such file or directory
                                                             ^^^
I checked up work directory and it extracts to: games/neo-cowsay/work/github.com/Code-Hex/Neo-cowsay/v2@v2.0.4 

>Neo-cowsay/cmd/v2@v2.0.4
<Neo-cowsay/v2@v2.0.4

---

Never saw this happened, any clues?
Comment 4 Dmitri Goutnik freebsd_committer freebsd_triage 2022-06-16 00:50:24 UTC
Created attachment 234714 [details]
neo-cowsay-2.0.4.diff v3

You probably need to do `make distclean makesum` to re-download the go.mod. The attached builds fine for me in poudriere.
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2022-06-16 09:51:20 UTC
(In reply to Dmitri Goutnik from comment #4)
Hello Dmitri!

I didn't know about the efect of 'distclean' in a command like 'make distclean makesum' in GO ports that use GO_MODULE method, but I will investigate it deep to undertand it better against a plain 'make makesum' and for what you told me, it seems that poudrire use it since it builded ok for you.

Like I said to maintainer in a PR some days a go: the more I learn, the more newbie I feel :)

I'd like to thank you very much for this excellent lesson that mekes me very happy and confidence for a next step: learn more.

Yours,

Nuno Eduardo Teixeira
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-06-16 10:04:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ed2683b77e74d7305e7110033165eb97ba0b315d

commit ed2683b77e74d7305e7110033165eb97ba0b315d
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2022-06-16 09:51:08 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-06-16 10:02:52 +0000

    games/neo-cowsay: Update to 2.0.4

    ChangeLog: https://github.com/Code-Hex/Neo-cowsay/releases

    PR:             264695
    Reviewed by:    dmgk@

 games/neo-cowsay/Makefile | 20 +++-----------------
 games/neo-cowsay/distinfo | 10 +++++-----
 2 files changed, 8 insertions(+), 22 deletions(-)
Comment 7 Dmitri Goutnik freebsd_committer freebsd_triage 2022-06-16 10:51:55 UTC
(In reply to Nuno Teixeira from comment #5)
You're welcome, glad to be of help.