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
194 changes: 194 additions & 0 deletions ruby-4.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
package:
name: ruby-4.0
version: "3_4_8"
epoch: 0
description: "the Ruby programming language"
copyright:
- license: Ruby
- license: BSD-2-Clause
dependencies:
provides:
- ruby=${{package.full-version}}
# These are bundled gems
- ruby3.4-csv
- ruby3.4-base64
- ruby3.4-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: \.
replace: _
to: underscore-package-version

pipeline:
- uses: git-checkout
with:
repository: https://github.com/ruby/ruby
tag: v${{vars.underscore-package-version}}
expected-commit: 995b59f66677d44767ce9faac6957e5543617ff9

- 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 3.4.*
RUBYWILD="$(echo ${{package.version}} | cut -d. -f-2).*"

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-3.4-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-3.4-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: v3_4_

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

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

ruby /tmp/hello.rb
erb --version
gem --version
gem --help
irb --version
irb --help
racc --version
rake --version
rake --help
rdbg --version
rdbg --help
rdoc --version
rdoc --help
ri --version
ri --help
ruby --help
- 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
29 changes: 29 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,29 @@
From ada5fb811e09dfe78f3f8bcdf265b94d1dced97c Mon Sep 17 00:00:00 2001
From: Batuhan Apaydin <batuhan.apaydin@chainguard.dev>
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 <batuhan.apaydin@chainguard.dev>
---
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 5.25.4 https://github.com/minitest/minitest
power_assert 2.0.5 https://github.com/ruby/power_assert
rake 13.2.1 https://github.com/ruby/rake
test-unit 3.6.7 https://github.com/test-unit/test-unit
-rexml 3.4.4 https://github.com/ruby/rexml
rss 0.3.1 https://github.com/ruby/rss
net-ftp 0.3.8 https://github.com/ruby/net-ftp
-net-imap 0.5.8 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.2 https://github.com/ruby/matrix
--
2.39.5 (Apple Git-154)

Loading