[Nix-dev] Re: [Nix-commits] SVN commit: nix - 16099 - MarcWeber - in nixpkgs/trunk/pkgs: development/interpreters/ruby top-level

Eelco Dolstra e.dolstra at tudelft.nl
Tue Jun 30 16:43:18 CEST 2009


Hi,

Marc Weber wrote:

> Log:
> ruby / gems update
> 
> Changes:
> 
> Modified: nixpkgs/trunk/pkgs/development/interpreters/ruby/default.nix
> ===================================================================
> --- nixpkgs/trunk/pkgs/development/interpreters/ruby/default.nix	2009-06-30 14:20:26 UTC (rev 16098)
> +++ nixpkgs/trunk/pkgs/development/interpreters/ruby/default.nix	2009-06-30 14:29:17 UTC (rev 16099)
> @@ -2,9 +2,10 @@
>    , lib
>    , zlib ? null
>    , openssl ? null
> +  , makeOverridable
>  }:
>  
> -stdenv.mkDerivation rec {
> +makeOverridable (stdenv.mkDerivation) rec {

This seems odd.  It breaks abstraction.  If you want to build multiple Ruby
versions, have a look at what we do with the Linux kernel
(pkgs/os-specific/linux/kernel).  There is one generic kernel builder function
(generic.nix) which is called with appropriate arguments to build various
versions (e.g. linux-2.6.29.nix).  That's cleaner (since more symmetrical) than
taking the result of the function that builds Ruby 1.8.7 and patching it to
build 1.9.1.

BTW, the ability to patch a derivation is useful for ad-hoc customisation (e.g.
in ~/.nixpkgs/config.nix).  However, rather than adding a makeOverridable in
every function, we could just integrate it in stdenv.mkDerivation so that it
works for every package.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list