Skip to content
Merged
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
101 changes: 64 additions & 37 deletions projects/ruby-lang.org/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ dependencies:

build:
dependencies:
freedesktop.org/pkg-config: ^0.29
gnu.org/gettext: ^0.21
gnu.org/patch: '*'
gnu.org/patch: "*"
gnu.org/bison: ^3
gnu.org/autoconf: '*'
gnu.org/autoconf: "*"
rust-lang.org: ^1 # required to build YJIT
rsync.samba.org: "*" # v4 fixes
linux:
ruby-lang.org: ^3 # ruby requires ruby to build
rubygems.org: "*"
# ^^ only linux because we got issues on darwin currently and darwin provides ruby (for now)
script:
- patch -p1 -F5 < props/mkconfig.rb.diff
Expand All @@ -30,19 +31,25 @@ build:

# clang17 doesn't like [[maybe_unused]] on types
# fix cribbed from https://github.com/ruby/ruby/pull/4603/commits/fbdff085ef3c8a56e0a33404e8795879e3167549
- run: |
if test -f maybe_unused.h; then
sed -i -e 's/elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused)/elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused) \&\& (__STDC_VERSION__ >= 202000L)/' maybe_unused.h
fi
- run:
- if test -f maybe_unused.h; then
- sed -i -e 's/elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused)/elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused) \&\& (__STDC_VERSION__ >= 202000L)/' maybe_unused.h
- fi
if: linux
working-directory: include/ruby/internal/attr

# ^3.1.4 can't find rubygems without help on linux
- run: |
if test "{{hw.platform}}" = "linux"; then
sed -i "s_^RUBYLIB.*=.*\$_RUBYLIB = ${RUBYLIB}_" uncommon.mk
fi
if: '>=3.1.4<3.2'
- run:
- if test "{{hw.platform}}" = "linux"; then
- sed -i "s_^RUBYLIB.*=.*\$_RUBYLIB = ${RUBYLIB}_" uncommon.mk
- fi
if: ">=3.1.4<3.2"
# back in 4.0.0
- run:
- if test "{{hw.platform}}" = "linux"; then
- sed -i "s_^RUBYLIB.*=.*\$_RUBYLIB = ${RUBYLIB}_" common.mk
- fi
if: ">=4"

- make install

Expand All @@ -59,32 +66,35 @@ build:
# pkgenv. Ruby behaves well if gems isn't around but the user may get
# unexpected errors in scenarios where they constructed an pkgenv manually
- working-directory: ${{prefix}}/lib/ruby/{{version.marketing}}.0
run: |
for x in bundler rubygems bundler.rb rubygems.rb; do
if test -d $x; then
rm -rf $x
else
rm -f $x
fi
done
rm -rf ../gems/3.2.0/gems/bundler-*.*.*

- run: |
rm -rf share/ri
rm -rf share/doc
rm -rf lib/ruby/site_ruby
rm -rf lib/ruby/vendor_ruby
run:
- |
for x in bundler rubygems bundler.rb rubygems.rb; do
if test -d $x; then
rm -rf $x
else
rm -f $x
fi
done
- rm -rf ../gems/3.2.0/gems/bundler-*.*.*

- run:
- rm -rf share/ri
- rm -rf share/doc
- rm -rf lib/ruby/site_ruby
- rm -rf lib/ruby/vendor_ruby
working-directory: ${{prefix}}

# weirdly files get put here and we can't figure out how to stop it
- run: |
if test -d pkgconfig; then rm -rf pkgconfig; fi
if test -d *-{{hw.platform}}* ; then
mv *-{{hw.platform}}*/* .
rmdir *-{{hw.platform}}*
fi
- run:
- if test -d pkgconfig; then rm -rf pkgconfig; fi
- |
if test -d *-{{hw.platform}}* ; then
mv *-{{hw.platform}}*/* .
rmdir *-{{hw.platform}}*
fi
working-directory: ${{prefix}}/lib
if: '>=2.6'
if: ">=2.6"

- run: |
if test *-{{hw.platform}}*/bin/ruby ; then
unlink bin/ruby
Expand All @@ -93,7 +103,24 @@ build:
rmdir *-{{hw.platform}}*
fi
working-directory: ${{prefix}}
if: '>=3.4'
if: ">=3.4"

# v4 is adding {{prefix}}/{{prefix}}, oddly.
- run:
- if test -d include; then rsync include/ {{prefix}}/include/ -a; fi
# rbconfig.rb has a nil ref issue
# rbconfig.rb:310:in 'RbConfig.expand': undefined method 'gsub' for nil (NoMethodError)
# from ~/.pkgx/ruby-lang.org/v4.0.0/lib/ruby/4.0.0/rbconfig.rb:328:in 'block in <module:RbConfig>'
- sed -i -f $PROP lib/ruby/{{version.marketing}}.0/rbconfig.rb
- if test -d lib; then rsync lib/ {{prefix}}/lib/ -a; fi
- cd ..
# this './' is IMPORTANT
- rm -rf ./{{prefix}}
prop: |
/def RbConfig::expand/a\
val = val || ''
if: ">=4"
working-directory: ${{prefix}}/{{prefix}}

- run: sed -i
-e 's|$(DESTDIR){{prefix}}|$(topdir)|g'
Expand All @@ -120,7 +147,7 @@ build:

test:
dependencies:
rubygems.org: '*' # is a companion __however__ brewkit doesn’t add companions to the test env automatically
rubygems.org: "*" # is a companion __however__ brewkit doesn’t add companions to the test env automatically
script:
- ruby -e 'puts "Hello World!"'

Expand Down Expand Up @@ -174,4 +201,4 @@ interprets:
args: ruby

companions:
rubygems.org: '*'
rubygems.org: "*"