Skip to content

Commit 926e7f4

Browse files
committed
Support new RubyGems lib location.
1 parent 4d601dc commit 926e7f4

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Makefile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# These line gets substituted with the actual Config::CONFIG items location by extconf.rb
22
PREFIX = notspecified
33
BINDIR = $(PREFIX)/bin
4-
SITELIBDIR = $(PREFIX)/lib/ruby/site_ruby/1.8
4+
INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
5+
OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
56

67
ifeq (true,$(shell test -x $(BINDIR)/jruby && echo true))
78
RAKE=$(BINDIR)/jruby -S rake
@@ -37,9 +38,18 @@ install:
3738
@if [ ! -w $(BINDIR) ]; then echo "'$(BINDIR)' does not exist or cannot write to '$(BINDIR)'."; exit 1; fi
3839
@if [ -f $(BINDIR)/jruby -a ! -w $(BINDIR)/jruby ]; then echo "Cannot write to '$(BINDIR)/jruby'."; exit 1; fi
3940
cp ./jruby $(BINDIR)/jruby
40-
@if [ x$(SITELIBDIR) = xnotspecified/lib/ruby/site_ruby/1.8 ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
41-
@if [ ! -w $(SITELIBDIR) ]; then echo "'$(SITELIBDIR)' does not exist or cannot write to '$(SITELIBDIR)'."; exit 1; fi
42-
cp ./lib/rubygems/defaults/jruby_native.rb $(SITELIBDIR)/rubygems/defaults
41+
@if [ x$(PREFIX) = xnotspecified ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
42+
@if [ ! -w $(INSTALLDIR) ]; then \
43+
if [ ! -w $(OLDINSTALLDIR) ]; then \
44+
echo "Neither '$(INSTALLDIR)' nor '$(OLDINSTALLDIR)' exist and are writable"; exit 1; \
45+
else \
46+
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR)"; \
47+
cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR); \
48+
fi; \
49+
else \
50+
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR)"; \
51+
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR); \
52+
fi;
4353

4454
test:
4555
$(RAKE)

extconf.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
mf = File.read('Makefile')
44
mf = mf.gsub(/^BINDIR\s*=.*$/, "BINDIR = #{Config::CONFIG['bindir']}")
5-
mf = mf.gsub(/^SITELIBDIR\s*=.*$/, "SITELIBDIR = #{Config::CONFIG['sitelibdir']}")
5+
mf = mf.gsub(/^PREFIX\s*=.*$/, "PREFIX = #{File.dirname(Config::CONFIG['libdir'])}")
6+
puts mf
67
File.open('Makefile', 'wb') {|f| f << mf}

lib/jruby-launcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JRubyLauncher
2-
VERSION = "1.0.9"
2+
VERSION = "1.0.10"
33
end

0 commit comments

Comments
 (0)