tech-pkg archive

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

Re: multi-variant packages and bulk builds



>     The other use of bulk building is for testing purposes, in which
>     case your VARIANTS idea could have merit.  The problem is, if you
>     want to test all building possibilities of a package, you also have
>     to test all subsets of the options list from the options framework.
[...]
>     The point is, if you really want to formalise that part, you'd
>     better go all the way, and I really wish you good luck with that.

After a few minutes after sending my previous email, I realised that
distbb with support for VARIANTS will be able to be used for
generating all binaries for option-enabled packages automatically,
that is without additional changes to distbb itself.

For this to work the following things should be implemented (except
VARIANTS and distbb support for it, of course)

(The following is make-like pseudocode)

1) category/package/Makefile:
   ...
   PKGNAME=general-package-name${OPTIONS_SUFX}-version
   ...

2) somewhere in pkgsrc .mk files
   .if defined(GENERATE_ALL_OPTIONS_PKGS) && defined(PKG_SUPPORTED_OPTIONS)
       VARIANTS+= ...
       # VARIANTS should look like OPTIONS.name1=0,1 OPTIONS.name2=0,1 ...
       # 0 means "feature is disabled", 1 - "enabled"
   .endif

3) .for opt in ${PKG_SUPPORTED_OPTIONS}
      .if ${OPTIONS.${opt}} = 1
          OPTIONS_SUFX += -${f} # string concatenation here, not +=
      .endif
   .endfor

That's all ;-)

That is bulk building for both multi-php/apache/python modules and
packages with multiple options can be implemented through universal
VARIANTS variable.

IIRC jlam@ wanted this functionality a few months ago.
And he was not alone.

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index