[Nix-dev] Package depends on other package options

Nicolas Pierron nicolas.b.pierron at gmail.com
Sun Jan 27 18:53:50 CET 2008


Hi,

While looking at all-packages.nix I can read some dependencies on
packages options that require to duplicate some code because they
depends on specific options. An example is "swig" which has another
derivation named "swigWithJava" that use the same nix expression with
different options which is only used by "subversion" which also has
another derivation named "subversionWithJava".

To vanish code duplication it would be good to have only one set of
default options for "swig" that could be overwrite to make the
derivation. The current view import a function and directly call it
with options and inherited packages. This way forbids any options
overload.

I suggest to separate the function call from the default options and
inherited packages set. By separating them a user can install "swig"
with its own options and install another package that install "swig"
with some specific options not set by the user.

The attached nix expression is an example of solution that fake the
install of "swig" and "subversion" with two user options which are
"swigDep.javaSupport" and "subversionDep.javaBindings". As you can see
when running this example is that a different "swig" package is
installed by "subversion" to satisfy the value of the option of
"swig". In this example, when you change the value of
"subversionDep.javaBindings" to "false", you can see that only one
"swig" package would be installed because the user install satisfy the
property of the subversion package.

Do you have any comments / suggestions about this idea?

-- 
Nicolas Pierron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: depends-on-package-options.nix
Type: application/octet-stream
Size: 2609 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20080127/1b1c16a8/attachment.obj 


More information about the nix-dev mailing list