Bug 267373 - [NEW PORT] games/solver Math quiz game using SDL2
Summary: [NEW PORT] games/solver Math quiz game using SDL2
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: Jason W. Bacon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-26 19:02 UTC by modex
Modified: 2022-11-23 13:51 UTC (History)
2 users (show)

See Also:


Attachments
port files for solver (5.31 KB, application/x-shellscript)
2022-10-26 19:02 UTC, modex
no flags Details
port files for solver (5.16 KB, application/x-shellscript)
2022-11-17 15:09 UTC, modex
no flags Details
files for solver (5.12 KB, application/x-shellscript)
2022-11-20 03:43 UTC, modex
no flags Details
lastest share file (5.40 KB, application/x-shellscript)
2022-11-21 18:53 UTC, modex
no flags Details
latest share file (5.40 KB, application/x-shellscript)
2022-11-23 12:48 UTC, modex
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description modex 2022-10-26 19:02:14 UTC
Created attachment 237663 [details]
port files for solver

Hello!

I am submitting a new port: [NEW PORT] games/solver Math quiz game using SDL2
The shar file is attached.
Comment 1 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-17 14:15:33 UTC
Good morning,

The port still needs a little work.  You can start by running "portlint -A" from the solver directory and try to silence the errors and warnings it produces.

Then add DEVELOPER=yes to your /etc/make.conf, so you will see stage-qa messages when installing.

These two tools will catch most of the potential problems, but not all.

Thanks for getting involved in ports!
Comment 2 modex 2022-11-17 15:09:47 UTC
Created attachment 238140 [details]
port files for solver
Comment 3 modex 2022-11-17 15:11:03 UTC
(In reply to Jason W. Bacon from comment #1)

Hello,

I have run the portlint -a command. I believe the warnings and 1 fatal error have been fixed.
Comment 4 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-19 13:22:00 UTC
WARN: /usr/ports/wip/solver/pkg-descr: the URL of the project website has been moved into the Makefile.  Remove the WWW: line from this file and add "WWW=https://github.com/modexsoft/solver"to the Makefile immediately below the COMMENT line.
WARN: Makefile: "WWW" has to appear earlier.
0 fatal errors and 2 warnings found.

===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%DATADIR%%/block_limit.png
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped in /usr/ports/wip/solver
Comment 5 modex 2022-11-20 03:43:00 UTC
Created attachment 238187 [details]
files for solver

updates makefile for the www error.
also removed the the file block_limit.png from the git repo.
Comment 6 modex 2022-11-20 03:44:56 UTC
(In reply to Jason W. Bacon from comment #4)

The new shar has been updated.

The png was a test file that was still in the github repo. It has been removed.
The makefile and pkg-descr files have been updated for the www change.
Comment 7 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-20 13:35:22 UTC
It builds cleanly now.

pkg-descr should have a better description, at least a few sentences.

On that note, the README on Github is empty and should have a complete description of the game's purpose and how to play it.  I'm not seeing any way for users to find out what this program does.

Adding a Makefile to the git repo that respects CC, CFLAGS, PREFIX, DESTDIR , and INSTALL (maybe a few other standard vars) would eliminate the need for do-build and do-install in the port.

I tried running "solver" on a laptop and it just seemed to hang, taking up 100% CPU.
Comment 8 modex 2022-11-21 18:53:50 UTC
Created attachment 238225 [details]
lastest share file

Add description to the pkg-descr file.
Add info to the Readme in github.
Introduced some basic cap functionality so the CPU will not run at 100%.
Comment 9 modex 2022-11-21 18:59:34 UTC
(In reply to Jason W. Bacon from comment #7)


Thank you for all these tips and assistance. I have submitted a new shar. The only thing I had not done was the makefile in the git. I found a few example ports that do this and wanted to look them over before I do this for version 1.0 possibly. I also introduced some functionality to limit the CPU running at 100%. I completely went through the entire process on the oldest machine I had (a laptop from 2013) and a fresh hard drive using using FreeBSD 12.3. Please let me know if you have any other suggestions.
Comment 10 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-21 19:09:19 UTC
For an example of a simple, port-friendly Makefile:

https://github.com/auerlab/vcf-split

The ports system (and pkgsrc) automatically provide all the information needed by this project Makefile (CC, CFLAGS, etc).  The only thing we might need to do from the port is run "make depend", if you use that feature in your Makefile.  Otherwise, the port Makefile will be trivial.

https://github.com/outpaddling/freebsd-ports-wip/blob/master/vcf-split
Comment 11 modex 2022-11-21 19:58:05 UTC
(In reply to Jason W. Bacon from comment #10)

Thank you for this example. I will look it over. Is there anything else I need do for solver at this point?
Comment 12 Daniel Engberg freebsd_committer freebsd_triage 2022-11-21 20:38:18 UTC
Worth noting that you might want to look into either CMake or Meson because it greatly reduces the effort of detecting libraries and can be easier to integrate into various "build frameworks".
Comment 13 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-21 21:30:49 UTC
Locating libraries and other dependencies (and ensuring that they are installed)  is the job of a package manager like FreeBSD ports, not the upstream build system.  I explicitly avoid GNU configure, cmake, or anything else of that nature because I don't want to encourage people to do ad-hoc "caveman" builds that might grab the wrong version of a dependency unexpectedly.  My project Makefiles are designed to look where the user or package manager tells them to look and nowhere else.
Comment 14 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-22 23:58:54 UTC
The poudriere tests finally finished, and I ran a basic build test on aarch64.  Everything is building cleanly now.

The only potential issue I still see is the name.  Would you consider renaming the project to something more descriptive?  "Solver" doesn't really provide any clues about what the program does.  A name that makes it obvious that this is a teaching tool for basic math would be nice, as would something that sounds fun.  Changing the name of a port is problematic, so it would be better to address this before adding it to the tree.
Comment 15 modex 2022-11-23 12:48:35 UTC
Created attachment 238279 [details]
latest share file

Updated the github readme and github description.
Comment 16 modex 2022-11-23 12:49:41 UTC
(In reply to Jason W. Bacon from comment #14)

I added a subtitle to the Readme file in the github. I also added a description to the github. Everything else I would like to keep the same. I uploaded a new shar as well since the distinfo timestamp and such would have changed as well.
Comment 17 commit-hook freebsd_committer freebsd_triage 2022-11-23 13:50:08 UTC
A commit in branch main references this bug:

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

commit 35dc7ffe64b4fb05423d7bccff4b7aad032e164e
Author:     Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2022-11-23 13:46:28 +0000
Commit:     Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2022-11-23 13:49:16 +0000

    games/solver: Math training game using C and SDL2

    Solver is a math training game. The goal of the game is to improve the
    user's confidence in using four basic math operations: addition,
    subtraction, multiplication and division. The user can set various
    options to create a custom game experience. These options include
    setting the time limit and the goal for correct/incorrect answers.
    This program uses C and SDL2.

    PR:             267373
    Reported by:    modex@danwin1210.de

 games/Makefile               |   1 +
 games/solver/Makefile (new)  |  26 ++++++++
 games/solver/distinfo (new)  |   3 +
 games/solver/pkg-descr (new) |   6 ++
 games/solver/pkg-plist (new) | 152 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 188 insertions(+)
Comment 18 Jason W. Bacon freebsd_committer freebsd_triage 2022-11-23 13:51:06 UTC
Thanks!