Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Feb 2024 10:05:07 +0300
From:      Gleb Popov <arrowd@freebsd.org>
To:        Alastair Hogge <agh@riseup.net>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: emulators/mame: Increasing option granularity woes
Message-ID:  <CALH631=4UCndd8NZo4Zzxop8MBCBLHTU_i1RUezxTBH0P5VaNQ@mail.gmail.com>
In-Reply-To: <0f7f4f5675d1e75e504ad67d963e8874@riseup.net>
References:  <0f7f4f5675d1e75e504ad67d963e8874@riseup.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 23, 2024 at 5:51=E2=80=AFAM Alastair Hogge <agh@riseup.net> wro=
te:
>
> Hello,
>
> The current in-tree port of mame, 0.261, is built around the core
> multi-emulation framework, which results in the usual mega monolithic
> mame binary. There are options for TOOLS, which include two other
> emulators. The current upstream release, 0.262 has enabled separation of
> mame from the rest of the project=E2=80=94TOOLS can now be built separate=
ly. I
> would like to reflect this in the Port, however, that means moving the
> two added emulators (LaserDisk player, and Netlist resolver) out of
> TOOLS (which I think the correct path to take). Considering the new
> upstream build pattern, I would like to configure the Port to option any
> of the emulators, and existing TOOLS. The problem I am facing, the three
> emulators require the same (or close to it) runtime config/resources,
> the assets are currently covered by the do-install target[1], how do I
> cover the assets in the Port, specifically in the pkg-plist to be
> conditioned on either of 3 potential emulator options? Should I add an
> option MAMEDATA?

You're almost right. Indeed there is no need in the user-visible
option, but you want all other machinery to kick in.
Basically, it boils down to

.if somecond
PLIST_SUB+=3D    MAMEDATA=3D
.else
PLIST_SUB+=3D    MAMEDATA=3D"@comment "
.endif

where "somecond" defines if the files should be present in the
package. For OPTIONS (and when OPTIONS_SUB=3Dyes is present [1]) it
happens automatically.

If you end up with "somecond" being in form "${PORT_OPTIONS:MFOO} ||
${PORT_OPTIONS:MBAR}" then you could simplify it even more

FOO_PLIST_SUB=3D MAMEDATA=3D
FOO_PLIST_SUB_OFF=3D MAMEDATA=3D"@comment "
BAR_PLIST_SUB=3D MAMEDATA=3D
BAR_PLIST_SUB_OFF=3D MAMEDATA=3D"@comment "


[1] https://docs.freebsd.org/en/books/porters-handbook/makefiles/#options_s=
ub



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALH631=4UCndd8NZo4Zzxop8MBCBLHTU_i1RUezxTBH0P5VaNQ>