mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-13 01:18:14 -05:00
* glibc: Several improvements Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Unset LD_PRELOAD before build Signed-off-by: SupeChicken666 <me@supechicken666.dev> * Adjust make to avoid segfaults. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * build changes Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add built packages for linux/386 to glibc_update * Add built packages for linux/amd64 to glibc_update * Add built packages for linux/arm/v7 to glibc_update * add armv7l binaries Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Make lib64 aarch64 changes clearer. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust crew_profile_base to remove LD_LIBRARY_PATH Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust LD_LIBRARY_PATH setting again. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Handle arm multiarch. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust installer LD_LIBRARY_PATH Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove core. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update install.sh to working version. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add crew_preload package. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update preload logic... Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update hashes, add crew_preload to CREW_ESSENTIAL_PACKAGES. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove preload install sections from install.sh now that there is a separate crew_preload package. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add build instructions reference to crew_preload package. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Bring over more from the old install.sh Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix install on older systems. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Let CREW_ESSENTIAL_PACKAGES work on older syatems. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Move down setting of repo variables to after initial system checks exit. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Use right ldconfig. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove sudo from ldconfig call. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust locale generation. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * cleanup Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add condition for crew_preload. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove duplicate hashes. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Handle some install errors. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update ncurses, readline, bash Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add update of sudo_rs Signed-off-by: Satadru Pramanik <satadru@gmail.com> * ruby updates Signed-off-by: Satadru Pramanik <satadru@gmail.com> * llvm => 20.1.6 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rust rebuilds to work on older container glibcs... Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove instance variable. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add libxcrypt to core. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Use our versions of core apps where possible, since they will likely be newer than system binaries. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Universalize fixup to work with pre_glibc_standalone branch. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rename function to better describe what it does. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rebuild filecmd and update edit. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * package updates/rebuilds Signed-off-by: Satadru Pramanik <satadru@gmail.com> * updates and rebuilds Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update unit tests. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * fixup Signed-off-by: Satadru Pramanik <satadru@gmail.com> * gettext rebuild Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add upx and patchelf to essential packages, to avoid unit test failure. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * updates & rebuilds Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update install.sh Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Install adjustment. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Install adjustment. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Break out curl dependencies in install.sh Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust install.sh for arm. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Handle remove during upgrade of special packages. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust to notice empty CREW_ESSENTIAL_PACKAGES during remove. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add libxcrypt to CREW_ESSENTIAL_PACKAGES Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust CREW_STANDALONE_UPGRADE_ORDER Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Lint ruby package as per new rubocop. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Simplify getrealdeps.rb Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Ruby rebuild Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add usage of docker tmpfs to workflows. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update python3 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * rebuild ruby Signed-off-by: Satadru Pramanik <satadru@gmail.com> * rebuild zlib Signed-off-by: Satadru Pramanik <satadru@gmail.com> * install testing Signed-off-by: Satadru Pramanik <satadru@gmail.com> * curl rebuild with older glibc Signed-off-by: Satadru Pramanik <satadru@gmail.com> * cleanup Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust packages to reduce subshells during install. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Handle ELOOP exception. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add gcc15 rebuild. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rebuild binutils without gcc version. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * update cmake Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add date stamp to installer.sh Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update libxml2 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * shared_mime_info rebuild Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Many updates rebuilt on a lower glibc Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add updates Signed-off-by: Satadru Pramanik <satadru@gmail.com> * updates Signed-off-by: Satadru Pramanik <satadru@gmail.com> * sync up from pre_glibc_standalone Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Merge pre_glibc_standalone and master versions of glibc.rb. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Sync back deprecated glibc packages from pre_glibc_standalone. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint packages/rust.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add versioning to installer error message. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * perl => 5.40.2 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add more variable setting to install.sh Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Reverse logic in glibc.rb Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust curl_wrapper logic in install.sh Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Allow glibc package to pass rubocop. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust installer. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Gate new glibc behind CREW_PRE_GLIBC_STANDALONE env variable. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update lib/const.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update mold Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust installer. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * debug Signed-off-by: Satadru Pramanik <satadru@gmail.com> * rebuild uchardet Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Python Tweaks. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Python Tweaks Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Arm install adjustment Signed-off-by: Satadru Pramanik <satadru@gmail.com> * xzutils rebuild Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust installer to detect i686 in container. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add message to source bashrc to end of install. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix Updater workflow Signed-off-by: Satadru Pramanik <satadru@gmail.com> * updates Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rebuild lz4, adjust meson buildsystem to handle alternate location for meson files. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rebuild zlib Signed-off-by: Satadru Pramanik <satadru@gmail.com> * rebuild xzutils Signed-off-by: Satadru Pramanik <satadru@gmail.com> * rebuild libyaml Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rebuilds of acl and attr for i686 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update automake and add no_filefix to autotools buildsystem. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Rebuild acl, attr, and revert from gettext 0.25, which is broken when using autopoint on x86_64 and armv7l. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * adjust core for i686 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjustments for i686 installs. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add ruby_prism to ruby_rubocop_ast package. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * updates Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust messages Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update compatibility of uutils_coreutils. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust install for both M136 hatch and M136 strongbad. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Use Concurrent Ruby for upx and patchelf. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Switch installer to using static zstd. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update packages/zstd_static.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Make final crew update in install more robust. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * install adjustments. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: SupeChicken666 <me@supechicken666.dev> Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: SupeChicken666 <me@supechicken666.dev> Co-authored-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: satmandu <satmandu@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ed Reel <edreel@gmail.com>
94 lines
4.6 KiB
Ruby
94 lines
4.6 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/'
|
|
version '1.87.0-1'
|
|
license 'Apache-2.0 and MIT'
|
|
compatibility 'all'
|
|
source_url 'https://github.com/rust-lang/rustup.git'
|
|
git_hashtag '1.28.2'
|
|
binary_compression 'tar.zst'
|
|
|
|
binary_sha256({
|
|
aarch64: 'd4738c64e9fedef0cc6273786d9077ccfdce8eeadbe80ed1e435440372ae858e',
|
|
armv7l: 'd4738c64e9fedef0cc6273786d9077ccfdce8eeadbe80ed1e435440372ae858e',
|
|
i686: 'd4ee502fbbc70236f1897db2d9973dd7e75a00156aed4dff9b60b064aad18db1',
|
|
x86_64: '9608d7152960d2e0b31351a8649372108df6c3739ac6140933c494dff14384c4'
|
|
})
|
|
|
|
depends_on 'gcc_lib' # R
|
|
depends_on 'glibc' # R
|
|
depends_on 'zlib' # R
|
|
|
|
no_strip
|
|
print_source_bashrc
|
|
|
|
def self.install
|
|
ENV['RUSTUP_PERMIT_COPY_RENAME'] = 'unstable'
|
|
ENV['RUSTUP_INIT_SKIP_PATH_CHECK'] = 'yes'
|
|
ENV['RUST_BACKTRACE'] = 'full'
|
|
ENV['CARGO_HOME'] = "#{CREW_DEST_PREFIX}/share/cargo"
|
|
ENV['RUSTUP_HOME'] = "#{CREW_DEST_PREFIX}/share/rustup"
|
|
ENV['RUSTFLAGS'] = '-Cdebuginfo=0 -Copt-level=3 -Clink-arg=-fuse-ld=mold'
|
|
|
|
ENV['RUSTUP_TOOLCHAIN'] = 'stable'
|
|
default_host = %w[aarch64 armv7l].include?(ARCH) ? 'armv7-unknown-linux-gnueabihf' : "#{ARCH}-unknown-linux-gnu"
|
|
system "sed -i 's,$(mktemp -d 2>/dev/null || ensure mktemp -d -t rustup),#{CREW_PREFIX}/tmp,' rustup-init.sh"
|
|
FileUtils.mkdir_p(CREW_DEST_HOME)
|
|
FileUtils.mkdir_p("#{CREW_DEST_PREFIX}/share/cargo")
|
|
FileUtils.mkdir_p("#{CREW_DEST_PREFIX}/share/rustup")
|
|
system "bash ./rustup-init.sh -y --no-modify-path --default-host #{default_host} --default-toolchain #{ENV.fetch('RUSTUP_TOOLCHAIN', nil)} --profile default"
|
|
FileUtils.mkdir_p("#{CREW_DEST_PREFIX}/share/bash-completion/completions/")
|
|
FileUtils.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/"
|
|
system "sed -i 's,#{CREW_DEST_PREFIX}/share/cargo,#{CREW_PREFIX}/share/cargo,g' #{CREW_DEST_PREFIX}/share/cargo/env"
|
|
File.write "#{CREW_DEST_PREFIX}/etc/env.d/rust", <<~RUSTCONFIGEOF
|
|
# Rustup and cargo configuration
|
|
export CARGO_HOME=#{ENV.fetch('CARGO_HOME', nil).gsub(CREW_DEST_PREFIX, CREW_PREFIX)}
|
|
export RUSTFLAGS="#{ENV.fetch('RUSTFLAGS', nil)}"
|
|
export RUSTUP_HOME=#{ENV.fetch('RUSTUP_HOME', nil).gsub(CREW_DEST_PREFIX, CREW_PREFIX)}
|
|
export RUSTUP_TOOLCHAIN=#{ENV.fetch('RUSTUP_TOOLCHAIN', nil)}
|
|
source #{CREW_PREFIX}/share/cargo/env
|
|
RUSTCONFIGEOF
|
|
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/bash.d/"
|
|
File.write "#{CREW_DEST_PREFIX}/etc/bash.d/rust", <<~RUSTCOMPLETIONEOF
|
|
# Rustup and cargo bash completion
|
|
source #{CREW_PREFIX}/share/bash-completion/completions/rustup
|
|
RUSTCOMPLETIONEOF
|
|
system "#{CREW_DEST_PREFIX}/share/cargo/bin/rustup completions bash > #{CREW_DEST_PREFIX}/share/bash-completion/completions/rustup"
|
|
end
|
|
|
|
def self.postinstall
|
|
# This may eventually not be needed, as there is no rpath hard coded
|
|
# into the rust binaries by default, but this does currently fix
|
|
# building with rust, especially for building gcc 15.1.
|
|
# This isn't being done in the build section since currently crew
|
|
# strips rpaths during install.
|
|
return unless Dir.exist?(CREW_GLIBC_PREFIX)
|
|
|
|
puts 'Updating rpaths for rust...'.lightblue
|
|
default_host = %w[aarch64 armv7l].include?(ARCH) ? 'armv7-unknown-linux-gnueabihf' : "#{ARCH}-unknown-linux-gnu"
|
|
Dir["#{CREW_PREFIX}/share/rustup/toolchains/stable-#{default_host}/bin/*"].each do |bin|
|
|
system "patchelf --set-rpath #{CREW_GLIBC_PREFIX}:#{CREW_PREFIX}/share/rustup/toolchains/stable-#{default_host}/lib #{bin}", exception: false if IO.popen(['file', '--brief', '--mime-type', bin], &:read).chomp == 'application/x-pie-executable'
|
|
end
|
|
end
|
|
|
|
def self.postremove
|
|
# This replicates the actions of 'rustup self uninstall'.
|
|
Package.agree_to_remove("#{HOME}/.rustup")
|
|
# Delete RUSTUP_HOME
|
|
Package.agree_to_remove("#{CREW_PREFIX}/share/rustup")
|
|
Package.agree_to_remove("#{HOME}/.cargo")
|
|
# Delete CARGO_HOME
|
|
Package.agree_to_remove("#{CREW_PREFIX}/share/cargo")
|
|
end
|
|
end
|