mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Add Microsoft Edit (#11940)
* Add Microsoft Edit, and rust buildsystem tweaks. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add built packages for linux/amd64 to msedit * tweak rust options Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: satmandu <satmandu@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
626a53a7a7
commit
31efa32a05
@@ -3,7 +3,7 @@ require_relative '../require_gem'
|
||||
require_relative '../report_buildsystem_methods'
|
||||
|
||||
class RUST < Package
|
||||
property :rust_features, :rust_options, :rust_release_profile, :rust_targets, :pre_rust_options, :rust_build_extras, :rust_install_extras
|
||||
property :rust_channel, :rust_features, :rust_options, :rust_release_profile, :rust_targets, :pre_rust_options, :rust_build_extras, :rust_install_extras
|
||||
|
||||
def self.build
|
||||
rust_env =
|
||||
@@ -13,14 +13,21 @@ class RUST < Package
|
||||
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil)
|
||||
}.transform_keys(&:to_s)
|
||||
|
||||
@channel_flag = @rust_channel.to_s.empty? ? '' : "+#{@rust_channel}"
|
||||
@features = @rust_features.to_s.empty? ? '' : "--features #{@rust_features}"
|
||||
@profile = @rust_release_profile.to_s.empty? ? 'release' : @rust_release_profile
|
||||
extend ReportBuildsystemMethods
|
||||
print_buildsystem_methods
|
||||
|
||||
unless @rust_channel.to_s.empty?
|
||||
system rust_env, "rustup install --force #{@rust_channel}"
|
||||
fix_interpreter_path("#{CREW_PREFIX}/share/rustup/toolchains")
|
||||
end
|
||||
system rust_env, "rustup target add #{@rust_targets}" unless @rust_targets.to_s.empty?
|
||||
system rust_env, "#{@pre_rust_options} cargo fetch"
|
||||
system rust_env, "#{@pre_rust_options} cargo build \
|
||||
--profile=#{@rust_release_profile.to_s.empty? ? 'release' : @rust_release_profile} \
|
||||
#{@rust_features.to_s.empty? ? '' : "--features #{@rust_features}"} \
|
||||
system rust_env, "#{@pre_rust_options} cargo #{@channel_flag} fetch"
|
||||
system rust_env, "#{@pre_rust_options} cargo #{@channel_flag} build \
|
||||
--profile=#{@profile} \
|
||||
#{@features} \
|
||||
#{@rust_options}"
|
||||
@rust_build_extras&.call
|
||||
end
|
||||
@@ -33,12 +40,12 @@ class RUST < Package
|
||||
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil)
|
||||
}.transform_keys(&:to_s)
|
||||
|
||||
system rust_env, "cargo install \
|
||||
--profile=#{@rust_release_profile.to_s.empty? ? 'release' : @rust_release_profile} \
|
||||
system rust_env, "cargo #{@channel_flag} install \
|
||||
--profile=#{@profile} \
|
||||
--offline \
|
||||
--no-track \
|
||||
--path . \
|
||||
#{@rust_features.to_s.empty? ? '' : "--features #{@rust_features}"} \
|
||||
#{@features} \
|
||||
#{@rust_options} \
|
||||
--root #{CREW_DEST_PREFIX}"
|
||||
@rust_install_extras&.call
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
require 'etc'
|
||||
|
||||
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
||||
CREW_VERSION ||= '1.61.4' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||
CREW_VERSION ||= '1.61.5' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||
|
||||
# Kernel architecture.
|
||||
KERN_ARCH ||= Etc.uname[:machine]
|
||||
|
||||
Reference in New Issue
Block a user