mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 07:28:01 -05:00
* Make basic crew-profile-base package * Use crew consts * Upgrade to 0.0.2-pre2 * Convert aa* to cf* * Docbook * aa* to dz* * docbook-xsl * through fz* and fix environment variables * through mz* * through pz* * through zz* * fix crew-profile-base * upgrade crew-profile-base * major crew-profile-base changes * Upgrade crew-profile-base and fix xdg-base * fix sha256sum * Remove stale files * pkgsrc and sommelier * Add crew-profile-base to core packages and ready for merging * Bump versions * prevent conflicts with #5494 * fix sha256sum * fix fop * profile.d is not ours * fix bash * Upgrade crew-profile-base to 0.0.1-pre6 and fix bash * Remove self-referencing comment * Add binaries, fix rust, fix #{@ver} * move compatibility line * add core mandb deps back * File.exists? => File.exist? * deduplicate @env * update packages * Fix gdk_pixbug source url * Add binaries, use rubocop style fixes * Update cf from 6.36.1-1 to 6.53.0 * fix sl * fix depot tools * remove apulse since it conflicts with pulseaudio. * refactor crew_profile_base * first tranche of builds * go * add cf * hunspell * transmission * clean up dependency & env situation for gdk_pixbuf * fix gettext * fix nano * fix intel-media-driver * add zziplib for texlive * fix texlive * split fuse for flatpak * fix flatpak * delete rack (broken and unmaintained) * fix packer completion * modify and fix sl * fix s * fix stressng * fix stack * Add TMPDIR * Remove TMPDIR from build files * Fix aws2 version * Go: remove extraneous dependency * hunspell_fr_fr: use french in description * intel media driver: remove case x86_64 * aws2: quickfix * everything but texlive * texlive * fix stressng * Delete pkgsrc.rb * add back pkgsrc Co-authored-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Ed Reel <edreel@gmail.com> Co-authored-by: satmandu <satadru@umich.edu>
76 lines
3.9 KiB
Ruby
76 lines
3.9 KiB
Ruby
require 'package'
|
|
|
|
class Rust < Package
|
|
description 'Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.'
|
|
homepage 'https://www.rust-lang.org/'
|
|
@_ver = '1.51.0'
|
|
version @_ver
|
|
license 'Apache-2.0 and MIT'
|
|
compatibility 'all'
|
|
source_url 'file:///dev/null'
|
|
source_sha256 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
|
|
|
|
binary_url({
|
|
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/rust-1.51.0-chromeos-armv7l.tar.xz',
|
|
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/rust-1.51.0-chromeos-armv7l.tar.xz',
|
|
i686: 'https://dl.bintray.com/chromebrew/chromebrew/rust-1.51.0-chromeos-i686.tar.xz',
|
|
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/rust-1.51.0-chromeos-x86_64.tar.xz'
|
|
})
|
|
binary_sha256({
|
|
aarch64: '1673202f5a6ff0b3753468bc96084da810ba1d5952c207be459556598faa6f68',
|
|
armv7l: '1673202f5a6ff0b3753468bc96084da810ba1d5952c207be459556598faa6f68',
|
|
i686: '07b04e4b808aba2e34a98ace8939a7b3285c41e99596a5560ac941729635e90a',
|
|
x86_64: 'e272a06829c9bb3d1c14752b668767bd85911231ba48e3a6281fc746b40ac19a'
|
|
})
|
|
|
|
def self.install
|
|
ENV['RUST_BACKTRACE'] = 'full'
|
|
ENV['CARGO_HOME'] = "#{CREW_DEST_PREFIX}/share/cargo"
|
|
ENV['RUSTUP_HOME'] = "#{CREW_DEST_PREFIX}/share/rustup"
|
|
case ARCH
|
|
when 'aarch64', 'armv7l'
|
|
default_host = 'armv7-unknown-linux-gnueabihf'
|
|
else
|
|
default_host = "#{ARCH}-unknown-linux-gnu"
|
|
end
|
|
system 'curl -Lf https://sh.rustup.rs -o rustup.sh'
|
|
unless Digest::SHA256.hexdigest(File.read('rustup.sh')) == 'fa50ccf79c30ce9446cc45917e8ea10655674c2a9509221cb12bd865c60ab709'
|
|
abort 'Checksum mismatch. :/ Try again.'.lightred
|
|
end
|
|
system "sed -i 's,\$(mktemp -d 2>/dev/null || ensure mktemp -d -t rustup),#{CREW_PREFIX}/tmp,' rustup.sh"
|
|
FileUtils.mkdir_p(CREW_DEST_HOME)
|
|
FileUtils.mkdir_p("#{CREW_DEST_PREFIX}/bin")
|
|
FileUtils.mkdir_p("#{CREW_DEST_PREFIX}/share/cargo")
|
|
FileUtils.mkdir_p("#{CREW_DEST_PREFIX}/share/rustup")
|
|
system "RUSTFLAGS='-Clto=thin' bash ./rustup.sh -y --no-modify-path --default-host #{default_host} --default-toolchain stable --profile minimal"
|
|
FileUtils.cd("#{CREW_DEST_PREFIX}/share/cargo/bin") do
|
|
system "find -type f -exec ln -s #{CREW_PREFIX}/share/cargo/bin/{} #{CREW_DEST_PREFIX}/bin/{} \\;"
|
|
end
|
|
system "install -Dm644 #{CREW_DEST_PREFIX}/share/rustup/toolchains/stable-#{default_host}/etc/bash_completion.d/cargo #{CREW_DEST_PREFIX}/share/bash-completion/completions/cargo"
|
|
FileUtils.rm("#{CREW_DEST_PREFIX}/share/rustup/toolchains/stable-#{default_host}/etc/bash_completion.d/cargo")
|
|
system "touch #{CREW_DEST_PREFIX}/share/bash-completion/completions/rustup"
|
|
FileUtils.mv("#{CREW_DEST_PREFIX}/share/rustup/toolchains/stable-#{default_host}/share/man/",
|
|
"#{CREW_DEST_PREFIX}/share/")
|
|
FileUtils.rm_rf("#{CREW_DEST_PREFIX}/share/rustup/toolchains/stable-#{default_host}/share/doc/")
|
|
FileUtils.ln_sf("#{CREW_PREFIX}/share/cargo", "#{CREW_DEST_HOME}/.cargo")
|
|
FileUtils.ln_sf("#{CREW_PREFIX}/share/rustup", "#{CREW_DEST_HOME}/.rustup")
|
|
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/env.d/"
|
|
@rustconfigenv = <<~RUSTCONFIGEOF
|
|
# Rustup and cargo configuration
|
|
export CARGO_HOME=#{CREW_PREFIX}/share/cargo
|
|
export RUSTUP_HOME=#{CREW_PREFIX}/share/rustup
|
|
RUSTCONFIGEOF
|
|
IO.write("#{CREW_DEST_PREFIX}/etc/env.d/rust", @rustconfigenv)
|
|
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/bash.d/"
|
|
@rustcompletionenv = <<~RUSTCOMPLETIONEOF
|
|
# Rustup and cargo bash completion
|
|
source #{CREW_PREFIX}/share/bash-completion/completions/cargo
|
|
source #{CREW_PREFIX}/share/bash-completion/completions/rustup
|
|
RUSTCOMPLETIONEOF
|
|
IO.write("#{CREW_DEST_PREFIX}/etc/bash.d/rust", @rustcompletionenv)
|
|
system "#{CREW_DEST_PREFIX}/share/cargo/bin/rustup completions bash > #{CREW_DEST_PREFIX}/share/bash-completion/completions/rustup"
|
|
end
|
|
end
|