rbinstall.rb: install ext only when it's configured [Bug #18414]
This commit is contained in:
parent
9b917315f4
commit
3c7e95966d
Notes:
git
2021-12-21 15:15:12 +09:00
@ -176,6 +176,7 @@ GOLFPRELUDES = {$(srcdir)}golf_prelude.c
|
|||||||
|
|
||||||
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
|
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
|
||||||
--extout="$(EXTOUT)" \
|
--extout="$(EXTOUT)" \
|
||||||
|
--ext-build-dir="./ext" \
|
||||||
--mflags="$(MFLAGS)" \
|
--mflags="$(MFLAGS)" \
|
||||||
--make-flags="$(MAKEFLAGS)"
|
--make-flags="$(MAKEFLAGS)"
|
||||||
EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
|
EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
|
||||||
|
@ -61,6 +61,7 @@ def parse_args(argv = ARGV)
|
|||||||
opt.on('-n', '--dry-run') {$dryrun = true}
|
opt.on('-n', '--dry-run') {$dryrun = true}
|
||||||
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
|
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
|
||||||
opt.on('--extout=DIR') {|dir| $extout = (dir unless dir.empty?)}
|
opt.on('--extout=DIR') {|dir| $extout = (dir unless dir.empty?)}
|
||||||
|
opt.on('--ext-build-dir=DIR') {|v| $ext_build_dir = v }
|
||||||
opt.on('--make=COMMAND') {|make| $make = make}
|
opt.on('--make=COMMAND') {|make| $make = make}
|
||||||
opt.on('--mantype=MAN') {|man| $mantype = man}
|
opt.on('--mantype=MAN') {|man| $mantype = man}
|
||||||
opt.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
|
opt.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
|
||||||
@ -151,6 +152,9 @@ def parse_args(argv = ARGV)
|
|||||||
|
|
||||||
$dir_mode ||= $prog_mode | 0700
|
$dir_mode ||= $prog_mode | 0700
|
||||||
$script_mode ||= $prog_mode
|
$script_mode ||= $prog_mode
|
||||||
|
if $ext_build_dir.nil?
|
||||||
|
raise OptionParser::MissingArgument.new("--ext-build-dir=DIR")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
$install_procs = Hash.new {[]}
|
$install_procs = Hash.new {[]}
|
||||||
@ -729,6 +733,16 @@ module RbInstall
|
|||||||
(ruby_libraries + built_libraries).sort
|
(ruby_libraries + built_libraries).sort
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def skip_install?(files)
|
||||||
|
case type
|
||||||
|
when "ext"
|
||||||
|
# install ext only when it's configured
|
||||||
|
!File.exist?("#{$ext_build_dir}/#{relative_base}/Makefile")
|
||||||
|
when "lib"
|
||||||
|
files.empty?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def type
|
def type
|
||||||
/\/(ext|lib)?\/.*?\z/ =~ @base_dir
|
/\/(ext|lib)?\/.*?\z/ =~ @base_dir
|
||||||
@ -966,6 +980,9 @@ def install_default_gem(dir, srcdir, bindir)
|
|||||||
spec = load_gemspec(src)
|
spec = load_gemspec(src)
|
||||||
file_collector = RbInstall::Specs::FileCollector.new(src)
|
file_collector = RbInstall::Specs::FileCollector.new(src)
|
||||||
files = file_collector.collect
|
files = file_collector.collect
|
||||||
|
if file_collector.skip_install?(files)
|
||||||
|
next
|
||||||
|
end
|
||||||
spec.files = files
|
spec.files = files
|
||||||
spec
|
spec
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user