about summary refs log tree commit diff
path: root/pkgs/development/ruby-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ruby-modules')
-rw-r--r--pkgs/development/ruby-modules/bundler/default.nix36
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix5
-rw-r--r--pkgs/development/ruby-modules/gem/default.nix6
3 files changed, 29 insertions, 18 deletions
diff --git a/pkgs/development/ruby-modules/bundler/default.nix b/pkgs/development/ruby-modules/bundler/default.nix
index 4645a3530c58f..032b61958fa12 100644
--- a/pkgs/development/ruby-modules/bundler/default.nix
+++ b/pkgs/development/ruby-modules/bundler/default.nix
@@ -1,32 +1,40 @@
-{ lib, buildRubyGem, ruby, writeScript }:
+{ lib, buildRubyGem, ruby, writeScript, testers, bundler }:
 
 buildRubyGem rec {
   inherit ruby;
   name = "${gemName}-${version}";
   gemName = "bundler";
-  version = "2.4.3";
-  source.sha256 = "sha256-AfX4PydFNdghhYk3cApKLxtTw8L8sLEvU3Y49nKHxwA=";
+  version = "2.4.4";
+  source.sha256 = "sha256-gwAxWVkd9nptMRtaZc++8PmJZdIDVr66wUv1xi1NPJ0=";
   dontPatchShebangs = true;
 
-  passthru.updateScript = writeScript "gem-update-script" ''
-    #!/usr/bin/env nix-shell
-    #!nix-shell -i bash -p curl common-updater-scripts jq
-
-    set -eu -o pipefail
-
-    latest_version=$(curl -s https://rubygems.org/api/v1/gems/${gemName}.json | jq --raw-output .version)
-    update-source-version ${gemName} "$latest_version"
-  '';
-
   postFixup = ''
     sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
   '';
 
+  passthru = {
+    updateScript = writeScript "gem-update-script" ''
+      #!/usr/bin/env nix-shell
+      #!nix-shell -i bash -p curl common-updater-scripts jq
+
+      set -eu -o pipefail
+
+      latest_version=$(curl -s https://rubygems.org/api/v1/gems/${gemName}.json | jq --raw-output .version)
+      update-source-version ${gemName} "$latest_version"
+    '';
+    tests.version = testers.testVersion {
+      package = bundler;
+      command = "bundler -v";
+      version = version;
+    };
+  };
+
   meta = with lib; {
     description = "Manage your Ruby application's gem dependencies";
     homepage = "https://bundler.io";
     changelog = "https://github.com/rubygems/rubygems/blob/bundler-v${version}/bundler/CHANGELOG.md";
     license = licenses.mit;
-    maintainers = with maintainers; [anthonyroussel];
+    maintainers = with maintainers; [ anthonyroussel ];
+    mainProgram = "bundler";
   };
 }
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index ccc4430ca83cf..1a95520b92731 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -370,7 +370,7 @@ in
   # otherwise the gem will fail to link to the libv8 binary.
   # see: https://github.com/cowboyd/libv8/pull/161
   libv8 = attrs: {
-    buildInputs = [ which v8 python3 ];
+    buildInputs = [ which v8 python2 ];
     buildFlags = [ "--with-system-v8=true" ];
     dontBuild = false;
     # The gem includes broken symlinks which are ignored during unpacking, but
@@ -384,6 +384,9 @@ in
         --replace "location = Libv8::Location::Vendor.new" \
                   "location = Libv8::Location::System.new"
     '';
+    meta.broken = true; # At 2023-01-20, errors as:
+                        #   "Failed to build gem native extension."
+                        # Requires Python 2. Project is abandoned.
   };
 
   execjs = attrs: {
diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix
index 32bf8ed820799..dbb9e4f451cc4 100644
--- a/pkgs/development/ruby-modules/gem/default.nix
+++ b/pkgs/development/ruby-modules/gem/default.nix
@@ -86,7 +86,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
   inherit ruby;
   inherit dontBuild;
   inherit dontStrip;
-  inherit type;
+  gemType = type;
 
   nativeBuildInputs = [
     ruby makeWrapper
@@ -143,7 +143,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
   buildPhase = attrs.buildPhase or ''
     runHook preBuild
 
-    if [[ "$type" == "gem" ]]; then
+    if [[ "$gemType" == "gem" ]]; then
       if [[ -z "$gemspec" ]]; then
         gemspec="$(find . -name '*.gemspec')"
         echo "found the following gemspecs:"
@@ -158,7 +158,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
       gempkg=$(echo "$output" | grep -oP 'File: \K(.*)')
 
       echo "gem package built: $gempkg"
-    elif [[ "$type" == "git" ]]; then
+    elif [[ "$gemType" == "git" ]]; then
       git init
       # remove variations to improve the likelihood of a bit-reproducible output
       rm -rf .git/logs/ .git/hooks/ .git/index .git/FETCH_HEAD .git/ORIG_HEAD .git/refs/remotes/origin/HEAD .git/config