Bug 294320 - [NEW PORT] games/suika3: Portable 2D game and visual novel scripting engine
Summary: [NEW PORT] games/suika3: Portable 2D game and visual novel scripting engine
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kenneth Raplee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-08 05:38 UTC by Awe Morris
Modified: 2026-04-09 18:41 UTC (History)
2 users (show)

See Also:


Attachments
Patch (13.05 KB, application/mbox)
2026-04-08 05:38 UTC, Awe Morris
no flags Details
Poudriere log (82.16 KB, text/plain)
2026-04-08 05:39 UTC, Awe Morris
no flags Details
Patch (13.05 KB, patch)
2026-04-08 07:28 UTC, Awe Morris
no flags Details | Diff
Patch (13.21 KB, patch)
2026-04-08 11:29 UTC, Awe Morris
no flags Details | Diff
poudriere log (187.59 KB, text/plain)
2026-04-08 11:30 UTC, Awe Morris
no flags Details
Patch (13.18 KB, patch)
2026-04-08 11:40 UTC, Awe Morris
no flags Details | Diff
Patch (13.19 KB, patch)
2026-04-08 12:26 UTC, Awe Morris
no flags Details | Diff
Patch (15.03 KB, patch)
2026-04-08 22:26 UTC, Awe Morris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Awe Morris 2026-04-08 05:38:38 UTC
Created attachment 269481 [details]
Patch

New port: games/suika3

Suika3 is a 2D game & visual novel scripting engine
with high portability and hybrid JIT/AOT scripting.

The JIT target includes i386, amd64, arm, arm64, powerpc, and riscv.

WWW: https://github.com/awemorris/suika3
Comment 1 Awe Morris 2026-04-08 05:39:48 UTC
Created attachment 269483 [details]
Poudriere log
Comment 2 Benjamin Takacs 2026-04-08 06:32:36 UTC
According to https://github.com/awemorris/suika3/blob/main/docs/mkdocs-en/docs/build.md#freebsd you should use cmake to build, so add cmake to USES and remove GNU_CONFIGURE= yes . That will also automatically switch to the right CMAKE_BUILD_TYPE depending on WITH_DEBUG being used and makes sure other flags are correctly passed to cmake and automatically uses the install/strip target when the binaries should get stripped, so that post-install should be unneeded after that too.

The primary URL seems to be https://suika3.vn/ so add that as first entry in WWW

GH_TAGNAME defaults to DISTVERSION so you don't need to duplicate it, same with GH_PROJECT defaulting to PORTNAME.

There are some dependencies bundled in external, can those be converted to individual ports?
Comment 3 Awe Morris 2026-04-08 07:28:41 UTC
Created attachment 269485 [details]
Patch

Add the main site to WWW. Removed GH_PROJECT and GH_TAGNAME.
Comment 4 Awe Morris 2026-04-08 07:31:23 UTC
Hi Benjamin, thank you for reviewing.

Regarding the build system (CMake vs. configure):
There is an upstream policy for these two methods:

- CMake: The build instructions you pointed out are intended
  for static builds (including libpng, libvorbis, etc.),
  primarily for standalone distribution.

- configure && make: This method is specifically designed
  for packaging systems like FreeBSD Ports. It correctly
  links against shared libraries and preserves debug
  information, which is consistent with other packaging
  standards like Debian.

Regarding the sub-projects in external/:

- These are not external dependencies in the traditional sense.
- This repository serves as the UPSTREAM for these components.
- While separate repositories exist for these sub-projects,
  they are maintained and developed primarily within the Suika3
  codebase.
- Improvements and fixes are periodically backported from here
  to the standalone repositories, rather than the other way
  around.
- Therefore, bundling them is the most appropriate way to ensure
  architectural integrity and build stability.

I have also updated the Makefile to fix WWW, GH_PROJECT, and GH_TAGNAME as you suggested.

Please check and review again.

