buildsystem: Use native ruby block in install_extras (#10110)

* buildsystem: Use native ruby block in `install_extras`

Signed-off-by: supechicken <me@supechicken666.dev>

* Make rubocop happy, disable `Security/Eval` cop

Signed-off-by: supechicken <me@supechicken666.dev>

---------

Signed-off-by: supechicken <me@supechicken666.dev>
This commit is contained in:
SupeChicken666
2024-07-09 21:56:03 +08:00
committed by GitHub
parent fad195cada
commit f9738c639d
12 changed files with 21 additions and 19 deletions

View File

@@ -31,7 +31,7 @@ class Autotools < Package
def self.install
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
eval @install_extras if @install_extras
@install_extras&.call
end
def self.check

View File

@@ -14,7 +14,7 @@ class Meson < Package
def self.install
system "DESTDIR=#{CREW_DEST_DIR} #{CREW_NINJA} -C builddir install"
eval @meson_install_extras if @meson_install_extras
@meson_install_extras&.call
end
def self.check

View File

@@ -16,6 +16,6 @@ class PERL < Package
def self.install
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
eval @perl_install_extras if @perl_install_extras
@perl_install_extras&.call
end
end

View File

@@ -42,6 +42,6 @@ class Pip < Package
FileUtils.mkdir_p File.dirname(@destpath) if Gem::Version.new(RUBY_VERSION.to_s) < Gem::Version.new('3.3')
FileUtils.install @pip_path, @destpath
end
eval @pip_install_extras if @pip_install_extras
@pip_install_extras&.call
end
end

View File

@@ -30,6 +30,6 @@ class Python < Package
puts "Python install options being used: #{PY3_INSTALLER_OPTIONS}".orange
system "MAKEFLAGS=-j#{CREW_NPROC} python3 -m installer #{PY3_INSTALLER_OPTIONS}"
end
eval @python_install_extras if @python_install_extras
@python_install_extras&.call
end
end

View File

@@ -10,6 +10,6 @@ class Qmake < Package
def self.install
system "make INSTALL_ROOT=#{CREW_DEST_DIR} install"
eval @qmake_install_extras if @qmake_install_extras
@qmake_install_extras&.call
end
end

View File

@@ -16,6 +16,6 @@ class RUBY < Package
@ruby_ver = version.split('-', 3).last
system "yes | gem uninstall -a #{@gem_name}", exception: false
system "gem install -i #{CREW_DEST_LIB_PREFIX}/ruby/gems/#{@ruby_ver}.0 -n #{CREW_DEST_PREFIX}/bin -N #{@gem_name}", exception: false
eval @ruby_install_extras if @ruby_install_extras
@ruby_install_extras&.call
end
end