Files
chromebrew/packages/ruby.rb
chromebrew-actions[bot] 2553f78d13 Ruby => 3.4.6 — ruby → 3.4.6-1 (#12806)
* Ruby => 3.4.6

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

* updater-ruby_3.4.6: Build Run on linux/arm/v7.

* updater-ruby_3.4.6: Build Run on linux/amd64.

* updater-ruby_3.4.6: Build Run on linux/386.

* updater-ruby_3.4.6: Package File Update Run on linux/386 container.

* Rebuild ruby for i686 with GCC 14.

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

* Adjust updater verbiage.

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>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
2025-09-17 00:01:58 +00:00

88 lines
3.3 KiB
Ruby

require 'package'
class Ruby < Package
description 'Ruby is a dynamic, open source programming language with a focus on simplicity and productivity.'
homepage 'https://www.ruby-lang.org/en/'
version '3.4.6-1'
license 'Ruby-BSD and BSD-2'
compatibility 'all'
source_url 'https://github.com/ruby/ruby.git'
# git_hashtag '07f7832cffea879946a796e066ccb13ccb4b2abd'
git_hashtag "v#{version.split('-').first.gsub('.', '_')}"
binary_compression 'tar.zst'
binary_sha256({
aarch64: '657ad0990f631364d173e9be238e315f7cd2581a97f39b2dbf9ba2b80b85ea62',
armv7l: '657ad0990f631364d173e9be238e315f7cd2581a97f39b2dbf9ba2b80b85ea62',
i686: 'af078eaf4d3ba17720ca1c6cdae0a06513e596de23bc4d111a1d1acd22eb6d77',
x86_64: '08a53568e5398650855aeb3c2ed02c1e761bedf1ee931416367855f0c9ab9be7'
})
depends_on 'ca_certificates' # L
depends_on 'filecmd' # L (This is to enable file command use in package files.)
depends_on 'gcc_lib' # R
depends_on 'glibc' # R
depends_on 'gmp' # R
depends_on 'libffi' # R
depends_on 'libxcrypt' # R
depends_on 'libyaml' # R
depends_on 'openssl' # R
depends_on 'rust' => :build
depends_on 'zlib' # R
conflicts_ok # Needed for successful build.
# at run-time, system's gmp, openssl, and zlib can be used
def self.patch
# Download bundled gems version from Top of Tree. Otherwise outdated
# compile needed gems during install can cause issues when updates
# are attempted.
# downloader 'https://github.com/ruby/ruby/raw/refs/heads/master/gems/bundled_gems', 'SKIP', 'gems/bundled_gems'
end
def self.build
system '[ -x configure ] || autoreconf -fiv'
system 'filefix'
system "RUBY_TRY_CFLAGS='stack_protector=no' \
RUBY_TRY_LDFLAGS='stack_protector=no' \
optflags='-flto=auto -fuse-ld=mold' \
LD=mold \
./configure #{CREW_CONFIGURE_OPTIONS} \
--enable-shared \
#{'--enable-yjit' if ARCH == 'x86_64' || ARCH == 'aarch64'} \
--disable-fortify-source"
system "MAKEFLAGS='--jobs #{CREW_NPROC}' make"
end
def self.check
# Do not run checks if rebuilding current ruby version.
# RUBY_VERSION is a built-in ruby constant.
system "MAKEFLAGS='--jobs #{CREW_NPROC}' make check || true" unless version.split('-')[0] == RUBY_VERSION
end
def self.install
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
# See https://stackoverflow.com/questions/1844118/ruby-split-string-at-character-counting-from-the-right-side.
@ruby_ver = version.split(/\.([^.]*)$/).first
# Gems are stored in a ruby majorversion.minorversion.0 folder.
@gemrc = <<~GEMRCEOF
gem: --no-document
gempath: #{CREW_LIB_PREFIX}/ruby/gems/#{@ruby_ver}.0
GEMRCEOF
FileUtils.mkdir_p CREW_DEST_HOME
File.write("#{CREW_DEST_HOME}/.gemrc", @gemrc)
end
def self.postinstall
puts 'Updating ruby gems. This may take a while...'
# update_rubygems is provided by the ruby_rubygems_update package.
system 'gem install rubygems-update', exception: false unless File.executable?("#{CREW_PREFIX}/bin/update_rubygems")
system 'update_rubygems'
# install for Ruby 3.4
system 'gem uninstall resolv-replace', exception: false
system 'gem install highline ptools'
system "gem update #{'--silent' unless @opt_verbose} -N --system", exception: false
end
end