From a1b84aa7da729b6f11ac5b11398571e74667e1b2 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 15 Jan 2023 14:34:19 -0500 Subject: [PATCH] Ruby gems path (#85) * set gem path correctly --- projects/gnu.org/make/package.yml | 4 ++++ projects/ruby-lang.org/defaults.rb.patch | 13 ++++++++++++ projects/ruby-lang.org/package.yml | 26 +++++++++++++++++++----- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 projects/ruby-lang.org/defaults.rb.patch diff --git a/projects/gnu.org/make/package.yml b/projects/gnu.org/make/package.yml index 846d2baf..da4304f7 100644 --- a/projects/gnu.org/make/package.yml +++ b/projects/gnu.org/make/package.yml @@ -9,6 +9,10 @@ versions: provides: - bin/make +interprets: + filename: Makefile + args: [make, --file] + build: dependencies: gnu.org/m4: 1 diff --git a/projects/ruby-lang.org/defaults.rb.patch b/projects/ruby-lang.org/defaults.rb.patch new file mode 100644 index 00000000..6f95d7d8 --- /dev/null +++ b/projects/ruby-lang.org/defaults.rb.patch @@ -0,0 +1,13 @@ +diff --git a/lib/ruby/3.2.0/rubygems/defaults.rb b/lib/ruby/3.2.0/rubygems/defaults.rb +index 8daff0b..59ecd32 100644 +--- a/lib/ruby/3.2.0/rubygems/defaults.rb ++++ b/lib/ruby/3.2.0/rubygems/defaults.rb +@@ -34,7 +34,7 @@ module Gem + # specified in the environment + + def self.default_dir +- @default_dir ||= File.join(RbConfig::CONFIG["rubylibprefix"], "gems", RbConfig::CONFIG["ruby_version"]) ++ @default_dir ||= File.expand_path(File.join(__FILE__, "../../../../../../gems", RbConfig::CONFIG["ruby_version"])) + end + + ## diff --git a/projects/ruby-lang.org/package.yml b/projects/ruby-lang.org/package.yml index 452daafd..8a0b9641 100644 --- a/projects/ruby-lang.org/package.yml +++ b/projects/ruby-lang.org/package.yml @@ -8,7 +8,7 @@ versions: dependencies: openssl.org: ^1.1 pyyaml.org: ^0.2 - zlib.net: 1 + zlib.net: ^1 build: dependencies: @@ -16,11 +16,17 @@ build: 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 + ./configure --prefix="{{prefix}}" --enable-load-relative --disable-rubygems make --jobs {{hw.concurrency}} install - cd "{{prefix}}"/bin + 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 @@ -37,8 +43,18 @@ build: - rdoc - ri -test: | - ruby -e 'puts "Hello World!"' +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