diff --git a/ruby-4.0.yaml b/ruby-4.0.yaml new file mode 100644 index 00000000000..aa2e8c8fe99 --- /dev/null +++ b/ruby-4.0.yaml @@ -0,0 +1,189 @@ +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 <> /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/help-check + with: + bins: | + gem + irb + rake + rdbg + rdoc + ri + ruby diff --git a/ruby-4.0/remove-already-provided-gems-from-gems_bundled_gems.patch b/ruby-4.0/remove-already-provided-gems-from-gems_bundled_gems.patch new file mode 100644 index 00000000000..adaa723e7b7 --- /dev/null +++ b/ruby-4.0/remove-already-provided-gems-from-gems_bundled_gems.patch @@ -0,0 +1,26 @@ +From ada5fb811e09dfe78f3f8bcdf265b94d1dced97c Mon Sep 17 00:00:00 2001 +From: Batuhan Apaydin +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 +--- + 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 diff --git a/ruby4.0-bundler.yaml b/ruby4.0-bundler.yaml new file mode 100644 index 00000000000..2de81e4f751 --- /dev/null +++ b/ruby4.0-bundler.yaml @@ -0,0 +1,91 @@ +package: + name: ruby4.0-bundler + version: "4.0.3" + epoch: 0 + description: "Manage an application's gem dependencies" + copyright: + - license: MIT + dependencies: + runtime: + - ruby-${{vars.rubyMM}} + +environment: + contents: + packages: + - bash + - build-base + - busybox + - ca-certificates-bundle + - ruby-${{vars.rubyMM}} + - ruby-${{vars.rubyMM}}-dev + +vars: + gem: bundler + +pipeline: + - uses: git-checkout + with: + expected-commit: 28c66ecc1e6c283156eba82504ef6e7168665813 + repository: https://github.com/rubygems/rubygems + tag: bundler-v${{package.version}} + + - working-directory: ${{vars.gem}} + pipeline: + - uses: ruby/build + with: + gem: ${{vars.gem}} + - uses: ruby/install + with: + gem: ${{vars.gem}} + version: ${{package.version}} + - uses: ruby/clean + - name: build-docs-clean + runs: | + export INSTALL_DIR=${{targets.destdir}}/$(ruby -e 'puts Gem.default_dir') + for n in 1 5; do + mkdir -p "${{targets.destdir}}"/usr/share/man/man$n + mv "$INSTALL_DIR"/gems/bundler-${{package.version}}/lib/bundler/man/*.$n "${{targets.destdir}}"/usr/share/man/man$n/ + done + + rm -rf "$INSTALL_DIR"/cache \ + "$INSTALL_DIR"/build_info \ + "$INSTALL_DIR"/doc \ + "$INSTALL_DIR"/gems/bundler-${{package.version}}/man \ + "$INSTALL_DIR"/gems/bundler-${{package.version}}/*.md + +subpackages: + - name: "${{package.name}}-doc" + description: "ruby-bundler documentation" + pipeline: + - uses: split/manpages + test: + pipeline: + - uses: test/docs + +update: + enabled: true + github: + identifier: rubygems/rubygems + strip-prefix: bundler-v + tag-filter: bundler-v + +test: + pipeline: + # AUTOGENERATED + - runs: | + bundle --version + bundler --version + bundle --help + bundler --help + - runs: | + echo "source 'https://rubygems.org'" > Gemfile + echo "gem 'rake'" >> Gemfile + bundle install + bundle list + echo "Bundler test passed!" + +var-transforms: + - from: ${{package.name}} + match: ^ruby(\d\.\d+)-.* + replace: $1 + to: rubyMM