ruby: add a new .dev output to ruby derivations
The idea is to bundle ruby, bundler and bundix together. I was having issues where bundler was installed with ruby 2.3.0 and I wanted to use ruby 2.0.0. With this change all the developer has to do is install `ruby_2_0_0.dev` either in his environment or in a nix-shell.
This commit is contained in:
parent
4637cfa51f
commit
19820e9a96
@ -1,6 +1,7 @@
|
|||||||
{ stdenv, lib, fetchurl, fetchFromSavannah, fetchFromGitHub
|
{ stdenv, lib, fetchurl, fetchFromSavannah, fetchFromGitHub
|
||||||
, zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison
|
, zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison
|
||||||
, autoconf, darwin ? null
|
, autoconf, darwin ? null
|
||||||
|
, buildEnv, bundler, bundix
|
||||||
} @ args:
|
} @ args:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -35,6 +36,7 @@ let
|
|||||||
, libffi, fiddleSupport ? true
|
, libffi, fiddleSupport ? true
|
||||||
, autoreconfHook, bison, autoconf
|
, autoreconfHook, bison, autoconf
|
||||||
, darwin ? null
|
, darwin ? null
|
||||||
|
, buildEnv, bundler, bundix
|
||||||
}:
|
}:
|
||||||
let rubySrc =
|
let rubySrc =
|
||||||
if useRailsExpress then fetchFromGitHub {
|
if useRailsExpress then fetchFromGitHub {
|
||||||
@ -146,11 +148,15 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
inherit majorVersion minorVersion teenyVersion patchLevel;
|
inherit majorVersion minorVersion teenyVersion patchLevel version;
|
||||||
rubyEngine = "ruby";
|
rubyEngine = "ruby";
|
||||||
baseRuby = baseruby;
|
baseRuby = baseruby;
|
||||||
libPath = "lib/${rubyEngine}/${versionNoPatch}";
|
libPath = "lib/${rubyEngine}/${versionNoPatch}";
|
||||||
gemPath = "lib/${rubyEngine}/gems/${versionNoPatch}";
|
gemPath = "lib/${rubyEngine}/gems/${versionNoPatch}";
|
||||||
|
dev = import ./dev.nix {
|
||||||
|
inherit buildEnv bundler bundix;
|
||||||
|
ruby = self;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
) args; in self;
|
) args; in self;
|
||||||
|
24
pkgs/development/interpreters/ruby/dev.nix
Normal file
24
pkgs/development/interpreters/ruby/dev.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/* An environment for development that bundles ruby, bundler and bundix
|
||||||
|
together. This avoids version conflicts where each is using a diferent
|
||||||
|
version of each-other.
|
||||||
|
*/
|
||||||
|
{ buildEnv, ruby, bundler, bundix }:
|
||||||
|
let
|
||||||
|
bundler_ = bundler.override {
|
||||||
|
ruby = ruby;
|
||||||
|
};
|
||||||
|
bundix_ = bundix.override {
|
||||||
|
ruby = ruby;
|
||||||
|
bundler = bundler_;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
buildEnv {
|
||||||
|
name = "${ruby.rubyEngine}-dev-${ruby.version}";
|
||||||
|
paths = [
|
||||||
|
bundix_
|
||||||
|
bundler_
|
||||||
|
ruby
|
||||||
|
];
|
||||||
|
pathsToLink = [ "/bin" ];
|
||||||
|
ignoreCollisions = true;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user