diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-03-12 12:02:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-12 12:02:07 +0000 |
commit | 681b1c28a471df0d3fdef27a7b9ffa32aecdbc0f (patch) | |
tree | fe53003bb67c33c8578214dc44084e26cc74aa1a /pkgs/development/ruby-modules | |
parent | 249da6de9c1afa6a31b09e3d1dcfc14d8cf0aad6 (diff) | |
parent | 9d8f144878711c034914fe452563c39b253fb43e (diff) |
Merge staging-next into staging
Diffstat (limited to 'pkgs/development/ruby-modules')
-rw-r--r-- | pkgs/development/ruby-modules/with-packages/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/ruby-modules/with-packages/test.nix | 18 |
2 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/development/ruby-modules/with-packages/default.nix b/pkgs/development/ruby-modules/with-packages/default.nix index 5be820b60e300..31573bce499fc 100644 --- a/pkgs/development/ruby-modules/with-packages/default.nix +++ b/pkgs/development/ruby-modules/with-packages/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildEnv, buildRubyGem, ruby, gemConfig, makeWrapper }: +{ stdenv, lib, buildEnv, buildRubyGem, ruby, gemConfig, makeBinaryWrapper }: /* Example usage: @@ -43,7 +43,7 @@ let wrappedRuby = stdenv.mkDerivation { name = "wrapped-${ruby.name}"; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeBinaryWrapper ]; buildCommand = '' mkdir -p $out/bin for i in ${ruby}/bin/*; do @@ -54,7 +54,7 @@ let in stdenv.mkDerivation { name = "${ruby.name}-with-packages"; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeBinaryWrapper ]; buildInputs = [ selected ruby ]; dontUnpack = true; diff --git a/pkgs/development/ruby-modules/with-packages/test.nix b/pkgs/development/ruby-modules/with-packages/test.nix index ca2934b6f61c9..be652747c4699 100644 --- a/pkgs/development/ruby-modules/with-packages/test.nix +++ b/pkgs/development/ruby-modules/with-packages/test.nix @@ -15,6 +15,22 @@ let pkgs.ruby.gems) // (import ./require_exceptions.nix); + testWrapper = ruby: stdenv.mkDerivation { + name = "test-wrappedRuby-${ruby.name}"; + buildInputs = [ ((ruby.withPackages (ps: [ ])).wrappedRuby) ]; + buildCommand = '' + cat <<'EOF' > test-ruby + #!/usr/bin/env ruby + puts RUBY_VERSION + EOF + + chmod +x test-ruby + patchShebangs test-ruby + [[ $(./test-ruby) = $(${ruby}/bin/ruby test-ruby) ]] + touch $out + ''; + }; + tests = ruby: lib.mapAttrs (name: gem: let @@ -39,7 +55,7 @@ let in stdenv.mkDerivation { name = "test-all-ruby-gems"; - buildInputs = builtins.foldl' (sum: ruby: sum ++ ( builtins.attrValues (tests ruby) )) [] rubyVersions; + buildInputs = builtins.foldl' (sum: ruby: sum ++ [ (testWrapper ruby) ] ++ ( builtins.attrValues (tests ruby) )) [] rubyVersions; buildCommand = '' touch $out ''; |