1{ lib, stdenv, fetchFromGitHub, bash, installShellFiles }:
2
3stdenv.mkDerivation rec {
4 pname = "rbenv";
5 version = "1.2.0";
6
7 nativeBuildInputs = [ installShellFiles ];
8
9 src = fetchFromGitHub {
10 owner = "rbenv";
11 repo = "rbenv";
12 rev = "v${version}";
13 sha256 = "sha256-m/Yy5EK8pLTBFcsgKCrNvQrPFFIlYklXXZbjN4Nmm9c=";
14 };
15
16 postPatch = ''
17 patchShebangs src/configure
18 pushd src
19 '';
20
21 installPhase = ''
22 popd
23 mkdir -p $out/bin
24 mv libexec $out
25 ln -s $out/libexec/rbenv $out/bin/rbenv
26
27 installShellCompletion completions/rbenv.{bash,zsh}
28 '';
29
30 meta = with lib; {
31 description = "Groom your app’s Ruby environment";
32 longDescription = ''
33 Use rbenv to pick a Ruby version for your application and guarantee that your development environment matches production.
34 Put rbenv to work with Bundler for painless Ruby upgrades and bulletproof deployments.
35 '';
36 homepage = "https://github.com/rbenv/rbenv";
37 license = licenses.mit;
38 maintainers = with maintainers; [ fzakaria ];
39 platforms = platforms.all;
40 };
41}