Re: src.conf(5) to specify multiple flavours of a port

2023-08-22 Thread Enji Cooper

> On Aug 21, 2023, at 9:34 PM, Warner Losh  wrote:
> 
> On Mon, Aug 21, 2023, 10:24 PM Graham Perrin  > wrote:
>> In a thread elsewhere, as an example that did not involve src.conf, Mark 
>> Johnston wrote:
>> 
>>> $ cd /usr/ports/graphics/gpu-firmware-intel-kmod
>>> $ sudo make reinstall FLAVOR=kabylake
>> How might I use /etc/src.conf to achieve much the same, with a different 
>> port?
>> 
> 
> 
> 
> I thought stuff like this went in ports.conf…

ports.conf?

ports-mgmt/portconf/files/portconf.sh.in:_conf=%%PREFIX%%/etc/ports.conf
ports-mgmt/portconf/files/pkg-message.in:%%PREFIX%%/etc/ports.conf 
configuration file

Huh… TIL.
-Enji


signature.asc
Description: Message signed with OpenPGP


Re: src.conf(5) to specify multiple flavours of a port

2023-08-22 Thread Enji Cooper

> On Aug 21, 2023, at 10:01 PM, Bakul Shah  wrote:
> 
> On Aug 21, 2023, at 9:24 PM, Graham Perrin  wrote:
>> 
>> In a thread elsewhere, as an example that did not involve src.conf, Mark 
>> Johnston wrote:
>> 
>>> $ cd /usr/ports/graphics/gpu-firmware-intel-kmod
>>> $ sudo make reinstall FLAVOR=kabylake
>> 
>> How might I use /etc/src.conf to achieve much the same, with a different 
>> port?
> 
> Since /etc/src.conf is included from make, may be you can use some make 
> feature
> for conditional define?

I think there’s some confusion… /etc/make.conf is always included by bmake; 
/etc/src.conf is only included when building the base system.
FreeBSD ports doesn’t have a special systemwide config file like the base 
system for toggling build/install behavior, but it does have 
"${PORTSDIR}/Mk/bsd.local.mk” .
-Enji

$ grep -r /etc/src.conf share/mk/
share/mk/src.opts.mk:# Users define WITH_FOO and WITHOUT_FOO on the command 
line or in /etc/src.conf
share/mk/src.opts.mk:# to set via WITH_*/WITHOUT_* in /etc/src.conf and 
override in the
share/mk/bsd.port.mk:# Needed to keep bsd.own.mk from reading in /etc/src.conf
share/mk/bsd.opts.mk:# Users define WITH_FOO and WITHOUT_FOO on the command 
line or in /etc/src.conf
share/mk/bsd.opts.mk:# to set via WITH_*/WITHOUT_* in /etc/src.conf and 
override in the
share/mk/src.sys.mk:SRCCONF?=   /etc/src.conf
share/mk/src.sys.mk:(exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") 
&& \


signature.asc
Description: Message signed with OpenPGP


Re: ports-mgmt/portconf – not src.conf(5) – to specify multiple flavours of a port for buildkernel purposes

2023-08-22 Thread Graham Perrin


On 22/08/2023 06:42, Graham Perrin wrote:


…
% cat /usr/local/etc/ports.conf
graphics/gpu-firmware-radeon-kmod: FLAVORS=btc sumo turks
%


Still, there's guesswork. I have /no/ idea whether the FLAVORS part of 
that last line is valid :-)


Time will tell.

/me tails /var/log/buildkernel.log, rocks with laughter at innumerable 
warnings, cancels,


