Bug 286919 - [NEW PORT] games/xtxf: Terminal screensaver
Summary: [NEW PORT] games/xtxf: Terminal screensaver
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: Hiroki Tagato
URL: https://github.com/charlesrocket/xtxf...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-19 01:36 UTC by charlesrocket
Modified: 2025-09-04 12:53 UTC (History)
2 users (show)

See Also:


Attachments
port v0.11.0 (2.09 KB, patch)
2025-05-19 01:36 UTC, charlesrocket
no flags Details | Diff
port v0.11.0 (2.07 KB, patch)
2025-05-19 09:52 UTC, charlesrocket
no flags Details | Diff
port v0.11.0 (2.06 KB, patch)
2025-05-19 09:57 UTC, charlesrocket
no flags Details | Diff
add port v0.11.0 (2.07 KB, patch)
2025-05-20 14:55 UTC, charlesrocket
no flags Details | Diff
add port v0.11.1 (2.11 KB, patch)
2025-05-25 15:01 UTC, charlesrocket
no flags Details | Diff
add port v0.11.2 (2.91 KB, patch)
2025-07-03 18:57 UTC, charlesrocket
no flags Details | Diff
add port v0.11.2 (3.85 KB, patch)
2025-07-06 15:27 UTC, charlesrocket
no flags Details | Diff
add port v0.11.2 (3.80 KB, patch)
2025-07-07 14:16 UTC, charlesrocket
no flags Details | Diff
Patch passing poudriere testport (4.60 KB, patch)
2025-07-08 23:51 UTC, Hiroki Tagato
tagattie: maintainer-approval? (slowdive)
Details | Diff
add port v0.11.3 (3.81 KB, patch)
2025-07-09 01:51 UTC, charlesrocket
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description charlesrocket 2025-05-19 01:36:44 UTC
Created attachment 260528 [details]
port v0.11.0

Demo https://defcon.social/@charlesrocket/113915474617572176
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2025-05-19 07:21:44 UTC
${WITH_DEBUG:D:U-Doptimize=ReleaseFast} can probably be written as ${WITH_DEBUG:U-Doptimize=ReleaseFast}.

Then, I don't quite get why you set NO_INSTALL and define a post-install target, you could simply have a do-install target.

You don't need to wrap all your scripts in (), for example, this is enough:

do-test:
	@cd ${WRKSRC} && ${TEST_ENV} zig build test ${CONFIGURE_ARGS}
