summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby/rubygems/default.nix
blob: cf2ca1b766ea69865cd9f78681685a23fa30ff62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv, lib, fetchurl, fetchpatch }:

stdenv.mkDerivation rec {
  name = "rubygems";
  version = "3.2.16";

  src = fetchurl {
    url = "https://rubygems.org/rubygems/rubygems-${version}.tgz";
    sha256 = "1bpn45hchcbirqvqwxcxyk1xy2xkdd915jci2hfjq4y6zc4idns0";
  };

  patches = [
    ./0001-add-post-extract-hook.patch
    ./0002-binaries-with-env-shebang.patch
    ./0003-gem-install-default-to-user.patch
    # Ensure tmp directory are not left behind
    # https://github.com/rubygems/rubygems/pull/4610
    (fetchpatch {
      url = "https://github.com/rubygems/rubygems/commit/2c2ffde6e4a9f7f571d38af687034fb8507a833d.patch";
      sha256 = "sha256-bs2dXALKiJvMgk7lKjMx0NzGqlEqDYBBO35UrzNifms=";
    })
  ];

  installPhase = ''
    runHook preInstall
    cp -r . $out
    runHook postInstall
  '';

  meta = with lib; {
    description = "Package management framework for Ruby";
    homepage = "https://rubygems.org/";
    license = with licenses; [ mit /* or */ ruby ];
    maintainers = with maintainers; [ zimbatm ];
  };
}