mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Bundled gems are expanded under .bundle/gems
now
This commit is contained in:
parent
3607657e1c
commit
db3d111c1d
Notes:
git
2022-04-07 09:47:32 +09:00
2 changed files with 8 additions and 7 deletions
13
ext/extmk.rb
13
ext/extmk.rb
|
@ -146,7 +146,7 @@ def extmake(target, basedir = 'ext', maybestatic = true)
|
||||||
top_srcdir = $top_srcdir
|
top_srcdir = $top_srcdir
|
||||||
topdir = $topdir
|
topdir = $topdir
|
||||||
hdrdir = $hdrdir
|
hdrdir = $hdrdir
|
||||||
prefix = "../" * (target.count("/")+1)
|
prefix = "../" * (basedir.count("/")+target.count("/")+1)
|
||||||
$top_srcdir = relative_from(top_srcdir, prefix)
|
$top_srcdir = relative_from(top_srcdir, prefix)
|
||||||
$hdrdir = relative_from(hdrdir, prefix)
|
$hdrdir = relative_from(hdrdir, prefix)
|
||||||
$topdir = prefix + $topdir
|
$topdir = prefix + $topdir
|
||||||
|
@ -460,10 +460,11 @@ for dir in ["ext", File::join($top_srcdir, "ext")]
|
||||||
end unless $extstatic
|
end unless $extstatic
|
||||||
|
|
||||||
@gemname = nil
|
@gemname = nil
|
||||||
if ARGV[0]
|
if exts = ARGV.shift
|
||||||
ext_prefix, exts = ARGV.shift.split('/', 2)
|
ext_prefix = exts[%r[\A(?>\.bundle/)?[^/]+(?:/(?=(.+)?)|\z)]]
|
||||||
|
exts = $1
|
||||||
$extension = [exts] if exts
|
$extension = [exts] if exts
|
||||||
if ext_prefix == 'gems'
|
if ext_prefix.start_with?('.')
|
||||||
@gemname = exts
|
@gemname = exts
|
||||||
elsif exts
|
elsif exts
|
||||||
$static_ext.delete_if {|t, *| !File.fnmatch(t, exts)}
|
$static_ext.delete_if {|t, *| !File.fnmatch(t, exts)}
|
||||||
|
@ -515,7 +516,7 @@ cond = proc {|ext, *|
|
||||||
exts.delete_if {|d| File.fnmatch?("-*", d)}
|
exts.delete_if {|d| File.fnmatch?("-*", d)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ext_prefix = File.basename(ext_prefix)
|
ext_prefix = ext_prefix[$top_srcdir.size+1..-2]
|
||||||
|
|
||||||
extend Module.new {
|
extend Module.new {
|
||||||
def timestamp_file(name, target_prefix = nil)
|
def timestamp_file(name, target_prefix = nil)
|
||||||
|
@ -634,7 +635,7 @@ rubies = []
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
Dir.chdir ".."
|
Dir.chdir dir
|
||||||
unless $destdir.to_s.empty?
|
unless $destdir.to_s.empty?
|
||||||
$mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
|
$mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,7 +25,7 @@ macros["old_extensions"] = []
|
||||||
|
|
||||||
contpat = /(?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*/
|
contpat = /(?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*/
|
||||||
Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
|
Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
|
||||||
gem = /\Agems(?=\/)/ =~ e
|
gem = e.start_with?(".bundle/gems/")
|
||||||
s = File.read(e)
|
s = File.read(e)
|
||||||
s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v|
|
s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v|
|
||||||
v.gsub!(/\\\n[ \t]*/, ' ')
|
v.gsub!(/\\\n[ \t]*/, ' ')
|
||||||
|
|
Loading…
Reference in a new issue