Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
jruby: fix shebang for binaries in JRuby
Browse files Browse the repository at this point in the history
There are a variety of additional scripts that are included with the
JRuby installation that use JRuby itself.

For instance the `bin/gem` had the following contents:

```bash
❯ cat /nix/store/kglkqf56ii83yl6yrgcaj5r3s9m2fzr0-jruby-9.2.13.0/bin/gem

load File.join(File.dirname(__FILE__), 'jgem')
```

This is clearly wrong. Patchshebangs was not picking up the fix as part
of stdenv because the patch is not a build input but the final output
itself.

We have to rely on substituteInPlace so that we get the correct version.

```bash
❯ cat /nix/store/k4fnrn0dcsh2wzw81217r0ywsspb468f-jruby-9.2.13.0/bin/gem

```
  • Loading branch information
fzakaria committed Sep 25, 2020
1 parent 638c8cb commit 8da7bd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/development/interpreters/jruby/default.nix
Expand Up @@ -40,6 +40,10 @@ jruby = stdenv.mkDerivation rec {
EOF
'';

postFixup = ''
PATH=$out/bin:$PATH patchShebangs $out/bin
'';

passthru = rec {
rubyEngine = "jruby";
gemPath = "lib/${rubyEngine}/gems/${rubyVersion.libDir}";
Expand Down

0 comments on commit 8da7bd6

Please sign in to comment.