On 29/9/2025 17:54, Karl-Michael Schindler wrote:
Hallo
I want to create a Portfile for a series of Freepascal cross compilers for
embedded avr. But this needs to take into account a list of subarchs, which
conflict with each other and only one can be installed at a time. So the
installation of one should cause the uninstallation of an installed one. This
is a snippet with the essential parts:
foreach subarch {25 35 4 5 51 6} {
subport “fpc-cross-avr${subarch}-embedded" {
revision 0
build.target rtl
destroot.target rtl_install
description FPC cross-compiler for avr${subarch}
set full_target "CPU_TARGET=avr OS_TARGET=embedded
SUBARCH=avr${subarch}"
build.args PP=ppcavr BINUTILSPREFIX=avr- ${full_target}
destroot.args ${full_target} CROSSINSTALL=1
INSTALL_PREFIX=${destroot}${prefix}
}
}
How could I achieve that the subports conflict each other and also replace each
other when installing with nothing more than a warning.
This would normally be achieved with variants rather than subports.
There's no supported way for installing one port to deactivate another
without permanently replacing it. You would have to resort to hacks like
deactivating the other ports in each port's pre-activate.
- Josh