Subject: Re: ===> db4 is not an acceptable Berkeley DB type for
To: None <>
From: Klaus Heinz <>
List: tech-pkg
Date: 11/15/2005 22:17:06
thoran wrote:

> I'm supposing that I merely need to define something as being =db3 or
> something similar to this and that that might fix it.  I tried various
> incantations of the sort in the lang/ruby Makefile but that didn't do
> any good.  

To understand this little mess about various types of Berkeley Databases
(BDB) you need to know that NetBSD (and I think the other *BSD as well)
has the latest version 1.85 of the original Berkeley DB integrated in
their base system (in libc in the case of NetBSD).
Since this version 1, the company Sleepycat Software has created
versions 2, 3 and 4 which all include a compatibility mode for version 1.

As mentioned (although not in the user section) in the pkgsrc guide, determines which kind of Berkeley DB is going to be
used. Looking at this file, you can see a bit of documentation (which
should probably find its way into the guide).

Basically, it says you can set BDB_DEFAULT (typically in mk.conf) to
db2, db3 or db4 in order to choose which Berkeley DB you want pkgsrc 
to use. BDB185_DEFAULT sets the default BDB version for packages which
demand the API of BDB version 1.
If you did not set BDB_DEFAULT or BDB185_DEFAULT, they will be set to
db4 (BDB_DEFAULT) and db1 on *BSD or db4 on other systems (BDB185_DEFAULT).

Packages can require specifice BDB versions by setting BDB_ACCEPTED to a
list of accepted versions. A match between what the user chose and the
accepted versions by the package will be used for the package at hand.

The error message you got can be explained by the fact that lang/ruby
depends on lang/ruby18-base which only accepts db1 in its Makefile.
On Debian (without a builtin db1) both BDB_DEFAULT and BDB185_DEFAULT
are set to db4 and ruby18-base only accepts db1 on Debian (since it's
not IRIX or SunOS).

The question is now why ruby18-base requires db1. I_guess_ that the

  .if  ${OPSYS} != "IRIX" && ${OPSYS} != "SunOS"

in the Makefile really means "if it's a *BSD demand db1, else let
pkgsrc use the default" but that is probably a question the
maintainer can answer.

If you like, you can experimentally change this line in the Makefile to

  .if  ${OPSYS} != "IRIX" && ${OPSYS} != "SunOS" &&  ${OPSYS} != "Linux"

and try to build ruby again.