…
make[4028]: "/usr/ports/Mk/bsd.port.mk" line 5393: warning: duplicate 
script for target "sumo" ignored
make[4028]: "/usr/ports/Mk/Uses/kmod.mk" line 74: warning: using 
previous script for "sumo" defined here
make[4028]: "/usr/ports/Mk/bsd.port.mk" line 5402: warning: duplicate 
script for target 
"/usr/obj/usr/src/amd64.amd64/sys/GENERIC/usr/ports/graphics/gpu-firmware-radeon-kmod/work-"btc" 
ignored
make[4028]: "/usr/ports/Mk/Uses/kmod.mk" line 74: warning: using 
previous script for 
"/usr/obj/usr/src/amd64.amd64/sys/GENERIC/usr/ports/graphics/gpu-firmware-radeon-kmod/work-"btc" 
defined here
make[4028]: "/usr/ports/Mk/bsd.port.mk" line 5402: warning: duplicate 
script for target "sumo" ignored
make[4028]: "/usr/ports/Mk/Uses/kmod.mk" line 74: warning: using 
previous script for "sumo" defined here

env: sumo: No such file or directory
^C
%


, begins a new build that excludes GPU firmware whilst ignoring the 
relevance of 
, intends to 
build the modules with poudriere-devel after the OS is updated, 
rebelliously  begins a paragraph with a comma and makes a whitespace 
error that should be barely visible in the HTML version of this email 
that will not be seen in an archive :-)


ports-mgmt/portconf – not src.conf(5) – to specify multiple flavours of a port for buildkernel purposes

2023-08-21 Thread Graham Perrin

On 22/08/2023 05:34, Warner Losh wrote:


How might I use /etc/src.conf to achieve much the same, with a
different port?



I thought stuff like this went in ports.conf...

…


Warner solves another mystery. Thanks!

Honestly, I was oblivious to the possibility:

% man -P cat 5 ports.conf
No manual entry for ports.conf
% apropos ports.conf
apropos: nothing appropriate
% rg -i -e 'ports\.conf' /usr/doc/website/content/en
% rg -i -e 'ports\.conf' /usr/doc/documentation/content/en
%

– and so on. As far as I can tell, it's not documented in the usual places.

Eventually, Google helped to remind me of a 2021 comment 
, 
where part of the previous person's comment had never sunk in. I wrote:



(I never used ports-mgmt/portconf, and so on.)



So:


% gh repo sync grahamperrin/freebsd-ports && git -C /usr/ports pull 
--ff-only --quiet && git -C /usr/ports pull --ff-only freebsd main

✓Synced the "grahamperrin:main" branch from "freebsd:main"
Updating files: 100% (35/35), done.
From https://git.freebsd.org/ports
* branch  main   -> FETCH_HEAD
  15a5c70847f1..355374a1f6be  main   -> freebsd/main
Already up to date.
% sudo pkg install ports-mgmt/portconf
grahamperrin's password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.pkg: 100%    2 KiB   2.2kB/s    00:01
The provides database is up-to-date.
Processing entries: 100%
poudriere repository update completed. 7 packages processed.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
   portconf: 1.6_1 [FreeBSD]

Number of packages to be installed: 1

2 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching portconf-1.6_1.pkg: 100%    2 KiB   2.3kB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Installing portconf-1.6_1...
[1/1] Extracting portconf-1.6_1: 100%
Spamming /etc/make.conf... Done.
=
Message from portconf-1.6_1:

--
To set port-specific make variables, create the
/usr/local/etc/ports.conf configuration file
with the following syntax:


# this is a comment
*: NOPORTDOCS
editors/openoffice-3: WITH_CCACHE|LOCALIZED_LANG=it
print/ghostscript-* print/lpr-wrapper: A4
sysutils/fusefs-kmod*: !KERNCONF | !NOPORTDOCS
www/firefox-i18n: WITHOUT_SWITCHER | FIREFOX_I18N=fr it
x11/fakeport: CONFIGURE_ARGS=--with-modules="aaa bbb ccc"


