tech-pkg archive

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

Re: pkgsrc and robotpkg

On Sunday, at 00:04, David Holland wrote:
| This is surprisingly difficult, IME.

Yup :) But still, I'm happy that users of robotpkg finally seem to have adopted
the concept. Now they tend to make a release at every single commit in their
software, but I guess this is a progress :)

| This is, however, exactly how pkgsrc builtin works --

Actually yes. I am not sure if this changed recently in pkgsrc. I remember that
when I checked this (back in 2006/2007) it was a lot less complete. E.g. I
don't remember than 'builtin' handled the version checks at the time?

I must admit that the syntax slightly frighten me, though :)

| Have you done this for every package, or have you set up an automated
| mechanism for finding builtin packages, and if the latter, how does it
| work?

No, this was/is done for every package.

Everything is controlled by two variables. For instance for a gtk 'builtin':
PREFER.gtk?=            system
SYSTEM_SEARCH.gtk=      \
        'include/gtk-2.0/gtk/gtk.h'                             \

PREFER.pkg is either 'robotpkg' or 'system' (in the exact case of gtk, there is
no 'robotpkg' version, though).

SYSTEM_SEARCH.pkg is a list of requirements of the form
  'file[:sed[:pgm]]' (bits between brackets are optional)

. 'file' is a file that must be present,
. 'sed' is a sed program applied to the file (or pgm output if present, see
  below) to extract the version,
. 'pgm' is a program that is run and passed to the sed program above to extract
  the version. '%' in pgm replaced by the file name, so you can have somethig
  like 'bin/gcc:/gcc version/s/[^0-9.]//gp:% -v' to get gcc version.

[ I admit that the syntax is unreadable :) ]

All the requirements in SYSTEM_SEARCH are searched in a list of path
prefixes (like /usr /usr/local /opt/ports etc.). Then the PREFIX.pkg is set to
what is found, or an error is reported. In addition, a hint as to what system
package to install (manually) is printed (e.g. gtk2-devel on fedora,
libgtk2.0-dev on debian, x11/gtk2 for pkgsrc etc.).

You can see the whole "" (same as gtk2 file here:

| Arguably I do too; it doesn't make sense to have to build deps before
| you can untar something.

Yes, see my previous reply to the other David :)

Home | Main Index | Thread Index | Old Index