Skip to content

Commit dcbec67

Browse files
committed
Copy jruby.sh into place if it is not present
The new skinny launcher depends on jruby.sh being in the same bin dir, but at least one installer (ruby-build) deletes it during initial setup. This patch includes jruby.sh in the gem and copies it into JRuby's bin dir if it does not already exist. See rbenv/ruby-build#2517
1 parent 0004209 commit dcbec67

File tree

3 files changed

+966
-20
lines changed

3 files changed

+966
-20
lines changed

Diff for: Makefile

+1-19
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ PREFIX = notspecified
33
BINDIR = $(PREFIX)/bin
44
JRUBY_VERSION = notspecified
55
JRUBY_MODULE = 1
6-
INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
7-
INSTALLDIR9000 = $(PREFIX)/lib/ruby/stdlib/rubygems/defaults
8-
OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
96

107
ifeq (true,$(shell test -x $(BINDIR)/jruby && echo true))
118
RAKE=$(BINDIR)/jruby -S rake
@@ -42,22 +39,7 @@ install:
4239
@if [ -f $(BINDIR)/jruby -a ! -w $(BINDIR)/jruby ]; then echo "Cannot write to '$(BINDIR)/jruby'."; exit 1; fi
4340
cp ./jruby $(BINDIR)/jruby
4441
@if [ x$(PREFIX) = xnotspecified ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
45-
@if [ ! -w $(INSTALLDIR) ]; then \
46-
if [ ! -w $(OLDINSTALLDIR) ]; then \
47-
if [ ! -w $(INSTALLDIR9000) ]; then \
48-
echo "Neither '$(INSTALLDIR9000)' nor '$(INSTALLDIR)' nor '$(OLDINSTALLDIR)' exist and are writable"; exit 1; \
49-
else \
50-
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000)"; \
51-
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000); \
52-
fi; \
53-
else \
54-
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR)"; \
55-
cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR); \
56-
fi; \
57-
else \
58-
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR)"; \
59-
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR); \
60-
fi;
42+
@if [ ! -f $(BINDIR)/jruby.sh ]; then cp ./exe/jruby.sh $(BINDIR)/jruby.sh; fi
6143

6244
test:
6345
$(RAKE)

Diff for: Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ task :gemspec => './lib/jruby-launcher.rb' do
2626
s.summary = %q{Native launcher for JRuby}
2727
2828
s.extensions = ["extconf.rb"]
29-
s.files = FileList["COPYING", "README.md", "Makefile", "Rakefile", "*.c", "*.cpp", "*.h", "inc/*.*", "**/*.rb", "resources/*.*"]
29+
s.files = FileList["COPYING", "README.md", "Makefile", "Rakefile", "*.c", "*.cpp", "*.h", "inc/*.*", "**/*.rb", "resources/*.*", "exe/jruby.sh"]
3030
s.homepage = %q{http://jruby.org}
3131
end
3232
end

0 commit comments

Comments
 (0)