Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 200 additions & 0 deletions ruby-4.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
package:
name: ruby-4.0
version: "4.0.0"
epoch: 0
description: "the Ruby programming language"
copyright:
- license: Ruby
- license: BSD-2-Clause
dependencies:
provides:
- ruby=${{package.full-version}}
# These are bundled gems
- ruby${{vars.ruby-major-version}}-csv
- ruby${{vars.ruby-major-version}}-base64
- ruby${{vars.ruby-major-version}}-drb
runtime:
- glibc
- gmp
- libgcc
- yaml
- zlib

environment:
contents:
packages:
- autoconf
- build-base
- busybox
- ca-certificates-bundle
- coreutils
- expat-dev
- gcc-14-default
- gdbm-dev
- glibc-dev
- gmp-dev
- graphviz
- jemalloc-dev
- libffi-dev
- libxcrypt-dev
- linux-headers
- mpdecimal-dev
- ncurses-dev
- oniguruma-dev
- openssl-dev
- pkgconf
- readline-dev
- ruby-3.4
- rust
- tk-dev
- yaml-dev
- zlib-dev

vars:
prefix: /usr

var-transforms:
- from: ${{package.version}}
match: (\d+\.\d+).*
replace: $1
to: ruby-major-version

pipeline:
- uses: git-checkout
with:
repository: https://github.com/ruby/ruby
tag: v${{package.version}}
expected-commit: 553f1675f3a9cece340b90f374a4245dccac2272

- uses: patch
with:
patches: remove-already-provided-gems-from-gems_bundled_gems.patch

- name: Generate and Configure
runs: |
./autogen.sh
./configure \
--host=${{host.triplet.gnu}} \
--build=${{host.triplet.gnu}} \
--target=${{host.triplet.gnu}} \
--prefix=${{vars.prefix}} \
--enable-shared \
--disable-rpath \
--sysconfdir=/etc \
--enable-mkmf-verbose \
--enable-yjit \
--with-jemalloc

- uses: autoconf/make

# Update and Extract bundled gems
- uses: autoconf/make
with:
opts: update-gems extract-gems

# Build documentation
- uses: autoconf/make
with:
opts: rdoc capi

- uses: autoconf/make-install

- runs: |
# Ignore the patch version of ruby since ruby will install under the
# version of the latest standard library. Should produce the string 4.0.*
RUBYWILD="${{vars.ruby-major-version}}.*"

RUBYDIR=${{targets.destdir}}${{vars.prefix}}/lib/ruby/$RUBYWILD
rm -rf ${RUBYDIR}/bundler
rm -f ${RUBYDIR}/bundler.rb

GEMDIR=${{targets.destdir}}${{vars.prefix}}/lib/ruby/gems/$RUBYWILD
rm -rf ${GEMDIR}/gems/bundler-*
rm -f ${GEMDIR}/specifications/default/bundler-*.gemspec

rm -f ${{targets.destdir}}/usr/bin/bundle \
${{targets.destdir}}/usr/bin/bundler

- runs: |
find ${{targets.destdir}} -name 'mkmf.log' -exec rm {} \;

subpackages:
- name: "ruby-${{vars.ruby-major-version}}-doc"
description: "ruby documentation"
pipeline:
- uses: split/manpages
- runs: |
mkdir -p "${{targets.subpkgdir}}"/usr/share
mv "${{targets.destdir}}"/usr/share/doc "${{targets.subpkgdir}}"/usr/share/
mv "${{targets.destdir}}"/usr/share/ri "${{targets.subpkgdir}}"/usr/share/
test:
pipeline:
- uses: test/docs

- name: "ruby-${{vars.ruby-major-version}}-dev"
description: "ruby development headers"
dependencies:
runtime:
- jemalloc-dev
pipeline:
- uses: split/dev
test:
pipeline:
- uses: test/pkgconf
- uses: test/tw/ldd-check

update:
enabled: true
version-transform:
- match: "_"
replace: .
github:
identifier: ruby/ruby
strip-prefix: v
use-tag: true
tag-filter-prefix: v4_0_

