Bug 290584 - Mk/Uses/meson.mk: Add MESON_{TRUE,FALSE,YES,NO,ENABLED,DISABLED} support
Summary: Mk/Uses/meson.mk: Add MESON_{TRUE,FALSE,YES,NO,ENABLED,DISABLED} support
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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks: 289276
  Show dependency treegraph
 
Reported: 2025-10-27 19:39 UTC by Po-Chuan Hsieh
Modified: 2025-11-05 20:18 UTC (History)
4 users (show)

See Also:
vishwin: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-10-27 19:39:08 UTC
Patch is available at https://people.FreeBSD.org/~sunpoet/patch/Mk-Uses-meson.mk.txt

Inspired by CMAKE_{ON,OFF}.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2025-10-27 19:41:10 UTC
Do we really need yes/no?
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-10-27 21:12:27 UTC
It is a quite old patch in my local repo. I'm sure why I added it before.

I could remove it and keep only TRUE/FALSE/ENABLED/DISABLED which I'm sure is used in the ports tree.

Is that OK for you?
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2025-10-28 08:18:25 UTC
(In reply to Po-Chuan Hsieh from comment #2)
> keep only TRUE/FALSE/ENABLED/DISABLED

I personally like this plan. But I'd like to have opinions from more our fellow committers.
Comment 4 Max Brazhnikov freebsd_committer freebsd_triage 2025-10-28 17:08:04 UTC
(In reply to Gleb Popov from comment #3)
ok for me
Comment 5 Charlie Li freebsd_committer freebsd_triage 2025-10-28 17:39:32 UTC
https://mesonbuild.com/Build-options.html

The only boolean values are true and false. The only features states are enabled and disabled (auto is disregarded for ports purposes). YES and NO and any other words not already mentioned do not mean anything to meson so we should not have port/framework variables alluding to them.

So yes only expose TRUE/FALSE/ENABLED/DISABLED.
Comment 6 commit-hook freebsd_committer freebsd_triage 2025-11-05 10:25:43 UTC
A commit in branch main references this bug:

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

commit 5cf2c031f53e3089da39445f6abccf1cb44fc752
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-11-05 10:18:37 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-11-05 10:23:43 +0000

    Mk/Uses/meson.mk: Add MESON_{TRUE,FALSE,ENABLED,DISABLED} support

    PR:             290584
    Approved by:    arrowd, makc, vishwin

 Mk/Uses/meson.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 7 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-11-05 18:39:28 UTC
Committed. Thanks.