pantry/projects/ruby-lang.org/package.yml
Max Howell a1b84aa7da
Ruby gems path (#85)
* set gem path correctly
2023-01-15 14:34:19 -05:00

72 lines
1.5 KiB
YAML

distributable:
url: https://cache.ruby-lang.org/pub/ruby/{{version.marketing}}/ruby-{{version}}.tar.xz
strip-components: 1
versions:
github: ruby/ruby/tags
dependencies:
openssl.org: ^1.1
pyyaml.org: ^0.2
zlib.net: ^1
build:
dependencies:
freedesktop.org/pkg-config: ^0.29
gnu.org/gettext: ^0.21
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
git-scm.org: ^2
script: |
./configure --prefix="{{prefix}}" --enable-load-relative --disable-rubygems
make --jobs {{hw.concurrency}} install
cd "{{prefix}}"
# use the GEM_PATH we want
git apply "$SRCROOT"/props/defaults.rb.patch
cd bin
# we provide these as `rubygems.org`
rm bundle bundler gem rake rbs rdbg typeprof
for shim in $shims; do
sed -i.bak -e 's_#!{{prefix}}/bin/ruby_#!/usr/bin/env ruby_' $shim
rm $shim.bak
done
env:
shims:
- erb
- irb
- racc
- rdoc
- ri
test:
dependencies:
#NOTE rubygems.org depends on us… so it may be difficult to test this
# in a bootstrap scenario…
rubygems.org: '*'
tea.xyz/gx/cc: c99 # for native extensions
tea.xyz/gx/make: '*'
script: |
ruby -e 'puts "Hello World!"'
gem install hexapdf -v 0.28.0
hexapdf version
test -d "{{tea.prefix}}"/ruby-lang.org/gems/{{version}}/gems/hexapdf-0.28.0
provides:
- bin/erb
- bin/irb
- bin/racc
- bin/rdoc
- bin/ri
- bin/ruby
interprets:
extensions: rb
args: ruby
companions:
rubygems.org: '*'