test:
environment:
contents:
packages:
- ruby${{vars.ruby-major-version}}-bundler
pipeline:
- name: Test binaries
runs: |
ruby --version | grep ${{package.version}}

cat <<EOF >> /tmp/hello.rb
puts("Hello Wolfi!")
EOF

ruby /tmp/hello.rb
- name: Validate HTTPS support
runs: |
bundle init
OUTPUT=$(bundle doctor --ssl 2>&1)
echo "$OUTPUT"
if echo "$OUTPUT" | grep -i "failed"; then
exit 1
fi
- uses: test/tw/ver-check
with:
bins: |
erb
gem
irb
racc
rake
rdbg
rdoc
ri
- uses: test/tw/help-check
with:
bins: |
gem
irb
rake
rdbg
rdoc
ri
ruby
26 changes: 26 additions & 0 deletions ruby-4.0/remove-already-provided-gems-from-gems_bundled_gems.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From ada5fb811e09dfe78f3f8bcdf265b94d1dced97c Mon Sep 17 00:00:00 2001
From: Batuhan Apaydin <[email protected]>
Date: Fri, 16 May 2025 20:03:12 +0300
Subject: [PATCH] Remove modules from bundled gems list to avoid unnecessary
duplication.

Signed-off-by: Batuhan Apaydin <[email protected]>
---
gems/bundled_gems | 2 --
1 file changed, 2 deletions(-)

diff --git a/gems/bundled_gems b/gems/bundled_gems
index a5286d5..d4f50fa 100644
--- a/gems/bundled_gems
+++ b/gems/bundled_gems
@@ -10,10 +10,8 @@ minitest 6.0.0 https://github.com/minitest/minitest
power_assert 3.0.1 https://github.com/ruby/power_assert
rake 13.3.1 https://github.com/ruby/rake
test-unit 3.7.5 https://github.com/test-unit/test-unit
-rexml 3.4.4 https://github.com/ruby/rexml
rss 0.3.2 https://github.com/ruby/rss
net-ftp 0.3.9 https://github.com/ruby/net-ftp
-net-imap 0.6.2 https://github.com/ruby/net-imap
net-pop 0.1.2 https://github.com/ruby/net-pop
net-smtp 0.5.1 https://github.com/ruby/net-smtp
matrix 0.4.3 https://github.com/ruby/matrix
74 changes: 74 additions & 0 deletions ruby4.0-activemodel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package:
name: ruby4.0-activemodel
version: "8.1.1" # !!! Update activesupport at the same time
epoch: 0
description: A toolkit for building modeling frameworks like Active Record. Rich support for attributes, callbacks, validations, serialization, internationalization, and testing.
copyright:
- license: MIT
dependencies:
runtime:
- ruby${{vars.rubyMM}}-activesupport

environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- git
- ruby-${{vars.rubyMM}}
- ruby-${{vars.rubyMM}}-dev

pipeline:
- uses: git-checkout
with:
repository: https://github.com/rails/rails
tag: v${{package.version}}
expected-commit: 90a1eaa1b30ba1f2d524e197460e549c03cf5698

- uses: ruby/build
with:
gem: ${{vars.gem}}
dir: activemodel

- uses: ruby/install
with:
gem: ${{vars.gem}}
version: ${{package.version}}
dir: activemodel

- uses: ruby/clean

vars:
gem: activemodel

test:
pipeline:
- name: Validate import
runs: ruby -e "require 'active_model'"
- name: Basic example
runs: |
cat > example.rb <<EOF
require 'active_model'
class Person
include ActiveModel::Model
attr_accessor :name, :age
validates :name, presence: true
end
person = Person.new(name: 'bob')
puts person.valid?
EOF

ruby example.rb

update:
enabled: true
github:
identifier: rails/rails
strip-prefix: v

var-transforms:
- from: ${{package.name}}
match: ^ruby(\d\.\d+)-.*
replace: $1
to: rubyMM
Loading
Loading