Files
chromebrew/lib/buildsystems/python.rb
Satadru Pramanik, DO, MPH, MEng 24cda80f45 Add gem binary build functionality and also refactor upload to use regex in lieu of sed (#10494)
* Add initial plumbing for ruby gem-compiler use.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add binary gem building to ruby buildsystem.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Refactor upload to avoid sed.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add gem binary build plumbing to crew.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add binary_compression to gems.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add ruby gem binaries.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Move ruby_ruby_libversion to core.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Ruby gem update check should account for local versions.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove unused update_sha256 function.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add no_compile_needed to ruby_rubocop.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove ruby_gem_compiler from buildessential.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
2024-09-19 11:52:39 -05:00

38 lines
1.9 KiB
Ruby

require 'package'
class Python < Package
property :no_svem, :python_build_extras, :python_build_options, :python_build_relative_dir, :python_install_extras, :python_install_options
def self.build
@python_build_relative_dir ||= '.'
Dir.chdir(@python_build_relative_dir) do
if File.file?('setup.py')
puts "Python build options being used: #{PY3_SETUP_BUILD_OPTIONS} #{@python_build_options}".orange
puts "MAKEFLAGS=-j#{CREW_NPROC} python3 setup.py build #{PY3_SETUP_BUILD_OPTIONS} #{@python_build_options}" if CREW_VERBOSE
system "MAKEFLAGS=-j#{CREW_NPROC} python3 setup.py build #{PY3_SETUP_BUILD_OPTIONS} #{@python_build_options}"
else
puts "Python build options being used: #{PY3_BUILD_OPTIONS}".orange
puts "MAKEFLAGS=-j#{CREW_NPROC} python3 -m build #{PY3_BUILD_OPTIONS}" if CREW_VERBOSE
system "MAKEFLAGS=-j#{CREW_NPROC} python3 -m build #{PY3_BUILD_OPTIONS}"
end
@python_build_extras&.call
end
end
def self.install
Dir.chdir(@python_build_relative_dir) do
if File.file?('setup.py')
@py_setup_install_options = @no_svem ? PY_SETUP_INSTALL_OPTIONS_NO_SVEM : PY_SETUP_INSTALL_OPTIONS
puts "Python install options being used: #{@py_setup_install_options} #{@python_install_options}".orange
puts "MAKEFLAGS=-j#{CREW_NPROC} python3 setup.py install #{@py_setup_install_options} #{@python_install_options}" if CREW_VERBOSE
system "MAKEFLAGS=-j#{CREW_NPROC} python3 setup.py install #{@py_setup_install_options} #{@python_install_options}"
else
puts "Python install options being used: #{PY3_INSTALLER_OPTIONS}".orange
puts "MAKEFLAGS=-j#{CREW_NPROC} python3 -m installer #{PY3_INSTALLER_OPTIONS}" if CREW_VERBOSE
system "MAKEFLAGS=-j#{CREW_NPROC} python3 -m installer #{PY3_INSTALLER_OPTIONS}"
end
@python_install_extras&.call
end
end
end