Tuesday, July 30, 2024

Re: [Maintainer update] Add FLAVOR to emulator/minivmac

On 2024/07/30 10:48:58 -0400, Jag Talon <jag@aangat.lahat.computer> wrote:
> Thanks for the help! If I'm understanding correctly, I should still use
> FLAVORS instead of MULTI_PACKAGES but do it in a way so that the
> flavors don't conflict with one another?

Yes, it's right. There are some examples already in the port tree, what
comes to my mind are devel/luarocks and lang/fennel, but these are far
from being the only ones. (lang/fennel is slightly more complex due to
how -docs is handled.)

Actually the plist seems fine, so you have most of the work done I
believe.

> Attached is my attempt to do that, but when running `make install` it
> seems to install minivmac-36.04 but with the binary for minivmac-ii-
> 36.04.

This due to how make evals the variables. You have

: # Macintosh Plus
: MODEL = -m Plus
:
: # Macintosh II
: .if ${FLAVOR:Mii}
: MODEL = -m II
: SUFFIX = -ii
: .endif

so MODEL will always be '-m II'. you have to restructure this into
something like

.if "${FLAVOR}" = ""
MODEL = -m Pus
.elif ${FLAVOR:Mii}
MODEL = -m II
SUFFIX = -ii
.else
ERRORS += unsupported flavor ${FLAVOR}
.endif

or use ?=, as in

MODEL ?= -m Plus
.if ...
MODEL = -m II
.endif

No comments:

Post a Comment