Comment 2 charlesrocket 2025-05-19 09:49:34 UTC
(In reply to Mathieu Arnold from comment #1)
Thanks! I was getting a makefile error, but switching to the do-install target resolved it.
Comment 3 charlesrocket 2025-05-19 09:52:21 UTC
Created attachment 260539 [details]
port v0.11.0

Fix installation/style
Comment 4 charlesrocket 2025-05-19 09:57:04 UTC
Created attachment 260540 [details]
port v0.11.0

Fix debug flag
Comment 5 charlesrocket 2025-05-20 14:55:20 UTC
Created attachment 260581 [details]
add port v0.11.0

Switched to `BUILD_ARGS`
All checks are green
Comment 6 charlesrocket 2025-05-25 15:01:53 UTC
Created attachment 260706 [details]
add port v0.11.1

* Bump zig to v0.14
* Strip the binary
Comment 7 charlesrocket 2025-07-03 18:57:02 UTC
Created attachment 261856 [details]
add port v0.11.2

* bump to 0.11.2
* add distfiles
Comment 8 Hiroki Tagato freebsd_committer freebsd_triage 2025-07-04 21:07:30 UTC
Thanks for a new port submission.

Here are some comments:
- Put ${SETENV} before ${MAKE_ENV} and ${TEST_ENV}
- make check-plist fails with the following error:

====> Running Q/A tests (stage-qa)
Warning: 'bin/cova_generator_xtxf' is not stripped consider trying INSTALL_TARGET=install-strip or using ${STRIP_CMD}
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: bin/cova_generator_xtxf
Error: Orphaned: bin/meta/arg_templates/xtxf-template.json
Error: Orphaned: bin/meta/arg_templates/xtxf-template.kdl
Error: Orphaned: bin/meta/help_docs/manpages/xtxf-version.1
Error: Orphaned: bin/meta/help_docs/manpages/xtxf.1
Error: Orphaned: bin/meta/help_docs/markdown/xtxf-version.md
Error: Orphaned: bin/meta/help_docs/markdown/xtxf.md
Error: Orphaned: bin/meta/tab_completions/_xtxf-completion.zsh
Error: Orphaned: bin/meta/tab_completions/xtxf-completion.bash
Error: Orphaned: bin/meta/tab_completions/xtxf-completion.ps1
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

Stop.

It appears some extra files are generated in addition to manpages. So you may have to remove those extras.

- It would be a good idea to install shell completion files generated.
Comment 9 charlesrocket 2025-07-06 15:25:06 UTC
(In reply to Hiroki Tagato from comment #8)

thanks! patching
Comment 10 charlesrocket 2025-07-06 15:27:23 UTC
Created attachment 261927 [details]
add port v0.11.2

* completions
* cleanup
Comment 11 Hiroki Tagato freebsd_committer freebsd_triage 2025-07-07 05:39:35 UTC
(In reply to charlesrocket from comment #10)

`make check-plist` still fails with the same error.

My observation is that:
- cova_generator_xtxf generates "meta" directory under the current working directory
- executing cova_generator_xtxf under ${STAGEDIR}${PREFIX}/bin does not play nice with the ports framework because "meta" directory must be deleted before check-plist phase

So I would suggest executing cova_generator_xtxf from ${WRKSRC}. Post-build stage will look something like:
post-build:
        cd ${WRKSRC} && ${STAGEDIR}${PREFIX}/bin/cova_generator_xtxf

By doing that, "meta" directory will be generated under ${WRKSRC} and we will not be bothered by removing "meta" directory.

Additional comments:
- I would suggest adding LICENSE_FILE since the source archive contains a license file
- There is a typo in post-install-BASH-on (s at the end of the line)
  ${MKDIR} ${STAGEDIR}${PREFIX}/share/bash-completion/completion
  -> ${MKDIR} ${STAGEDIR}${PREFIX}/share/bash-completion/completions
Comment 12 charlesrocket 2025-07-07 14:15:07 UTC
(In reply to Hiroki Tagato from comment #11)
Seems like I fixed it:

```
make check-plist
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
===> No pkg-plist issues found (check-plist)
```
Comment 13 charlesrocket 2025-07-07 14:16:59 UTC
Created attachment 261940 [details]
add port v0.11.2
Comment 14 Hiroki Tagato freebsd_committer freebsd_triage 2025-07-08 04:44:31 UTC
As a final confirmation, I tried to build the port using poudriere to make it sure that the port succesfully builds on the package builders.

I got the following error indicating the build process tried to access network during the build phase:

=======================<phase: build          >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0
===>  Building for xtxf-0.11.2
/wrkdirs/usr/ports/games/xtxf/work/xtxf-0.11.2/build.zig.zon:8:20: error: unable to connect to server: CertificateBundleLoadFailure
            .url = "https://github.com/termbox/termbox2/archive/9c9281a9a4c971a2be57f8645e828ec99fd555e8.zip",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/games/xtxf/work/xtxf-0.11.2/build.zig.zon:12:20: error: unable to connect to server: CertificateBundleLoadFailure
            .url = "https://github.com/00JCIV00/cova/archive/4c56696fba4505a739c15223fc52985832051351.zip",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/games/xtxf/work/xtxf-0.11.2/build.zig.zon:16:20: error: unable to connect to server: CertificateBundleLoadFailure
            .url = "https://github.com/charlesrocket/ghext/archive/refs/tags/0.7.2.tar.gz",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** Error code 1

Stop.

Network access is only allowed in the fetch phase so you have to fetch all the necessary sources in that phase.

Can you address the error and revise the patch?
Comment 15 charlesrocket 2025-07-08 18:22:06 UTC
(In reply to Hiroki Tagato from comment #14)
Hmm, I thought I did, via GH_TUPLE. Checked the tree, and all other ports with Zig do the same, not sure whats going on.
Comment 16 Hiroki Tagato freebsd_committer freebsd_triage 2025-07-08 23:51:13 UTC
Created attachment 261985 [details]
Patch passing poudriere testport

(In reply to charlesrocket from comment #15)

I dug a bit into this issue and managed to make it pass `poudriere testport`.

The problem it seems was:
- one of the GH_TUPLE entries was corrupted (needs additional three letters at the end)
  00JCIV00:cova:4c56696:cova/../.cache/zig/p/cova-0.10.1-AAAAAPqeBAAThnQ-eGLXG9tyPsBRehaw8ySs8nEPw
  -> 00JCIV00:cova:4c56696:cova/../.cache/zig/p/cova-0.10.1-AAAAAPqeBAAThnQ-eGLXG9tyPsBRehaw8ySs8nEPwMUy
- hashes in build.zig.zon seems wrong (maybe they are for older versions of zig?)
  patching build.zig.zon solved the network access issue in the build phase

Can you review the patch and check if it's OK? If so, I will commit this version.
Comment 17 charlesrocket 2025-07-09 00:56:10 UTC
(In reply to Hiroki Tagato from comment #16)
That is weird, it was pulling all three deps for some reason, despite only one being invalid (I guess its due to different compiler). Let me try to fix it, feels like patching is not necessary here if I can resolve this in the upstream. Thank you! I was pretty sure its the makefile.
Comment 18 charlesrocket 2025-07-09 01:51:31 UTC
Created attachment 261989 [details]
add port v0.11.3

* fixed offline build
Comment 19 commit-hook freebsd_committer freebsd_triage 2025-07-09 07:01:16 UTC
A commit in branch main references this bug:

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

commit f166c8bb1ffa5cac48850520cb09668f0d079a1d
Author:     charlesrocket <slowdive@me.com>
AuthorDate: 2025-07-09 01:49:54 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-07-09 06:58:09 +0000

    games/xtxf: add port: Terminal-based screensaver

    The Matrix screensaver for your terminal. Light and
    efficient without heavy CPU usage.

    WWW: https://github.com/charlesrocket/xtxf

    PR:             286919
    Reported by:    charlesrocket <slowdive@me.com> (new maintainer)
    Reviewed by:    mat

 games/Makefile             |  1 +
 games/xtxf/Makefile (new)  | 65 ++++++++++++++++++++++++++++++++++++++++++++++
 games/xtxf/distinfo (new)  |  9 +++++++
 games/xtxf/pkg-descr (new) |  2 ++
 4 files changed, 77 insertions(+)
Comment 20 Hiroki Tagato freebsd_committer freebsd_triage 2025-07-09 07:02:18 UTC
Committed, thanks!
Comment 21 Jan Beich freebsd_committer freebsd_triage 2025-09-04 12:53:35 UTC
(In reply to Mathieu Arnold from comment #1)
> ${WITH_DEBUG:D:U-Doptimize=ReleaseFast} can probably be written as ${WITH_DEBUG:U-Doptimize=ReleaseFast}.

Likely copied from one of my ports. If WITH_DEBUG is set its value should be ignored but your suggestion breaks that. Fortunately, "zig build" ignores unknown arguments thus it works by accident.

$ make -V BUILD_ARGS WITH_DEBUG=true
--prefix /usr/local true   -Dcpu=baseline --verbose

Note, ${VAR:D:Unewval} idiom is documented in make(1) manpage.