Global port directory patterns and blanks around the
pipe "|" symbol are allowed.
Values shouldn't be quoted even if they contain spaces.
Lines beginning with a '#' are comments.
% apropos ports.conf
apropos: nothing appropriate
% rg --count -e 'ports\.conf' /usr/ports
/usr/ports/net-mgmt/ocsinventory-ocsreports/files/pkg-message.in:1
/usr/ports/ports-mgmt/portconf/files/pkg-message.in:1
/usr/ports/ports-mgmt/portconf/files/portconf.sh.in:1
^C
% sudo nano /usr/local/etc/ports.conf
grahamperrin's password:
% cat /usr/local/etc/ports.conf
graphics/gpu-firmware-radeon-kmod: FLAVORS=btc sumo turks
%


Still, there's guesswork. I have /no/ idea whether the FLAVORS part of 
that last line is valid :-)


Time will tell.


Re: src.conf(5) to specify multiple flavours of a port

2023-08-21 Thread Bakul Shah
On Aug 21, 2023, at 9:24 PM, Graham Perrin  wrote:
> 
> In a thread elsewhere, as an example that did not involve src.conf, Mark 
> Johnston wrote: 
> 
>> $ cd /usr/ports/graphics/gpu-firmware-intel-kmod
>> $ sudo make reinstall FLAVOR=kabylake
> 
> How might I use /etc/src.conf to achieve much the same, with a different port?

Since /etc/src.conf is included from make, may be you can use some make feature
for conditional define? 


Re: src.conf(5) to specify multiple flavours of a port

2023-08-21 Thread Warner Losh
On Mon, Aug 21, 2023, 10:24 PM Graham Perrin  wrote:

> In a thread elsewhere, as an example that did *not* involve src.conf,
> Mark Johnston wrote:
>
> $ cd /usr/ports/graphics/gpu-firmware-intel-kmod
> $ sudo make reinstall FLAVOR=kabylake
>
>
> How might I use /etc/src.conf to achieve much the same, with a different
> port?
>


I thought stuff like this went in ports.conf...

Warner

> A recent edition of my file included these four lines, the third of which
> causes an error:
>
> PORTS_MODULES= graphics/drm-510-kmod
> # PORTS_MODULES= graphics/drm-515-kmod
> PORTS_MODULES+= graphics/gpu-firmware-radeon-kmod@btc
> graphics/gpu-firmware-radeon-kmod@sumo
> graphics/gpu-firmware-radeon-kmod@turks
> # PORTS_MODULES+= graphics/gpu-firmware-radeon-kmod
>
> This morning: I use the fourth line, instead.
>
> In future: I'd prefer to be without the build time that's associated with
> so many flavours, when only three are required.
>
> 
> 
>
>
> More than doubly time-consuming, because:
>
> KERNCONF=GENERIC GENERIC-NODEBUG
> # KERNCONF=GENERIC
> # KERNCONF=GENERIC-NODEBUG
>
> NO_INSTALLEXTRAKERNELS=no
>
> TIA
>
>
>


src.conf(5) to specify multiple flavours of a port

2023-08-21 Thread Graham Perrin
In a thread elsewhere, as an example that did /not/ involve src.conf, 
Mark Johnston wrote:



$ cd /usr/ports/graphics/gpu-firmware-intel-kmod
$ sudo make reinstall FLAVOR=kabylake


How might I use /etc/src.conf to achieve much the same, with a different 
port?


A recent edition of my file included these four lines, the third of 
which causes an error:


PORTS_MODULES= graphics/drm-510-kmod
# PORTS_MODULES= graphics/drm-515-kmod
PORTS_MODULES+= graphics/gpu-firmware-radeon-kmod@btc 
graphics/gpu-firmware-radeon-kmod@sumo 
graphics/gpu-firmware-radeon-kmod@turks

# PORTS_MODULES+= graphics/gpu-firmware-radeon-kmod

This morning: I use the fourth line, instead.

In future: I'd prefer to be without the build time that's associated 
with so many flavours, when only three are required.





More than doubly time-consuming, because:

KERNCONF=GENERIC GENERIC-NODEBUG
# KERNCONF=GENERIC
# KERNCONF=GENERIC-NODEBUG

NO_INSTALLEXTRAKERNELS=no

TIA