mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
* Add rust rework, man_db update, glibc_standalone rebuild, and adjustment of rpath handling during install. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * bump version Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add glibc_standalone to CREW_STANDALONE_UPGRADE_ORDER. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove debug code. Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
50 lines
1.6 KiB
Ruby
50 lines
1.6 KiB
Ruby
require 'package'
|
|
|
|
class RUST < Package
|
|
property :rust_options, :rust_release_profile, :rust_targets, :pre_rust_options, :rust_build_extras, :rust_install_extras
|
|
|
|
def self.build
|
|
rust_env =
|
|
{
|
|
BASH_ENV: "#{CREW_PREFIX}/etc/env.d/rust",
|
|
CREW_LINKER: 'mold',
|
|
LD: 'mold',
|
|
LIBRARY_PATH: "#{CREW_GLIBC_PREFIX}:#{CREW_LIB_PREFIX}",
|
|
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil)
|
|
}.transform_keys(&:to_s)
|
|
|
|
puts 'Additional rust options being used:'.orange
|
|
method_list = methods.grep(/rust_/).delete_if { |i| send(i).blank? }
|
|
method_list.each do |method|
|
|
puts "#{method}: #{send method}".orange
|
|
end
|
|
|
|
system rust_env, "bash -c \"rustup target add #{@rust_targets}\"" unless @rust_targets.to_s.empty?
|
|
system rust_env, "bash -c \"#{@pre_rust_options} cargo fetch \
|
|
--manifest-path Cargo.toml\""
|
|
system rust_env, "bash -c \"#{@pre_rust_options} cargo build \
|
|
--profile=#{@rust_release_profile.to_s.empty? ? 'release' : @rust_release_profile} \
|
|
#{@rust_options} \
|
|
--manifest-path Cargo.toml\""
|
|
@rust_build_extras&.call
|
|
end
|
|
|
|
def self.install
|
|
rust_env =
|
|
{
|
|
BASH_ENV: "#{CREW_PREFIX}/etc/env.d/rust",
|
|
CREW_LINKER: 'mold',
|
|
LD: 'mold',
|
|
LIBRARY_PATH: "#{CREW_GLIBC_PREFIX}:#{CREW_LIB_PREFIX}",
|
|
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil)
|
|
}.transform_keys(&:to_s)
|
|
|
|
system rust_env, "bash -c \"cargo install \
|
|
--offline \
|
|
--no-track \
|
|
--path . \
|
|
--root #{CREW_DEST_PREFIX}\""
|
|
@rust_install_extras&.call
|
|
end
|
|
end
|