On Tue, 3 Jul 2007, Marc Espie wrote:

I'll admit that the current situation might be a bit confusing, I should
probably get around to rewrite ports(7) at some point.

The current situation is as follows:

         +--> package
one port -|--> package
         +--> package
                 ...

Some targets do everything, others don't. Mostly for historical reasons.
- everything related to the build has no ambiguity, obviously
(e.g., fetch, extract, patch, configure, build, fake)
- make package  builds all packages. Because, in a BULK build context,
it's followed by a clean, and so it would be annoying to re-build the port
for the other packages. If you just want one specific subpackage, you can
run make subpackage, but that's not too common.
- make install will only install one single package, for historical reasons.
If you want to install all packages from a port, you need to run
make install-all. This is not always possible. For instance, fvwm2 builds
conflicting subpackages.
- make update will update all installed packages from a given port... because
it's more useful that way, there is little history behind it (update hasn't
existed for all that long), and also because there is no possible problem in
there. You can use subupdate if you want to update one specific packages.

The package tools themselves mostly do not see anything of the ports tree.
To the package tools, each package is created equal. Packages mostly have
names (with some logic, see packages-specs) and @pkgpath annotations. There
is some magic behind it that establishes some equivalence and canonical form
for pkgpaths, for historical reasons. But mostly, when you install something
with dependencies, it cares only about finding the packages... if it needs
to build them, it will build all packages from a port, obviously, to avoid
wasting time.

Yeah, I know, it's a bit complicated... it's designed so that, in most cases,
it does just the right thing... ;-)

I think every package management framework is a bit confusing at some point, mostly because it has to deal with too much variables, cases, exceptions, etc. and OpenBSD ports is no different.

And I am still a bit confused, mostly because audio/bmp/Makefile than because ports itself. Does this file looks correct?

(...)

.if !${FLAVOR:L:Mno_mp3}
MULTI_PACKAGES+=-mp3
.endif
.if !${FLAVOR:L:Mno_vorbis}
MULTI_PACKAGES+=-vorbis
.endif

.if !${MULTI_PACKAGES:M-mp3}
CONFIGURE_ARGS+=--disable-mp3
.endif
.if !${MULTI_PACKAGES:M-vorbis}
CONFIGURE_ARGS+=--disable-vorbis
.endif

(...)

If FLAVOR is specified at some point, it should modify some arguments of the build, not the subpackages itself. And vice-versa with SUBPACKAGE. Or am I completely missing the point?

Thank you.

Reply via email to