Skip to content

Commit

Permalink
ruby 3.4: interpreter & gem batch 1
Browse files Browse the repository at this point in the history
  • Loading branch information
justinvreeland committed Dec 12, 2024
1 parent bea68c7 commit 6aee559
Show file tree
Hide file tree
Showing 83 changed files with 5,759 additions and 0 deletions.
164 changes: 164 additions & 0 deletions ruby-3.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
package:
name: ruby-3.4
version: 3.4.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
- ruby3.4-csv
- ruby3.4-base64
- ruby3.4-drb
runtime:
- glibc
- gmp
- libgcc
- openssl
- yaml
- zlib

environment:
contents:
packages:
- autoconf
- build-base
- busybox
- coreutils
- gdbm-dev
- glibc-dev
- gmp-dev
- graphviz
- libffi-dev
- libxcrypt-dev
- linux-headers
- openssf-compiler-options
- openssl-dev
- pkgconf
- readline-dev
- ruby-3.3
- 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}}_preview2
expected-commit: 32c733f57bb91e22972319ee63eac9521d954ebc

- 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
- 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/
- name: "ruby-3.4-dev"
description: "ruby development headers"
pipeline:
- uses: split/dev
test:
pipeline:
- uses: test/pkgconf

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

test:
pipeline:
- 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
83 changes: 83 additions & 0 deletions ruby3.4-aes_key_wrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package:
name: ruby3.4-aes_key_wrap
version: 1.1.0
epoch: 0
description: A Ruby implementation of AES Key Wrap, a.k.a RFC 3394, a.k.a NIST Key Wrap.
copyright:
- license: MIT

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

pipeline:
- uses: git-checkout
with:
expected-commit: 7749c8d6dbc80a1544aea5d0da09b0380cbd9e57
repository: https://github.com/tomdalling/aes_key_wrap
tag: v${{package.version}}

- uses: ruby/unlock-spec

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

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

- uses: ruby/clean

test:
environment:
contents:
packages:
- ruby-${{vars.rubyMM}}
pipeline:
- runs: |
ruby <<-EOF
require 'aes_key_wrap'
require 'test/unit'
include Test::Unit::Assertions
# Define KEK, plaintext key, and IV as per documentation
plaintext_key = ['00112233445566778899AABBCCDDEEFF'].pack('H*') # 16-byte binary string
kek = ['000102030405060708090A0B0C0D0E0F'].pack('H*') # 16-byte binary string
iv = ['DEADBEEFC0FFEEEE'].pack("H*") # 8-byte binary string
# Test wrapping with IV
wrapped_key = AESKeyWrap.wrap(plaintext_key, kek, iv)
assert wrapped_key && wrapped_key.bytesize > 0, "Wrapped key should not be empty"
puts "Wrap test passed"
# Test unwrapping with IV
unwrapped_key = AESKeyWrap.unwrap(wrapped_key, kek, iv)
assert_equal plaintext_key, unwrapped_key, "Unwrapped key should match the original plaintext key"
puts "Unwrap test passed"
puts "Basic wrap/unwrap test with explicit IV passed"
EOF
vars:
gem: aes_key_wrap

update:
enabled: true
github:
identifier: tomdalling/aes_key_wrap
strip-prefix: v
use-tag: true

var-transforms:
- from: ${{package.name}}
match: ^ruby(\d\.\d+)-.*
replace: $1
to: rubyMM
77 changes: 77 additions & 0 deletions ruby3.4-attr_required.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package:
name: ruby3.4-attr_required
version: 1.0.2
epoch: 0
description: attr_required and attr_optional
copyright:
- license: MIT

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/nov/attr_required
tag: v${{package.version}}
expected-commit: a48a5f1f83bffff24a58b96c30b8a5cf15c56d8f

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

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

- uses: ruby/clean

vars:
gem: attr_required

test:
environment:
contents:
packages:
- ruby-${{vars.rubyMM}}
pipeline:
- runs: |
ruby <<-EOF
require 'attr_required'
require 'test/unit'
class SimpleAttrTest < Test::Unit::TestCase
class TestClass
include AttrRequired
attr_required :name
end
def test_required_attribute
obj = TestClass.new
obj.name = "Alice"
assert_equal "Alice", obj.name
puts "attr_required test passed."
end
end
EOF
update:
enabled: true
github:
identifier: nov/attr_required
strip-prefix: v
use-tag: true

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

0 comments on commit 6aee559

Please sign in to comment.