pantry/projects/ruby-lang.org/package.yml

137 lines
3.9 KiB
YAML
Raw Normal View History

2022-10-03 18:37:28 +03:00
distributable:
2023-01-03 19:09:13 +03:00
url: https://cache.ruby-lang.org/pub/ruby/{{version.marketing}}/ruby-{{version}}.tar.xz
2022-10-03 18:37:28 +03:00
strip-components: 1
versions:
# ruby have *some* releases, but historically only have tags
# so if we want to build older releases we can only scan tags
github: ruby/ruby/tags
2022-10-03 18:37:28 +03:00
dependencies:
openssl.org: ^1.1
pyyaml.org: ^0.2
zlib.net: ^1
2022-10-03 18:37:28 +03:00
build:
dependencies:
freedesktop.org/pkg-config: ^0.29
gnu.org/gettext: ^0.21
gnu.org/patch: '*'
2023-06-13 18:15:14 +03:00
gnu.org/bison: ^3
gnu.org/autoconf: '*'
linux:
ruby-lang.org: ~3.1 # ruby requires ruby to build
# ^^ only linux because we got issues on darwin currently and darwin provides ruby (for now)
env:
ARGS:
- --prefix="{{prefix}}"
- --enable-load-relative # makes us relocatable
- --without-gmp
- --with-rubyarchprefix={{prefix}}/lib/ruby # no need for architecture specific crap
- --with-rubyhdrdir={{prefix}}/include # ^^
- --with-rubyarchhdrdir={{prefix}}/include # ^^
- --disable-multiarch # ^^
- --with-vendordir=no # is empty so dont pollute
- --with-vendorarchdir=no # ^^
- --with-sitedir=no # ^^
- --with-sitearchdir=no # ^^
script:
- patch -p1 < props/mkconfig.rb.diff
- ./configure $ARGS
- make --jobs {{hw.concurrency}} install
2022-11-02 23:38:19 +03:00
# we provide these as `rubygems.org`
- run: rm bundle bundler gem
working-directory: ${{prefix}}/bin
2022-11-02 23:38:19 +03:00
- fix-shebangs.ts ${{prefix}}/bin/*
# ruby itself provides the gems for these and we dont want that
# we want to pkg them ourselves as part of rubygems.org
# to ensure the user gets a good ruby experience rubygems is marked as
# a companion which in most use means gems are automatically added to the
# 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 $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}}
2023-03-19 15:01:42 +03:00
# weirdly files get put here and we can't figure out how to stop it
- run: |
mv *-{{hw.platform}}*/* .
rmdir *-{{hw.platform}}*
working-directory:
${{prefix}}/lib
- run: sed -i.bak
-e 's|$(DESTDIR){{prefix}}|$(topdir)|g'
-e 's|CONFIG\["topdir"\] = .*|CONFIG\["topdir"\] = TOPDIR|g'
rbconfig.rb
working-directory:
${{prefix}}/lib/ruby/{{version.marketing}}.0
2023-06-13 22:31:03 +03:00
test:
dependencies:
rubygems.org: '*' # is a companion __however__ brewkit doesnt add companions to the env automatically
script:
- |
ruby -e 'puts "Hello World!"'
# echo 'puts 1' | irb
# ^^ FIXME `The terminfo database could not be found`
# tests the libraries that come with Ruby can be utilized
- run: |
mv $FIXTURE a.rb
ruby a.rb
fixture: |
require 'date'
puts Date.today
# tests the gems that come with Ruby can be utilized
- run: |
mv $FIXTURE a.rb
ruby a.rb
fixture: |
require 'matrix'
matrix = Matrix[[1, 2], [3, 4]]
transpose_matrix = matrix.transpose
determinant = matrix.determinant
puts "Original matrix:\n#{matrix}"
puts "Transposed matrix:\n#{transpose_matrix}"
puts "Determinant of the matrix: #{determinant}"
2022-11-02 23:38:19 +03:00
provides:
- bin/erb
- bin/irb
- bin/racc
2023-03-19 15:01:42 +03:00
- bin/rake
- bin/rbs
2022-11-02 23:38:19 +03:00
- bin/rdoc
- bin/ri
- bin/ruby
2023-03-19 15:01:42 +03:00
- bin/typeprof
2022-11-02 23:38:19 +03:00
interprets:
extensions: rb
args: ruby
2022-11-02 23:38:19 +03:00
companions:
rubygems.org: '*'