tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

binary pkg "variants" ? [was: Re: Package split or package options?]



On Wednesday, at 20:56, Fredrik Pettai wrote:
| I noticed the way MacPorts done it and it looks reasonable ok. They name the
| package "variants" as: pkgname @version+option(s). Perhaps pkgsrc could name
| those alternative bin pkgs as: pkgname+option(s)-version ?

I also did that in robotpkg (http://robotpkg.openrobots.org), which is a fork
of pkgsrc (targetting more specific goals and users and packages, hence the
fork).

Binary packages are named according to the following scheme:
 ${PKGBASE}-${PKGVERSION}~${PKG_OPTIONS}.tgz

$PKG_OPTIONS are joined with the "+" char.

This works well (tested on the ~300 pkgs in robotpkg), and required only
_minimal_ changes to pkgtools/pkg_install and can easily be "backported" to
pkgsrc. If people are interested I can give more details.

The hard part is to manage dependencies properly on options (see below).

| OTOH, it would too time-consuming to build all pkgs with all the different
| make-option combinations,

Sure. I also have developed an awk script that is able to expand patterns for
the above naming scheme, and I can define in robotpkg.conf (read: mk.conf) sets
of packages that can be used for bulk builds (or also for bulk installation
from source).

E.g.:
MY_SET = */* would expand to all possible packages with default options
(like current pbulk)
MY_SET = */*~* would expand to all possible packages (untracktable, though).
MY_SET = devel/*~foo (all packages in devel with option "foo" set)
MY_SET = */bar~!foo (all bar packages in any category without option "foo" set)
MY_SET = */bar~foo+* (all bar packages in any category with option "foo" and
all combination of other options)
etc.

This script is also used to expand dependencies with option requirements, e.g.:
DEPENDS+= foo>=1.0~bar or DEPENDS+= foo>=1.0~!bar+x11 etc.

This would probably require more work to integrate in pkgsrc/pbulk.


Home | Main Index | Thread Index | Old Index