[Nix-dev] Multiple packages from one source package

Marc Weber marco-oweber at gmx.de
Tue Nov 6 10:25:36 CET 2007


> Is there a way to produce several (binary) packages from one source
> package?
> 
> It's not uncommon in Debian (or other binary distros) to have a source
> package yield multiple binary packages, e.g., `libfoo', `libfoo-dev',
> `foo-utils', `python-foo', etc.  The advantage is that the set of
> run-time dependencies of these individual packages is smaller than that
> of the original source package.
> 
> AIUI, there's a one-to-one mapping between pre-built packages pushed to
> channels and source packages.  IOW, there's always one store path per
> source package.  Actually, it's one store path per Nix expression, but
> there's only one Nix expression per package, right?

Hi Ludovic.

In debian you have
source  - > binary [1] (I'm thinking of a library here)
        `-> binary-dev [2] ( thus includes / kernel header files .. )
            ....
right?

I don't see why you should'nt be able to create nix expressions
creating [1], [2]

Moreover in the simple case of
lib
lib-dev

case static library:
  The library is compiled into the executable and if nix does a binary
  fetch I the library is no longer runtime dependency. So you get this
  separation by default
case shared libs:
  You are right: The runtime deps (shared lib *.so)
    are delivered together with the include files now with most
    libraries I've seen
    (which you don't need to run the depending applications)

Of course we can start passing
  buildIpnuts = [ jpeglib jpeg_includes ]
  or define extra attributes
  buildInputs = concat [ jpeglib_and_includes ]

Would be more effort but perhaps we can automate this somehow?

It's definitely an idea to think about.

Marc



More information about the nix-dev mailing list