Fink CVS HEAD now contains full variant support. It works for me, but
I would love for some folks to try some test cases and let me know if
things aren't working (as you expect, according to the docs, or at
all:). I'm of course open to suggestions for improvement or if
situations arise where other features are needed (but let's try not to
get bogged down in syntax:)

Packaging indexing speed has taken a bit of a hit, and I'm working on
fixing that. Validator needs some work, and I have no idea what .info
filename format to recommend (since Package will now contain shell
metacharacters). Anyway, here's documentation on syntax and usage.

The key to the whole thing is a list of subtypes in a .info file:

  Type: perl (5.6.0 5.8.1)

This yields two clones of the package description, one with each value
(one would be have "Type: perl 5.6.0" the other "Type: perl 5.8.1").
The type and subtype are each arbitrary strings (matching \S+) but
parens, comma, and percent should not be used. The special subtype
list "(boolean)" is stands for a list containing the type itself and a
period, so the following two forms are identical:

  Type: -x11 (boolean)
  Type: -x11 (-x11 .)

You can have multiple types as a comma-separated list. If there are
subtypes you will get packages for all combinations (subtype list
expansion/package cloning is recursive).

The subtype is available for percent expansion in other fields using
the type_raw[] and type_pkg[] pseudohashes. The _raw form gives the
exact (as written in Type) subtype for a given type, while the _pkg
form has periods removed (as per fink's package naming convention for
language-versioned packages, and for other clever uses).

You must somehow encode each multivariant subtype in Package (since
package names must be unique and always build the same way). Note that
the use of percent expansion in the Package: field is new and severely
incompatible with older versions of fink, so such package descriptions
must be embedded in a Info2: field.

Here are two example .info fragments:

  Info2: <<
  Package: foo-pm%type_pkg[perl]
  Type: perl (5.6.0 5.8.1)
  Depends: perl-core%type_pkg[perl]
  <<

  Info2: <<
  Package: bar%type_pkg[-x11]
  Type: -x11 (boolean)
  Depends: (%type_raw[-x11] = -x11) x11
  CompileScript: <<
    #!/bin/bash -ev
    if ["%type_raw[-x11]" eq "-x11"]; then
      ./configure %c --with-x11
    else
      ./configure %c --without-x11
    fi
    make
  <<
  <<

dan

-- 
Daniel Macks
[EMAIL PROTECTED]
http://www.netspace.org/~dmacks



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to