Best regards,
Comment 5 Benjamin Takacs 2026-04-08 08:34:48 UTC
(In reply to Awe Morris from comment #4)
That configure script doesn't allow to properly choose the CMAKE_BUILD_TYPE, it just uses Release, while Debug should be used when WITH_DEBUG is set or RelWithDebInfo when WITH_DEBUGINFO is set. It doesn't pass LDFLAGS and CXXFLAGS to cmake too. In the ports tree USES=cmake ensures that cmake properly gets passed what it should get, additionally ninja should be used as generator, except in the cases it doesn't work.

The only things that configure script does is detecting JIT support (which seems to be there on all architectures FreeBSD supports as far as I can see), setting SUIKA_ENABLE_DIST and setting the dirs for SUIKA_DIR_DOCS and SUIKA_DIR_GAME, the rest seems to be what is set by default in CMakeLists.txt or would be handled by USES=cmake.
So that should be done by:

CMAKE_ARGS= -DSUIKA_DIR_DOCS="share/doc/suika3" \
 -DSUIKA_DIR_GAME="share/examples/suika3"
CMAKE_ON= PLAYFIELD_ENABLE_JIT SUIKA_ENABLE_DIST

Or maybe even make JIT optional via

OPTIONS_DEFINE= JIT
OPTIONS_DEFAULT= JIT
JIT_DESC=		Enable just-in-time compiler
JIT_CMAKE_ON= PLAYFIELD_ENABLE_JIT

[0]: https://docs.freebsd.org/en/books/porters-handbook/uses/#uses-cmake
[1]: https://docs.freebsd.org/en/books/porters-handbook/special/#using-cmake
[2]: https://docs.freebsd.org/en/books/porters-handbook/makefiles/#makefile-options
[3]: ports/Mk/Uses/cmake.mk
Comment 6 Benjamin Takacs 2026-04-08 08:40:32 UTC
(In reply to Awe Morris from comment #3)
Seems like you reuploded the original patch by accident instead of the new patch

(In reply to Awe Morris from comment #4)
As this is the upstream location for those libs, could they made into shared libs, so that other ports can depend on them and when subpackages land eventually they can get their own packages.
Comment 7 Awe Morris 2026-04-08 11:29:26 UTC
Created attachment 269495 [details]
Patch
Comment 8 Awe Morris 2026-04-08 11:30:44 UTC
Created attachment 269496 [details]
poudriere log
Comment 9 Awe Morris 2026-04-08 11:40:59 UTC
Created attachment 269497 [details]
Patch
Comment 10 Awe Morris 2026-04-08 11:41:21 UTC
(In reply to Benjamin Takacs from comment #5)
I've updated the port to use CMake, as you noticed.
In addition, I replaced a font file with a symlink.

(In reply to Benjamin Takacs from comment #6)
For now, I believe it is better to keep the external libraries statically linked.

The external projects are the following:

* NoctLang: the scripting language. In this games/suika3 port,
  NoctLang needs to be built with certain options disabled for
  security reasons, namely `NOCTLANG_API_SYSTEM` and
  `NOCTLANG_API_CONSOLE`.

* StratoHAL: the graphics and audio HAL. Since this library is
  not maintained as a separately hosted standalone project,
  I think it is reasonable to keep it statically linked in the
  games/suika3 port.

* Playfield Engine: the base r2D engine. In this games/suika3 port,
  Playfield Engine is built with a specific option,
  `PLAYFIELD_ENABLE_INITHOOK`, so that suika3 can hook into the engine
  initialization from its C code. Given that integration,
  I think it is also reasonable to keep it statically linked.

Please review and give me advice.

Best regards,
Comment 11 Benjamin Takacs 2026-04-08 12:13:15 UTC
(In reply to Awe Morris from comment #10)
It looks fine to me now, thanks for your contribution.

As these libs currently aren't used by anything else, it should be fine. If and when additional ports want to use them, we can find some solution that avoids duplicating the updating and fixing work.

You can think about changing some of the cmake booleans into options, but that would increase your work (as each combination of options can potentially have problems) and can happen after this port got added to the tree.
Comment 12 Awe Morris 2026-04-08 12:26:06 UTC
Created attachment 269499 [details]
Patch
Comment 13 Awe Morris 2026-04-08 12:30:20 UTC
(In reply to Benjamin Takacs from comment #11)
Thank you for the review, Benjamin.

I've updated the patch to use LOCALBASE.

I wanted to make JIT an option, but I couldn't get it to work locally.
I'd like to revisit this once I've gained more experience with ports.

Thank you again for your help.
Comment 14 Awe Morris 2026-04-08 22:26:33 UTC
Created attachment 269520 [details]
Patch
Comment 15 Awe Morris 2026-04-08 22:28:05 UTC
I've updated the patch to address kenrap's review comments on Discord.
Comment 16 commit-hook freebsd_committer freebsd_triage 2026-04-09 18:26:10 UTC
A commit in branch main references this bug:

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

commit f188994f5b67a03b3afe1448610de8a514737792
Author:     Awe Morris <awe@noctvm.io>
AuthorDate: 2026-04-08 13:55:12 +0000
Commit:     Kenneth Raplee <kenrap@FreeBSD.org>
CommitDate: 2026-04-09 18:23:56 +0000

    games/suika3: New port: Portable 2D and visual novel engine

    PR:             294320
    Reviewed by:    makc (mentor)
    Approved by:    arrowd (co-mentor)

 games/Makefile               |  1 +
 games/suika3/Makefile (new)  | 56 ++++++++++++++++++++++++++++++++++++++++++++
 games/suika3/distinfo (new)  |  3 +++
 games/suika3/pkg-descr (new) |  6 +++++
 games/suika3/pkg-plist (new) |  8 +++++++
 5 files changed, 74 insertions(+)
Comment 17 Kenneth Raplee freebsd_committer freebsd_triage 2026-04-09 18:41:57 UTC
Thanks for your submission! :)