Skip to content

Commit

Permalink
Link bin as well as lib so that Gem.bin_path works
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jan 15, 2025
1 parent 272a8c3 commit e0be1b9
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions ext/extmk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ def create_makefile(*args, &block)
}
end

gemlib = File.directory?("#{$top_srcdir}/#{@ext_prefix}/#{@gemname}/lib")
if conf.any? {|s| /^TARGET *= *\S/ =~ s}
conf << %{
gem_platform = #{Gem::Platform.local}
Expand Down Expand Up @@ -617,23 +616,25 @@ def create_makefile(*args, &block)
clean-gemspec:
-$(Q)$(RM) $(gemspec)
}

if gemlib
conf << %{
install-rb: gemlib
clean-rb:: clean-gemlib
LN_S = #{config_string('LN_S')}
CP_R = #{config_string('CP')} -r
gemlib = $(TARGET_TOPDIR)/gems/$(gem)/lib
gemlib:#{%{ $(gemlib)\n$(gemlib): $(gem_srcdir)/lib} if $nmake}
$(Q) #{@inplace ? '$(NULLCMD) ' : ''}$(RUBY) $(top_srcdir)/tool/ln_sr.rb -q -f -T $(gem_srcdir)/lib $(gemlib)
clean-gemlib:
$(Q) $(#{@inplace ? 'NULLCMD' : 'RM_RF'}) $(gemlib)
}
unless @inplace
%w[bin lib].each do |d|
next unless File.directory?("#{$top_srcdir}/#{@ext_prefix}/#{@gemname}/#{d}")
conf << %{
install-rb: gem#{d}
clean-rb:: clean-gem#{d}
gem#{d} = $(TARGET_TOPDIR)/gems/$(gem)/#{d}
gem#{d}:#{%{ $(gem#{d})\n$(gem#{d}): $(gem_srcdir)/#{d}} if $nmake}
$(Q) $(RUBY) $(top_srcdir)/tool/ln_sr.rb -q -f -T $(gem_srcdir)/#{d} $(gem#{d})
clean-gem#{d}:
$(Q) $(RM_RF) $(gem#{d})
}
end
end
end

Expand Down

0 comments on commit e0be1b9

Please sign in to comment.