2022-11-02 23:38:19 +03:00
|
|
|
distributable:
|
|
|
|
url: https://github.com/rubygems/rubygems/archive/refs/tags/v{{version}}.tar.gz
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
|
|
|
github: rubygems/rubygems
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
ruby-lang.org: '>=2.3'
|
|
|
|
|
2023-06-16 16:33:37 +03:00
|
|
|
runtime:
|
|
|
|
env:
|
|
|
|
RUBYLIB: ${{prefix}}/lib
|
|
|
|
|
2022-11-02 23:38:19 +03:00
|
|
|
build:
|
2023-02-17 15:41:07 +03:00
|
|
|
dependencies:
|
|
|
|
gnu.org/patch: '*'
|
2023-10-04 01:29:47 +03:00
|
|
|
ruby-lang.org: ~3.1 # testing a theory
|
2023-06-13 22:31:03 +03:00
|
|
|
script:
|
2023-06-16 16:33:37 +03:00
|
|
|
- ruby setup.rb
|
2023-12-26 12:51:02 +03:00
|
|
|
--prefix={{prefix}}
|
|
|
|
--env-shebang
|
|
|
|
--no-ri
|
|
|
|
--no-rdoc
|
2023-03-19 15:01:42 +03:00
|
|
|
|
2023-06-16 16:33:37 +03:00
|
|
|
- run: |
|
|
|
|
patch -p1 < "$SRCROOT"/props/fit-n-finish.patch
|
|
|
|
patch -p1 < "$SRCROOT"/props/fit-n-finish.2.patch
|
2023-12-26 12:51:02 +03:00
|
|
|
sed -i -e 's/Gem.default_dir/Gem.default_system_dir/' lib/rubygems/path_support.rb
|
2023-06-16 16:33:37 +03:00
|
|
|
working-directory: ${{prefix}}
|
2023-12-16 01:04:32 +03:00
|
|
|
|
2023-12-26 12:51:02 +03:00
|
|
|
- run: sed -i -e 's/Gem.state_home, "gem",/Gem.state_home,/' defaults.rb
|
2023-12-16 01:04:32 +03:00
|
|
|
working-directory: ${{prefix}}/lib/rubygems
|
2023-11-13 21:44:01 +03:00
|
|
|
if: '>=3.4'
|
2023-12-16 01:04:32 +03:00
|
|
|
|
|
|
|
- run: patch -p1 < "$SRCROOT"/props/fit-n-finish.3.patch
|
|
|
|
working-directory: ${{prefix}}
|
|
|
|
if: '<3.5'
|
|
|
|
|
|
|
|
- run: patch -p1 < "$SRCROOT"/props/fit-n-finish.4.patch
|
|
|
|
working-directory: ${{prefix}}
|
|
|
|
if: '>=3.5'
|
|
|
|
|
2023-12-26 12:51:02 +03:00
|
|
|
- run: sed -i -e
|
|
|
|
's/Dir\.mkdir dir, \*\[options\[:dir_mode\].*/FileUtils.mkdir_p dir, *[options[:dir_mode] \&\& 0o755].compact/'
|
|
|
|
installer.rb
|
2023-10-19 01:17:28 +03:00
|
|
|
working-directory: ${{prefix}}/lib/rubygems
|
2023-02-17 15:41:07 +03:00
|
|
|
|
2023-06-16 16:33:37 +03:00
|
|
|
# these are provided by ruby-lang.org
|
2023-12-26 12:51:02 +03:00
|
|
|
# they turn up here since that is how gem handles deps
|
|
|
|
# but ruby is in PATH and has these and that is the preference
|
2023-06-16 16:33:37 +03:00
|
|
|
- run: rm rake rbs rdbg typeprof
|
|
|
|
working-directory: ${{prefix}}/bin
|
2023-03-19 15:01:42 +03:00
|
|
|
|
2023-12-26 12:51:02 +03:00
|
|
|
# bundle and bundler are “gem” shims that try to invoke rubygems magic
|
|
|
|
# to figure out which bundler etc. to run. However this is not what we
|
|
|
|
# need since we are a specifically packages rubygems version and only
|
|
|
|
# want to use ourselves.
|
|
|
|
# REF https://github.com/pkgxdev/pantry/issues/4010
|
2023-06-16 16:33:37 +03:00
|
|
|
- run: |
|
2023-12-26 12:51:02 +03:00
|
|
|
for tool in bundle bundler; do
|
|
|
|
rm $tool
|
|
|
|
cp $PROP $tool
|
2023-06-13 22:31:03 +03:00
|
|
|
done
|
2023-12-26 12:51:02 +03:00
|
|
|
prop: |
|
|
|
|
#!/bin/sh
|
|
|
|
d="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
|
|
export RUBYLIB="$d/lib"
|
|
|
|
exec "$d"/gems/bundler-*/exe/bundle "$@"
|
|
|
|
working-directory:
|
|
|
|
${{prefix}}/bin
|
|
|
|
|
|
|
|
# ruby has a neat feature where it will look for a ruby shebang and
|
|
|
|
# ignore everything from before that, so we can make scripts that execute
|
|
|
|
# as POSIX shell and then re-exec themselves as ruby scripts
|
|
|
|
- run:
|
|
|
|
echo "$(cat $PROP gem)" > gem
|
|
|
|
prop: |
|
|
|
|
#!/bin/sh
|
|
|
|
RUBYLIB="$(cd "$(dirname "$0")"/../lib && pwd)" exec ruby "$0" "$@"
|
|
|
|
working-directory:
|
|
|
|
${{prefix}}/bin
|
|
|
|
|
|
|
|
# clean up empty, unused directory
|
2023-06-13 22:31:03 +03:00
|
|
|
- rmdir {{prefix}}/plugins
|
2022-11-02 23:38:19 +03:00
|
|
|
|
|
|
|
test:
|
2023-02-17 15:41:07 +03:00
|
|
|
env:
|
2023-06-13 22:31:03 +03:00
|
|
|
vRUBY: ${{deps.ruby-lang.org.version.marketing}}.0
|
2023-06-16 16:33:37 +03:00
|
|
|
script:
|
|
|
|
# for debug
|
|
|
|
- gem env
|
|
|
|
|
|
|
|
- |
|
|
|
|
gem install awesome_print --verbose
|
|
|
|
ruby -e 'require "rubygems"' -e 'require "awesome_print"' -e'ap $LOAD_PATH'
|
|
|
|
|
|
|
|
- |
|
|
|
|
gem install hexapdf --verbose
|
|
|
|
|
|
|
|
if [ -w /usr/local/lib/ruby/ ]; then
|
|
|
|
v="$(/usr/local/bin/hexapdf version | cut -d' ' -f2)"
|
|
|
|
test -d /usr/local/lib/ruby/gems/$vRUBY/gems/hexapdf-$v
|
|
|
|
else
|
|
|
|
v="$(~/.local/bin/hexapdf version | cut -d' ' -f2)"
|
|
|
|
test -d ~/.gem/ruby/$vRUBY/gems/hexapdf-$v
|
|
|
|
fi
|
2022-11-02 23:38:19 +03:00
|
|
|
|
2023-12-26 12:51:02 +03:00
|
|
|
- run: |
|
|
|
|
mv $FIXTURE Gemfile
|
|
|
|
bundle install --path vendor/bundle
|
|
|
|
fixture: |
|
|
|
|
source 'https://rubygems.org'
|
|
|
|
gem 'warbler', platforms: :jruby
|
|
|
|
|
2022-11-02 23:38:19 +03:00
|
|
|
provides:
|
|
|
|
- bin/bundle
|
|
|
|
- bin/bundler
|
|
|
|
- bin/gem
|